repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
kennedyshead/home-assistant
refs/heads/dev
homeassistant/components/remote/reproduce_state.py
2
"""Reproduce an Remote state.""" from __future__ import annotations import asyncio from collections.abc import Iterable import logging from typing import Any from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_OFF, STATE_ON, ) from homeassistant.core import C...
Jonekee/chromium.src
refs/heads/nw12
third_party/tlslite/tlslite/basedb.py
114
# Authors: # Trevor Perrin # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. """Base class for SharedKeyDB and VerifierDB.""" try: import anydbm except ImportError: # Python 3 import dbm as anydbm import threading class BaseDB(object): ...
agoragames/leaderboard-python
refs/heads/main
test/leaderboard/reverse_tie_ranking_leaderboard_test.py
1
from leaderboard.leaderboard import Leaderboard from leaderboard.tie_ranking_leaderboard import TieRankingLeaderboard import unittest import time import sure class ReverseTieRankingLeaderboardTest(unittest.TestCase): def setUp(self): self.leaderboard = TieRankingLeaderboard('ties', order=Leaderboard.ASC,...
ByteInternet/python-redis-lock
refs/heads/master
src/redis_lock/__init__.py
2
from logging import getLogger from os import urandom from hashlib import sha1 from redis import StrictRedis from redis.exceptions import NoScriptError __version__ = "2.1.0" logger = getLogger(__name__) UNLOCK_SCRIPT = b""" if redis.call("get", KEYS[1]) == ARGV[1] then redis.call("del", KEYS[2]) ...
j-carpentier/nova
refs/heads/master
nova/tests/unit/cmd/test_baseproxy.py
30
# Copyright 2015 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
cosmoharrigan/pylearn2
refs/heads/master
pylearn2/utils/image.py
39
""" Utility functions for working with images. """ import logging import numpy as np plt = None axes = None from theano.compat.six.moves import xrange from theano.compat.six import string_types import warnings try: import matplotlib.pyplot as plt import matplotlib.axes except (RuntimeError, ImportError, TypeErr...
catapult-project/catapult
refs/heads/master
third_party/google-endpoints/packaging/specifiers.py
1107
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import functools import itertools import re from ._compat impo...
Geoion/MITMf
refs/heads/master
core/servers/LDAP.py
24
#!/usr/bin/env python # This file is part of Responder # Original work by Laurent Gaffie - Trustwave Holdings # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
gems-uff/noworkflow
refs/heads/master
capture/noworkflow/now/persistence/models/variable_dependency.py
1
# Copyright (c) 2016 Universidade Federal Fluminense (UFF) # Copyright (c) 2016 Polytechnic Institute of New York University. # This file is part of noWorkflow. # Please, consult the license terms in the LICENSE file. """Slicing Dependency Model""" from __future__ import (absolute_import, print_function, ...
koniiiik/django
refs/heads/master
django/conf/locale/de/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
girving/tensorflow
refs/heads/master
tensorflow/compiler/tests/adagrad_da_test.py
9
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
G1DR4/buendia
refs/heads/dev
tools/convert_to_xml.py
13
#!/usr/bin/python # Copyright 2015 The Project Buendia Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at: http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
asya-bergal/led-matrix-server
refs/heads/master
server.py
1
import random import os import posixpath import BaseHTTPServer import urllib import cgi import shutil import mimetypes import re import glob import time import leds __version__ = "0.1" __all__ = ["SimpleHTTPRequestHandler"] #__author__ = "bones7456" #__home_page__ = "http://li2z.cn/" #!/usr/bin/env python """Simple...
clouddocx/boto
refs/heads/master
boto/pyami/installers/ubuntu/installer.py
153
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
fedora-infra/datanommer
refs/heads/develop
datanommer.models/alembic/versions/143ec484f5ba_add_uuid_column.py
2
# This file is a part of datanommer, a message sink for fedmsg. # Copyright (C) 2014, Red Hat, Inc. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your...
se4u/pylearn2
refs/heads/master
pylearn2/sandbox/nlp/datasets/text.py
44
"""Datasets for working with text""" from theano.compat import six class TextDatasetMixin(object): """ Use multiple inheritance with this class and any other dataset class in order to provide useful functionality for natural language processing purposes. The derived class is expected to have a `_...
emedinaa/contentbox
refs/heads/master
third_party/social/apps/django_app/default/__init__.py
12
""" Django default ORM backend support. To enable this app: * Add 'social.apps.django_app.default' to INSTALLED_APPS * In urls.py include url('', include('social.apps.django_app.urls')) """
joxeankoret/diaphora
refs/heads/master
pygments/styles/xcode.py
50
# -*- coding: utf-8 -*- """ pygments.styles.xcode ~~~~~~~~~~~~~~~~~~~~~ Style similar to the `Xcode` default theme. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, N...
xuru/pyvisdk
refs/heads/master
pyvisdk/do/net_ip_stack_info.py
1
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def NetIpStackInfo(vim, *args, **kwargs): '''Protocol version independent reporting data ...
cldershem/osf.io
refs/heads/develop
tests/webtest_tests.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functional tests using WebTest.""" import httplib as http import logging import mock import re import unittest import markupsafe from nose.tools import * # flake8: noqa (PEP8 asserts) from framework.mongo.utils import to_mongo_key from framework.auth import exceptions...
lshain-android-source/external-skia
refs/heads/master
bench/bench_compare.py
209
#!/usr/bin/env python ''' Created on May 16, 2011 @author: bungeman ''' import sys import getopt import bench_util def usage(): """Prints simple usage information.""" print '-o <file> the old bench output file.' print '-n <file> the new bench output file.' print '-h causes headers to be output.' ...
GlobalFishingWatch/vessel-classification
refs/heads/master
classification/run_training.py
1
# Copyright 2017 Google Inc. and Skytruth Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
namunu/MBS_Patent
refs/heads/master
parser_test/xml_driver.py
2
#!/usr/bin/env python """ Copyright (c) 2013 The Regents of the University of California, AMERICAN INSTITUTES FOR RESEARCH All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source co...
rolandovillca/python_basic_concepts
refs/heads/master
context_manager/a.py
4
class A: def __enter__(self): print '11111' return '22222' def __exit__(self, type, value, traceback): print '33333' return False with A() as s: a = '44444' print '55555:', s print '66666:', a print '77777:', s # 11111 # 55555: 22222 # 33333 # 66666: 44444 # 77777: 2...
wcmitchell/insights-core
refs/heads/master
insights/contrib/pyparsing.py
5
# module pyparsing.py # # Copyright (c) 2003-2015 Paul T. McGuire # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to u...
Luise-li/haroopad
refs/heads/develop
node_modules/stringex/node_modules/js-yaml/support/pyyaml-src/scanner.py
235
# Scanner produces tokens of the following types: # STREAM-START # STREAM-END # DIRECTIVE(name, value) # DOCUMENT-START # DOCUMENT-END # BLOCK-SEQUENCE-START # BLOCK-MAPPING-START # BLOCK-END # FLOW-SEQUENCE-START # FLOW-MAPPING-START # FLOW-SEQUENCE-END # FLOW-MAPPING-END # BLOCK-ENTRY # FLOW-ENTRY # KEY # VALUE # AL...
MattsFleaMarket/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/sample_util.py
133
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
spadae22/odoo
refs/heads/chris_master_8
addons/l10n_es/migrations/8.0.4.1/pre-rename.py
52
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2014 Domatix (http://www.domatix.com) # Angel Moya <angel.moya@domatix.com> # # This program is free software: you can redist...
xuzhao1211/OnlineExam
refs/heads/master
misago/core/migrations/0002_basic_settings.py
8
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.utils.translation import ugettext as _ from misago.conf.migrationutils import migrate_settings_group def create_basic_settings_group(apps, schema_editor): migrate_settings_group( apps, ...
erinspace/osf.io
refs/heads/develop
website/project/signals.py
39
import blinker signals = blinker.Namespace() comment_added = signals.signal('comment-added') mention_added = signals.signal('mention-added') contributor_added = signals.signal('contributor-added') project_created = signals.signal('project-created') contributor_removed = signals.signal('contributor-removed') unreg_cont...
gquirozbogner/contentbox-master
refs/heads/master
third_party/django/core/context_processors.py
232
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ from __future__ i...
PyCQA/pylint
refs/heads/main
tests/functional/n/nonlocal_without_binding.py
3
""" Checks that reversed() receive proper argument """ # pylint: disable=missing-docstring,invalid-name,unused-variable, useless-object-inheritance # pylint: disable=too-few-public-methods,no-self-use,no-absolute-import def test(): def parent(): a = 42 def stuff(): nonlocal a c = 2...
City-of-Bloomington/green-rental
refs/heads/master
allauth/account/adapter.py
5
import warnings import json from django.conf import settings from django.http import HttpResponse from django.template.loader import render_to_string from django.template import TemplateDoesNotExist from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives, EmailMessage from djan...
ryangallen/django
refs/heads/master
tests/foreign_object/models/empty_join.py
106
from django.db import models from django.db.models.fields.related import ( ForeignObjectRel, ForeignRelatedObjectsDescriptor, ) from django.db.models.lookups import StartsWith from django.db.models.query_utils import PathInfo from django.utils.encoding import python_2_unicode_compatible class CustomForeignObjectR...
kingvuplus/gui_test4
refs/heads/master
tests/events.py
80
import time import tests recorded_events = [ ] def event(self, name, args, kwargs): global recorded_events print "*EVENT*", time.time(), self, name, args, kwargs recorded_events.append((time.time(), self, name, args, kwargs)) def eventfnc(f): name = f.__name__ def wrapper(self, *args, **kwargs): event(self, n...
dylanaraps/pywal
refs/heads/master
pywal/backends/colorz.py
1
""" Generate a colorscheme using Colorz. """ import logging import sys try: import colorz except ImportError: logging.error("colorz wasn't found on your system.") logging.error("Try another backend. (wal --backend)") sys.exit(1) from .. import colors from .. import util def gen_colors(img): """...
caveman-dick/ansible
refs/heads/devel
lib/ansible/modules/windows/win_iis_webapplication.py
47
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
jawad6233/Lenovo_A820_kernel_kk
refs/heads/master
bionic/libc/kernel/tools/defaults.py
5
# this module contains all the defaults used by the generation of cleaned-up headers # for the Bionic C library # import time, os, sys from utils import * # the list of supported architectures # kernel_archs = [ 'arm', 'x86', 'mips' ] # the list of include directories that belong to the kernel # tree. used when look...
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks
refs/heads/master
Splunk_TA_paloalto/bin/lib/pandevice/tests/live/test_network.py
2
import random from tests.live import testlib from pandevice import network class TestZoneBasic(testlib.FwFlow): def setup_state_obj(self, fw, state): state.obj = network.Zone( testlib.random_name(), mode='layer3', ) fw.add(state.obj) def update_state_obj(self,...
jordonbiondo/cldoc
refs/heads/master
cldoc/generators/xml.py
3
# This file is part of cldoc. cldoc is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the ...
earshel/PokeyPyManager
refs/heads/master
POGOProtos/Inventory/ItemId_pb2.py
7
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Inventory/ItemId.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf ...
luiseiherrera/jsmd
refs/heads/master
blog/tests.py
24123
from django.test import TestCase # Create your tests here.
andrew-szymanski/gae_django
refs/heads/master
django/core/management/commands/sqlreset.py
313
from optparse import make_option from django.core.management.base import AppCommand from django.core.management.sql import sql_reset from django.db import connections, DEFAULT_DB_ALIAS class Command(AppCommand): help = "Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s)." option_...
VanirAOSP/external_chromium_org
refs/heads/kk44
PRESUBMIT_test.py
24
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import re import unittest import PRESUBMIT class MockInputApi(object): def __init__(self): self.re = re self...
jredd23/March_Madness_Style_Bracket
refs/heads/master
manage.py
1
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ncaa.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
overtherain/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_3/tests/regressiontests/generic_views/views.py
49
from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page from regre...
odejesush/tensorflow
refs/heads/master
tensorflow/python/ops/control_flow_ops.py
6
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2014cdbg17/2015cd_midterm2
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/atexit.py
743
"""allow programmer to define multiple exit functions to be executedupon normal program termination. Two public functions, register and unregister, are defined. """ class __loader__(object): pass def _clear(*args,**kw): """_clear() -> None Clear the list of previously registered exit functions.""" ...
mazvv/travelcrm
refs/heads/master
travelcrm/models/task.py
1
# -*-coding: utf-8-*- from datetime import timedelta from sqlalchemy import ( Column, Integer, String, DateTime, Table, ForeignKey, ) from sqlalchemy.orm import relationship, backref from ..models import ( DBSession, Base, ) from ..lib import EnumIntType from ..lib.utils.common_utils ...
cernops/rally
refs/heads/master
tests/unit/rally_jobs/test_jobs.py
12
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
imron/scalyr-agent-2
refs/heads/master
scalyr_agent/compat.py
1
# Copyright 2014-2020 Scalyr Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
mojoboss/scikit-learn
refs/heads/master
sklearn/neighbors/__init__.py
306
""" The :mod:`sklearn.neighbors` module implements the k-nearest neighbors algorithm. """ from .ball_tree import BallTree from .kd_tree import KDTree from .dist_metrics import DistanceMetric from .graph import kneighbors_graph, radius_neighbors_graph from .unsupervised import NearestNeighbors from .classification impo...
toslunar/chainerrl
refs/heads/master
chainerrl/links/sequence.py
1
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA import chainer from chainerrl.recurrent import RecurrentCha...
amyvmiwei/qt-creator
refs/heads/master
tests/system/suite_editors/tst_revert_changes/test.py
1
############################################################################# ## ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this f...
OmairAJ/Plagia
refs/heads/master
local/matchReduce.py
1
#matchReduce.py # python matchReduce.py -d text.m import os import sys import string import argparse import fileinput ## Casefold text def casefold(text): text = text.lower() text = text.translate(string.maketrans("",""), string.punctuation) text = text.split() text = filter(None, text) return text def uniqifi...
superberny70/pelisalacarta
refs/heads/develop
python/main-classic/channels/zpeliculas.py
2
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para seriespepito # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # ------------------------------------------------------------ import re import urllib from core import logge...
AnimeshSinha1309/WebsiteEdunet
refs/heads/master
WebsiteEdunet/env/Lib/site-packages/django/template/defaultfilters.py
23
"""Default variable filters.""" from __future__ import unicode_literals import random as random_module import re import warnings from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation from functools import wraps from pprint import pformat from django.conf import settings from django.utils import format...
0x0mar/memex-explorer
refs/heads/master
source/apps/crawl_space/tests/test_crawl_model.py
1
from __future__ import unicode_literals # Test from memex.test_utils.unit_test_utils import UnitTestSkeleton, form_errors from django.test import TestCase from django.db import IntegrityError from django.core.files.uploadedfile import SimpleUploadedFile # App from base.forms import AddProjectForm from base.models impo...
hortonworks/hortonworks-sandbox
refs/heads/master
desktop/core/ext-py/Django-1.2.3/django/contrib/localflavor/sk/forms.py
344
""" Slovak-specific form helpers """ from django.forms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ class SKRegionSelect(Select): """ A select widget widget with list of Slovak regions as choices. """ def __init__(self, attrs=None): from sk_regions i...
yro/buttsworth
refs/heads/master
chatterbot/tests.py
24123
from django.test import TestCase # Create your tests here.
chirilo/mozillians
refs/heads/master
vendor-local/lib/python/tablib/packages/xlwt3/ExcelFormula.py
44
from . import ExcelFormulaParser, ExcelFormulaLexer import struct from .antlr import ANTLRException class Formula(object): __slots__ = ["__s", "__parser", "__sheet_refs", "__xcall_refs"] def __init__(self, s): try: self.__s = s lexer = ExcelFormulaLexer.Lexer(s) ...
juliusbierk/scikit-image
refs/heads/master
skimage/viewer/tests/test_plugins.py
35
# -*- coding: utf-8 -*- import numpy as np import skimage import skimage.data as data from skimage.filters.rank import median from skimage.morphology import disk from skimage.viewer import ImageViewer, has_qt from skimage.viewer.plugins.base import Plugin from skimage.viewer.widgets import Slider from skimage....
keakon/Doodle
refs/heads/master
doodle/core/models/tag.py
1
# -*- coding: utf-8 -*- from itertools import izip from doodle.config import CONFIG from doodle.core.property import IntegerProperty, StringProperty from .base_model import JSONModel, SimpleModel class Tag(SimpleModel): @classmethod def get_all(cls): names = cls.redis_client.smembers(cls.KEY) ...
FreskyZ/fff-lang
refs/heads/master
scripts/bump-version.py
1
from common import solution import sys if len(sys.argv) < 2: print("require 2 args") exit() solution.set_version(sys.argv[1])
da1z/intellij-community
refs/heads/master
bin/linux/printenv.py
24
#!/usr/bin/env python # Dumps environment variables into specified file. # Format: zero-separated "name=value" pairs in platform encoding. import os import sys if len(sys.argv) != 2: raise Exception('Exactly one argument expected') f = open(sys.argv[1], 'wb') try: for key, value in os.environ.items(): ...
benjello/openfisca-core
refs/heads/master
openfisca_core/taxscales.py
3
# -*- coding: utf-8 -*- from __future__ import division from bisect import bisect_left, bisect_right import copy import logging import itertools import numpy as np from numpy import maximum as max_, minimum as min_ from .tools import empty_clone log = logging.getLogger(__name__) class AbstractTaxScale(object):...
joshfriend/sqlalchemy-utils
refs/heads/master
sqlalchemy_utils/types/color.py
1
import six from sqlalchemy import types from sqlalchemy_utils.exceptions import ImproperlyConfigured from .scalar_coercible import ScalarCoercible colour = None try: import colour except ImportError: pass class ColorType(types.TypeDecorator, ScalarCoercible): """ ColorType provides a way for saving C...
Cantera/cantera-svn
refs/heads/master
interfaces/cython/cantera/mixmaster/Units/power.py
4
from .SI import watt, kilo # # Definitions of common power units # Data taken from Appendix F of Halliday, Resnick, Walker, "Fundamentals of Physics", # fourth edition, John Willey and Sons, 1993 kilowatt = kilo * watt horsepower = 745.7 * watt
AuyaJackie/odoo
refs/heads/8.0
addons/mass_mailing/models/mass_mailing.py
68
# -*- coding: utf-8 -*- from datetime import datetime from dateutil import relativedelta import json import random from openerp import tools from openerp.exceptions import Warning from openerp.tools.safe_eval import safe_eval as eval from openerp.tools.translate import _ from openerp.tools import ustr from openerp.os...
SCSSG/Odoo-SCS
refs/heads/master
addons/account/report/account_invoice_report.py
224
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
newsteinking/docker
refs/heads/master
tests/data/packages/LocalExtras/setup.py
46
import os from setuptools import setup, find_packages def path_to_url(path): """ Convert a path to URI. The path will be made absolute and will not have quoted path parts. """ path = os.path.normpath(os.path.abspath(path)) drive, path = os.path.splitdrive(path) filepath = path.split(os.pat...
rfkrocktk/powerpy
refs/heads/master
src/powerpy/util/__init__.py
1
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import re import string class base36(object): matcher = re.compile(r'^([a-z0-9]+)$', re.I) alphabet = string.digits + string.lowercase @classmethod def encode(cls, value): """ Converts a number into a base36 string. Argument...
humblec/glusterblock-provisioner
refs/heads/master
vendor/k8s.io/kubernetes/hack/update_owners.py
40
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
zfil/ansible-modules-core
refs/heads/devel
files/replace.py
103
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Evan Kaufman <evan@digitalflophouse.com # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
dhenrygithub/QGIS
refs/heads/master
python/ext-libs/future/past/types/olddict.py
62
""" A dict subclass for Python 3 that behaves like Python 2's dict Example use: >>> from past.builtins import dict >>> d1 = dict() # instead of {} for an empty dict >>> d2 = dict(key1='value1', key2='value2') The keys, values and items methods now return lists on Python 3.x and there are methods for iterkeys, ite...
NLeSC/eEcology-script-wrapper
refs/heads/master
extras/nagios/check_redis.py
1
#!/usr/local/bin/python2.7 import socket import sys from optparse import OptionParser EXIT_OK = 0 EXIT_WARN = 1 EXIT_CRITICAL = 2 def get_info(host, port, timeout): socket.setdefaulttimeout(timeout or None) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) s.send("*1\r\...
cpcloud/numba
refs/heads/master
numba/typeconv/rules.py
2
from __future__ import print_function, absolute_import import itertools from .typeconv import TypeManager, TypeCastingRules from numba import types default_type_manager = TypeManager() def dump_number_rules(): tm = default_type_manager for a, b in itertools.product(types.number_domain, types.number_domain):...
aioue/ansible
refs/heads/devel
lib/ansible/cli/galaxy.py
15
######################################################################## # # (C) 2013, James Cammarata <jcammarata@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software ...
provaleks/o8
refs/heads/8.0
addons/auth_signup/__openerp__.py
313
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
aselle/tensorflow
refs/heads/master
tensorflow/python/debug/lib/grpc_debug_server.py
57
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
i4Ds/IRE
refs/heads/master
IREMedia/libraries/OpenCV/modules/ts/misc/report.py
19
#!/usr/bin/env python import testlog_parser, sys, os, xml, re, glob from table_formatter import * from optparse import OptionParser if __name__ == "__main__": parser = OptionParser() parser.add_option("-o", "--output", dest="format", help="output results in text format (can be 'txt', 'html' or 'auto' - defaul...
pulkitpahwa/smart-image-coordinates
refs/heads/master
smarter/base/apps.py
15
from __future__ import unicode_literals from django.apps import AppConfig class BaseConfig(AppConfig): name = 'base'
watonyweng/nova
refs/heads/master
nova/db/sqlalchemy/migrate_repo/versions/273_sqlite_foreign_keys.py
79
# Copyright 2014 Rackspace Hosting # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Vauxoo/hr
refs/heads/8.0
hr_employee_age/models/hr_employee.py
13
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2015 Salton Massally (<smassally@idtlabs.sl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
Workday/OpenFrame
refs/heads/master
tools/json_schema_compiler/features_compiler.py
49
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generator for C++ features from json files. Usage example: features_compiler.py --destdir gen --root /home/Work/src _permissions.j...
cfg2015/EPT-2015-2
refs/heads/master
addons/website_event_sale/__init__.py
1577
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
kenwang815/KodiPlugins
refs/heads/master
script.module.youtube.dl/lib/youtube_dl/extractor/rtvnh.py
9
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ExtractorError class RTVNHIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rtvnh\.nl/video/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.rtvnh.nl/video/131946', 'md5': '6e1d0ab079e...
analurandis/Tur
refs/heads/master
backend/venv/Lib/site-packages/unidecode/x0c6.py
253
data = ( 'yeoss', # 0x00 'yeong', # 0x01 'yeoj', # 0x02 'yeoc', # 0x03 'yeok', # 0x04 'yeot', # 0x05 'yeop', # 0x06 'yeoh', # 0x07 'ye', # 0x08 'yeg', # 0x09 'yegg', # 0x0a 'yegs', # 0x0b 'yen', # 0x0c 'yenj', # 0x0d 'yenh', # 0x0e 'yed', # 0x0f 'yel', # 0x10 'yelg', ...
scorphus/django
refs/heads/master
tests/defer/models.py
282
""" Tests for defer() and only(). """ from django.db import models from django.utils.encoding import python_2_unicode_compatible class Secondary(models.Model): first = models.CharField(max_length=50) second = models.CharField(max_length=50) @python_2_unicode_compatible class Primary(models.Model): name...
la3lma/lightblue-0.4
refs/heads/master
src/linux/__init__.py
180
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
shiblon/pytour
refs/heads/master
tutorials/regular_expressions.py
1
# vim:tw=50 """Regular Expressions Python, like most other languages these days, has **regular expression** facilities, but not built into the language. If you don't know what regular expressions are, that's a topic all by itself, so we'll only be covering the barest of the basics here to show how to use them in Pyth...
zasdfgbnm/tensorflow
refs/heads/master
tensorflow/python/profiler/profile_context_test.py
32
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
bslatkin/8-bits
refs/heads/master
tools/cssutils/src/cssutils/_codec2.py
9
#!/usr/bin/env python """Python codec for CSS.""" __docformat__ = 'restructuredtext' __author__ = 'Walter Doerwald' __version__ = '$Id: util.py 1114 2008-03-05 13:22:59Z cthedot $' import codecs import marshal # We're using bits to store all possible candidate encodings (or variants, i.e. # we have two bits for the v...
moio/spacewalk
refs/heads/master
backend/common/RPC_Base.py
1
# # Copyright (c) 2008--2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
agwilt/python
refs/heads/master
onetime/OneTime_Main.py
1
#!/usr/bin/env python3 # OneTime Papa Edition Main Window # With an overview of everything: # key manager # en/de-crypter # KeyGen(r) :p from tkinter import * from tkinter import filedialog import random, pickle, os, sys def keygen(): save_file = filedialog.asksaveasfilename() key = [ random.randint(0,255) for x in...
h3biomed/ansible-modules-core
refs/heads/devel
network/nxos/nxos_evpn_vni.py
13
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
ewitz/PhotoHaus
refs/heads/master
venv/lib/python2.7/site-packages/wtforms/ext/django/fields.py
175
""" Useful form fields for use with the Django ORM. """ from __future__ import unicode_literals import datetime import operator try: from django.conf import settings from django.utils import timezone has_timezone = True except ImportError: has_timezone = False from wtforms import fields, widgets from...
jaloren/robotframework
refs/heads/master
src/robot/writer/__init__.py
8
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
dlozeve/reveal_CommunityDetection
refs/heads/master
node_modules/node-gyp/gyp/tools/graphviz.py
2679
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
jor-/scipy
refs/heads/master
scipy/sparse/linalg/isolve/iterative/test.py
6
from __future__ import division, print_function, absolute_import from iterative import * import numpy as np def test_fun(alpha, x, beta, y, A, n): # compute z = alpha*A*x + beta*y xx = x[:n] yy = y[:n] w = np.dot(A,xx) z = alpha*w+beta*yy y[:n] = z return def test_fun_t(alpha, x, beta, ...