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
efiop/dvc
tests/remotes/gdrive.py
1
3618
# pylint:disable=abstract-method import json import os import uuid from functools import partialmethod import pytest from funcy import cached_property, retry from dvc.fs.gdrive import GDriveFileSystem from dvc.path_info import CloudURLInfo from dvc.utils import tmp_fname from .base import Base TEST_GDRIVE_REPO_BUCK...
apache-2.0
nealtodd/django
tests/test_runner/test_discover_runner.py
210
6196
import os from contextlib import contextmanager from unittest import TestSuite, TextTestRunner, defaultTestLoader from django.test import TestCase from django.test.runner import DiscoverRunner @contextmanager def change_cwd(directory): current_dir = os.path.abspath(os.path.dirname(__file__)) new_dir = os.pat...
bsd-3-clause
liuqr/edx-xiaodun
lms/djangoapps/certificates/management/commands/gen_cert_report.py
28
3498
from django.core.management.base import BaseCommand from certificates.models import GeneratedCertificate from django.contrib.auth.models import User from optparse import make_option from django.conf import settings from xmodule.course_module import CourseDescriptor from xmodule.modulestore.django import modulestore fro...
agpl-3.0
protatremy/buildbot
master/buildbot/test/unit/test_db_builders.py
8
11032
# 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
smart-developerr/my-first-blog
Lib/site-packages/pip/_vendor/packaging/_structures.py
1152
1416
# 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 class Infinity(object): def __repr__(self): return "Infinity...
gpl-3.0
ybellavance/python-for-android
python-modules/twisted/twisted/web/vhost.py
53
4382
# -*- test-case-name: twisted.web. # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ I am a virtual hosts implementation. """ # Twisted Imports from twisted.python import roots from twisted.web import resource class VirtualHostCollection(roots.Homogenous): """Wrapper for virt...
apache-2.0
todaychi/hue
desktop/core/ext-py/Paste-2.0.1/tests/test_util/test_quoting.py
47
1073
from paste.util import quoting import six import unittest class TestQuoting(unittest.TestCase): def test_html_unquote(self): self.assertEqual(quoting.html_unquote(b'&lt;hey&nbsp;you&gt;'), u'<hey\xa0you>') self.assertEqual(quoting.html_unquote(b''), ...
apache-2.0
JGulbronson/rmc
analytics/stats.py
8
15642
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # There's some code in this file that checks for whether a field has been rated # incorrectly (eg. `if course_review.interest`). Also, there's very slow code # that loads all records in a collection into memory that should be converted # to...
mit
aarose/togglwrapper
tests.py
1
26969
# -*- coding: utf-8 -*- """ tests ----- Ensures that certain actions in the togglwrapper library result in certain behaviours. Uses the responses library to mock out the requests library, and loads fixtures from ``fixtures/`` for the mock JSON response output. """ import json import os import unittest import respo...
mit
40223102/w16b_test
static/Brython3.1.1-20150328-091302/Lib/browser/markdown.py
623
13060
# -*- coding: utf-8 -*- try: import _jsre as re except: import re import random import time letters = 'abcdefghijklmnopqrstuvwxyz' letters += letters.upper()+'0123456789' class URL: def __init__(self,src): elts = src.split(maxsplit=1) self.href = elts[0] self.alt = '' if ...
agpl-3.0
magfest/ubersystem
tests/uber/models/test_merch.py
1
9284
import pytest from uber.config import c from uber.models import Attendee @pytest.fixture(autouse=True) def donation_tier_fixture(monkeypatch): shirt_level = 25 supporter_level = 85 monkeypatch.setattr(c, 'DONATION_TIERS', { 0: 'No thanks', shirt_level: 'RedShirt', 55: 'Cruiser', ...
agpl-3.0
babycaseny/poedit
deps/boost/tools/build/src/util/__init__.py
12
4982
import bjam import re import types from itertools import groupby # Decorator the specifies bjam-side prototype for a Python function def bjam_signature(s): def wrap(f): f.bjam_signature = s return f return wrap def metatarget(f): f.bjam_signature = (["name"], ["sources", "*"],...
mit
smunaut/gnuradio
gnuradio-runtime/examples/network/dial_tone_sink.py
58
2479
#!/usr/bin/env python # # Copyright 2006,2007,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
gpl-3.0
sebi-hgdata/ansible
lib/ansible/runner/lookup_plugins/dict.py
166
1329
# (c) 2014, Kent R. Spillner <kspillner@acm.org> # # 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 ve...
gpl-3.0
mice-software/maus
tests/py_unit/test_docstore/_test_root_document_store/test_control_message.py
1
3246
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus # # MAUS 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. # ...
gpl-3.0
lonetwin/pydown
pygments/styles/native.py
26
1938
# -*- coding: utf-8 -*- """ pygments.styles.native ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "native" vim theme. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, ...
mit
jdjnovak/WaffleTalk
WaffleTalk/functions.py
1
2627
#!/usr/bin/python3 import random GLOBAL_NULLS = "abcdefghijklmnopqrstuvwxyz" def encrypt(message, key): KEY = key.strip() spacelessmessage = message.replace(" ","") strippedmessage = spacelessmessage.strip() WORK_MSG = strippedmessage.lower() #Use this as workable string SORTED_KEY = sortKey(KEY...
mit
sarvesh-ranjan/swift
swift/common/middleware/x_profile/profile_model.py
2
10240
# Copyright (c) 2010-2012 OpenStack, LLC. # # 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 ...
apache-2.0
Fale/ansible
test/units/module_utils/common/text/converters/test_container_to_bytes.py
71
3223
# -*- coding: utf-8 -*- # Copyright 2019, Andrew Klychkov @Andersson007 <aaklychkov@mail.ru> # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from ansible.modu...
gpl-3.0
sqlalchemy/sqlalchemy
test/aaa_profiling/test_memusage.py
3
45648
import decimal import gc import itertools import multiprocessing import weakref import sqlalchemy as sa from sqlalchemy import ForeignKey from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import select from sqlalchemy import String from sqlalchemy import test...
mit
eranchetz/nupic
nupic/regions/PictureSensorExplorers/random.py
17
5518
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
UManPychron/pychron
docs/user_guide/operation/scripts/examples/argus/measurement/noise/jan_noise20_8_125.py
4
2291
#!Measurement ''' baseline: after: true before: false counts: 125 detector: H1 mass: 34.2 settling_time: 15.0 default_fits: average equilibration: eqtime: 1.0 inlet: R inlet_delay: 3 outlet: O use_extraction_eqtime: true multicollect: counts: 20 detector: H1 isotope: Ar40 peakcenter: after...
apache-2.0
asimonia/Flask-Task
views.py
1
1097
import sqlite3 from functools import wraps from flask import Flask, flash, redirect, render_template, request, session, url_for # config app = Flask(__name__) app.config.from_object('_config') # helper functions def connect_db(): return sqlite3.connect(app.config['DATABASE_PATH']) def login_required(test): ...
apache-2.0
bzero/statsmodels
statsmodels/compat/scipy.py
31
6660
from __future__ import absolute_import import numpy as np def _bit_length_26(x): if x == 0: return 0 elif x == 1: return 1 else: return len(bin(x)) - 2 try: from scipy.lib._version import NumpyVersion except ImportError: import re from .python import string_types ...
bsd-3-clause
FodT/t1-python
tests/test_deals.py
3
3119
from __future__ import absolute_import import unittest import responses import requests from .requests_patch import patched_extract_cookies_to_jar from terminalone import T1 mock_credentials = { 'username': 'user', 'password': 'password', 'api_key': 'api_key', } API_BASE = 'api.mediamath.com' requests.se...
apache-2.0
Immortalin/python-for-android
python3-alpha/extra_modules/pyxmpp2/streamtls.py
46
11438
# # (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be u...
apache-2.0
AppVentus/AvTime-client
packages/wakatime/wakatime/packages/pygments2/pygments/lexers/_phpbuiltins.py
274
122046
# -*- coding: utf-8 -*- """ pygments.lexers._phpbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file loads the function names and their modules from the php webpage and generates itself. Do not alter the MODULES dict by hand! WARNING: the generation transfers quite much data over your ...
bsd-3-clause
xkmato/youtube-dl
youtube_dl/extractor/freesound.py
192
1392
from __future__ import unicode_literals import re from .common import InfoExtractor class FreesoundIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?freesound\.org/people/([^/]+)/sounds/(?P<id>[^/]+)' _TEST = { 'url': 'http://www.freesound.org/people/miklovan/sounds/194503/', 'md5': '1228...
unlicense
matthew-brett/pymc
pymc/NormalApproximation.py
1
16647
# TODO: Test case for EM algorithm. # TODO: Derivatives from the EM algorithm can't actually be used to compute the Hessian for the normal approx. # Post-2.0-release: # TODO: Think about what to do about int-valued stochastics. # TODO: Allow constraints if fmin_l_bfgs_b is used. __docformat__='reStructuredText' __a...
mit
Livit/Livit.Learn.EdX
common/lib/xmodule/xmodule/tests/xml/factories.py
40
5142
""" Factories for generating edXML for testing XModule import """ import inspect from fs.memoryfs import MemoryFS from factory import Factory, lazy_attribute, post_generation, Sequence from lxml import etree from xblock.mixins import HierarchyMixin from xmodule.modulestore.inheritance import InheritanceMixin from xm...
agpl-3.0
obnoxxx/samba
source3/script/tests/test_wbinfo_sids2xids_int.py
27
3214
#!/usr/bin/env python import sys,os,subprocess if len(sys.argv) != 3: print "Usage: test_wbinfo_sids2xids_int.py wbinfo net" sys.exit(1) wbinfo = sys.argv[1] netcmd = sys.argv[2] def flush_cache(): os.system(netcmd + " cache flush") def fill_cache(inids, idtype='gid'): for inid in inids: i...
gpl-3.0
lynnUg/django-registration-10
registration/models.py
1
10562
import datetime import hashlib import random import re from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db import transaction from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ try: from d...
bsd-3-clause
hanicker/odoo
addons/product/wizard/__init__.py
452
1076
# -*- 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...
agpl-3.0
basnijholt/holoviews
holoviews/tests/plotting/plotly/testcurveplot.py
2
2277
import numpy as np from holoviews.element import Curve from .testplot import TestPlotlyPlot class TestCurvePlot(TestPlotlyPlot): def test_curve_state(self): curve = Curve([1, 2, 3]) state = self._get_plot_state(curve) self.assertEqual(state['data'][0]['x'], np.array([0, 1, 2])) ...
bsd-3-clause
jorik041/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/reopenbugafterrollout.py
125
2205
# Copyright (C) 2010 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 list of conditions and th...
bsd-3-clause
kisel/trex-core
scripts/external_libs/pyzmq-14.5.0/python2/ucs2/32bit/zmq/tests/test_imports.py
30
1742
# Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import sys from unittest import TestCase class TestImports(TestCase): """Test Imports - the quickest test to ensure that we haven't introduced version-incompatible syntax errors.""" def test_toplevel(self): ...
apache-2.0
jseabold/scikit-learn
sklearn/manifold/tests/test_locally_linear.py
232
4761
from itertools import product from nose.tools import assert_true import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from scipy import linalg from sklearn import neighbors, manifold from sklearn.manifold.locally_linear import barycenter_kneighbors_graph from sklearn.utils.testi...
bsd-3-clause
aarande/nexradaws
setup.py
1
1799
import setuptools setuptools.setup( name='nexradaws', version='1.1', packages=['nexradaws','nexradaws.resources'], description= 'Query and download NEXRAD data from AWS S3 storage.', long_description= '''This module is designed to allow you to query and download Nexrad radar files from Amazon Web S...
mit
tonybaloney/st2
st2common/st2common/transport/__init__.py
10
1213
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
shyamalschandra/picochess
libs/requests/packages/chardet/langgreekmodel.py
2763
12628
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
DirtyPiece/dancestudio
Build/Tools/Python27/Lib/lib-tk/Tkdnd.py
198
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 an 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...
mit
ruschelp/cortex-vfx
test/IECore/MeshPrimitiveImplicitSurfaceOp.py
12
2702
########################################################################## # # Copyright (c) 2008, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
partofthething/home-assistant
homeassistant/components/atag/climate.py
16
3345
"""Initialization of ATAG One climate platform.""" from typing import List, Optional from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, HVAC_MODE_AUTO, HVAC_MODE_HEAT, PRESET_AWAY, PRESET_BOOST, ...
mit
meimz/linux
tools/perf/scripts/python/sctop.py
1996
2102
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
EvaSDK/sqlalchemy
lib/sqlalchemy/orm/attributes.py
24
56510
# orm/attributes.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Defines instrumentation for class attributes and their interaction with instanc...
mit
benschulz/servo
tests/wpt/harness/wptrunner/executors/executorselenium.py
61
9570
# 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/. import os import socket import sys import threading import time import traceback import urlparse import uuid from .base...
mpl-2.0
scmallorca/primefactors-dojo
alearnaiz_joanmiralles/tests/prime_factors_test.py
1
1155
import unittest from ..src.prime_factors import PrimeFactors class PrimeFactorsTest(unittest.TestCase): def test_generate_one__should_be_empty(self): primes = PrimeFactors.generate(1) assert len(primes) == 0 def test_generate_two__should_be_two(self): number = 2 self.check_p...
mit
loretoparisi/pattern
pattern/server/cherrypy/cherrypy/lib/httputil.py
37
17721
"""HTTP library functions. This module contains functions for building an HTTP application framework: any one, not just one whose name starts with "Ch". ;) If you reference any modules from some popular framework inside *this* module, FuManChu will personally hang you up by your thumbs and submit you to a public canin...
bsd-3-clause
jazzmes/ryu
ryu/services/protocols/bgp/operator/commands/show/count.py
52
1840
import logging from ryu.services.protocols.bgp.operator.command import Command from ryu.services.protocols.bgp.operator.command import CommandsResponse from ryu.services.protocols.bgp.operator.command import STATUS_ERROR from ryu.services.protocols.bgp.operator.command import STATUS_OK from ryu.services.protocols.bgp....
apache-2.0
skudriashev/incubator-airflow
tests/contrib/sensors/test_jira_sensor_test.py
37
2886
# -*- 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
teeple/pns_server
work/install/Python-2.7.4/Lib/test/test_file_eintr.py
95
10480
# Written to test interrupted system calls interfering with our many buffered # IO implementations. http://bugs.python.org/issue12268 # # This tests the '_io' module. Similar tests for Python 2.x's older # default file I/O implementation exist within test_file2k.py. # # It was suggested that this code could be merged...
gpl-2.0
jlegendary/youtube-dl
youtube_dl/extractor/imgur.py
54
3627
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, js_to_json, mimetype2ext, ExtractorError, ) class ImgurIE(InfoExtractor): _VALID_URL = r'https?://(?:i\.)?imgur\.com/(?P<id>[a-zA-Z0-9]+)' ...
unlicense
2013Commons/hue
desktop/core/ext-py/Django-1.4.5/tests/regressiontests/signing/tests.py
34
4197
import time from django.core import signing from django.test import TestCase from django.utils.encoding import force_unicode class TestSigner(TestCase): def test_signature(self): "signature() method should generate a signature" signer = signing.Signer('predictable-secret') signer2 = sign...
apache-2.0
ChrisCinelli/pgessays
env/lib/python2.7/site-packages/BeautifulSoup.py
218
79567
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
bsd-2-clause
wilsonianb/nacl_contracts
pynacl/log_tools.py
2
4476
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Logging related tools.""" import logging import os import subprocess import sys # Module-level configuration LOG_FH = None VE...
bsd-3-clause
eehello/shadowsocks
shadowsocks/crypto/sodium.py
1032
3778
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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 ...
apache-2.0
mhbu50/frappe
frappe/patches/v5_2/change_checks_to_not_null.py
58
1267
from __future__ import unicode_literals import frappe from frappe.utils import cint from frappe.model import default_fields def execute(): for table in frappe.db.get_tables(): doctype = table[3:] if frappe.db.exists("DocType", doctype): fieldnames = [df["fieldname"] for df in frappe.get_all("DocField", fie...
mit
napalm-automation/napalm-base
napalm_base/clitools/cl_napalm_validate.py
2
1376
# -*- coding: utf-8 -*- ''' NAPALM CLI Tools: validate =========================== Validating deployments from the shell. ''' # Python3 support from __future__ import print_function from __future__ import unicode_literals # import helpers from napalm_base import get_network_driver from napalm_base.clitools.helpers i...
apache-2.0
dbbhattacharya/kitsune
vendor/packages/selenium/py/selenium/webdriver/support/select.py
44
8366
#!/usr/bin/python # # Copyright 2011 Software Freedom Conservancy. # # 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 ap...
bsd-3-clause
bksim/chinese-translation
nltk/sem/relextract.py
5
14650
# Natural Language Toolkit: Relation Extraction # # Copyright (C) 2001-2012 NLTK Project # Author: Ewan Klein <ewan@inf.ed.ac.uk> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ Code for extracting relational triples from the ieer and conll2002 corpora. Relations are stored internally as ...
apache-2.0
mrGeen/cython
Cython/Compiler/UtilityCode.py
6
8783
from __future__ import absolute_import from .TreeFragment import parse_from_strings, StringParseContext from . import Symtab from . import Naming from . import Code class NonManglingModuleScope(Symtab.ModuleScope): cpp = False def __init__(self, prefix, *args, **kw): self.prefix = prefix se...
apache-2.0
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/616_MagicalPowerOfFirePart2/__init__.py
1
6980
#Made by Emperorc import sys from com.l2scoria import Config from com.l2scoria.gameserver.datatables.sql import SpawnTable from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest from co...
gpl-3.0
wuga214/Django-Wuga
env/lib/python2.7/site-packages/django/core/management/commands/makemessages.py
48
26302
from __future__ import unicode_literals import fnmatch import glob import io import os import re import sys from functools import total_ordering from itertools import dropwhile import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.temp import Nam...
apache-2.0
wujinjun/TFbook
chapter5/models-master/syntaxnet/dragnn/tools/build_pip_package.py
2
2371
"""Builds a pip package suitable for redistribution. Adapted from tensorflow/tools/pip_package/build_pip_package.sh. This might have to change if Bazel changes how it modifies paths. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse impor...
gpl-3.0
shaufi10/odoo
addons/report/models/report_paperformat.py
311
7814
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-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
zapier/transformer
transformer/transforms/string/phone_number_extract_test.py
1
2330
import unittest import phone_number_extract class TestStringPhoneExtractTransform(unittest.TestCase): def test_phoneextract(self): transformer = phone_number_extract.StringPhoneExtractTransform() # using the default regex - which is uni1 self.assertEqual(transformer.transform(""), "") ...
gpl-3.0
kofron/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/ar.py
61
2200
"""SCons.Tool.ar Tool-specific initialization for ar (library archive). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons ...
apache-2.0
badlogicmanpreet/nupic
src/nupic/frameworks/opf/two_gram_model.py
40
6927
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
Enttoi/enttoi-client
gpio_output.py
3
1773
""" Wrappers for OUTPUT devices connected to GPIO """ import threading import RPi.GPIO as GPIO class Led(object): """Represent LED as output""" def __init__(self, pin): self.pin = pin GPIO.setup(self.pin, GPIO.OUT) self.__blinking_frequency = -1 # indicates no blinking self....
mit
bobisme/odoo
addons/im_livechat/im_livechat.py
36
11826
# -*- 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
ucsb-seclab/dr_checker
helper_scripts/runner_scripts/components/entry_point_identifier.py
1
4615
from base_component import * import os class EntryPointIdentifier(Component): """ This component tries to find entry point functions from provided bitcode file and hdr file list. """ def __init__(self, value_dict): ep_finder_bin = None ep_config = None llvm_bc_out = None ...
bsd-2-clause
qianwenming/mapnik
scons/scons-local-2.3.1/SCons/Node/__init__.py
8
49617
"""SCons.Node The Node package for the SCons software construction utility. This is, in many ways, the heart of SCons. A Node is where we encapsulate all of the dependency information about any thing that SCons can build, or about any thing which SCons can use to build some other thing. The canonical "thing," of co...
lgpl-2.1
kamyu104/LeetCode
Python/shortest-completing-word.py
2
2247
# Time: O(n) # Space: O(1) # Find the minimum length word from a given dictionary words, # which has all the letters from the string licensePlate. # Such a word is said to complete the given string licensePlate # # Here, for letters we ignore case. # For example, "P" on the licensePlate still matches "p" on the word....
mit
jwoeifjoei/bot01
src/main.py
1
6502
# -*- coding: utf-8 -*- # Copyright (c) 2016-2017 Marco Aceti <dev@marcoaceti.it> # # 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 right...
mit
davy39/eric
Debugger/DebuggerInterfacePython.py
1
43520
# -*- coding: utf-8 -*- # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the Python debugger interface for the debug server. """ from __future__ import unicode_literals import sys import os import re from PyQt5.QtCore import QObject, QTextCodec, QProcess, QProcessEn...
gpl-3.0
xzturn/tensorflow
tensorflow/python/keras/engine/training_utils_test.py
9
16566
# Copyright 2018 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
woprgit/p2pool-wopr
p2pool/util/datachunker.py
288
1407
import collections class StringBuffer(object): 'Buffer manager with great worst-case behavior' def __init__(self, data=''): self.buf = collections.deque([data]) self.buf_len = len(data) self.pos = 0 def __len__(self): return self.buf_len - self.pos def add...
gpl-3.0
jumpstarter-io/nova
nova/scheduler/filters/exact_ram_filter.py
26
1513
# Copyright (c) 2014 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
jschuecker/nest-simulator
pynest/examples/brunel_alpha_numpy.py
13
11715
# -*- coding: utf-8 -*- # # brunel_alpha_numpy.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Lice...
gpl-2.0
psci2195/espresso-ffans
src/python/espressomd/checkpointing.py
1
9727
# # Copyright (C) 2013-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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...
gpl-3.0
theshadowx/enigma2
tests/events.py
31
1652
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...
gpl-2.0
mattgrogan/ledmatrix
ledmatrix/components/viewport.py
1
1050
class Viewport_Mixin(object): """ Mixin to help move around the image """ def update(self): """ Call update to get fresh data. """ pass def reset(self): """ Reset the viewport """ self._position = (0, 0) def set_position(self, xy): self._position = xy def move_left(self)...
mit
yqm/sl4a
python-build/python-libs/gdata/tests/gdata_tests/apps/migration/service_test.py
89
2125
#!/usr/bin/python # # Copyright (C) 2008 Google # # 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
drogenlied/qudi
core/util/network.py
4
1048
# -*- coding: utf-8 -*- """ Check if something is a rpyc remote object and transfer it Qudi 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. ...
gpl-3.0
the-dalee/gnome-2048
gui/controllers/theme_selection_controller.py
1
3718
from gi.repository import Gtk import os from properties import Directories, Properties from model.themes import ThemeAttributes class ThemeSelectionController(object): def __init__(self): self._builder = Gtk.Builder() glade_file = os.path.join(Directories.APP_GLADES, ...
mit
SerCeMan/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/sk/sk_districts.py
543
2453
""" Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska """ from django.utils.translation import ugettext_lazy as _ DISTRICT_CHOICES = ( ('BB', _('Banska Bystrica')), ('BS', _('Banska Stiavnica')), ('BJ', _('Bardejov')), ('BN', _('Banovce nad Bebravo...
apache-2.0
joelpinheiro/safebox-smartcard-auth
Client/veclient/lib/python2.7/site-packages/setuptools/site-patch.py
720
2389
def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys,'path_importer_cache',{}) stdpath = sys.path[le...
gpl-2.0
wemanuel/smry
smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/boto/cloudtrail/exceptions.py
127
2246
""" Exceptions that are specific to the cloudtrail module. """ from boto.exception import BotoServerError class InvalidSnsTopicNameException(BotoServerError): """ Raised when an invalid SNS topic name is passed to Cloudtrail. """ pass class InvalidS3BucketNameException(BotoServerError): """ ...
apache-2.0
hyvas/libgdx
extensions/gdx-freetype/jni/freetype-2.6.2/src/tools/docmaker/docbeauty.py
877
2642
#!/usr/bin/env python # # DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org> # # This program is used to beautify the documentation comments used # in the FreeType 2 public headers. # from sources import * from content import * from utils import * import utils import sys, os, time, string, getopt ...
apache-2.0
odoousers2014/odoo
addons/hr/res_config.py
4
3547
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
sepehr125/pybrain
pybrain/rl/environments/flexcube/viewer.py
25
10775
from __future__ import print_function __author__ = 'Frank Sehnke, sehnke@in.tum.de' ######################################################################### # OpenGL viewer for the FlexCube Environment # # The FlexCube Environment is a Mass-Spring-System composed of 8 mass points. # These resemble a cube with flexi...
bsd-3-clause
googleapis/google-cloud-php
Gaming/synth.py
2
2871
# Copyright 2020 Google LLC # # 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, s...
apache-2.0
winndows/cinder
cinder/tests/unit/objects/test_volume_type.py
9
4317
# Copyright 2015 SimpliVity 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 o...
apache-2.0
bratsche/Neutron-Drive
google_appengine/lib/django_1_3/django/contrib/localflavor/fi/forms.py
309
1803
""" FI-specific Form helpers """ import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class FIZipCodeField(RegexField): default_error_messages = { ...
bsd-3-clause
0x00f/pelican
pelican/tools/pelican_themes.py
1
7117
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import shutil import sys try: import pelican except: err('Cannot import pelican.\nYou must install Pelican in order to run this script.', -1) global _THEMES_PATH _THEMES_PATH = os.path.join( os.path.dirname( os.path.abspath(...
agpl-3.0
ishank08/scikit-learn
examples/applications/plot_stock_market.py
76
8522
""" ======================================= Visualizing the stock market structure ======================================= This example employs several unsupervised learning techniques to extract the stock market structure from variations in historical quotes. The quantity that we use is the daily variation in quote ...
bsd-3-clause
dagar/libpypa-test
tools/astdump.py
6
1070
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 import ast PADDING = ' ' def member_filter(item): if item in ('col_offset', 'lineno'): return False return not item.startswith("_") def print_ast(a, pad=''): if isinstance(a, (list, tuple)): print '[' for i in a:...
apache-2.0
MonicaHsu/truvaluation
venv/lib/python2.7/distutils/emxccompiler.py
250
11931
"""distutils.emxccompiler Provides the EMXCCompiler class, a subclass of UnixCCompiler that handles the EMX port of the GNU C compiler to OS/2. """ # issues: # # * OS/2 insists that DLLs can have names no longer than 8 characters # We put export_symbols in a def-file, as though the DLL can have # an arbitrary len...
mit
fdvarela/odoo8
addons/mrp_operations/__init__.py
443
1091
# -*- 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...
agpl-3.0
dnephin/pre-commit
pre_commit/clientlib/validate_config.py
4
2492
from __future__ import unicode_literals from pre_commit.clientlib.validate_base import get_run_function from pre_commit.clientlib.validate_base import get_validator from pre_commit.clientlib.validate_base import is_regex_valid from pre_commit.errors import FatalError _LOCAL_HOOKS_MAGIC_REPO_STRING = 'local' def is...
mit