repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
hfp/tensorflow-xsmm
tensorflow/contrib/learn/python/learn/estimators/estimator.py
14
62926
# 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
Krossom/python-for-android
python3-alpha/python3-src/Lib/unittest/loader.py
46
13782
"""Loading unittests.""" import os import re import sys import traceback import types import functools from fnmatch import fnmatch from . import case, suite, util __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '.pyc' *and* '.pyo' VALID...
apache-2.0
gdgellatly/OCB1
addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
52
3163
# -*- 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
monikasulik/django-oscar
tests/integration/offer/multibuy_benefit_tests.py
51
3626
from decimal import Decimal as D from django.test import TestCase import mock from oscar.apps.offer import models from oscar.test.basket import add_product, add_products from oscar.test import factories class TestAMultibuyDiscountAppliedWithCountCondition(TestCase): def setUp(self): range = models.Rang...
bsd-3-clause
hackerbot/DjangoDev
django/templatetags/tz.py
251
5574
from datetime import datetime, tzinfo from django.template import Library, Node, TemplateSyntaxError from django.utils import six, timezone try: import pytz except ImportError: pytz = None register = Library() # HACK: datetime is an old-style class, create a new-style equivalent # so we can define additio...
bsd-3-clause
selvakumars2/baremetal-network-provisioning
baremetal_network_provisioning/ml2/hpironicextensiondriver.py
1
1339
# Copyright (c) 2015 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 or agreed to ...
apache-2.0
davidszotten/pytest
src/_pytest/pytester.py
1
44698
"""(disabled by default) support for testing pytest and pytest plugins.""" from __future__ import absolute_import, division, print_function import codecs import gc import os import platform import re import subprocess import six import sys import time import traceback from fnmatch import fnmatch from weakref import W...
mit
Omegaphora/external_chromium_org
build/android/pylib/monkey/test_runner.py
51
3520
# 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. """Runs a monkey test on a single device.""" import logging import random from pylib import constants from pylib.base import base_test_result from pylib.ba...
bsd-3-clause
sarielsaz/sarielsaz
test/functional/segwit.py
1
42244
#!/usr/bin/env python3 # Copyright (c) 2016 The Sarielsaz 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 SarielsazTestFramework fro...
mit
ghchinoy/tensorflow
tensorflow/contrib/boosted_trees/examples/boston.py
14
6262
# Copyright 2017 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
mozilla-services/xml2kinto
xml2kinto/tests/test_kinto.py
1
3808
import mock from xml2kinto.kinto import get_kinto_records def test_get_kinto_records_try_to_create_the_bucket(): kinto_client = mock.MagicMock() kinto_client.create_collection.return_value.status_code = 201 get_kinto_records(kinto_client, mock.sentinel.bucket, mock.sentinel.collectio...
apache-2.0
JoyTeam/metagam
mg/core/config.py
1
5222
#!/usr/bin/python2.6 # This file is a part of Metagam project. # # Metagam 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 # any later version. # # Metagam is distributed ...
gpl-3.0
PlanTool/plantool
wrappingPlanners/Deterministic/LAMA/seq-sat-lama/lama/translate/pddl/pddl_file.py
5
2795
#! /usr/bin/env python # -*- coding: latin-1 -*- ####################################################################### # # Author: Malte Helmert (helmert@informatik.uni-freiburg.de) # (C) Copyright 2003-2004 Malte Helmert # Modified by: Silvia Richter (silvia.richter@nicta.com.au) # (C) Copyright 2008: NICTA # # Thi...
gpl-2.0
kolanos/dialtone
dialtone/blueprints/api/views.py
1
1318
from flask import Blueprint from flask import jsonify from dialtone.extensions import twilio from dialtone.utils.twiml import scrub from dialtone.utils.twiml import to_dict bp = Blueprint('api', __name__, url_prefix='/api') @bp.route('/') def root(): account = twilio.accounts.get(twilio.sid) return jsonify(...
mit
Debian/debile
debile/slave/runners/sbuild.py
1
5743
# -*- coding: utf-8 -*- # # Copyright (c) 2012-2013 Paul Tagliamonte <paultag@debian.org> # Copyright (c) 2013 Leo Cavaille <leo@cavaille.net> # # 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 Softwar...
mit
decause/pyglet-remy
examples/10countdown.py
1
3999
#!/usr/bin/env python # ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are me...
bsd-3-clause
bonitadecker77/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_keeprefs.py
65
4022
from ctypes import * import unittest class SimpleTestCase(unittest.TestCase): def test_cint(self): x = c_int() self.assertEqual(x._objects, None) x.value = 42 self.assertEqual(x._objects, None) x = c_int(99) self.assertEqual(x._objects, None) def test_ccharp(sel...
apache-2.0
mushtaqak/edx-platform
lms/djangoapps/shoppingcart/context_processor.py
173
1679
""" This is the shoppingcart context_processor module. Currently the only context_processor detects whether request.user has a cart that should be displayed in the navigation. We want to do this in the context_processor to 1) keep database accesses out of templates (this led to a transaction bug with user email change...
agpl-3.0
matrumz/RPi_Custom_Files
Printing/hplip-3.15.2/fax/fax.py
1
32217
# -*- coding: utf-8 -*- # # (c) Copyright 2010 Hewlett-Packard Development Company, L.P. # # 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) ...
gpl-2.0
michigraber/scikit-learn
sklearn/tests/test_dummy.py
129
17774
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.base import clone from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_eq...
bsd-3-clause
nvoron23/socialite
jython/Lib/test/test_mimetools.py
19
1715
import unittest from test import test_support import string, StringIO, mimetools msgtext1 = mimetools.Message(StringIO.StringIO( """Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Foo! """)) class MimeToolsTest(unittest.TestCase): def test_decodeencode(self): ...
apache-2.0
rynomad/SFCCW2
server/express/node_modules/npm/node_modules/node-gyp/gyp/test/library/gyptest-static.py
430
2241
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies simple build of a "Hello, world!" program with static libraries, including verifying that libraries are rebuilt correctly when ...
mit
VelocityCloud/python-servicenow
src/servicenow/Utils.py
2
1490
import hashlib import json import redis from functools import wraps rd = redis.Redis() def cached(ttl=300): def proxy(f): @wraps(f) def caching(*args, **kwargs): if ttl == 0: return f(*args, **kwargs) _hash = "{0}-{1}".format(f.__name__, hashlib.md5("{0}{1}...
apache-2.0
pselle/calibre
src/calibre/devices/binatone/driver.py
24
1486
# -*- coding: utf-8 -*- __license__ = 'GPL v3' __copyright__ = '2009, John Schember <john at nachtimwald.com>' __docformat__ = 'restructuredtext en' ''' Device driver for Bookeen's Cybook Gen 3 ''' from calibre.devices.usbms.driver import USBMS class README(USBMS): name = 'Binatone Readme Device In...
gpl-3.0
chrys87/orca-beep
test/keystrokes/gtk3-demo/learn_mode.py
5
3015
#!/usr/bin/python """Test of learn mode.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(KeyComboAction("<Control>f")) sequence.append(TypeAction("Printing")) sequence.append(KeyComboAction("Return")) sequence.append(KeyPressAction(0, None, "KP_Insert")) sequence.append(K...
lgpl-2.1
phenoxim/cinder
cinder/tests/unit/volume/test_image.py
2
29715
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
c-o-m-m-a-n-d-e-r/CouchPotatoServer
libs/suds/soaparray.py
205
2262
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
gpl-3.0
Danisan/odoo-1
addons/stock/report/stock_graph.py
326
4514
# -*- 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
abridgett/boto
boto/cognito/identity/layer1.py
135
24701
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
blighj/django
tests/admin_widgets/models.py
37
4467
from django.contrib.auth.models import User from django.db import models class MyFileField(models.FileField): pass class Member(models.Model): name = models.CharField(max_length=100) birthdate = models.DateTimeField(blank=True, null=True) gender = models.CharField(max_length=1, blank=True, choices=[...
bsd-3-clause
xh4n3/shadowsocks
tests/nose_plugin.py
1072
1164
#!/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
behanceops/moto
tests/test_ec2/test_elastic_network_interfaces.py
15
6615
from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises import boto import boto.cloudformation import boto.ec2 from boto.exception import EC2ResponseError import sure # noqa from moto import mock_...
apache-2.0
napkindrawing/ansible
lib/ansible/modules/network/f5/bigip_user.py
28
19342
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2017 F5 Networks Inc. # # 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 # ...
gpl-3.0
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/tests/test_core.py
48
2058
"""Tests for distutils.core.""" import StringIO import distutils.core import os import shutil import sys import test.test_support import unittest # setup script that uses __file__ setup_using___file__ = """\ __file__ from distutils.core import setup setup() """ setup_prints_cwd = """\ import os print os.getcwd()...
apache-2.0
loongson-community/EFI-MIPS
ToolKit/cmds/python/Lib/test/good/test_fpformat.py
2
2252
''' Tests for fpformat module Nick Mathewson ''' from test.test_support import run_unittest import unittest from fpformat import fix, sci, NotANumber StringType = type('') # Test the old and obsolescent fpformat module. # # (It's obsolescent because fix(n,d) == "%.*f"%(d,n) and # sci(n...
bsd-3-clause
fzenke/morla
papers/models.py
1
2553
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User class Article(models.Model): title = models.CharField(max_length=250) authors = models.CharField(max_length=500) pubdate = models.DateField() journal = models.CharField(max_length=250) ...
mit
pschanely/gunicorn
gunicorn/debug.py
1
2310
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. """The debug module contains utilities and functions for better debugging Gunicorn.""" import sys import linecache import re import inspect __all__ = ['spew', 'unspew'] _token_spliter = r...
mit
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v3_1_0/device_port_broker.py
16
55309
from ..broker import Broker class DevicePortBroker(Broker): controller = "device_ports" def index(self, **kwargs): """Lists the available device ports. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is mo...
apache-2.0
EnablingDimensions/tincan
sites/all/modules/bootstrap-3.3.1/test-infra/s3_cache.py
2166
5734
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
gpl-2.0
Evervolv/android_external_chromium_org
tools/telemetry_tools/telemetry_bootstrap.py
34
5890
# 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. """Bootstrap Chrome Telemetry by downloading all its files from SVN servers. Requires a DEPS file to specify which directories on which SVN servers are ...
bsd-3-clause
FHannes/intellij-community
python/helpers/pycharm/_jb_runner_tools.py
2
14510
# coding=utf-8 """ Tools to implement runners (https://confluence.jetbrains.com/display/~link/PyCharm+test+runners+protocol) """ import atexit import _jb_utils import os import re import sys from teamcity import teamcity_presence_env_var, messages # Some runners need it to "detect" TC and start protocol if teamcity_p...
apache-2.0
SUSE-Cloud/nova
nova/scheduler/filters/aggregate_multitenancy_isolation.py
7
2034
# Copyright (c) 2011-2013 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 # # Un...
apache-2.0
nicholasbishop/bel
bel/shader.py
1
7349
from contextlib import contextmanager import logging import re from bidict import bidict from OpenGL.GL import (GL_COMPILE_STATUS, GL_FRAGMENT_SHADER, GL_GEOMETRY_SHADER, GL_VERTEX_SHADER, glAttachShader, glCompileShader, glCreateProgram, glCreateSh...
gpl-3.0
mdeemer/XlsxWriter
examples/textbox.py
9
3793
####################################################################### # # An example of inserting textboxes into an Excel worksheet using # Python and XlsxWriter. # # Copyright 2013-2015, John McNamara, jmcnamara@cpan.org # import xlsxwriter workbook = xlsxwriter.Workbook('textbox.xlsx') worksheet = workbook.add_wor...
bsd-2-clause
yury-s/v8-inspector
Source/chrome/tools/telemetry/telemetry/core/platform/tracing_category_filter.py
58
6027
# 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 re def CreateNoOverheadFilter(): """Returns a filter with the least overhead possible. This contains no sub-traces of thread tasks, so it's onl...
bsd-3-clause
lokeshjindal15/pd-gem5
configs/splash2/run.py
14
9801
# Copyright (c) 2005-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
bigswitch/neutron
neutron/tests/tempest/plugin.py
5
1099
# Copyright 2015 # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
maftieu/CouchPotatoServer
libs/migrate/changeset/databases/visitor.py
73
2371
""" Module for visitor class mapping. """ import sqlalchemy as sa from migrate.changeset import ansisql from migrate.changeset.databases import (sqlite, postgres, mysql, oracle, ...
gpl-3.0
user-none/calibre
src/cherrypy/_cpdispatch.py
82
24595
"""CherryPy dispatchers. A 'dispatcher' is the object which looks up the 'page handler' callable and collects config for the current request based on the path_info, other request attributes, and the application architecture. The core calls the dispatcher as early as possible, passing it a 'path_info' argument. The de...
gpl-3.0
quamilek/django
django/conf/locale/nn/formats.py
504
1810
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
bsd-3-clause
scalingdata/Impala
thirdparty/hive-1.2.1.2.3.0.0-2557/src/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py
2
326857
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException import fb303.ttypes from thrift.transport import TTransport from thrift.protocol import TBinaryP...
apache-2.0
windyuuy/opera
chromium/src/chrome/test/functional/webrtc_call.py
29
8808
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import time # This little construct ensures we can run even if we have a bad version of # psutil installed. If so, we'll just skip...
bsd-3-clause
apporc/cinder
cinder/wsgi/common.py
3
9407
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
Krukov/amocrm_api
amocrm/v2/model.py
1
2286
import inspect from . import fields from .register import _RegisterMeta _EMBEDDED_FIELDS = (fields._EmbeddedLinkListField, fields._EmbeddedLinkField) _FIELDS_FOR_REPR = (fields._Field,) + _EMBEDDED_FIELDS class Model(metaclass=_RegisterMeta): _init_data = {} id = fields._UnEditableField("id", blank=True) ...
mit
jorge2703/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause
AlbertXingZhang/android_kernel_sony_msm8x60
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # 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. import errno, os FUTEX_WAIT = 0...
gpl-2.0
sjdv1982/seamless
tests/lowlevel/compile.py
1
1156
import seamless.core.execute seamless.core.execute.DIRECT_PRINT = True code = """ #include <cmath> extern "C" float add(int a, int b){ return a + b + M_PI; } """ testmodule = { "type": "compiled", "objects": { "main": { "code": code, "language": "cpp", }, }, ...
mit
zorojean/scikit-learn
sklearn/decomposition/kernel_pca.py
207
9120
"""Kernel Principal Components Analysis""" # Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import numpy as np from scipy import linalg from ..utils.arpack import eigsh from ..utils.validation import check_is_fitted, NotFittedError from ..base import BaseEstimator, TransformerMixin from ..pre...
bsd-3-clause
Maximilian-Reuter/SickRage
lib/hachoir_metadata/riff.py
93
7679
""" Extract metadata from RIFF file format: AVI video and WAV sound. """ from hachoir_metadata.metadata import Metadata, MultipleMetadata, registerExtractor from hachoir_metadata.safe import fault_tolerant, getValue from hachoir_parser.container.riff import RiffFile from hachoir_parser.video.fourcc import UNCOMPRESSED...
gpl-3.0
MonkeyZZZZ/platform_external_protobuf
python/google/protobuf/internal/api_implementation.py
80
3726
# 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...
bsd-3-clause
frishberg/django
django/contrib/sessions/backends/file.py
118
8034
import datetime import errno import logging import os import shutil import tempfile from django.conf import settings from django.contrib.sessions.backends.base import ( VALID_KEY_CHARS, CreateError, SessionBase, UpdateError, ) from django.contrib.sessions.exceptions import InvalidSessionKey from django.core.except...
bsd-3-clause
javaarchive/PIDLE
UpdateIdle.py
2
3681
import urllib.request as Url import tkinter as tk from tkinter import ttk import time #import wget #import requests def dwn(url): file_name = url.split('/')[-1] u = urllib2.urlopen(url) f = open(file_name, 'wb') meta = u.info() file_size = len(u.read()) print("Downloading: %s Bytes: ...
mit
barrand/CTRs
src/lib/flaskext/wtf/__init__.py
30
1776
# -*- coding: utf-8 -*- """ flask.ext.wtf ~~~~~~~~~~~~ Flask-WTF extension :copyright: (c) 2010 by Dan Jacob. :license: BSD, see LICENSE for more details. """ try: import sqlalchemy _is_sqlalchemy = True except ImportError: _is_sqlalchemy = False from wtforms import fields, widgets, ...
mit
anbasile/pmu_simulator
bot/route.py
2
1665
import googlemaps import datetime import json from nominatim import Nominatim gmaps = googlemaps.Client(key='TOKEN') # q = float(Nominatim('Plataci')[0]['lat']),float(Nominatim('Plataci')[0]['lon']) # l = float(Nominatim('Milano')[0]['lat']),float(Nominatim('Milano')[0]['lon']) # Look up an address with reverse geocod...
gpl-3.0
jtouug/pylibtiff
libtiff/bitarray-0.3.5-numpy/setup.py
13
1410
import sys import re from os.path import abspath, join from distutils.core import setup, Extension import numpy if sys.version_info[:2] < (2, 5): raise Exception('bitarray requires Python 2.5 or greater.') kwds = {} # Read the long description from README kwds['long_description'] = open(abspath('README')).read()...
bsd-3-clause
cupy/cupy
cupyx/scipy/sparse/_index.py
1
22898
"""Indexing mixin for sparse matrix classes. """ import cupy from cupy import _core from cupyx.scipy.sparse.base import isspmatrix from cupyx.scipy.sparse.base import spmatrix from cupy_backends.cuda.libs import cusparse from cupy.cuda import device import numpy try: import scipy scipy_available = True exc...
mit
Eficent/purchase-workflow
product_supplierinfo_discount/models/purchase_order.py
9
3091
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> # # This progr...
agpl-3.0
ImageEngine/gaffer
python/GafferOSLTest/OSLImageTest.py
4
25359
########################################################################## # # Copyright (c) 2013-2015, John Haddon. 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 ...
bsd-3-clause
rmcgibbo/reftagger
bibtagger/chunker.py
1
3436
from .tokenizer import tokenize def tokenize_and_tag(text, chunk_sets): # all tokens separated by whitespace text = ' '.join(tokenize(text)) + ' ' tokens = text.split() chunks = [] chunk2tag = [] for k in chunk_sets: for c in chunk_sets[k]: tc = tokenize(c) ...
agpl-3.0
nextzy/foursquared
util/gen_parser.py
262
4392
#!/usr/bin/python import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joelapenna.foursquare.error.FoursquareError; import com.joel...
apache-2.0
rmtew/peasauce
python/loaderlib/amiga/doshunks.py
1
1639
from __future__ import print_function """ Peasauce - interactive disassembler Copyright (C) 2012-2017 Richard Tew Licensed using the MIT license. """ HUNK_UNIT = 999 HUNK_NAME = 1000 HUNK_CODE = 1001 HUNK_DATA = 1002 HUNK_BSS = 1003 HUNK_RELOC32 = ...
mit
sometallgit/AutoUploader
Python27/Lib/test/test_multibytecodec_support.py
18
14605
# test_multibytecodec_support.py # Common Unittest Routines for CJK codecs # import codecs import os import re import sys import unittest from httplib import HTTPException from test import test_support from StringIO import StringIO class TestBase: encoding = '' # codec name codec = None #...
mit
styxit/CouchPotatoServer
libs/html5lib/utils.py
982
2545
from __future__ import absolute_import, division, unicode_literals from types import ModuleType try: import xml.etree.cElementTree as default_etree except ImportError: import xml.etree.ElementTree as default_etree __all__ = ["default_etree", "MethodDispatcher", "isSurrogatePair", "surrogatePairTo...
gpl-3.0
mozilla/firefox-flicks
vendor-local/lib/python/kombu/transport/pyamqp.py
12
4598
""" kombu.transport.pyamqp ====================== pure python amqp transport. """ from __future__ import absolute_import import amqp from kombu.exceptions import ( StdConnectionError, StdChannelError, VersionMismatch, ) from kombu.utils.amq_manager import get_manager from . import base DEFAULT_PORT = ...
bsd-3-clause
sloria/osf.io
tests/test_test_utils.py
11
1973
# -*- coding: utf-8 -*- import mock from urlparse import urlparse from nose.tools import * # flake8: noqa import unittest from framework.auth import Auth from osf.models import AbstractNode, NodeLog from tests.base import OsfTestCase from osf_tests.factories import ProjectFactory from tests import utils as test_util...
apache-2.0
aosprey/rose
lib/python/rose/config_editor/valuewidget/array/logical.py
1
11117
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2012-8 Met Office. # # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
gpl-3.0
freezas/hy
hy/models.py
1
9468
# Copyright 2017 the authors. # This file is part of Hy, which is free software licensed under the Expat # license. See the LICENSE. from __future__ import unicode_literals from math import isnan, isinf from hy._compat import PY3, str_type, bytes_type, long_type, string_types from fractions import Fraction class HyO...
mit
harikrishnanm/sentry
gcmclient/__init__.py
1
1690
# Sentry # # This file is part of Sentry # # Sentry 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. # # Sentry is distrib...
gpl-3.0
yimingpeng/rl-library
system/scripts/updateStableTag.py
3
1070
#!/usr/bin/python import os import sys import random import optparse import httplib import getpass import base64 def updateStable(baseRepoURL): trunkDir="trunk/"; versionDir="tags/versions/"; branchDir="branches/"; versionURL=baseRepoURL+versionDir+"stable"; trunkURL=baseRepoURL+trunkDir; cleanCommand="ant c...
apache-2.0
supertom/ansible
test/units/parsing/test_mod_args.py
86
4940
# (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...
gpl-3.0
defance/edx-platform
common/djangoapps/contentserver/migrations/0001_initial.py
62
1129
# -*- coding: utf-8 -*- #pylint: skip-file from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL),...
agpl-3.0
tlangerak/Multi-Agent-Systems
tlslite/utils/hmac.py
3
3470
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. (This file is modified from the standard library version to do faster copying) """ def _strxor(s1, s2): """Utility method. XOR the two strings s1 and s2 (must have same length). """ r...
lgpl-2.1
greatghoul/jinshuju-proxy
jinshuju.py
1
1489
# coding: utf-8 import json from uuid import uuid4 from flask import Flask from flask import request from flask import render_template from flask import jsonify from sae import kvdb app = Flask(__name__) app.debug = True db = kvdb.Client(debug=True) @app.route('/') def home(): return render_template('index.ht...
mit
camallen/aggregation
experimental/penguins/newCluster.py
2
11987
#!/usr/bin/env python __author__ = 'greg' from sklearn.cluster import DBSCAN from sklearn.cluster import AffinityPropagation import numpy as np import matplotlib.pyplot as plt import csv import sys import os import pymongo import matplotlib.cbook as cbook import cPickle as pickle import shutil import urllib import math...
apache-2.0
MarkusHackspacher/pyfootballmngr
modules/gui/dialogs/new_player.py
1
2461
#!/usr/bin/env python # coding: utf-8 """ pyfootballmngr Copyright (C) <2012-2017> Markus Hackspacher This file is part of pyfootballmngr. pyfootballmngr 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 Foundat...
gpl-3.0
zaksoup/gpdb
gpMgmt/bin/gppylib/gpcoverage.py
21
13194
""" This file is a wrapper around figleaf and will start/stop coverage as needed. It also includes a method for generating the HTML reports. """ import os import random import figleaf import pickle from glob import glob from gppylib import gplog from gppylib.commands.base import Command, LOCAL, REMOTE, ExecutionConte...
apache-2.0
fedora-infra/python-fedora
fedora/client/baseclient.py
1
15300
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Red Hat, Inc. # This file is part of python-fedora # # python-fedora 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 # version 2.1 of the License, ...
lgpl-2.1
leiferikb/bitpop
src/extensions/common/permissions/PRESUBMIT.py
54
1110
# 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. """Chromium presubmit script for src/extensions/common/permissions. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more det...
gpl-3.0
skarlekar/chehara
chardet/mbcharsetprober.py
289
3413
######################## 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...
mit
abhiQmar/servo
tests/wpt/css-tests/tools/pytest/_pytest/assertion/__init__.py
176
6457
""" support for presenting detailed information in failing assertions. """ import py import os import sys from _pytest.monkeypatch import monkeypatch from _pytest.assertion import util def pytest_addoption(parser): group = parser.getgroup("debugconfig") group.addoption('--assert', action="...
mpl-2.0
cxxgtxy/tensorflow
tensorflow/contrib/data/python/kernel_tests/dataset_constructor_op_test.py
6
10356
# Copyright 2017 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
alown/mypaint
gui/brushcolor.py
3
2807
# This file is part of MyPaint. # Copyright (C) 2012 by Andrew Chadwick <andrewc-git@piffle.org> # # 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 ...
gpl-2.0
prutseltje/ansible
lib/ansible/plugins/cache/redis.py
49
4208
# (c) 2014, Brian Coca, Josh Drake, et al # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' cache: redis short_description: Use Redis...
gpl-3.0
alpenliebe/Sortable
fuzzywuzzy/StringMatcher.py
17
2437
#!/usr/bin/env python # encoding: utf-8 """ StringMatcher.py ported from python-Levenshtein [https://github.com/miohtama/python-Levenshtein] License available here: https://github.com/miohtama/python-Levenshtein/blob/master/COPYING """ from Levenshtein import * from warnings import warn class StringMatcher: """...
mit
jmehnle/ansible
lib/ansible/modules/network/ios/ios_config.py
27
14146
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/importlib/test/extension/test_finder.py
50
1237
from importlib import _bootstrap from .. import abc from . import util import unittest class FinderTests(abc.FinderTests): """Test the finder for extension modules.""" def find_module(self, fullname): importer = _bootstrap._FileFinder(util.PATH, _bootstrap._...
apache-2.0
canaltinova/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/test_update.py
26
15332
import unittest import StringIO import pytest from .. import metadata, manifestupdate from mozlog import structuredlog, handlers, formatters class TestExpectedUpdater(unittest.TestCase): def create_manifest(self, data, test_path="path/to/test.ini"): f = StringIO.StringIO(data) return manifestupd...
mpl-2.0
kkoksvik/FreeCAD
src/Mod/Ship/shipCreateShip/__init__.py
36
1825
#*************************************************************************** #* * #* Copyright (c) 2011, 2016 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
lgpl-2.1
CompPhysics/ThesisProjects
doc/MSc/msc_students/former/sean/Thesis/Codes/PythonCode/temp/lib/python2.7/site-packages/setuptools/tests/test_windows_wrappers.py
151
6154
""" Python Script Wrapper for Windows ================================= setuptools includes wrappers for Python scripts that allows them to be executed like regular windows programs. There are 2 wrappers, one for command-line programs, cli.exe, and one for graphical programs, gui.exe. These programs are almost ident...
cc0-1.0
youdonghai/intellij-community
python/lib/Lib/site-packages/django/forms/fields.py
71
38361
""" Field classes. """ import datetime import os import re import time import urlparse import warnings from decimal import Decimal, DecimalException try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.core.exceptions import ValidationError from django.core import ...
apache-2.0