repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
VahidGh/ChannelWorm
channelworm/account/form.py
4
1305
from django import forms from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User from django.forms import ModelForm from models import UserProfile class UserForm(ModelForm): password = forms.CharField(widget=forms.PasswordInput) confirm_password = forms.CharField(wid...
mit
-2,069,984,549,935,955,000
31.65
97
0.670498
false
RyanHope/PyeTracker
parse.py
1
14485
from __future__ import division from PySide.QtCore import * from PySide.QtGui import * from datamodel import DataModel import sys,re,csv,copy,operator class ParseDlg(QDialog): def __init__(self, filename, parent=None): super(ParseDlg, self).__init__(parent) self.filename = filename...
gpl-3.0
-2,666,859,638,188,011,500
40.507163
157
0.619192
false
lcharleux/numerical_analysis
doc/Optimisation/Example_code/brachi1d.py
1
2925
#------------------------------------------------------------------------ # RECHERCHE DU CHEMIN LE PLUS RAPIDE ENTRE 2 POINTS A ET B #------------------------------------------------------------------------ #------------------------------------------------------------------------ # PACKAGES from scipy import optimize ...
gpl-2.0
-2,556,885,399,186,978,300
28.846939
81
0.426667
false
MozillaSecurity/laniakea
laniakea/core/multipart.py
2
2571
# 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/. """Utility class for multipart UserData scripts.""" import os import gzip from email import encoders fro...
mpl-2.0
-216,928,512,037,070,750
33.28
92
0.605601
false
nicocardiel/numina
numina/core/tests/test_validator.py
3
2875
import pytest import numina.exceptions import numina.core.recipes from ..validator import validate from ..validator import only_positive from ..validator import as_list from ..validator import range_validator class RecipeIO(object): def __init__(self, valid=True): self.valid = valid self.was_call...
gpl-3.0
5,094,184,151,341,460,000
23.159664
76
0.644174
false
tkaitchuck/nupic
external/linux64/lib/python2.6/site-packages/matplotlib/backends/backend_wx.py
69
77038
from __future__ import division """ backend_wx.py A wxPython backend for matplotlib, based (very heavily) on backend_template.py and backend_gtk.py Author: Jeremy O'Donoghue (jeremy@o-donoghue.com) Derived from original copyright work by John Hunter (jdhunter@ace.bsd.uchicago.edu) Copyright (C) Jeremy O'Don...
gpl-3.0
-2,675,313,338,307,218,400
34.898416
174
0.569498
false
rickhurst/Django-non-rel-blog
django/contrib/gis/db/backends/spatialite/creation.py
178
4393
import os from django.conf import settings from django.core.cache import get_cache from django.core.cache.backends.db import BaseDatabaseCache from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command from django.db.backends.sqlite3.creation import DatabaseCreation class S...
bsd-3-clause
606,379,564,797,397,800
43.373737
102
0.599135
false
xmission/d-note
venv/lib/python2.7/site-packages/wheel/pep425tags.py
220
2861
"""Generate and work with PEP 425 Compatibility Tags.""" import sys try: import sysconfig except ImportError: # pragma nocover # Python < 2.7 import distutils.sysconfig as sysconfig import distutils.util def get_abbr_impl(): """Return abbreviated implementation name.""" if hasattr(sys, 'pypy_ve...
agpl-3.0
8,000,590,395,151,281,000
28.494845
79
0.586858
false
sarahn/ganeti
lib/tools/node_daemon_setup.py
3
6412
# # # Copyright (C) 2012 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
gpl-2.0
-3,679,734,539,444,799,500
26.169492
79
0.697286
false
pmelchior/skymapper
examples/example1.py
1
3622
# load projection and helper functions import numpy as np import skymapper as skm def getCatalog(size=10000, survey=None): # dummy catalog: uniform on sphere # Marsaglia (1972) xyz = np.random.normal(size=(size, 3)) r = np.sqrt((xyz**2).sum(axis=1)) dec = np.arccos(xyz[:,2]/r) / skm.DEG2RAD - 90 ...
mit
-5,505,459,051,134,020,000
32.537037
94
0.654059
false
fairbird/OpenPLI-TSimage
lib/python/Components/ConfigList.py
2
8963
from GUIComponent import GUIComponent from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS, ConfigElement, ConfigText, ConfigPassword from Components.ActionMap import NumberActionMap, ActionMap from enigma import eListbox,...
gpl-2.0
-2,028,217,348,976,131,800
28.580858
193
0.715497
false
taigaio/taiga-back
taiga/webhooks/migrations/0001_initial.py
1
1572
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import taiga.base.db.models.fields class Migration(migrations.Migration): dependencies = [ ('projects', '0015_auto_20141230_1212'), ] operations = [ migrations.CreateModel( ...
agpl-3.0
-8,855,350,482,861,830,000
37.341463
121
0.55598
false
gpodder/gpodder
src/gpodder/core.py
1
1953
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder 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 Licens...
gpl-3.0
354,112,733,514,611,840
34.509091
71
0.696877
false
kaushiks/GDB
gdb/testsuite/gdb.python/py-events.py
17
3247
# Copyright (C) 2010-2012 Free Software Foundation, Inc. # 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 progr...
gpl-2.0
-6,470,416,340,243,291,000
35.897727
76
0.660918
false
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/urllib/robotparser.py
11
8832
""" robotparser.py Copyright (C) 2000 Bastian Kleineidam You can choose between two licenses when using this package: 1) GNU GPLv2 2) PSF license for Python 2.2 The robots.txt Exclusion Protocol is implemented as specified in http://www.robotstxt.org/norobots-rfc.txt """ import collections ...
gpl-3.0
4,295,201,133,481,036,300
33.232558
90
0.525362
false
nelmiux/CarnotKE
jyhton/Lib/test/test_multibytecodec_support.py
12
14633
#!/usr/bin/env python # # 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 ...
apache-2.0
-5,753,882,792,005,093,000
38.021333
99
0.510832
false
jalaziz/ansible
lib/ansible/runner/action_plugins/async.py
5
1849
# (c) 2012, 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) any lat...
gpl-3.0
-133,023,566,661,733,940
40.088889
143
0.683613
false
shadyueh/pyranking
env/lib/python2.7/site-packages/pip/commands/search.py
323
4604
from __future__ import absolute_import import logging import sys import textwrap from pip.basecommand import Command, SUCCESS from pip.download import PipXmlrpcTransport from pip.index import PyPI from pip.utils import get_terminal_size from pip.utils.logging import indent_log from pip.exceptions import CommandError ...
mit
-3,735,071,605,526,955,500
32.122302
76
0.580148
false
prasanna08/oppia
core/domain/stats_jobs_continuous.py
2
13768
# Copyright 2014 The Oppia 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 applicable ...
apache-2.0
-8,551,332,108,992,965,000
43.556634
80
0.638873
false
pblottiere/QGIS
python/plugins/processing/algs/qgis/SetRasterStyle.py
26
2812
# -*- coding: utf-8 -*- """ *************************************************************************** SetRasterStyle.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ************************...
gpl-2.0
-6,281,536,410,621,982,000
37
169
0.528094
false
Warvito/DeepLearningTutorials
code/hmc/test_hmc.py
35
2218
import numpy from scipy import linalg import theano from hmc import HMC_sampler def sampler_on_nd_gaussian(sampler_cls, burnin, n_samples, dim=10): batchsize = 3 rng = numpy.random.RandomState(123) # Define a covariance and mu for a gaussian mu = numpy.array(rng.rand(dim) * 10, dtype=theano.config....
bsd-3-clause
-2,401,513,822,325,168,000
34.774194
75
0.638864
false
rossant/phy
phy/utils/tests/test_config.py
2
3120
# -*- coding: utf-8 -*- """Test config.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os.path as op from textwrap import dedent from pytest import fixture from traitlets import Float...
bsd-3-clause
8,388,722,849,309,848,000
24.365854
79
0.516026
false
kevinkindom/chrome_depto_tools
third_party/boto/ses/connection.py
56
21582
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 Harry Marr http://hmarr.com/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # wit...
bsd-3-clause
-4,472,726,061,588,080,000
40.424184
80
0.616532
false
v4hn/moveit
moveit_commander/src/moveit_commander/interpreter.py
4
30614
# Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
bsd-3-clause
7,568,663,404,722,551,000
48.941272
155
0.512086
false
jelugbo/ddi
common/lib/chem/chem/tests.py
68
21271
import codecs from fractions import Fraction import unittest from .chemcalc import (compare_chemical_expression, divide_chemical_expression, render_to_html, chemical_equations_equal) import miller local_debug = None def log(s, output_type=None): if local_debug: print s if ...
agpl-3.0
2,873,802,996,793,777,000
44.065678
161
0.530346
false
jaj42/GraPhysio
graphysio/ui/loopwidget.py
2
5830
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'loopwidget.ui' # # Created by: PyQt5 UI code generator 5.12.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_LoopWidget(object): def setupUi(self, LoopWidget): Loo...
isc
-868,509,789,296,132,200
50.575221
115
0.687028
false
h3biomed/ansible-modules-core
network/nxos/nxos_vrf_interface.py
25
15853
#!/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
6,115,809,007,749,842,000
30.208661
80
0.581278
false
broferek/ansible
lib/ansible/modules/remote_management/ucs/ucs_org.py
18
6663
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', 'status': ['preview'], ...
gpl-3.0
1,438,805,044,069,677,300
28.482301
143
0.601831
false
aYukiSekiguchi/ACCESS-Chromium
third_party/protobuf/python/google/protobuf/internal/message_test.py
253
15707
#! /usr/bin/python # # 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: # # ...
bsd-3-clause
-690,752,059,073,269,900
44.793003
79
0.741644
false
zhy0216/random-read
article/models.py
1
4390
# -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User import requests import chardet from utils import redis_conn, q, get_whoosh_ix ''' primary means whether the article is the first similar article added ''' class Article(models.Model): original_url = models.CharF...
mit
2,961,649,039,079,748,600
29.068493
121
0.624829
false
dea82/StateMachineCreator
build-tools/build_conan_dependencies.py
1
2859
#!/usr/bin/env python import argparse import json import conan.conanrepo.conanrepo as conanrepo from subprocess import call def decorated_print(string): print("*" * 60) print('* ' + string) print("*" * 60) def get_login_credentials(config_file, section): try: conan_repo_config = conanrep...
mit
-6,868,744,522,381,674,000
38.164384
128
0.597412
false
mangaki/movielens
code/reco.py
1
2969
notes = [ [1, -1, 0, 1, 0, -1], [-1, 0, 1, -1, 1, 1], [1, 1, 1, 1, -1, -1], [1, 1, 0, 0, 1, -1], [1, -1, 1, 1, -1, 0]] nb_gens = 5 nb_films = 6 prenoms = ['Alice', 'Bob', 'Charles', 'Daisy', 'Everett'] films = ['007', 'Batman 1', 'Shrek 2', 'Toy Story 3', 'Star Wars 4', 'Twilight 5'] NB_VOISINS = 3 ...
mit
-2,393,946,331,958,444,000
28.919192
84
0.575962
false
Orav/kbengine
kbe/src/lib/python/Lib/tokenize.py
2
25567
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for ...
lgpl-3.0
-6,782,688,112,013,753,000
35
83
0.501076
false
echelon/laser-asteroids
entities/healthbar.py
2
3143
""" Player's health bar TODO: DOC """ # STDLIB import math import random import itertools import sys import thread import time import pygame # GLOBALS from globalvals import * # Base class from entity import Entity class HealthBar(Entity): HEALTH_MAX = SHIP_HEALTH_MAX def __init__(self, x = 0, y = 0, r = 0, g...
mit
-399,872,556,859,170,500
21.941606
83
0.609609
false
CamelBackNotation/CarnotKE
jyhton/lib-python/2.7/encodings/tis_620.py
593
12556
""" Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='st...
apache-2.0
250,156,984,479,462,000
39.899023
105
0.52461
false
lberruti/ansible
lib/ansible/cache/memcached.py
132
5890
# (c) 2014, Brian Coca, Josh Drake, et al # # 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. ...
gpl-3.0
9,085,870,271,290,256,000
29.837696
96
0.620543
false
itai12312/workspaces
hellodjango/venv/lib/python2.7/site-packages/django/contrib/localflavor/ch/forms.py
101
3963
""" Swiss-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.ch.ch_states import STATE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select f...
gpl-2.0
3,572,552,593,924,294,700
31.483607
122
0.60762
false
openstack-packages/DLRN
dlrn/shell.py
1
35994
# 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 t...
apache-2.0
-2,085,051,565,705,724,000
42.106587
79
0.545897
false
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/account_bank_statement_extensions/wizard/confirm_statement_line.py
381
1490
# -*- 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 under ...
agpl-3.0
-7,381,579,785,549,938,000
40.388889
80
0.628188
false
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/kombu-3.0.13-py2.7.egg/kombu/tests/test_simple.py
30
3772
from __future__ import absolute_import from kombu import Connection, Exchange, Queue from .case import Case, Mock class SimpleBase(Case): abstract = True def Queue(self, name, *args, **kwargs): q = name if not isinstance(q, Queue): q = self.__class__.__name__ if name...
gpl-3.0
-2,190,530,146,022,550,300
26.735294
77
0.54878
false
WhySoGeeky/DroidPot
venv/lib/python2.7/site-packages/pygments/scanner.py
135
3114
# -*- coding: utf-8 -*- """ pygments.scanner ~~~~~~~~~~~~~~~~ This library implements a regex based scanner. Some languages like Pascal are easy to parse but have some keywords that depend on the context. Because of this it's impossible to lex that just by using a regular expression lexer like ...
mit
5,933,823,109,914,096,000
28.942308
70
0.57964
false
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/collections/__init__.py
7
44832
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', 'UserString', 'Counter', 'OrderedDict', 'ChainMap'] # For backwards compatibility, continue to make the collections ABCs # available through the collections module. from _collections_abc import * import _collections_abc __all__ += _co...
gpl-3.0
-3,083,605,473,809,908,700
35.687398
99
0.5505
false
rocky/python2-trepan
trepan/lib/deparse.py
1
3101
# -*- coding: utf-8 -*- """Deparsing Routines""" import sys, tempfile from StringIO import StringIO from hashlib import sha1 from uncompyle6.semantics.linemap import code_deparse_with_map from uncompyle6.semantics.fragments import ( deparsed_find, code_deparse) import pyficache # FIXME remap filename to a short na...
gpl-3.0
3,469,374,536,150,473,000
31.989362
75
0.577556
false
kohout/djangocms-getaweb-products
djangocms_product/south_migrations/0009_auto__chg_field_order_city__chg_field_order_telephone__chg_field_order.py
1
12653
# -*- 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): # Changing field 'Order.city' db.alter_column(u'djangocms_product_order'...
unlicense
4,538,413,023,857,939,000
80.63871
200
0.567375
false
adkerr/tempest
tempest/openstack/common/timeutils.py
20
5955
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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.apac...
apache-2.0
-2,210,350,645,462,985,000
29.228426
78
0.652561
false
rgant/saas-api-boilerplate
tests/ourmarshmallow/test_schema.py
1
10435
""" Tests for our customized marshmallow Schema """ from __future__ import (absolute_import, division, print_function, unicode_literals) try: from builtins import * # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import except ImportError: import sys print("WARNING: Cannot Load builtins...
gpl-3.0
-8,404,345,849,439,623,000
41.942387
102
0.643028
false
tmrowco/electricitymap
parsers/ENTE.py
1
6758
#!/usr/bin/env python3 # This parser gets all real time interconnection flows from the # Central American Electrical Interconnection System (SIEPAC). import arrow import pandas as pd url = 'http://www.enteoperador.org/newsite/flash/data.csv' def read_data(): """ Reads csv data from the url. Returns a p...
gpl-3.0
3,875,510,916,984,893,000
28.12931
119
0.559929
false
xq262144/hue
desktop/core/ext-py/Django-1.6.10/tests/queryset_pickle/tests.py
49
3858
from __future__ import absolute_import import pickle import datetime from django.db import models from django.test import TestCase from .models import Group, Event, Happening, Container, M2MModel class PickleabilityTestCase(TestCase): def setUp(self): Happening.objects.create() # make sure the defaults...
apache-2.0
-847,511,473,862,110,200
36.096154
83
0.663297
false
sdlBasic/sdlbrt
win32/mingw/opt/lib/python2.7/distutils/command/install.py
1
26371
"""distutils.command.install Implements the Distutils 'install' command.""" from distutils import log # This module should be kept compatible with Python 2.1. __revision__ = "$Id$" import sys, os, string from types import * from distutils.core import Command from distutils.debug import DEBUG from distutils.sysconf...
lgpl-2.1
-8,464,534,073,703,006,000
38.18425
81
0.564408
false
cwolferh/heat-scratch
heat_integrationtests/functional/test_waitcondition.py
4
2623
# 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 # d...
apache-2.0
4,467,948,671,688,336,000
35.430556
78
0.627907
false
simmetria/sentry
src/sentry/utils/cache.py
2
1499
import logging import time from django.core.cache import get_cache, cache from sentry.conf import settings if settings.CACHE_BACKEND != 'default': cache = get_cache(settings.CACHE_BACKEND) # NOQA _cache = cache logger = logging.getLogger(__name__) class UnableToGetLock(Exception): pass class Lock(obj...
bsd-3-clause
7,371,907,994,083,945,000
23.177419
94
0.563709
false
neharejanjeva/techstitution
app/logs/venv/lib/python2.7/site-packages/werkzeug/http.py
75
35287
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
cc0-1.0
-1,213,073,805,442,158,000
33.52544
82
0.601275
false
lhellebr/spacewalk
java/scripts/api/kickstarttests.py
8
5508
#!/usr/bin/python import unittest import random from config import * KICKSTART_FILE = """ # Kickstart file automatically generated by anaconda. install nfs --server=shell.boston.redhat.com --dir=/mnt/redhat/iso/f7-64 lang en_US.UTF-8 keyboard us xconfig --startxonboot network --device eth0 --bootproto dhcp --hostna...
gpl-2.0
8,338,550,375,230,341,000
23.264317
95
0.697712
false
openelections/openelections-core
openelex/api/base.py
1
1772
"""OpenElex Api base wrapper""" from future import standard_library standard_library.install_aliases() from collections import OrderedDict from urllib.parse import urljoin import requests API_BASE_URL = "http://openelections.net/api/v1/" BASE_PARAMS = ['format=json', 'limit=0'] def get(base_url=API_BASE_URL, resource...
mit
4,458,187,746,696,392,700
26.6875
69
0.647291
false
dpetzold/django
tests/bash_completion/tests.py
327
3888
""" A series of tests to establish that the command-line bash completion works. """ import os import sys import unittest from django.apps import apps from django.core.management import ManagementUtility from django.test.utils import captured_stdout class BashCompletionTests(unittest.TestCase): """ Testing th...
bsd-3-clause
-6,765,772,420,583,749,000
36.747573
79
0.637346
false
Itxaka/libcloud
libcloud/compute/drivers/cloudsigma.py
2
67816
# -*- coding: utf-8 -*- # 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 "Lic...
apache-2.0
-5,343,668,978,271,925,000
31.354962
79
0.533768
false
imincik/pkg-qgis-1.8
python/plugins/fTools/tools/doRegPoints.py
2
7266
# -*- coding: utf-8 -*- #----------------------------------------------------------- # # fTools # Copyright (C) 2008-2011 Carson Farmer # EMAIL: carson.farmer (at) gmail.com # WEB : http://www.ftools.ca/fTools.html # # A collection of data management and analysis tools for vector data # #-----------------------------...
gpl-2.0
340,948,131,915,405,800
44.987342
254
0.595789
false
menardorama/ReadyNAS-Add-ons
headphones-1.0.0/files/apps/headphones/headphones/config.py
6
19704
import headphones.logger import itertools import os import re from configobj import ConfigObj def bool_int(value): """ Casts a config value into a 0 or 1 """ if isinstance(value, basestring): if value.lower() in ('', '0', 'false', 'f', 'no', 'n', 'off'): value = 0 return int(bo...
gpl-2.0
-3,349,715,194,356,728,300
39.459959
96
0.545828
false
will-Do/tp-libvirt_v2v
libguestfs/tests/guestfish_lvm.py
7
25965
from autotest.client.shared import error, utils from virttest import utils_test, utils_misc, data_dir from virttest.tests import unattended_install import logging import shutil import os import re def prepare_image(params): """ (1) Create a image (2) Create file system on the image """ params["ima...
gpl-2.0
-3,608,772,825,276,954,600
26.24554
83
0.594339
false
godfather1103/WeiboRobot
python27/1.0/lib/unittest/loader.py
61
13501
"""Loading unittests.""" import os import re import sys import traceback import types from functools import cmp_to_key as _CmpToKey from fnmatch import fnmatch from . import case, suite __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '....
gpl-3.0
7,449,726,647,561,652,000
41.724684
94
0.59366
false
aaronorosen/horizon-congress
openstack_dashboard/dashboards/project/networks/ports/tables.py
4
2995
# Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
-3,140,203,519,128,502,000
35.084337
79
0.628381
false
evidation-health/bokeh
bokeh/sphinxext/collapsible_code_block.py
43
3128
""" Display code blocks in collapsible sections when outputting to HTML. Usage ----- This directive takes a heading to use for the collapsible code block:: .. collapsible-code-block:: python :heading: Some Code from __future__ import print_function print("Hello, Bokeh!") Options ------...
bsd-3-clause
6,261,279,637,447,544,000
23.4375
159
0.643862
false
rozifus/TeamStrong13_4
por/obstacle.py
1
1320
# everything to do with the rubies import pyglet import settings import entity import utils from utils import Vec2d, Point, Rect class Obstacle(entity.Entity): """ In case we want more than one type? """ IMAGE = settings.ANVIL_IMAGE def collided(self, game): game.die() class InfiniteHei...
mit
8,833,108,048,788,514,000
20.639344
83
0.568182
false
djw8605/campus-factory
python-lib/GlideinWMS/condorMonitor.py
7
19973
# # Project: # glideinWMS # # File Version: # $Id: condorMonitor.py,v 1.10.8.1.2.2.6.1 2010/09/22 03:08:53 sfiligoi Exp $ # # Description: # This module implements classes to query the condor daemons # and manipulate the results # Please notice that it also converts \" into " # # Author: # Igor Sfiligoi (A...
apache-2.0
-3,578,608,600,550,556,000
30.905751
131
0.601412
false
tjhei/burnman
burnman/perplex.py
1
14384
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU # GPL v2 or later. from __future__ import absolute_import from __future__ import print_function import warnings from subprocess impor...
gpl-2.0
-3,262,577,928,917,112,300
44.375394
152
0.558051
false
cnsoft/kbengine-cocos2dx
kbe/src/lib/python/Lib/test/regex_tests.py
59
8992
# Regex test suite and benchmark suite v1.5a2 # The 3 possible outcomes for each pattern [SUCCEED, FAIL, SYNTAX_ERROR] = range(3) # Benchmark suite (needs expansion) # # The benchmark suite does not test correctness, just speed. The # first element of each tuple is the regex pattern; the second is a # string to matc...
lgpl-3.0
-2,232,507,822,566,824,700
30.550877
91
0.465191
false
40223231/2015-cdb-g4-final-test-by-6-22
static/Brython3.1.1-20150328-091302/Lib/contextlib.py
737
8788
"""Utilities for with-statement contexts. See PEP 343.""" import sys from collections import deque from functools import wraps __all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"] class ContextDecorator(object): "A base class or mixin that enables context managers to work as decorators." ...
gpl-3.0
7,797,959,368,090,316,000
31.913858
80
0.563951
false
anuveyatsu/dpr-api
tests/logic/test_classmethods.py
2
7043
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import unittest from app import create_app from app.database import db import app.logic as logic import app.models as models class PackageClass...
mit
3,785,539,569,984,233,000
36.663102
94
0.620332
false
gangadhar-kadam/sms-wnframework
webnotes/widgets/form/load.py
6
3757
# Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) # # MIT License (MIT) # # 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 lim...
mit
-5,307,791,629,798,678,000
31.387931
166
0.722119
false
11craft/immercv
immercv/users/admin.py
183
1048
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin as AuthUserAdmin from django.contrib.auth.forms import UserChangeForm, UserCreationForm from .models import User class MyUserChan...
bsd-3-clause
-9,055,110,844,730,081,000
26.578947
78
0.718511
false
safnuk/todone
todone/commands/tests/test_setup.py
1
3764
from contextlib import redirect_stdout import io from unittest import TestCase from unittest.mock import patch from todone.backend import DatabaseError from todone.commands.setup import setup_db, version from todone import config, __version__ from todone.parser import exceptions as pe class TestVersion(TestCase): ...
apache-2.0
1,502,557,630,668,867,000
36.64
79
0.645855
false
jalaziz/django-cms-grappelli-old
cms/utils/admin.py
2
3998
# -*- coding: utf-8 -*- from django.contrib.sites.models import Site from django.conf import settings from cms.utils.moderator import page_moderator_state, I_APPROVE from cms.utils import get_language_from_request from django.shortcuts import render_to_response from django.template.context import RequestContext from cm...
bsd-3-clause
5,117,509,744,615,190,000
39.383838
113
0.657329
false
RockySteveJobs/python-for-android
python3-alpha/python3-src/Lib/optparse.py
45
60573
"""A powerful, extensible, and easy-to-use option parser. By Greg Ward <gward@python.net> Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). Simple usage example: from optparse import OptionParser pa...
apache-2.0
755,765,974,847,042,300
34.969715
79
0.565615
false
filodej/django-filer
filer/tests/tools.py
12
2995
#-*- coding: utf-8 -*- from django.core.files import File as DjangoFile from django.test.testcases import TestCase from filer.models import tools from filer.models.clipboardmodels import Clipboard from filer.models.foldermodels import Folder from filer.models.imagemodels import Image from filer.tests.helpers import cre...
bsd-3-clause
8,403,948,087,914,608,000
39.472973
78
0.624374
false
535521469/crawler_sth
scrapy/tests/test_utils_spider.py
44
1083
import unittest from scrapy.http import Request from scrapy.item import BaseItem from scrapy.utils.spider import iterate_spider_output, iter_spider_classes from scrapy.contrib.spiders import CrawlSpider class MyBaseSpider(CrawlSpider): pass # abstract spider class MySpider1(MyBaseSpider): name = 'myspider1'...
bsd-3-clause
-2,219,332,084,686,273,300
28.27027
75
0.684211
false
Dhivyap/ansible
lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py
3
13840
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
-8,102,692,521,686,085,000
31.952381
141
0.634971
false
keedio/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geos/mutable_list.py
217
10972
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Released under the New BSD license. """ This module contains a base type which provides list-style mutations without specific data storage methods. See also http://www.aryehleib.com/MutableLists.html Author: Aryeh Leib Taurog. """ from django.utils.f...
apache-2.0
-5,943,974,512,671,401,000
32.45122
92
0.566715
false
caisq/tensorflow
tensorflow/python/ops/linalg_ops.py
10
23635
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,813,456,760,214,439,000
40.684303
81
0.64066
false
breathe/ansible-modules-extras
web_infrastructure/jira.py
78
10086
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Steve Smith <ssmith@atlassian.com> # Atlassian open-source approval reference OSR-76. # # 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 ...
gpl-3.0
-8,966,350,600,412,865,000
28.066282
300
0.634444
false
enthought/shiboken
tests/samplebinding/lock_test.py
9
1608
#!/usr/bin/env python '''Simple test with a blocking C++ method that should allow python threads to run.''' import unittest import threading from sample import Bucket class Unlocker(threading.Thread): def __init__(self, bucket): threading.Thread.__init__(self) self.bucket = bucket def ...
gpl-2.0
735,240,645,868,801,300
23
117
0.621891
false
etuna-SBF-kog/Stadsparken
env/lib/python2.7/site-packages/django/contrib/admin/helpers.py
84
13636
from django import forms from django.contrib.admin.util import (flatten_fieldsets, lookup_field, display_for_field, label_for_field, help_text_for_field) from django.contrib.admin.templatetags.admin_static import static from django.contrib.contenttypes.models import ContentType from django.core.exceptions import Ob...
gpl-3.0
-8,053,328,056,957,305,000
37.738636
133
0.600249
false
kmee/account-invoicing
stock_picking_invoicing/tests/test_picking_invoicing.py
21
3137
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licens...
agpl-3.0
-4,848,247,175,032,701,000
43.814286
79
0.607906
false
RevelSystems/django
django/contrib/auth/models.py
104
17967
from __future__ import unicode_literals from django.contrib import auth from django.contrib.auth.hashers import ( check_password, is_password_usable, make_password, ) from django.contrib.auth.signals import user_logged_in from django.contrib.contenttypes.models import ContentType from django.core import validators...
bsd-3-clause
-7,808,051,151,345,749,000
33.685328
107
0.632326
false
NProfileAnalysisComputationalTool/npact
pynpact/pynpact/util.py
1
9619
import errno import os import os.path import logging import time import hashlib import tempfile from contextlib import contextmanager from functools import wraps from path import Path def reducehashdict(dict, keys): """pull the given keys out of the dictionary, return the reduced dictionary and the sha1 hash ...
bsd-3-clause
-3,842,151,626,867,223,000
26.720461
87
0.606092
false
hcjcch/blogbyflask
app/api_1_0/users.py
104
1702
from flask import jsonify, request, current_app, url_for from . import api from ..models import User, Post @api.route('/users/<int:id>') def get_user(id): user = User.query.get_or_404(id) return jsonify(user.to_json()) @api.route('/users/<int:id>/posts/') def get_user_posts(id): user = User.query.get_or...
mit
-4,324,591,878,070,224,000
31.113208
78
0.618684
false
sacsant/avocado-misc-tests
generic/ipistorm.py
4
4063
#!/usr/bin/env python # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that...
gpl-2.0
155,636,610,193,024,480
36.971963
87
0.609648
false
jjdmol/LOFAR
CEP/PyBDSM/src/python/plotresults.py
1
29164
"""Plotting module This module is used to display fits results. """ from image import * from . import has_pl if has_pl: import matplotlib.pyplot as pl import matplotlib.cm as cm import matplotlib.patches as mpatches from matplotlib.widgets import Button from matplotlib.patches import Ellipse fr...
gpl-3.0
1,768,704,064,167,574,000
38.625
137
0.507509
false
thinkopensolutions/geraldo
site/newsite/django_1_0/django/db/backends/postgresql_psycopg2/base.py
14
3076
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures from django.db.backends.postgresql.operations import DatabaseOperations as PostgresqlDatabaseOperations from django.utils.safestring import Sa...
lgpl-3.0
-1,376,549,371,015,874,600
39.473684
119
0.650195
false
schets/scikit-learn
sklearn/utils/_scipy_sparse_lsqr_backport.py
378
18021
"""Sparse Equations and Least Squares. The original Fortran code was written by C. C. Paige and M. A. Saunders as described in C. C. Paige and M. A. Saunders, LSQR: An algorithm for sparse linear equations and sparse least squares, TOMS 8(1), 43--71 (1982). C. C. Paige and M. A. Saunders, Algorithm 583; LSQR: Sparse...
bsd-3-clause
4,360,755,749,965,351,000
34.474409
84
0.577382
false
jteehan/cfme_tests
cfme/intelligence/reports/menus.py
5
4810
# -*- coding: utf-8 -*- """Module handling report menus contents""" from contextlib import contextmanager from . import Report from cfme.fixtures import pytest_selenium as sel from cfme.intelligence.reports.ui_elements import FolderManager from cfme.web_ui import Region, BootstrapTreeview, Tree, accordion, form_button...
gpl-2.0
1,022,617,219,963,263,100
29.0625
100
0.669023
false
ofayans/freeipa
ipaserver/plugins/pkinit.py
1
2832
# Authors: # Simo Sorce <ssorce@redhat.com> # # Copyright (C) 2010 Red Hat # see file 'COPYING' for use and warranty information # # 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 versi...
gpl-3.0
5,261,848,845,998,234,000
26.230769
112
0.648305
false
feist/pcs
pcs/lib/env_tools.py
1
1365
from pcs.lib.cib.resource import remote_node, guest_node from pcs.lib.xml_tools import get_root def get_existing_nodes_names(corosync_conf=None, cib=None): return __get_nodes_names(*__get_nodes(corosync_conf, cib)) def get_existing_nodes_names_addrs(corosync_conf=None, cib=None): corosync_nodes, remote_and_g...
gpl-2.0
-1,135,470,570,007,281,500
34.921053
76
0.662271
false
nanolearningllc/edx-platform-cypress
lms/djangoapps/instructor_analytics/tests/test_distributions.py
165
5109
""" Tests for analytics.distributions """ from django.test import TestCase from nose.tools import raises from student.models import CourseEnrollment from student.tests.factories import UserFactory from opaque_keys.edx.locations import SlashSeparatedCourseKey from instructor_analytics.distributions import profile_dist...
agpl-3.0
968,482,188,495,970,700
43.043103
95
0.676649
false
klahnakoski/TestLog-ETL
vendor/mo_hg/relay/app.py
2
3084
# encoding: 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/. # from __future__ import absolute_import, division, unicode_literals import os import flask from fl...
mpl-2.0
239,248,944,162,476,740
30.151515
132
0.621595
false
heke123/chromium-crosswalk
tools/flakiness/is_flaky.py
84
2006
#!/usr/bin/env python # 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. """Runs a test repeatedly to measure its flakiness. The return code is non-zero if the failure rate is higher than the specified thresh...
bsd-3-clause
5,276,212,235,552,134,000
33.586207
79
0.640578
false
tectronics/lector
lector/editor/spellchecker.py
6
1392
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Lector: spellchecker.py Copyright (C) 2009, John Schember Modified for Lector by Zdenko Podobný This code is released under MIT licence """ import re from PyQt4.Qt import Qt, QAction from PyQt4.Qt import QSyntaxHighlighter, QTextCharFormat from PyQt4...
gpl-2.0
-7,673,795,914,867,930,000
23.839286
69
0.617541
false
abtink/openthread
tools/harness-automation/cases_R140/leader_7_1_6.py
9
1876
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 retain the above copyright # notic...
bsd-3-clause
5,191,898,571,080,388,000
41.636364
77
0.76226
false
sgraham/nope
tools/prepare-bisect-perf-regression.py
84
2403
#!/usr/bin/env python # Copyright (c) 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. """Prepare Performance Test Bisect Tool This script is used by a try bot to create a working directory and sync an initial copy of...
bsd-3-clause
7,040,595,614,083,420,000
33.328571
80
0.630046
false
sunu/oh-missions-oppia-beta
extensions/rules/tar_file_string_test.py
4
5041
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
-7,866,014,967,708,150,000
36.902256
74
0.666138
false
saurabh6790/test-frappe
frappe/model/__init__.py
28
2474
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # model __init__.py from __future__ import unicode_literals import frappe import json no_value_fields = ('Section Break', 'Column Break', 'HTML', 'Table', 'Button', 'Image', 'Fold', 'Heading') display_fieldtypes = ('S...
mit
-5,407,085,360,086,315,000
32.432432
106
0.654002
false