repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
adsabs/adsabs-pyingest
refs/heads/master
pyingest/tests/test_validators.py
1
""" Test parsers """ import unittest import os import glob import json import pyingest.validators.ads stubdata_dir = os.path.join(os.path.dirname(__file__), 'stubdata') class TestSimple(unittest.TestCase): def setUp(self): self.inputdocs = glob.glob(os.path.join(stubdata_dir, 'parsed/*.json')) # ...
nirb/whatsapp
refs/heads/master
yowsup/common/__init__.py
70
from .constants import YowConstants
CapOM/ChromiumGStreamerBackend
refs/heads/master
tools/telemetry/telemetry/internal/actions/action_runner_unittest.py
5
# 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 unittest from telemetry.core import exceptions from telemetry import decorators from telemetry.internal.actions import page_action from telemetry.page...
gennad/Django-nonrel-stub-for-Google-App-Engine
refs/heads/master
django/contrib/gis/gdal/tests/test_ds.py
233
import os, os.path, unittest from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString from django.contrib.gis.geometry.test_data import get_ds_file, TestDS # List of acceptable data sources....
meduz/scikit-learn
refs/heads/master
sklearn/gaussian_process/regression_models.py
72
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # License: BSD 3 clause """ The built-in regression models submodule for the gaussian_process module. """ import numpy as np def constant(x): """ Zero order polynomial (...
fkolacek/FIT-VUT
refs/heads/master
bp-revok/python/lib/python2.7/importlib/__init__.py
456
"""Backport of importlib.import_module from 3.x.""" # While not critical (and in no way guaranteed!), it would be nice to keep this # code compatible with Python 2.3. import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, 'rindex...
Xicnet/burnstation
refs/heads/master
Main.py
1
#!/usr/bin/env python """ burnstation - free media distribution system """ DIRECTION_UP = 0 DIRECTION_DOWN = 1 DIRECTION_LEFT = 2 DIRECTION_RIGHT = 3 #Import Modules import sys, os, pygame from pygame.locals import * import Common from LoadConfig import config basedir = config.bshome sys.path.append(config.bshome) ...
plowman/python-mcparseface
refs/heads/master
models/autoencoder/autoencoder_models/DenoisingAutoencoder.py
7
import tensorflow as tf import numpy as np import autoencoder.Utils class AdditiveGaussianNoiseAutoencoder(object): def __init__(self, n_input, n_hidden, transfer_function = tf.nn.softplus, optimizer = tf.train.AdamOptimizer(), scale = 0.1): self.n_input = n_input self.n_hidden = ...
peakwinter/firestarter
refs/heads/master
firestarter/models.py
2
from django.conf import settings from django.db import models class Reward(models.Model): name = models.CharField(max_length=255, default="", verbose_name='Reward Name') min_amount = models.DecimalField(max_digits=8, decimal_places=2, default="", verbose_name="Minimum Amount") desc = models.CharField(max_length=25...
skidzo/sympy
refs/heads/master
sympy/interactive/__init__.py
123
"""Helper module for setting up interactive SymPy sessions. """ from .printing import init_printing from .session import init_session
pozdnyakov/chromium-crosswalk
refs/heads/master
build/download_nacl_toolchains.py
66
#!/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. """Shim to run nacl toolchain download script only if there is a nacl dir.""" import os import sys def Main(args): # Exit earl...
bgris/ODL_bgris
refs/heads/master
lib/python3.5/site-packages/Sphinx-1.5.1-py3.5.egg/sphinx/util/fileutil.py
3
# -*- coding: utf-8 -*- """ sphinx.util.fileutil ~~~~~~~~~~~~~~~~~~~~ File utility functions for Sphinx. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import absolute_import import os import codecs import posixpath fro...
gurneyalex/sale-workflow
refs/heads/8.0
__unported__/sale_condition_text/condition.py
37
# -*- coding: utf-8 -*- # # # Copyright Camptocamp SA # # from osv import osv, fields class AccountConditionText(osv.osv): """add info condition in the invoice""" _name = "account.condition_text" _description = "Invoice condition text" _columns = {'name': fields.char('Condition', required=True, size...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_future_builtins.py
137
import test.test_support, unittest # we're testing the behavior of these future builtins: from future_builtins import hex, oct, map, zip, filter class BuiltinTest(unittest.TestCase): def test_hex(self): self.assertEqual(hex(0), '0x0') self.assertEqual(hex(16), '0x10') self.assertEqual(hex(...
Jhonbeltran/information-layer8
refs/heads/master
members/admin.py
1
from django.contrib import admin from .models import Member @admin.register(Member) class AdminMember(admin.ModelAdmin): list_display = ('name', 'last_name', 'phone', 'email', 'address', 'personal_skills', 'team_skills', 'weakness', 'under_presure',) list_filter = ('emai...
nirmeshk/oh-mainline
refs/heads/master
vendor/packages/celery/celery/tests/test_app/test_log.py
18
from __future__ import absolute_import from __future__ import with_statement import sys import logging from tempfile import mktemp from celery import log from celery.log import (setup_logger, setup_task_logger, get_default_logger, get_task_logger, redirect_stdouts_to_lo...
chengdh/openerp-ktv
refs/heads/master
openerp/addons/crm/__openerp__.py
9
# -*- 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...
auready/docker-py
refs/heads/master
tests/unit/swarm_test.py
7
# -*- coding: utf-8 -*- import json from . import fake_api from ..helpers import requires_api_version from .api_test import BaseAPIClientTest, url_prefix, fake_request class SwarmTest(BaseAPIClientTest): @requires_api_version('1.24') def test_node_update(self): node_spec = { 'Availabilit...
undoware/neutron-drive
refs/heads/master
neutron-drive/django/core/files/storage.py
78
import os import errno import urlparse import itertools from datetime import datetime from django.conf import settings from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation from django.core.files import locks, File from django.core.files.move import file_move_safe from django.utils.encoding impo...
captain-proton/aise
refs/heads/master
documentation/source/sphinx_ext/__init__.py
308
# -*- coding: utf-8 -*- """ sphinxcontrib ~~~~~~~~~~~~~ This package is a namespace package that contains all extensions distributed in the ``sphinx-contrib`` distribution. :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ __import__(...
pgandhi999/spark
refs/heads/master
python/pyspark/mllib/stat/_statistics.py
20
# # Licensed to the Apache Software Foundation (ASF) 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 us...
joeyjy/ayi-django
refs/heads/master
ms/accounts/migrations/0006_auto__add_compound.py
1
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Compound' db.create_table(u'accounts_compound', ( ...
cristianquaglio/odoo
refs/heads/master
addons/base_vat/base_vat.py
238
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
vfrc2/Flexget
refs/heads/develop
flexget/plugins/generic/log_start.py
19
from __future__ import unicode_literals, division, absolute_import from argparse import SUPPRESS import logging import os from flexget import options from flexget.event import event log = logging.getLogger('log_start') @event('manager.startup') def log_start(manager): if manager.options.log_start: ...
omg-insa/server
refs/heads/master
django/utils/copycompat.py
334
""" Fixes Python 2.4's failure to deepcopy unbound functions. """ import copy import types # Monkeypatch copy's deepcopy registry to handle functions correctly. if (hasattr(copy, '_deepcopy_dispatch') and types.FunctionType not in copy._deepcopy_dispatch): copy._deepcopy_dispatch[types.FunctionType] = copy._deepc...
overtherain/scriptfile
refs/heads/master
software/googleAppEngine/lib/PyAMF/doc/architecture/examples/class-mapping/alias-decorator.py
8
import pyamf @RemoteClass(alias="model.MyClass") class MyClass: def __init__(self, *args, **kwargs): self.a = args[0] self.b = args[1] class RemoteClass(object): def __init__(self, alias): self.alias = alias def __call__(self, klass): pyamf.register_class(klass, self.alias...
Jgarcia-IAS/SAT
refs/heads/master
openerp/addons/l10n_in/__init__.py
702
# -*- 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...
wehkamp/ansible
refs/heads/devel
lib/ansible/modules/__init__.py
2520
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 the License, or # (at your option) an...
rhurkes/chasegame
refs/heads/master
venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/commoncrypto/__init__.py
65
# 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 # distributed under the...
waltBB/neutron_read
refs/heads/master
neutron/db/migration/alembic_migrations/versions/27cc183af192_ml2_vnic_type.py
15
# Copyright 2014 OpenStack 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 # # Unless required by applicable law ...
manishpatell/erpcustomizationssaiimpex123qwe
refs/heads/master
addons/l10n_pt/__init__.py
439
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 Thinkopen Solutions, Lda. All Rights Reserved # http://www.thinkopensolutions.com. # $Id$ # # This program is free software: you can r...
jialing3/corner_cases
refs/heads/master
Relue/Eu59.py
1
# ord(), chr() f = [int(x) for x in open('cipher1.txt').readline().strip().split(',')] start = ord('a') end = ord('z') for i in range(start, end + 1): for j in range(start, end + 1): for k in range(start, end + 1): a = (i, j, k) lst = ''.join([chr(x^a[ind % 3]) for ind, x in enum...
mdsafwan/Deal-My-Stuff
refs/heads/master
Lib/site-packages/pip/commands/completion.py
538
import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ COMP_CWORD=$COMP_CWORD \\ ...
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
refs/heads/master
python-packages/mne-python-0.10/mne/forward/_compute_forward.py
1
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larsoner@uw.edu> # Mark Wronkiewicz <wronk@uw.edu> # # License: BSD (3-clause) # #...
janusnic/edge
refs/heads/master
src/accounts/admin.py
13848
from django.contrib import admin # Register your models here.
anyonecancode/recipeasy
refs/heads/master
api/app/app.py
1
from flask import Flask, request, Response import urllib2 from json import dumps as to_json, loads as from_json from base64 import encodestring from hashlib import md5 from os import getenv from elasticsearch import Elasticsearch app = Flask(__name__) app.debug = getenv('RECIPEASY_API_DEBUG', False) app.api_spec = Non...
xinjiguaike/edx-platform
refs/heads/master
openedx/core/djangoapps/course_groups/migrations/0001_initial.py
112
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models, connection class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseUserGroup' def table_exists(name): return name in connection....
Innovahn/odoo.old
refs/heads/master
addons/l10n_be_invoice_bba/__init__.py
438
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
Rav3nPL/PLNcoin
refs/heads/plnc
qa/rpc-tests/segwit.py
27
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test the SegWit changeover logic # from test_framework.test_framework import BitcoinTestFramework from te...
aspidites/django
refs/heads/master
django/core/files/utils.py
395
from django.utils import six class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file ...
jravey7/Joe2Music
refs/heads/master
mopidy_touchscreen/input/gpio_inpput_manager.py
1
import logging import RPi.GPIO as GPIO import pygame logger = logging.getLogger(__name__) class GPIOManager(): def __init__(self, pins): GPIO.setmode(GPIO.BCM) # Left Button GPIO.setup(pins['left'], GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.add_event_detect(pins['left'], GPIO.BO...
uberamd/NGECore2
refs/heads/master
scripts/object/mobile/maarek_stele.py
85615
import sys def setup(core, object): return
xiang12835/python_web
refs/heads/master
py2_web2py/web2py/gluon/packages/dal/tests/sql.py
2
# -*- coding: utf-8 -*- """ Basic unit tests """ from __future__ import print_function import os import glob import datetime import json from pydal._compat import basestring, StringIO, integer_types, xrange from pydal import DAL, Field from pydal.helpers.classes import SQLALL, OpRow from pydal.objects import Tabl...
10clouds/edx-platform
refs/heads/dev
openedx/core/lib/rooted_paths.py
186
"""Provides rooted_glob, for finding relative glob paths in another director.""" import glob2 def rooted_glob(root, glob): """ Returns the results of running `glob` rooted in the directory `root`. All returned paths are relative to `root`. Uses glob2 globbing """ return remove_root(root, sor...
amexperts/bounty
refs/heads/master
manage.py
1
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Bounty.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/static/particle/pt_miasma_of_fog_greenish.py
85615
import sys def setup(core, object): return
emoronayuso/beeton
refs/heads/master
files/agi-bin/salto.py
1
#!/usr/bin/env python2.6 ####Descripcion de la funcion salto######################################################## # Salta a una determianda linea de cualquier contexto, condicional o incondicionalmente ### ########################################################################################## ####NUMERO DE PARAM...
stephen144/odoo
refs/heads/9.0
addons/website_quote/__init__.py
3964
import controllers import models
csirtgadgets/py-whitefacesdk
refs/heads/master
csirtgsdk/constants.py
3
import os.path import sys from ._version import get_versions VERSION = get_versions()['version'] del get_versions API_VERSION = os.getenv('CSIRTG_API_VERSION', '1') REMOTE = 'https://csirtg.io/api' REMOTE = os.getenv('CSIRTG_REMOTE', REMOTE) TOKEN = os.getenv('CSIRTG_TOKEN', None) LIMIT = 25 LIMIT = os.getenv('CSI...
fbagirov/scikit-learn
refs/heads/master
sklearn/tests/test_learning_curve.py
225
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import warnings from sklearn.base import BaseEstimator from sklearn.learning_curve import learning_curve, validation_curve from sklearn.u...
lorenzo-desantis/mne-python
refs/heads/master
mne/preprocessing/tests/test_peak_finder.py
32
from numpy.testing import assert_array_equal from mne.preprocessing.peak_finder import peak_finder def test_peak_finder(): """Test the peak detection method""" x = [0, 2, 5, 0, 6, -1] peak_inds, peak_mags = peak_finder(x) assert_array_equal(peak_inds, [2, 4])
benfinke/ns_python
refs/heads/master
nssrc/com/citrix/netscaler/nitro/resource/config/network/vlan_nsip_binding.py
3
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
afrankl/resumeangular
refs/heads/master
resume/frontend/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
bulentsoykan/or-tools
refs/heads/master
examples/python/integer_programming.py
32
# Copyright 2010-2014 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 agreed to in writing, so...
dormbase/dormbase
refs/heads/master
dormbase/personal/urls.py
1
from django.conf.urls.defaults import patterns, url urlpatterns = patterns('dormbase.personal.views', url(r'^$', 'profile'), url(r'^(?P<username>.*)/$', 'profile_username') )
p3tecracknell/tellprox
refs/heads/master
tellprox/utilities.py
2
import os, urllib, httplib def full_path(sub_path): return os.path.dirname(__file__) + sub_path def readfile(sub_path): f = open(full_path(sub_path), 'r') contents = f.read() f.close() return contents #TODO make this generic def generateCompiledJS(jsApi, outputFile): params = urllib.urlencode([ ('js_code'...
gdimitris/ChessPuzzler
refs/heads/master
Virtual_Environment/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py
2768
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
jkugler/ansible
refs/heads/devel
test/units/executor/test_play_iterator.py
58
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 the License, or # (at your option) an...
roscoeZA/GeoGigSync
refs/heads/master
pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_has_key.py
61
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for has_key(). Calls to .has_key() methods are expressed in terms of the 'in' operator: d.has_key(k) -> k in d CAVEATS: 1) While the primary target of this fixer is dict.has_key(), the fix...
nekulin/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/build/gyp/test/lib/TestGyp.py
112
# Copyright (c) 2012 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. """ TestGyp.py: a testing framework for GYP integration tests. """ import collections import itertools import os import re import shutil import stat import subpr...
binghongcha08/pyQMD
refs/heads/master
GHQT/dat3/sys_bath.py
1
# -*- coding: utf-8 -*- """ Created on Fri Mar 25 09:42:22 2016 @author: bing """ import numpy as np #import scipy import numba import sys bohr_angstrom = 0.52917721092 hartree_wavenumber = 219474.63 #hartree_wavenumber = scipy.constants.value(u'hartree-inverse meter relationship') / 1e2 def M1mat(a, Nb):...
DOAJ/doaj
refs/heads/develop
doajtest/unit/test_prune_marvel.py
1
import datetime, calendar from dateutil.relativedelta import relativedelta from freezegun import freeze_time from doajtest.helpers import DoajTestCase from portality.scripts.prune_marvel import generate_delete_pattern class TestPruneMarvel(DoajTestCase): @classmethod def setUpClass(cls): cls.runs = ...
andykimpe/chromium-test-npapi
refs/heads/master
tools/telemetry/telemetry/unittest/gtest_unittest_results_unittest.py
9
# 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 unittest from telemetry.unittest import gtest_unittest_results from telemetry.unittest import simple_mock class TestFoo(unittest.TestCase): def _...
Venturi/oldcms
refs/heads/master
env/lib/python2.7/site-packages/filer/utils/pil_exif.py
5
# -*- coding: utf-8 -*- try: from PIL import Image from PIL import ExifTags except ImportError: try: import Image import ExifTags except ImportError: raise ImportError("The Python Imaging Library was not found.") from django.core.files.storage import default_storage as storage ...
paulsheridan/data-structures
refs/heads/master
src/test_linked_list.py
1
# -*- coding: utf-8 -*- import pytest TUP_INPUT = (3, 4, 5) LIST_INPUT = [6, 7, 8, 9] def test_empty_node_init(): from linked_list import Node empty_node = Node() assert empty_node.toward_tail is None def test_linked_node_init_data(): from linked_list import Node linked_node_two = Node(12) ...
mpetyx/heroku-buildpack-couchbase-geo-django
refs/heads/master
vendor/pip-1.3.1/pip/commands/zip.py
63
import sys import re import fnmatch import os import shutil import zipfile from pip.util import display_path, backup_dir, rmtree from pip.log import logger from pip.exceptions import InstallationError from pip.basecommand import Command class ZipCommand(Command): """Zip individual packages.""" name = 'zip' ...
laborautonomo/pip
refs/heads/develop
pip/download.py
1
import cgi import email.utils import hashlib import getpass import mimetypes import os import platform import re import shutil import sys import tempfile import pip from pip.compat import urllib, urlparse from pip.exceptions import InstallationError, HashMismatch from pip.util import (splitext, rmtree, format_size, d...
kiike23/CompiladoresFEI
refs/heads/master
tarea 2/1.py
1
import sys #variables terminales = [] noTerminales = [] reglas = [] tmp = [] #variables que se utilizaran para la pila del parser llr(1) state='q0' tabla=[] #construir tabla def crearTabla(): """ tabla del paser ll """ #para cada noTerminal obtener sus transicion al terminal l=0 for i in range(0,len(noTermin...
olduvaihand/ProjectEuler
refs/heads/master
src/python/problem003.py
1
# -*- coding: utf-8 -*- # ProjectEuler/src/python/problem003.py # # Largest prime factor # ==================== # Published on Friday, 2nd November 2001, 06:00 pm # # The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime # factor of the number 600851475143 ? import projecteuler as pe def main(): ...
refeed/coala
refs/heads/master
coalib/bearlib/abstractions/SectionCreatable.py
35
from coalib.settings.FunctionMetadata import FunctionMetadata class SectionCreatable: """ A SectionCreatable is an object that is creatable out of a section object. Thus this is the class for many helper objects provided by the bearlib. If you want to use an object that inherits from this class the f...
aristippe/pathagar
refs/heads/master
books/migrations/0017_merge.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('books', '0016_auto_20160307_2013'), ('books', '0016_auto_20160305_1942'), ] operations = [ ]
hamzehd/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/tests/test_split_migrator.py
153
""" Tests for split_migrator """ import random import uuid import mock from nose.plugins.attrib import attr from xblock.fields import Reference, ReferenceList, ReferenceValueDict, UNIQUE_ID from xmodule.modulestore.split_migrator import SplitMigrator from xmodule.modulestore.tests.test_split_w_old_mongo import Split...
Yannig/ansible
refs/heads/devel
lib/ansible/module_utils/facts/default_collectors.py
17
# # 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 distributed in the hope tha...
printminion/tdlogger
refs/heads/master
tdLoggerAnalyticsDjango/urls.py
2
from django.conf.urls import patterns, include, url from django.contrib import admin from messages import views admin.autodiscover() from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'messages_old', views.MessageViewSet) urlpatterns = patterns( '', url(r'^$', views...
ParsonsAMT/Myne
refs/heads/master
datamining/apps/profiles/migrations/0003_auto__add_project__add_field_course_tags__add_field_course_timeline.py
1
# encoding: 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 'Project' db.create_table('profiles_project', ( ('id', self.gf('django.db.models.fields....
pratikmallya/hue
refs/heads/master
desktop/core/ext-py/boto-2.38.0/boto/sdb/db/key.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,...
chengjf/database-interface-doc-management
refs/heads/master
flask-demo/flask/Lib/site-packages/sqlalchemy/engine/interfaces.py
50
# engine/interfaces.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 """Define core interfaces used by the engine system.""" from .. import util, e...
cstrassburg/smarthome
refs/heads/master
lib/scheduler.py
2
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2011-2014 Marcus Popp marcus@popp.mx # Copyright 2016- Christian Straßburg # Copyright 2017 Bernd Meiners ...
AltSchool/django
refs/heads/master
tests/gis_tests/geoadmin/admin.py
547
from django.contrib.gis import admin class UnmodifiableAdmin(admin.OSMGeoAdmin): modifiable = False
keflavich/pvextractor
refs/heads/master
pvextractor/_astropy_init.py
52
# Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ['__version__', '__githash__', 'test'] # this indicates whether or not we are in the package's setup.py try: _ASTROPY_SETUP_ except NameError: from sys import version_info if version_info[0] >= 3: import builtins else: ...
raymondnijssen/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/v_net_spanningtree.py
12
# -*- coding: utf-8 -*- """ *************************************************************************** v_net_spanningtree.py --------------------- Date : December 2017 Copyright : (C) 2017 by Médéric Ribreux Email : medspx at medspx dot fr ****************...
dreadrel/UWF_2014_spring_COP3990C-2507
refs/heads/master
notebooks/scripts/book_code/code/validate_descriptors2.py
1
# File validate_descriptors2.py: using per-client-instance state class CardHolder(object): # Need all "(object)" in 2.X only acctlen = 8 # Class data retireage = 59.5 def __init__(self, acct, name, age, addr): self.acct = acct ...
postlund/home-assistant
refs/heads/dev
homeassistant/components/zigbee/__init__.py
2
"""Support for Zigbee devices.""" from binascii import hexlify, unhexlify import logging from serial import Serial, SerialException import voluptuous as vol from xbee_helper import ZigBee import xbee_helper.const as xb_const from xbee_helper.device import convert_adc from xbee_helper.exceptions import ZigBeeException,...
MarkWh1te/xueqiu_predict
refs/heads/master
p3_env/lib/python3.5/site-packages/sqlalchemy/orm/strategy_options.py
3
# Copyright (C) 2005-2016 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 """ """ from .interfaces import MapperOption, PropComparator from .. import util from ..sql.base imp...
benspaulding/django
refs/heads/master
django/db/models/base.py
2
from __future__ import unicode_literals import copy import sys from functools import update_wrapper from future_builtins import zip import django.db.models.manager # Imported to register signal handler. from django.conf import settings from django.core.exceptions import (ObjectDoesNotExist, MultipleObjectsRet...
fw1121/bcbio-nextgen
refs/heads/master
bcbio/bam/highdepth.py
3
"""Identify windows with very high depth for potential filtering. In non-targeted experiments, high depth regions are often due to collapsed repeats or other structure which can create long run times and incorrect results in small and structural variant calling. """ import os import shutil import subprocess import sys...
hovsepm/AutoRest
refs/heads/master
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/version.py
1003
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
Sparker0i/fosswebsite
refs/heads/master
promotion/forms.py
6
# created by Chirath R, chirath.02@gmail.com # -*- coding: utf-8 -*- from __future__ import unicode_literals from captcha.fields import ReCaptchaField from django import forms from promotion.models import JoinApplication batch_choices = ( ('1st year', '1st year'), ('2nd year', '2nd year'), ('3rd year', '...
rwl/muntjac
refs/heads/master
muntjac/test/muntjac_classes.py
1
# @MUNTJAC_COPYRIGHT@ # @MUNTJAC_LICENSE@ import sys import traceback from os import listdir from os.path import exists, dirname, join, isdir, basename import muntjac from muntjac.ui.component import IComponent from muntjac.ui.component_container import IComponentContainer from muntjac.api import \ (PopupView...
jath03/projects
refs/heads/master
local/HSHacks 2017/main.py
1
#!/usr/bin/python3.5 from http.server import BaseHTTPRequestHandler, HTTPServer import threading, argparse from handler import MyHandler from socketserver import ThreadingMixIn import cv2 import streamer ag = argparse.ArgumentParser() ag.add_argument('-t', '--test', action='store_true') args = ag.parse_args() print(arg...
colemanja91/PyEloqua-Examples
refs/heads/master
venv/lib/python3.4/site-packages/psycopg2/tests/testutils.py
6
# testutils.py - utility module for psycopg2 testing. # # Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either vers...
lfeldkam/AliPhysics
refs/heads/master
PWG/MCLEGO/Herwig/generate_matchbox_from_template.py
33
#! /usr/bin/env python import os import sys import jinja2 def render_matchbox(matchbox_template_path, context): path, filename = os.path.split(matchbox_template_path) return jinja2.Environment( loader=jinja2.FileSystemLoader(path or './') ).get_template(filename).render(context) def generate_matchbox_from_...
RayRuizhiLiao/ITK_4D
refs/heads/master
Modules/Nonunit/IntegratedTest/test/itkCurvatureFlowTestPython2.py
1
#========================================================================== # # Copyright Insight Software Consortium # # 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 # # ...
gfrebello/sinfonia
refs/heads/master
dashboard/models.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models class VNF(models.Model): name = models.CharField(max_length=200) description = models.TextField()
petteyg/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/core/mail/backends/locmem.py
410
""" Backend for test environment. """ from django.core import mail from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): """A email backend for use during test sessions. The test connection stores email messages in a dummy outbox, rather than sending them out o...
xfournet/intellij-community
refs/heads/master
python/testData/pyi/type/comparisonOperatorOverloads/lib.py
21
class MyClass: def __init__(self, *args): pass def __lt__(self, other): pass def __gt__(self, other): return True
spadae22/odoo
refs/heads/chris_master_8
addons/note_pad/note_pad.py
441
# -*- 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...
lucidmotifs/auto-aoc
refs/heads/master
.venv/lib/python3.5/site-packages/pip/_vendor/retrying.py
934
## Copyright 2013-2014 Ray Holder ## ## 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 ...
SolidRun/linux-imx6-3.14
refs/heads/linux-linaro-lsk-mx6
tools/perf/util/setup.py
2079
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
Anlim/decode-Django
refs/heads/master
Django-1.5.1/django/contrib/gis/tests/test_spatialrefsys.py
103
from django.db import connection from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis, spatialite, HAS_SPATIALREFSYS, SpatialRefSys) from django.utils import unittest test_srs = ({'srid' : 4326, 'auth_name' : ('EPSG', True), '...