repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
pmisik/buildbot
master/buildbot/test/fake/pbmanager.py
5
1894
# This file is part of Buildbot. Buildbot 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 eve...
gpl-2.0
NeostreamTechnology/Microservices
venv/lib/python2.7/site-packages/yaml/cyaml.py
537
3290
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from constructor import * from serializer import * from representer import * from resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __init__(...
mit
HEPData/hepdata3
hepdata/modules/records/migrator/api.py
1
18355
# -*- coding: utf-8 -*- # # This file is part of HEPData. # Copyright (C) 2016 CERN. # # HEPData 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 2 of the # License, or (at your option) any later...
gpl-2.0
wbyne/QGIS
python/ext-libs/pygments/lexers/go.py
47
3701
# -*- coding: utf-8 -*- """ pygments.lexers.go ~~~~~~~~~~~~~~~~~~ Lexers for the Google Go language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words from pygments.token...
gpl-2.0
jumpstarter-io/horizon
openstack_dashboard/dashboards/admin/images/tests.py
4
8137
# Copyright 2012 Nebula, 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 agree...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/django/db/backends/sqlite3/features.py
49
2641
from __future__ import unicode_literals from django.db import utils from django.db.backends.base.features import BaseDatabaseFeatures from django.utils import six from django.utils.functional import cached_property from .base import Database class DatabaseFeatures(BaseDatabaseFeatures): # SQLite cannot handle u...
gpl-3.0
ryfeus/lambda-packs
Keras_tensorflow/source/tensorflow/contrib/learn/python/learn/ops/__init__.py
124
1104
# 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...
mit
derekjanni/spyre
tests/cptestcase.py
3
3887
# -*- coding: utf-8 -*- # from StringIO import StringIO from io import StringIO import unittest try: import urllib.parse as urllib except ImportError: import urllib import cherrypy # Not strictly speaking mandatory but just makes sense cherrypy.config.update({'environment': "test_suite"}) # This is mandator...
mit
nvoron23/brython
src/Lib/random.py
104
25660
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample generate random permutation distributions on the real line: ------------------------------ uniform ...
bsd-3-clause
raven47git/pyspider
pyspider/database/sqlite/sqlitebase.py
70
1861
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<roy@binux.me> # http://binux.me # Created on 2014-11-22 20:30:44 import time import sqlite3 import threading class SQLiteMixin(object): @property def dbcur(self): pid = threading....
apache-2.0
vLBrian/boxeehack-cigamit
hack/boxee/skin/boxee/720p/scripts/boxeehack_update.py
2
4717
import time import os,sys import xbmc, xbmcgui, mc import subprocess import common import time import urllib2 # Get the remote version number from github def get_remote_version(): u = urllib2.urlopen('http://dl.boxeed.in/version') version_remote = "%s" % u.read() return version_remote # Get the version number for...
mit
deKupini/erp
addons/pos_loyalty/__openerp__.py
9
1607
# -*- 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...
agpl-3.0
houghb/HDSAviz
savvy/network_tools.py
2
9496
""" This module contains functions to create and display network graphs of the sensitivity analysis results. It is included as an independent module in this package because graph-tools is an uncommon package that is slightly more involved to install than normal conda- or pip-accessible packages. All the other visuali...
bsd-2-clause
soltanmm-google/grpc
test/core/bad_client/gen_build_yaml.py
26
3674
#!/usr/bin/env python2.7 # Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this lis...
bsd-3-clause
flyngPig/APM_simulink
ardupilot/mk/PX4/Tools/genmsg/test/test_genmsg_msg_loader.py
215
29225
# Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
gpl-3.0
eric-stanley/youtube-dl
youtube_dl/extractor/odnoklassniki.py
30
3626
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote from ..utils import ( unified_strdate, int_or_none, qualities, unescapeHTML, ) class OdnoklassnikiIE(InfoExtractor): _VALID_URL = r'https?://(?:odnoklassniki|...
unlicense
shireenrao/pelican-plugins
github_activity/github_activity.py
75
1925
# -*- coding: utf-8 -*- # NEEDS WORK """ Copyright (c) Marco Milanesi <kpanic@gnufunk.org> Github Activity --------------- A plugin to list your Github Activity """ from __future__ import unicode_literals, print_function import logging logger = logging.getLogger(__name__) from pelican import signals class GitHub...
agpl-3.0
SGCreations/Flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connection.py
309
6533
# urllib3/connection.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import sys import socket from socket import timeout as SocketTimeout try: # Python 3 fr...
apache-2.0
Colonel-Top/Line-Bot-Python
python/oauth2client/crypt.py
60
8447
# -*- coding: utf-8 -*- # # Copyright 2014 Google Inc. 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 requ...
mit
klenks/jobsportal
venv/lib/python2.7/site-packages/django/db/backends/oracle/utils.py
539
1252
import datetime from django.utils.encoding import force_bytes, force_text from .base import Database # Check whether cx_Oracle was compiled with the WITH_UNICODE option if cx_Oracle is pre-5.1. This will # also be True for cx_Oracle 5.1 and in Python 3.0. See #19606 if int(Database.version.split('.', 1)[0]) >= 5 and...
mit
nsdown/zhihu-py3
zhihu/activity.py
14
1222
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = '7sDream' class Activity: """用户动态类,请使用Author.activities获取.""" def __init__(self, act_type, act_time, **kwarg): """创建用户动态类实例. :param ActType act_type: 动态类型 :param datatime.datatime act_time: 动态发生时间 :return: 用户动态对象 ...
mit
IronLanguages/ironpython2
Src/StdLib/repackage/setuptools/setuptools/command/setopt.py
299
5085
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils import os from setuptools.extern.six.moves import configparser from setuptools import Command __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="...
apache-2.0
tcwicklund/django
django/contrib/gis/gdal/prototypes/ds.py
349
4403
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
bsd-3-clause
CryptoRepairCrew/p2pool
nattraverso/portmapper.py
288
4157
""" Generic NAT Port mapping interface. TODO: Example @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" from twisted.internet.base import BasePort # Public API def get_port_mapper(proto="TCP"): ...
gpl-3.0
translate/pootle
pootle/core/models/virtualresource.py
5
1257
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from ..mixins import TreeItem class Virtu...
gpl-3.0
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/tkinter/dnd.py
15
11488
"""Drag-and-drop support for Tkinter. This is very preliminary. I currently only support dnd *within* one application, between different windows (or within the same window). I am trying to make this as generic as possible -- not dependent on the use of a particular widget or icon type, etc. I also hope that this wi...
apache-2.0
hiatobr/midiacapoeira
modules/queries.py
1
1403
# -*- coding: utf-8 -*- from gluon import current def tagQuery(tags, ctbl, ttbl, query = 0, op = 'or', field = 'texto_id'): ''' Busca no banco de dados por conteúdo marcado pelas tags em <tags>. A operação é recursiva, tag por tag, juntando o resultado de uma busca ao resultado referente à tag an...
gpl-3.0
jsaponara/opentaxforms
opentaxforms/serve.py
1
3082
#!/usr/bin/env python from __future__ import print_function, absolute_import import flask_restless from argparse import ArgumentParser from flask import Flask from flask_sqlalchemy import SQLAlchemy from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session, sessionmaker from .db...
agpl-3.0
chrisburr/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
73
1232
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
sijie/bookkeeper
stream/clients/python/examples/admin.py
3
3472
# -*- coding: utf-8 -*- # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
apache-2.0
marxin/youtube-dl
youtube_dl/extractor/podomatic.py
198
2327
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import int_or_none class PodomaticIE(InfoExtractor): IE_NAME = 'podomatic' _VALID_URL = r'^(?P<proto>https?)://(?P<channel>[^.]+)\.podomatic\.com/entry/(?P<id>[^?]+)' _TESTS = [ { ...
unlicense
p0psicles/SickRage
lib/rtorrent/lib/xmlrpc/http.py
180
1195
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com> # 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, modify, ...
gpl-3.0
amyvmiwei/kbengine
kbe/res/scripts/common/Lib/distutils/dir_util.py
7
7804
"""distutils.dir_util Utility functions for manipulating directories and directory trees.""" import os import errno from distutils.errors import DistutilsFileError, DistutilsInternalError from distutils import log # cache for by mkpath() -- in addition to cheapening redundant calls, # eliminates redundant "creating ...
lgpl-3.0
borosnborea/SwordGO_app
example/kivymap/.buildozer/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
gpl-3.0
willingc/oh-mainline
vendor/packages/Django/tests/regressiontests/utils/text.py
20
6650
# -*- coding: utf-8 -*- from __future__ import unicode_literals import warnings from django.test import SimpleTestCase from django.utils import text class TestUtilsText(SimpleTestCase): # In Django 1.6 truncate_words() and truncate_html_words() will be removed # so these tests will need to be adapted accord...
agpl-3.0
bjlemke/MINGW-packages
mingw-w64-ca-certificates/certdata2pem.py
26
16059
#!/usr/bin/python # vim:set et sw=4: # # certdata2pem.py - splits certdata.txt into multiple files # # Copyright (C) 2009 Philipp Kern <pkern@debian.org> # Copyright (C) 2013 Kai Engert <kaie@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Pub...
bsd-3-clause
lxn2/mxnet
tests/python/unittest/test_model_parallel.py
13
1545
import numpy as np import mxnet as mx def reldiff(a, b): diff = np.sum(np.abs(a - b)) norm = np.sum(np.abs(a)) if diff == 0: return 0 reldiff = diff / norm return reldiff def test_chain(): n = 2 data1 = mx.sym.Variable('data1') data2 = mx.sym.Variable('data2') with mx.Attr...
apache-2.0
aidanlister/django
django/contrib/gis/geoip/base.py
334
11859
import os import re import warnings from ctypes import c_char_p from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS from django.contrib.gis.geoip.prototypes import ( GeoIP_country_code_by_addr, GeoIP_country_code_by_name, GeoIP_country_name_by_addr, GeoIP_country_name_by_name, GeoIP_database_info,...
bsd-3-clause
patrickm/chromium.src
tools/metrics/histograms/pretty_print.py
2
6038
#!/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. """Pretty-prints the histograms.xml file, alphabetizing tags, wrapping text at 80 chars, enforcing standard attribute ordering, and sta...
bsd-3-clause
huawei-cloud/compass
compass/config_management/utils/config_filter.py
4
3195
"""Module to filter configuration when upddating. .. moduleauthor:: Xiaodong Wang <xiaodongwang@huawei.com> """ import logging from compass.config_management.utils import config_reference class ConfigFilter(object): """config filter based on allows and denies rules""" def __init__(self, allows=['*'], de...
apache-2.0
otherway/loc-spain
___unported__/l10n_es_partner_data/__openerp__.py
2
1801
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved. # Jordi Esteve <jesteve@zikzakmedia.com> # Copyright (c) ...
agpl-3.0
ch1bo/lime-backend
lib/sublime/sublime_plugin.py
9
3888
import os import os.path import inspect import traceback import imp import sublime import sys import importlib class Command(object): def is_enabled(self, args=None): return True def is_visible(self, args=None): return True class ApplicationCommand(Command): pass class WindowCommand(...
bsd-2-clause
bbglab/wok
wok/core/flow/reader.py
1
6997
############################################################################### # # Copyright 2009-2011, Universitat Pompeu Fabra # # This file is part of Wok. # # Wok 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...
gpl-3.0
mzizzi/ansible
lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py
4
27361
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 Soft...
gpl-3.0
pyfisch/servo
components/script/dom/bindings/codegen/parser/tests/test_exposed_extended_attribute.py
127
6466
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" [PrimaryGlobal] interface Foo {}; [Global=(Bar1,Bar2)] interface Bar {}; [Global=Baz2] interface Baz {}; [Exposed=(Foo,Bar1)] interface Iface { void method1(); [Exposed=Bar1] readonly attribute a...
mpl-2.0
Xeralux/tensorflow
tensorflow/python/keras/preprocessing/text/__init__.py
4
1227
# 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...
apache-2.0
nacc/autotest
client/tests/kvm/tests/pci_hotplug.py
1
8582
import re from autotest.client.shared import error from autotest.client.virt import virt_utils, virt_vm, aexpect def run_pci_hotplug(test, params, env): """ Test hotplug of PCI devices. (Elements between [] are configurable test parameters) 1) PCI add a deivce (NIC / block) 2) Compare output of m...
gpl-2.0
megarcia/WxCD
source/process_NCEI_04b.py
2
3913
""" Python script 'process_NCEI_04b.py' by Matthew Garcia, PhD student Dept. of Forest and Wildlife Ecology University of Wisconsin - Madison matt.e.garcia@gmail.com Copyright (C) 2015-2016 by Matthew Garcia Licensed Gnu GPL v3; see 'LICENSE_GnuGPLv3.txt' for complete terms Send questions, bug reports, any related req...
gpl-3.0
manassolanki/erpnext
erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py
19
1592
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable import VariablePathNotFound class TestSupplierScore...
gpl-3.0
cshtarkov/autobump
tests/test_java_handler.py
1
10110
import os import tempfile import unittest from autobump.handlers import java_ast from autobump.handlers import java_native class TestJavaHandlerBase(unittest.TestCase): """Used to set up a simple Java codebase in a temporary location. Does not contain any actual tests. Test cases are meant to inheri...
gpl-3.0
sexroute/commandergenius
project/jni/python/src/Demo/tkinter/matt/animation-w-velocity-ctrl.py
47
1201
from Tkinter import * # this is the same as simple-demo-1.py, but uses # subclassing. # note that there is no explicit call to start Tk. # Tkinter is smart enough to start the system if it's not already going. class Test(Frame): def printit(self): print "hi" def createWidgets(self): self.QUI...
lgpl-2.1
hifly/OpenUpgrade
addons/website_mail/__openerp__.py
379
1623
# -*- 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 ...
agpl-3.0
stylianos-kampakis/scikit-learn
sklearn/manifold/tests/test_spectral_embedding.py
216
8091
from nose.tools import assert_true from nose.tools import assert_equal from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_raises from nose.plugins.skip import SkipTest from sk...
bsd-3-clause
RapidApplicationDevelopment/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/operator_pd_test.py
9
12427
# 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...
apache-2.0
wubenqi/protoc-gen-luabind
protoc-gen-luabind/google/protobuf/internal/decoder.py
223
26136
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
apache-2.0
arruda/rmr
rmr/apps/accounts/migrations/0001_initial.py
1
4385
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserProfile' db.create_table('accounts_userprofile', ( ('id', self.gf('django.db...
mit
sigma-random/scrapy
scrapy/utils/testproc.py
39
1465
import sys import os from twisted.internet import reactor, defer, protocol class ProcessTest(object): command = None prefix = [sys.executable, '-m', 'scrapy.cmdline'] cwd = os.getcwd() # trial chdirs to temp dir def execute(self, args, check_code=True, settings=None): env = os.environ.copy()...
bsd-3-clause
xiandiancloud/edx-platform-Y
common/djangoapps/student/tests/test_microsite.py
15
3704
""" Test for User Creation from Micro-Sites """ from django.test import TestCase from student.models import UserSignupSource import mock import json from django.core.urlresolvers import reverse from django.contrib.auth.models import User FAKE_MICROSITE = { "SITE_NAME": "openedx.localhost", "REGISTRATION_EXTRA_...
agpl-3.0
rosterloh/CMSIS-DAP
tools/get_binary.py
21
1166
""" CMSIS-DAP Interface Firmware Copyright (c) 2009-2013 ARM Limited 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 la...
apache-2.0
hip-odoo/odoo
addons/survey/tests/test_survey.py
22
17884
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import random import re from collections import Counter from itertools import product from urlparse import urljoin from odoo import _ from odoo.exceptions import UserError from odoo.tests.common import TransactionCase f...
agpl-3.0
WillGuan105/django
django/core/mail/backends/console.py
696
1477
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend from django.utils import six class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream',...
bsd-3-clause
g19-hs/personfinder
app/pytz/zoneinfo/Atlantic/Stanley.py
9
5454
'''tzinfo timezone information for Atlantic/Stanley.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Stanley(DstTzInfo): '''Atlantic/Stanley timezone definition. See datetime.tzinfo for details''' zone = 'Atlantic/Stanley...
apache-2.0
eemirtekin/edx-platform
lms/envs/devplus.py
102
2123
""" This config file tries to mimic the production environment more closely than the normal dev.py. It assumes you're running a local instance of MySQL 5.1 and that you're running memcached. You'll want to use this to test caching and database migrations. Assumptions: * MySQL 5.1 (version important? (askbot breaks on...
agpl-3.0
VenturaDelMonte/staticwebanalyzer
SDK/sip-4.16.3/configure.py
2
29998
# This script handles the SIP configuration and generates the Makefiles. # # Copyright (c) 2014 Riverbank Computing Limited <info@riverbankcomputing.com> # # This file is part of SIP. # # This copy of SIP is licensed for use under the terms of the SIP License # Agreement. See the file LICENSE for more details. # # Thi...
mit
webmasterraj/GaSiProMo
flask/lib/python2.7/site-packages/flask/debughelpers.py
777
3508
# -*- coding: utf-8 -*- """ flask.debughelpers ~~~~~~~~~~~~~~~~~~ Various helpers to make the development experience better. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from ._compat import implements_to_string class UnexpectedUnicodeError(AssertionEr...
gpl-2.0
bpramod/azure-linux-extensions
DSC/azure/http/batchclient.py
47
13769
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
apache-2.0
ZTE-Dev/android_kernel_zte_p892e10
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/cc1/src/wi/tests/registration_test.py
1
3217
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
apache-2.0
marcosbontempo/inatelos
poky-daisy/scripts/lib/mic/3rdparty/pykickstart/handlers/control.py
10
50993
# # Chris Lumens <clumens@redhat.com> # # Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that...
mit
gustavovaliati/ci724-ppginfufpr-2016
knn-02-06/knn-cuda_notworking_yet.py
1
7979
#!/usr/bin/python import datetime, argparse, sys, os import numpy as np from multiprocessing import Pool import pycuda.driver as drv import pycuda.tools import pycuda.autoinit import numpy.linalg as la from pycuda.compiler import SourceModule import pycuda.gpuarray as gpuarray ap = argparse.ArgumentParser() ap.add_arg...
gpl-3.0
RichardLitt/wyrd-django-dev
django/utils/encoding.py
4
9883
from __future__ import unicode_literals import codecs import datetime from decimal import Decimal import locale try: from urllib.parse import quote except ImportError: # Python 2 from urllib import quote import warnings from django.utils.functional import Promise from django.utils import six class Django...
bsd-3-clause
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/pygame/tests/run_tests__tests/exclude/invisible_tag_test.py
18
1163
__tags__ = ['invisible'] if __name__ == '__main__': import sys import os pkg_dir = (os.path.split( os.path.split( os.path.split( os.path.abspath(__file__))[0])[0])[0]) parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = ...
mit
pilnujemy/pytamy
foundation/correspondence/views/letter.py
2
2369
from django.views.generic import DeleteView, DetailView, UpdateView, CreateView from django.forms.models import BaseInlineFormSet from django.forms.models import inlineformset_factory from braces.views import LoginRequiredMixin, UserFormKwargsMixin, SelectRelatedMixin from ..models import Letter, Attachment from ..form...
bsd-3-clause
rysson/filmkodi
plugin.video.mrknowtv/resources/lib/indexers/phstreams.py
2
28077
# -*- coding: utf-8 -*- ''' Phoenix Add-on Copyright (C) 2015 Blazetamer Copyright (C) 2016 mrknow 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 Lic...
apache-2.0
clembou/PCWG
tests/interpolators_test.py
1
4393
import pcwg.core.interpolators as interpolators import unittest from pcwg.core.binning import Bins class TestMarmanderPowerCurveInterpolator(unittest.TestCase): def test_spreadsheet_benchmark(self): x = [1.00, 2.00, 3.00, 4.10, 5.06, 6.04, ...
mit
bratsche/Neutron-Drive
google_appengine/lib/django_1_2/django/contrib/gis/geos/collections.py
311
4663
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ from ctypes import c_int, c_uint, byref from django.contrib.gis.geos.error import GEOSException, GEOSIndexError from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gi...
bsd-3-clause
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/site-packages/urllib3/response.py
24
24667
from __future__ import absolute_import from contextlib import contextmanager import zlib import io import logging from socket import timeout as SocketTimeout from socket import error as SocketError from ._collections import HTTPHeaderDict from .exceptions import ( BodyNotHttplibCompatible, ProtocolError, DecodeErr...
gpl-3.0
mmatyas/servo
tests/wpt/grouping_formatter.py
99
11175
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from mozlog.formatters import base import collections import os import sys import subprocess DEFAULT_MOVE_UP_CODE = u"\...
mpl-2.0
shengdie/Dorimanx-LG-G2-D802-Kernel
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
themutt/plastex
build/lib.linux-x86_64-2.7/plasTeX/Packages/changebar.py
9
1056
#!/usr/bin/env python from plasTeX import Command, Environment, DimenCommand, Counter def ProcessOptions(options, document): context = document.context class cbstart(Command): def invoke(self, tex): cb = self.ownerDocument.createElement('changebar') cb.macroMode = self.MODE_BEGIN cb.i...
mit
sgraham/nope
tools/chrome_proxy/integration_tests/network_metrics.py
9
6588
# Copyright 2014 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 base64 import gzip import hashlib import io import logging import zlib from metrics import Metric from telemetry.page import page_test # All network ...
bsd-3-clause
thresholdsoftware/asylum-v2.0
openerp/addons/mrp/stock.py
18
9255
# -*- 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...
agpl-3.0
Azure/azure-sdk-for-python
sdk/keyvault/azure-keyvault-keys/samples/backup_restore_operations_async.py
1
3785
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import asyncio import os from azure.keyvault.keys.aio import KeyClient from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpRespon...
mit
ondrokrc/gramps
gramps/gen/filters/rules/media/_hasidof.py
2
1651
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 2 of the License, or # (at you...
gpl-2.0
pniedzielski/fb-hackathon-2013-11-21
src/repl.it/jsrepl/extern/python/closured/lib/python2.7/encodings/shift_jis.py
816
1039
# # shift_jis.py: Python Unicode Codec for SHIFT_JIS # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jis') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multib...
agpl-3.0
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/python/tools/strip_unused_lib.py
104
4859
# pylint: disable=g-bad-file-header # 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/LICENS...
mit
ryfeus/lambda-packs
Keras_tensorflow/source/google/protobuf/internal/test_util.py
38
29253
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
mit
camradal/ansible
lib/ansible/modules/commands/expect.py
7
7744
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Martz <matt@sivel.net> # # 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, ...
gpl-3.0
pio-masaki/kernel_at1s0
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
Philippe12/external_chromium_org
tools/perf/measurements/session_restore.py
23
2150
# 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. from measurements import startup from metrics import cpu from metrics import startup_metric class SessionRestore(startup.Startup): """Performs a measurem...
bsd-3-clause
av8ramit/tensorflow
tensorflow/python/keras/_impl/keras/optimizers.py
4
25991
# 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...
apache-2.0
BarcampBangalore/Barcamp-Bangalore-Android-App
gcm_flask/flask/config.py
50
6150
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import imp import os import errno from werkzeug.utils import import_...
apache-2.0
foodszhang/kbengine
kbe/src/lib/python/Lib/test/test_email/test_message.py
72
26378
import unittest import textwrap from email import policy, message_from_string from email.message import EmailMessage, MIMEPart from test.test_email import TestEmailBase, parameterize # Helper. def first(iterable): return next(filter(lambda x: x is not None, iterable), None) class Test(TestEmailBase): polic...
lgpl-3.0
firerszd/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py
650
1701
# urllib3/__init__.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (a...
lgpl-3.0
kapilrastogi/Impala
shell/impala_shell.py
2
54594
#!/usr/bin/env python # Copyright 2012 Cloudera 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 ag...
apache-2.0
iuliat/nova
nova/tests/unit/scheduler/weights/test_weights_ram.py
73
4062
# Copyright 2011-2012 OpenStack Foundation # 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...
apache-2.0
catapult-project/catapult
tracing/tracing/proto/histogram_proto_unittest.py
4
1578
# Copyright 2020 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 unittest from tracing.proto import histogram_proto class HistogramProtoUnittest(unittest.TestCase): def testUnitFromProto(self): proto = hist...
bsd-3-clause
franky88/emperioanimesta
env/Lib/site-packages/django/conf/locale/en_GB/formats.py
504
2117
# -*- 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 M Y' # '25 Oc...
gpl-3.0
omaciel/billreminder
src/daemon/dbus_manager.py
2
7091
# -*- coding: utf-8 -*- __all__ = ['Server', 'get_interface', 'verify_service'] from datetime import date import dbus import dbus.service from lib import common, scheduler from lib.utils import force_string from lib.utils import get_dbus_interface as get_interface from lib.utils import verify_dbus_service as verify...
gpl-3.0
MicroTrustRepos/microkernel
src/l4/pkg/python/contrib/Lib/test/test_bsddb185.py
194
1258
"""Tests for the bsddb185 module. The file 185test.db found in Lib/test/ is for testing purposes with this testing suite. """ from test.test_support import run_unittest, findfile, import_module import unittest bsddb185 = import_module('bsddb185', deprecated=True) import anydbm import whichdb import os import tempfile...
gpl-2.0