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
tjsavage/sfcsdatabase
django/contrib/gis/tests/test_geoip.py
290
4204
import os, unittest from django.db import settings from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.utils import GeoIP, GeoIPException # Note: Requires use of both the GeoIP country and city datasets. # The GEOIP_DATA path should be the only setting set (the directory # should contain links or ...
bsd-3-clause
dparshin/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py
126
13672
# Copyright (C) 2011 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 the ...
bsd-3-clause
saleemjaveds/https-github.com-openstack-nova
nova/tests/scheduler/fakes.py
19
11486
# Copyright 2011 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 requ...
apache-2.0
rajanandakumar/DIRAC
Core/Utilities/Distribution.py
3
16784
# $HeadURL$ __RCSID__ = "$Id$" import urllib2, re, tarfile, os, types, sys, subprocess, urlparse, tempfile from DIRAC import gLogger, S_OK, S_ERROR from DIRAC.Core.Utilities import CFG, File, List class Distribution: cernAnonRoot = 'http://svn.cern.ch/guest/dirac' googleAnonRoot = 'http://dirac-grid.googlecode....
gpl-3.0
gurneyalex/vertical-travel
railway_station/res_partner.py
2
1263
# -*- encoding: utf-8 -*- # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
agpl-3.0
JianfengXu/crosswalk-test-suite
webapi/tct-navigationtiming-w3c-tests/inst.wgt.py
44
6786
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
cubledesarrollo/cubledotes
cuble/static/vendor/bootstrap/test-infra/s3_cache.py
1700
3523
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
mit
ProfessorKaos64/openlierox
tools/DedicatedServerVideo/gdata/books/__init__.py
124
18532
#!/usr/bin/python """ Data Models for books.service All classes can be instantiated from an xml string using their FromString class method. Notes: * Book.title displays the first dc:title because the returned XML repeats that datum as atom:title. There is an undocumented gbs:ope...
lgpl-2.1
hgl888/chromium-crosswalk-efl
net/tools/testserver/minica.py
78
10487
# 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 asn1 import hashlib import os # This file implements very minimal certificate and OCSP generation. It's # designed to test revocation checking. ...
bsd-3-clause
hernandito/SickRage
lib/hachoir_core/field/fake_array.py
95
2294
import itertools from hachoir_core.field import MissingField class FakeArray: """ Simulate an array for GenericFieldSet.array(): fielset.array("item")[0] is equivalent to fielset.array("item[0]"). It's possible to iterate over the items using:: for element in fieldset.array("item"): ...
gpl-3.0
ubc/edx-platform
common/djangoapps/util/migrations/0002_default_rate_limit_config.py
102
4097
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """Ensure that rate limiting is enabled by default. """ orm['util.RateLimitConfiguration'].objects.create(enable...
agpl-3.0
undoware/neutron-drive
google_appengine/lib/django_1_2/django/core/files/utils.py
901
1230
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 """ encoding = property(la...
bsd-3-clause
PennartLoettring/Poettrix
rootfs/usr/lib/python3.4/distutils/tests/test_bdist_rpm.py
71
4868
"""Tests for distutils.command.bdist_rpm.""" import unittest import sys import os import tempfile import shutil from test.support import run_unittest from distutils.core import Distribution from distutils.command.bdist_rpm import bdist_rpm from distutils.tests import support from distutils.spawn import find_executabl...
gpl-2.0
noroutine/ansible
lib/ansible/modules/remote_management/oneview/oneview_ethernet_network_facts.py
125
4863
#!/usr/bin/python # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
manthansharma/kivy
examples/canvas/mesh_manipulation.py
21
3123
''' Mesh Manipulation Example ========================= This demonstrates creating a mesh and using it to deform the texture (the kivy log). You should see the kivy logo with a five sliders to right. The sliders change the mesh points' x and y offsets, radius, and a 'wobble' deformation's magnitude and speed. This ex...
mit
rnikiforova/GuruTubeProject
GuruTube/libraries/django/contrib/gis/tests/geo3d/models.py
222
2064
from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class City3D(models.Model): name = models.CharField(max_length=30) point = models.PointField(dim=3) objects = models.GeoManager() def __str__(self): return self.n...
bsd-3-clause
amrdraz/kodr
app/brython/www/src/Lib/unittest/test/_test_warnings.py
858
2304
# helper module for test_runner.Test_TextTestRunner.test_warnings """ This module has a number of tests that raise different kinds of warnings. When the tests are run, the warnings are caught and their messages are printed to stdout. This module also accepts an arg that is then passed to unittest.main to affect the b...
mit
boxed/WCS-Hub
wcs-hub/models.py
1
1177
from google.appengine.ext import db from google.appengine.api import users from json import JSONDecoder class DictModel(db.Model): def to_dict(self): decoder = JSONDecoder() result = dict( [ (p[:-len('_json')], decoder.decode(getattr(self, p))) if p.endswith('_json') el...
mit
jmighion/ansible
lib/ansible/modules/windows/win_user.py
40
6163
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Matt Martz <matt@sivel.net>, and others # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
gpl-3.0
nxppru/zydiy
scripts/dl_cleanup.py
223
6094
#!/usr/bin/env python3 """ # OpenWrt download directory cleanup utility. # Delete all but the very last version of the program tarballs. # # Copyright (C) 2010-2015 Michael Buesch <m@bues.ch> # Copyright (C) 2013-2015 OpenWrt.org """ from __future__ import print_function import sys import os import re import getopt ...
gpl-2.0
mindworker/so-bro
watcher.py
1
1650
import os import sys from select import select from subprocess import Popen, PIPE import rpyc err = "" def handleInterpreter(conn, fd, data): global err if fd == p.stderr.fileno(): datastr = str(data, 'utf8') if datastr == '>>> ': return if 'Type "help", "co...
mit
hanlind/nova
nova/api/openstack/compute/schemas/fixed_ips.py
79
1027
# Copyright 2015 Intel Corporation # 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 require...
apache-2.0
pducks32/intergrala
python/sympy/sympy/utilities/tests/test_pytest.py
105
1601
from sympy.utilities.pytest import raises, USE_PYTEST if USE_PYTEST: import py.test pytestmark = py.test.mark.skipif(USE_PYTEST, reason=("using py.test")) # Test callables def test_expected_exception_is_silent_callable(): def f(): raise ValueError() raise...
mit
pidah/st2contrib
packs/smartthings/sensors/smartthings_sensor.py
10
2071
import eventlet import json from flask import request, json, Flask, Response # noqa from st2reactor.sensor.base import Sensor eventlet.monkey_patch( os=True, select=True, socket=True, thread=True, time=True) class SmartThingsSensor(Sensor): def __init__(self, sensor_service, config=None): ...
apache-2.0
jhamman/xray
xarray/tests/test_variable.py
1
54048
from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple from copy import copy, deepcopy from datetime import datetime, timedelta from textwrap import dedent import pytest from distutils.version import LooseVersion import numpy as n...
apache-2.0
maxamillion/ansible-modules-extras
cloud/amazon/lambda_alias.py
25
12180
#!/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 distributed...
gpl-3.0
westinedu/similarinterest
django/conf/locale/nl/formats.py
329
3056
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # 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' # '20 januari 2009' TIME_FORMAT = 'H:i' ...
bsd-3-clause
adammaikai/OmicsPipe2.0
omics_pipe/modules/bwa.py
2
6757
#!/usr/bin/env python from omics_pipe.parameters.default_parameters import default_parameters from omics_pipe.utils import * p = Bunch(default_parameters) def bwa1(sample, bwa1_flag): '''BWA aligner for read1 of paired_end reads. input: .fastq output: .sam citation: Li...
mit
Rafiot/botchallenge
client/google/protobuf/internal/cpp_message.py
2
23568
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
mit
spatialaudio/jackclient-python
examples/midi_chords.py
1
1118
#!/usr/bin/env python3 """JACK client that creates minor triads from single MIDI notes. All MIDI events are passed through. Two additional events are created for each NoteOn and NoteOff event. """ import jack import struct # First 4 bits of status byte: NOTEON = 0x9 NOTEOFF = 0x8 INTERVALS = 3, 7 # minor triad c...
mit
yuanzhao/gpdb
src/test/tinc/tincrepo/mpp/models/regress/sql_related/regress_sql_test_case/regress_sql_test_case.py
12
36052
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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....
apache-2.0
Observer-Wu/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/sheriff_unittest.py
122
3783
# 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 the f...
bsd-3-clause
systers/mailman
src/mailman/bin/mailman.py
3
3848
# Copyright (C) 2009-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
beeftornado/sentry
src/sentry/migrations/0066_alertrule_manager.py
1
1754
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-04-15 23:27 from __future__ import unicode_literals from django.db import migrations import django.db.models.manager class Migration(migrations.Migration): # This flag is used to mark that a migration shouldn't be automatically run in # production...
bsd-3-clause
llonchj/sentry
src/sentry/migrations/0085_auto__del_unique_project_slug__add_unique_project_slug_team.py
36
23551
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Project', fields ['slug'] db.delete_unique('sentry_project', ['slug']) ...
bsd-3-clause
dimtion/jml
outputFiles/statistics/archives/ourIA/improved_closest_v2.py/1.0/9/player1.py
1
11276
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #################################################################################################################################################################################################################################### ############################################...
mit
swdream/neutron
neutron/agent/linux/iptables_manager.py
17
28571
# Copyright 2012 Locaweb. # 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 appli...
apache-2.0
EricSB/powerline
tests/lib/config_mock.py
3
5302
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os from threading import Lock from copy import deepcopy from time import sleep from functools import wraps from powerline.renderer import Renderer from powerline.lib.config import ConfigLoader fr...
mit
thomashaw/SecGen
modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/readline.py
13
5659
import os.path import sys from warnings import warn try: _console = sys._jy_console _reader = _console.reader except AttributeError: raise ImportError("Cannot access JLine2 setup") try: # jarjar-ed version from org.python.jline.console.history import MemoryHistory except ImportError: # dev ver...
gpl-3.0
gamahead/nupic
tests/swarming/nupic/swarming/experiments/input_predicted_field/description.py
8
14110
# ---------------------------------------------------------------------- # 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...
gpl-3.0
VanHulleOne/DogBone
matrixTrans.py
1
2048
# -*- coding: utf-8 -*- """ Created on Thu Jan 07 17:44:20 2016 A module to store operations related to matrix tranformations. @author: Luke """ import Point as p import Line as l import constants as c import numpy import math def translateMatrix(shiftX, shiftY, shiftZ=0): transMatrix = numpy.identity(4) t...
mit
csherwood-usgs/landlab
landlab/grid/tests/test_raster_funcs/test_is_on_grid.py
6
1700
import numpy as np from numpy.testing import assert_array_equal from nose import with_setup from nose.tools import (assert_equal, assert_raises) try: from nose.tools import assert_is except ImportError: from landlab.testing.tools import assert_is from landlab.grid import raster_funcs as rfuncs from landlab imp...
mit
40223144/2015cdafinal
static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/sprite.py
603
55779
## pygame - Python Game Library ## Copyright (C) 2000-2003, 2007 Pete Shinners ## (C) 2004 Joe Wreschnig ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; e...
gpl-3.0
sfermigier/flask-linktester
docs/conf.py
1
1823
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. ...
bsd-3-clause
nstockton/barcode-finder
setup.py
1
4474
# -*- coding: utf-8 -*- # 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 glob import os import shutil import sys import zlib from distutils.core impo...
mpl-2.0
mromanoff/schedule-appointment
client/vendor/bower_components/jasmine/lib/jasmine-core/core.py
163
1481
import pkg_resources try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict class Core(object): @classmethod def js_package(cls): return __package__ @classmethod def css_package(cls): return __package__ @classmethod def image_...
mit
linfuzki/autokey
src/lib/gtkui/settingsdialog.py
46
9114
# -*- coding: utf-8 -*- # Copyright (C) 2011 Chris Dekter # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pr...
gpl-3.0
alsrgv/tensorflow
tensorflow/contrib/slim/python/slim/data/test_utils.py
163
3795
# 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
HubbleStack/Hubble
tests/unittests/test_readfile.py
2
23431
from __future__ import absolute_import import json import os import sys import yaml import pytest myPath = os.path.abspath(os.getcwd()) sys.path.insert(0, myPath) import hubblestack.extmods.fdg.readfile class TestReadfile(): ''' Class used to test the functions in ``readfile.py`` ''' def generate_d...
apache-2.0
toolforger/sympy
sympy/printing/python.py
118
3256
# -*- coding: utf-8 -*- from __future__ import print_function, division import keyword as kw import sympy from .repr import ReprPrinter from .str import StrPrinter # A list of classes that should be printed using StrPrinter STRPRINT = ("Add", "Infinity", "Integer", "Mul", "NegativeInfinity", "Pow", "Zero...
bsd-3-clause
MountainWei/nova
nova/tests/unit/compute/test_resources.py
57
11446
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # 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/LICEN...
apache-2.0
kuriositeetti/wamp-tikki
venv/lib/python2.7/site-packages/pip/utils/build.py
899
1312
from __future__ import absolute_import import os.path import tempfile from pip.utils import rmtree class BuildDirectory(object): def __init__(self, name=None, delete=None): # If we were not given an explicit directory, and we were not given an # explicit delete option, then we'll default to del...
mit
rjw57/videosequence
test/test_simple_seeking.py
1
2242
from __future__ import print_function from contextlib import closing from PIL import ImageChops, ImageStat from videosequence import VideoSequence def assert_images_not_equal(im1, im2): diff = ImageChops.difference(im1, im2) for min_, max_ in ImageStat.Stat(diff).extrema: if max_ > 0: retu...
mit
lukeiwanski/tensorflow
tensorflow/contrib/signal/python/ops/util_ops.py
71
2459
# 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
sasukeh/neutron
neutron/tests/unit/plugins/oneconvergence/test_security_group.py
28
4681
# Copyright 2014 OneConvergence, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
Kagee/youtube-dl
youtube_dl/extractor/ebaumsworld.py
149
1055
from __future__ import unicode_literals from .common import InfoExtractor class EbaumsWorldIE(InfoExtractor): _VALID_URL = r'https?://www\.ebaumsworld\.com/video/watch/(?P<id>\d+)' _TEST = { 'url': 'http://www.ebaumsworld.com/video/watch/83367677/', 'info_dict': { 'id': '83367677...
unlicense
d2emon/gurps-helper
fill_dmg.py
1
2024
def thrustDice(value): if value <= 10: return 1 if value < 40: return (value - 11) // 8 + 1 if value < 60: return (value - 5) // 10 + 1 return (value) // 10 + 1 def thrustModifier(value): if value <= 10: return (value - 11) // 2 - 1 if value < 40: return...
gpl-3.0
rnd0101/urbanmediator
urbanmediator/fckeditor.py
1
4435
""" FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2007 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http://www.gnu.org/license...
bsd-3-clause
skidzo/pydy
pydy/viz/shapes.py
4
19419
#!/usr/bin/env python __all__ = ['Cube', 'Cylinder', 'Cone', 'Sphere', 'Circle', 'Plane', 'Tetrahedron', 'Octahedron', 'Icosahedron', 'Torus', 'TorusKnot', 'Tube'] import numpy as np # This is a ...
bsd-3-clause
ojengwa/oh-mainline
vendor/packages/oauthlib/oauthlib/oauth1/rfc5849/signature.py
36
22922
# -*- coding: utf-8 -*- """ oauthlib.oauth1.rfc5849.signature ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module represents a direct implementation of `section 3.4`_ of the spec. Terminology: * Client: software interfacing with an OAuth API * Server: the API provider * Resource Owner: the user who is granting authoriza...
agpl-3.0
jfergie/closure-linter
closure_linter/not_strict_test.py
129
2318
#!/usr/bin/env python # # Copyright 2011 The Closure Linter 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 #...
apache-2.0
Omegaphora/external_chromium_org
build/android/findbugs_diff.py
57
1391
#!/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. """Runs findbugs, and returns an error code if there are new warnings. This runs findbugs with an additional flag to exclude know...
bsd-3-clause
premanandchandrasekar/boto
boto/emr/__init__.py
6
3243
# Copyright (c) 2010 Spotify AB # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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"),...
mit
pjmaker/python-tsi-tools
tags.py
1
32923
# tags.py -- map tags from one namespace to another # Copyright 2016 Ben Elliston # This file 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 v...
bsd-3-clause
happy56/kivy
examples/widgets/lists/list_cascade_images.py
3
4936
from kivy.adapters.dictadapter import DictAdapter from kivy.uix.selectableview import SelectableView from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.listview import ListView, ListItemButton from kivy.lang import Builder from kivy.factory import Factory from fixtures im...
lgpl-3.0
aquavitae/aafigure
aafigure/aafigure.py
1
46035
#!/usr/bin/env python """\ ASCII art to image converter. This is the main module that contains the parser. See svg.py and aa.py for output modules, that can render the parsed structure. (C) 2006-2009 Chris Liechti <cliechti@gmx.net> This is open source software under the BSD license. See LICENSE.txt for more detai...
bsd-3-clause
Adel-Magebinary/odoo
addons/account/wizard/account_report_general_journal.py
378
1697
# -*- 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
jcoady9/python-for-android
python3-alpha/python3-src/Lib/encodings/iso2022_jp_1.py
816
1061
# # iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_1') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
apache-2.0
StephenChusang/py-faster-rcnn-tracker
lib/datasetfactory/ILSVRC.py
1
5021
import os import os.path as osp import xml.etree.ElementTree as ET import numpy as np import scipy.sparse import scipy.io as sio # from utils.cython_bbox import bbox_overlaps years = {'2013': '2013', '2014': ['0000', '0001', '0002', '0003', '0004', '0005', '0006']} name = 'ILSVRC' _MAX_TRAIN_NUM = 20000 ...
mit
scott-maddox/fdint
scripts/gen_test_scfd.py
1
5280
# Copyright (c) 2015, Scott J Maddox. All rights reserved. # Use of this source code is governed by the BSD-3-Clause # license that can be found in the LICENSE file. ''' Uses numerical integration to calculate accurate values to test against. This should only be run after `python setup.py build_ext --inplace`. ''' im...
bsd-3-clause
abhijeet9920/python_project
develop/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
Johnetordoff/osf.io
admin/osf_groups/views.py
6
2534
from django.contrib.auth.mixins import PermissionRequiredMixin from django.urls import reverse from django.views.generic import FormView, ListView from osf.models import OSFGroup from admin.osf_groups.forms import OSFGroupSearchForm from admin.base.views import GuidView from admin.osf_groups.serializers import seriali...
apache-2.0
ahmadio/edx-platform
lms/djangoapps/certificates/api.py
23
14808
"""Certificates API This is a Python API for generating certificates asynchronously. Other Django apps should use the API functions defined in this module rather than importing Django models directly. """ import logging from django.conf import settings from django.core.urlresolvers import reverse from eventtracking ...
agpl-3.0
thezawad/flexx
make/copyright.py
21
2104
""" Update all copyright notices to the current year. Does a search for a specific copyright notice of last year and replaces it with a version for this year. Other copyright mentionings are listed, but left unmodified. If an argument is given, use that as the name of the copyright holder, otherwise use the name speci...
bsd-2-clause
EBTCoin/EBT
contrib/bitrpc/bitrpc.py
2348
7835
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") else: access = Ser...
mit
ashutoshvt/psi4
psi4/driver/qmmm.py
7
5473
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
wgcv/SWW-Crashphone
lib/python2.7/site-packages/django/conf/locale/mk/formats.py
43
1744
# -*- 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 = 'd F Y' TIME_FORMAT = 'H:i:s' DATE...
apache-2.0
vnpy/vnpy
vnpy/api/rohon/rohon_constant.py
5
39659
THOST_FTDC_EXP_Normal = '0' THOST_FTDC_EXP_GenOrderByTrade = '1' THOST_FTDC_ICT_EID = '0' THOST_FTDC_ICT_IDCard = '1' THOST_FTDC_ICT_OfficerIDCard = '2' THOST_FTDC_ICT_PoliceIDCard = '3' THOST_FTDC_ICT_SoldierIDCard = '4' THOST_FTDC_ICT_HouseholdRegister = '5' THOST_FTDC_ICT_Passport = '6' THOST_FTDC_ICT_TaiwanCompatri...
mit
flaviobarros/spyre
examples/stocks_example.py
3
2387
# tested with python2.7 and 3.4 from spyre import server import pandas as pd import json try: import urllib2 except ImportError: import urllib.request as urllib2 class StockExample(server.App): def __init__(self): # implements a simple caching mechanism to avoid multiple calls to the yahoo finance api self.d...
mit
chongtianfeiyu/kbengine
kbe/res/scripts/common/Lib/pty.py
120
4763
"""Pseudo terminal utilities.""" # Bugs: No signal handling. Doesn't set slave termios and window size. # Only tested on Linux. # See: W. Richard Stevens. 1992. Advanced Programming in the # UNIX Environment. Chapter 19. # Author: Steen Lumholt -- with additions by Guido. from select import select imp...
lgpl-3.0
shravya-ks/ECN-ns3
src/bridge/bindings/modulegen__gcc_LP64.py
2
194047
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
ilc/imgserv
paste/util/doctest24.py
26
99418
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! r"""Module doctest -- a framework for running examples in docstrings. In...
mit
pearlcoin-project/pearlcoin
qa/rpc-tests/keypool.py
86
3165
#!/usr/bin/env python3 # Copyright (c) 2014-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. # Exercise the wallet keypool, and interaction with wallet encryption/locking from test_framework.test_f...
mit
petemounce/ansible
lib/ansible/module_utils/rax.py
27
12110
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by # Ansible still belong to the author of the module, and may assign their own # license to the complete wo...
gpl-3.0
SciTools/cube_browser
lib/cube_browser/explorer.py
1
15222
from collections import OrderedDict import glob import os try: # Python 3 from urllib.parse import urlparse, parse_qs except ImportError: # Python 2 from urlparse import urlparse, parse_qs import IPython.display import cartopy.crs as ccrs import ipywidgets import iris import iris.plot as iplt import ma...
bsd-3-clause
meduz/scikit-learn
benchmarks/bench_plot_lasso_path.py
84
4005
"""Benchmarks of Lasso regularization path computation using Lars and CD The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function from collections import defaultdict import gc import sys from time import time import numpy as np from sklearn.linear_model import lars_pat...
bsd-3-clause
naturali/tensorflow
tensorflow/contrib/learn/python/learn/__init__.py
4
2319
# 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
aaronsw/watchdog
vendor/pyExcelerator-0.6.3a/build/lib/pyExcelerator/Worksheet.py
3
43893
#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Roman V. Kiseliov # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must reta...
agpl-3.0
renegelinas/mi-instrument
mi/instrument/ooici/mi/test_driver/driver.py
7
21975
# """ # @package mi.instrument.ooici.mi.test_driver.driver # @file marine-integrations/mi/instrument/ooici/mi/test_driver/driver.py # @author Bill French # @brief Driver for the test_driver # Release notes: # # This driver is used for coi testing # # """ # # __author__ = 'Bill French' # __license__ = 'Apache 2.0' # # i...
bsd-2-clause
sputnick-dev/weboob
modules/attilasub/test.py
7
1310
# -*- coding: utf-8 -*- # Copyright(C) 2013 Julien Veyssier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
agpl-3.0
chwiede/pyads
pyads/adsclient.py
1
6764
import time import select import socket import struct import threading import errno from .amspacket import AmsPacket from .adsconnection import AdsConnection from .adsexception import AdsException from .commands import * class InvalidPacket(AdsException): pass class AdsClient: def __init__(self, adsConnecti...
mit
SirPigles/rsf
forums/test/python/test.py
7
1204
import sys import os import re def print_environ(environ=os.environ): """Dump the shell environment as HTML.""" keys = environ.keys() keys.sort() i = 0 for key in keys: if not re.search("^HTTP_|^REQUEST_", key): continue if i == 0: print """<tr class="normal"><td>""",...
apache-2.0
OMNILab/CCFBDC2014
data_process/feature_spatio-temporal/feature_spatio/feature_spatio.py
1
2551
# -*- coding: utf-8 -*- import sys import os import math #读写文件接口函数文件函数 def read_write_file(rfname,wfname,resource_files): readf = open(rfname,'r') writef = open(wfname,'w') for line in readf: #add other functions to deal with each line result_line = location_extr(line.strip(),resource_files) writef.write(re...
mit
Axelio/pruebas_camelot
videostore/model.py
1
1389
from sqlalchemy import Unicode, Date, Integer from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.orm import relationship import sqlalchemy.types from camelot.admin.entity_admin import EntityAdmin from camelot.core.orm import Entity import camelot.types class Movie( Entity ): __tablename__ ...
gpl-3.0
h-mayorquin/competitive_and_selective_learning
play.py
1
1250
""" This is the play """ import numpy as np import matplotlib.pyplot as plt import math from sklearn.cluster import KMeans from sklearn.datasets import make_blobs from functions import selection_algorithm, scl from csl import CSL plot = True verbose = False tracking = True selection = False # Generate the data n_sa...
mit
repotvsupertuga/tvsupertuga.repository
plugin.video.TVsupertuga/resources/lib/plugins/unidecode/x1d6.py
248
3974
data = ( 's', # 0x00 't', # 0x01 'u', # 0x02 'v', # 0x03 'w', # 0x04 'x', # 0x05 'y', # 0x06 'z', # 0x07 'A', # 0x08 'B', # 0x09 'C', # 0x0a 'D', # 0x0b 'E', # 0x0c 'F', # 0x0d 'G', # 0x0e 'H', # 0x0f 'I', # 0x10 'J', # 0x11 'K', # 0x12 'L', # 0x13 'M', # 0...
gpl-2.0
GeyerA/android_external_chromium_org
chrome/common/extensions/docs/server2/api_list_data_source_test.py
24
2930
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from api_list_data_source import APIListDataSource from compiled_file_system import CompiledFileSystem from copy import...
bsd-3-clause
arrabito/DIRAC
DataManagementSystem/Client/DataManager.py
3
74453
""" :mod: DataManager .. module: DataManager :synopsis: DataManager links the functionalities of StorageElement and FileCatalog. This module consists of DataManager and related classes. """ # # imports from datetime import datetime, timedelta import fnmatch import os import time import errno # # from DIRAC import...
gpl-3.0
Sebubu/mushroom_crawler
mushroom/GoogleInceptionV3.py
1
6668
from keras.models import Graph from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D from keras.layers.advanced_activations import PReLU import datetime ''' Inception v3 paper http://arxiv.org/pdf/1512.00567v1.pdf Old inception paper http://arxiv.org/pdf/1409.4842.pdf ''' def activation_fu...
unlicense
cloudera/hue
desktop/core/ext-py/celery-4.2.1/t/unit/bin/test_base.py
2
12976
from __future__ import absolute_import, unicode_literals import os import pytest from case import Mock, mock, patch from celery.bin.base import Command, Extensions, Option from celery.five import bytes_if_py2 class MyApp(object): user_options = {'preload': None} APP = MyApp() # <-- Used by test_with_custom_...
apache-2.0