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
binking/News_website
news_website/models/user.py
1
1441
import datetime as dt from flask_login import UserMixin from news_website.extensions import db, bcrypt from news_website.database import ( Column, Model, ReferenceCol, relationship, SurrogatePK, ) class User(UserMixin, SurrogatePK, Model): __tablename__ = 'users' username = Column(db.Str...
bsd-3-clause
-7,922,503,576,990,030,000
31.044444
80
0.664816
false
albertomurillo/ansible
lib/ansible/modules/network/f5/bigip_profile_analytics.py
38
24086
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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
-7,125,061,101,761,782,000
30.65046
136
0.614755
false
ufownl/shadowsocks
shadowsocks/asyncdns.py
22
17640
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-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 r...
apache-2.0
-2,548,100,665,295,485,000
34.564516
79
0.480669
false
unho/translate
translate/storage/cpo.py
1
35665
# -*- coding: utf-8 -*- # # Copyright 2002-2007 Zuza Software Foundation # # This file is part of translate. # # translate 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 # ...
gpl-2.0
-1,019,300,712,738,302,200
38.983184
122
0.595934
false
msalloum/cs181
HomeWork/HW3/TwitterStream/tweetstream.py
1
2124
""" tweet_read.py Serve tweets to a socket for spark-streaming. Adapted from: http://www.awesomestats.in/spark-twitter-stream/ """ import tweepy from tweepy import OAuthHandler from tweepy import Stream from tweepy.streaming import StreamListener import socket import json import logging logger = logging.getLog...
mit
-5,819,835,974,491,849,000
25.234568
70
0.637476
false
vdjagilev/desefu
modules/file/Hash.py
1
1721
from modules import AbstractModule from kernel.output import Output import hashlib class Hash(AbstractModule): def is_collect_data(self) -> bool: return True def check(self): return True def description(self) -> str: return "A module which collects data about file hashes" de...
mit
2,510,895,257,083,972,000
28.186441
86
0.539802
false
orangeduck/PyAutoC
Python27/Lib/ctypes/test/test_structures.py
17
15068
import unittest from ctypes import * from struct import calcsize class SubclassesTest(unittest.TestCase): def test_subclass(self): class X(Structure): _fields_ = [("a", c_int)] class Y(X): _fields_ = [("b", c_int)] class Z(X): pass self.assertE...
bsd-2-clause
-8,441,927,205,540,570,000
32.55902
96
0.505575
false
mjschultz/ansible-modules-extras
notification/typetalk.py
18
3693
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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
-4,356,266,352,512,723,000
26.766917
87
0.645275
false
Yannig/ansible
lib/ansible/module_utils/api.py
103
4446
# 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
7,540,500,398,623,990,000
34.007874
92
0.632029
false
Titulacion-Sistemas/PythonTitulacion-EV
Lib/site-packages/django/contrib/formtools/tests/wizard/wizardtests/tests.py
116
16304
from __future__ import unicode_literals import os from django import forms from django.test import TestCase from django.test.client import RequestFactory from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.formto...
mit
-6,928,724,582,402,074,000
39.058968
105
0.613714
false
olivierdalang/QGIS
scripts/process_function_template.py
26
4716
# -*- coding: utf-8 -*- import sys import os import json import glob sys.path.append( os.path.join( os.path.dirname(os.path.realpath(__file__)), '../python/ext-libs')) cpp = open(sys.argv[1], "w", encoding="utf-8") cpp.write( "#include \"qgsexpression.h\"\n" "#include \"qgsexpression_p.h\...
gpl-2.0
3,111,483,083,077,636,000
33.423358
178
0.481976
false
muzena/deluge
deluge/ui/console/modes/torrent_actions.py
5
14567
# torrent_actions.py # # Copyright (C) 2011 Nick Lanham <nick@afternight.org> # # Deluge is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free Software # Foundation; either version 3 of the License, or (at your option) # any later ve...
gpl-3.0
-3,165,588,391,316,478,500
42.097633
122
0.538409
false
hazelnusse/robot.bicycle
design/derivative_filter.py
1
1131
""" Given a continuous time first order transfer function of the form: n1 * s + n0 ----------- s + d0 Compute the Tustin approximation and return a state space realization of this discrete time transfer function. """ from sympy import symbols, Poly, ccode, S, sqrt def discrete_realization_tustin(n0, n1...
bsd-2-clause
1,307,636,097,970,272,000
21.176471
77
0.583554
false
undoware/neutron-drive
google_appengine/lib/django_1_3/tests/regressiontests/dispatch/tests/test_saferef.py
51
2107
from django.dispatch.saferef import * from django.utils import unittest class Test1(object): def x(self): pass def test2(obj): pass class Test2(object): def __call__(self, obj): pass class Tester(unittest.TestCase): def setUp(self): ts = [] ss = [] for x in x...
bsd-3-clause
-7,538,106,101,776,041,000
25.670886
76
0.530138
false
openhatch/oh-mainline
vendor/packages/Django/django/contrib/auth/__init__.py
70
5196
import re from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from django.middleware.csrf import rotate_token from django.contrib.auth.signals import user_logged_in, user_logged_out, user_login_failed SESSION_KEY = '_auth_user_id' BACKEND_SESSION_KEY = '_auth_user_...
agpl-3.0
6,491,258,211,772,924,000
35.591549
140
0.677637
false
0asa/scikit-learn
examples/neighbors/plot_digits_kde_sampling.py
251
2022
""" ========================= Kernel Density Estimation ========================= This example shows how kernel density estimation (KDE), a powerful non-parametric density estimation technique, can be used to learn a generative model for a dataset. With this generative model in place, new samples can be drawn. These...
bsd-3-clause
-4,480,645,531,160,696,000
31.612903
77
0.681009
false
ToontownUprising/src
toontown/pets/PetBrain.py
3
20591
from pandac.PandaModules import * from direct.showbase.PythonUtil import weightedChoice, randFloat, Functor from direct.showbase.PythonUtil import list2dict from direct.showbase import DirectObject from direct.distributed import DistributedObjectAI from direct.directnotify import DirectNotifyGlobal from direct.task imp...
mit
-623,100,976,441,850,200
35.769643
117
0.582148
false
bitcraft/matrix
matrix.py
1
6431
""" Matrix Screen Effect (c) 2016, Leif Theden, leif.theden@gmail.com 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 lat...
gpl-3.0
-457,541,080,853,423,100
28.365297
82
0.602861
false
thomashaw/SecGen
modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/_LWPCookieJar.py
109
6555
"""Load / save to libwww-perl (LWP) format files. Actually, the format is slightly extended from that used by LWP's (libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information not recorded by LWP. It uses the version string "2.0", though really there isn't an LWP Cookies 2.0 format. This indicates that ...
gpl-3.0
-4,206,397,262,772,692,500
37.558824
79
0.504348
false
bingerZhang/libyuv
setup_links.py
140
16181
#!/usr/bin/env python # Copyright 2014 The LibYuv Project Authors. All rights reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contri...
bsd-3-clause
-6,526,354,377,728,710,000
33.354565
80
0.637291
false
dstufft/warehouse
warehouse/accounts/models.py
1
4012
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
apache-2.0
3,469,028,966,972,369,400
28.940299
86
0.661765
false
madmachinations/discordbot
plugins/msglog/__init__.py
2
11208
#!/usr/bin/python import __main__ import json #=================================================================================================================== #PLUGIN CALLS async def help_menu(): help_info = {} help_info['title'] = 'Message log' help_info['description'] = 'Search logged messages.' ...
gpl-3.0
-2,965,180,544,717,438,500
45.506224
367
0.556121
false
zhangg/docker
vendor/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py
1232
3478
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). import msgpack, msgpackrpc, sys, os, threading def get_test_data_list(): # get list with all primitive typ...
apache-2.0
-9,055,643,261,481,452,000
30.618182
96
0.560955
false
chaosmaster/christian
commands/postboxfunctions.py
2
1419
from utils import Filehandler from ConfigParser import SafeConfigParser import re class PostboxFunctions(object): def __init__(self): self.fhandler = Filehandler() def help(self, channel, callback, msg=None, nck=None, hq=None, keys=None, **kwargs): helpmsg = "!tell <user> - Store message in <...
gpl-3.0
-7,291,506,871,368,807,000
38.416667
88
0.540521
false
HalcyonChimera/osf.io
api_tests/logs/serializers/test_serializers.py
17
1820
import pytest from framework.auth import Auth from osf.models import NodeLog from api.logs.serializers import NodeLogSerializer from osf_tests.factories import ProjectFactory, UserFactory from tests.utils import make_drf_request_with_version pytestmark = pytest.mark.django_db class TestNodeLogSerializer: # Regr...
apache-2.0
1,142,879,770,726,996,600
41.325581
89
0.643407
false
dvdmgl/django-pg-fts
testapp/models.py
2
1209
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible from pg_fts.fields import TSVectorField from django.db import models @python_2_unicode_compatible class TSQueryModel(models.Model): title = models.CharField(max_length=50) body = mode...
bsd-2-clause
7,088,747,422,191,854,000
29.225
72
0.672457
false
wkennington/rethinkdb
external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-large-pdb.py
218
2332
#!/usr/bin/env python # Copyright (c) 2013 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. """ Make sure msvs_large_pdb works correctly. """ import TestGyp import struct import sys CHDIR = 'large-pdb' def CheckImageAndPdb(tes...
agpl-3.0
-7,041,706,562,893,611,000
32.314286
75
0.69211
false
vsergeev/python-periphery
tests/test_spi.py
1
5681
import os import sys import periphery from .test import ptest, pokay, passert, AssertRaises if sys.version_info[0] == 3: raw_input = input spi_device = None def test_arguments(): ptest() # Invalid mode with AssertRaises("invalid mode", ValueError): periphery.SPI("/dev/spidev0.0", 4, int(1...
mit
7,528,729,890,555,962,000
30.91573
117
0.621722
false
amith01994/intellij-community
python/lib/Lib/site-packages/django/db/models/fields/__init__.py
119
43384
import datetime import decimal import re import time import math from itertools import tee import django.utils.copycompat as copy from django.db import connection from django.db.models.fields.subclassing import LegacyConnection from django.db.models.query_utils import QueryWrapper from django.conf import settings fro...
apache-2.0
1,225,544,205,771,945,700
37.022787
166
0.605892
false
MaheshIBM/keystone
keystone/trust/core.py
2
9426
# Copyright 2012 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 in...
apache-2.0
6,996,709,919,692,504,000
37.317073
78
0.610757
false
deKupini/erp
addons/account/account.py
3
190066
# -*- 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
4,245,999,564,606,358,000
52.419337
425
0.584586
false
barnone/EigenD
tools/packages/SCons/Tool/c++.py
2
3374
"""SCons.Tool.c++ Tool-specific initialization for generic Posix C++ compilers. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons...
gpl-3.0
-6,787,838,246,406,859,000
33.080808
89
0.683165
false
synmnstr/flexx
flexx/app/pair.py
20
14935
""" Base class for objects that live in both Python and JS. This basically implements the syncing of signals. """ import sys import json import weakref import hashlib from .. import react from ..react.hassignals import HasSignalsMeta, with_metaclass from ..react.pyscript import create_js_signals_class, HasSignalsJS ...
bsd-2-clause
6,369,850,106,294,702,000
36.151741
135
0.553331
false
github-account-because-they-want-it/django
django/core/management/commands/startapp.py
513
1040
from importlib import import_module from django.core.management.base import CommandError from django.core.management.templates import TemplateCommand class Command(TemplateCommand): help = ("Creates a Django app directory structure for the given app " "name in the current directory or optionally in t...
bsd-3-clause
-8,040,728,885,091,260,000
37.518519
76
0.625
false
janisz/Diamond-1
src/diamond/handler/rrdtool.py
13
7698
# coding=utf-8 """ Save stats in RRD files using rrdtool. """ import os import re import subprocess import Queue from Handler import Handler # # Constants for RRD file creation. # # NOTE: We default to the collectd RRD directory # simply as a compatibility tool. Users that have # tools that look in that location a...
mit
98,388,752,585,656,400
33.520179
80
0.587295
false
wfarner/aurora
src/main/python/apache/aurora/tools/java/organize_imports.py
11
4397
#!/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-8,365,651,369,729,200,000
28.709459
80
0.660678
false
Yadnyawalkya/integration_tests
cfme/configure/documentation.py
3
3224
from widgetastic.widget import Image from widgetastic.widget import Text from widgetastic.widget import View class LinksView(View): """ Widgets for all of the links on the documentation page Each doc link is an anchor with a child image element, then an anchor with text Both the image and the text anc...
gpl-2.0
-2,923,846,867,050,711,600
36.488372
83
0.595223
false
jbzdak/edx-platform
common/lib/capa/capa/tests/__init__.py
129
2700
"""Tools for helping with testing capa.""" import gettext import os import os.path import fs.osfs from capa.capa_problem import LoncapaProblem, LoncapaSystem from capa.inputtypes import Status from mock import Mock, MagicMock import xml.sax.saxutils as saxutils TEST_DIR = os.path.dirname(os.path.realpath(__file__)...
agpl-3.0
4,202,108,949,353,067,500
31.142857
135
0.675556
false
fredkingham/blog-of-fred
markdown/extensions/def_list.py
46
3699
""" Definition List Extension for Python-Markdown ============================================= Added parsing of Definition Lists to Python-Markdown. A simple example: Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. : An american computer company. Orange ...
bsd-3-clause
6,547,109,810,817,374,000
30.347458
83
0.558529
false
minichate/heroku-buildpack-ldap
src/virtualenv-1.7/virtualenv.py
77
90881
#!/usr/bin/env python """Create a "virtual" Python installation """ # If you change the version here, change it in setup.py # and docs/conf.py as well. virtualenv_version = "1.7" import base64 import sys import os import optparse import re import shutil import logging import tempfile import zlib import errno import d...
mit
4,437,782,254,672,428,500
42.23549
244
0.686931
false
maurofaccenda/ansible
lib/ansible/utils/module_docs_fragments/postgres.py
143
2774
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
-58,405,190,225,566,780
38.628571
122
0.72819
false
oikarinen/plugin.audio.spotlight
server_addon.py
1
1074
# # Copyright (c) Dariusz Biskup # # This file is part of Spotlight # # Spotlight is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of # the License, or (at your option) any later ve...
gpl-3.0
-6,858,075,487,880,739,000
32.5625
71
0.749534
false
parag2489/Image-Quality
train_imageQuality_regressMOS_smallNetwork.py
1
14262
import pdb from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape from keras.layers.convolutional import Convolution1D, Convolution2D, MaxPooling2D # from keras.layers.normalization import BatchNormalization # from keras.layers.advanced_activations import LeakyReL...
mit
-5,576,581,045,133,756,000
49.39576
240
0.62649
false
gasongjian/ttpy
tt/eigb/eigb.py
1
2316
import numpy as np import tt_eigb from tt import tensor def eigb(A, y0, eps, rmax = 150, nswp = 20, max_full_size = 1000, verb = 1): """ Approximate computation of minimal eigenvalues in tensor train format This function uses alternating least-squares algorithm for the computation of several minimal eigenva...
mit
3,577,260,912,655,624,700
36.354839
119
0.579879
false
mbareta/edx-platform-ft
lms/djangoapps/teams/tests/test_views.py
16
63213
# -*- coding: utf-8 -*- """Tests for the teams API at the HTTP request level.""" import json from datetime import datetime import pytz from dateutil import parser import ddt from elasticsearch.exceptions import ConnectionError from mock import patch from search.search_engine_base import SearchEngine from django.core.u...
agpl-3.0
6,949,684,165,730,627,000
38.909551
146
0.594925
false
pu239ppy/graphite-web
webapp/graphite/render/datalib.py
3
5118
"""Copyright 2008 Orbitz WorldWide Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
apache-2.0
3,529,764,667,792,340,500
31.807692
111
0.668816
false
scrollback/kuma
vendor/packages/ipython/IPython/testing/parametric.py
7
1796
"""Parametric testing on top of twisted.trial.unittest. """ __all__ = ['parametric','Parametric'] from twisted.trial.unittest import TestCase def partial(f, *partial_args, **partial_kwargs): """Generate a partial class method. """ def partial_func(self, *args, **kwargs): dikt = dict(kwargs) ...
mpl-2.0
2,528,999,881,343,070,000
31.654545
78
0.609688
false
BenevolentAI/guacamol
tests/utils/test_chemistry.py
1
2868
from guacamol.utils.chemistry import canonicalize, canonicalize_list, is_valid, \ calculate_internal_pairwise_similarities, calculate_pairwise_similarities, parse_molecular_formula def test_validity_empty_molecule(): smiles = '' assert not is_valid(smiles) def test_validity_incorrect_syntax(): smile...
mit
3,597,007,323,894,010,000
27.39604
105
0.621339
false
pniedzielski/fb-hackathon-2013-11-21
src/repl.it/jsrepl/extern/python/unclosured/lib/python2.7/wsgiref/simple_server.py
177
4743
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, howev...
agpl-3.0
-1,924,963,485,749,839,000
29.6
79
0.607843
false
pinterb/st2
st2actions/setup.py
3
1301
# -*- coding: utf-8 -*- # Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Licen...
apache-2.0
8,154,290,682,756,787,000
34.162162
74
0.72329
false
Karosuo/Linux_tools
xls_handlers/xls_sum_venv/lib/python3.6/site-packages/pip/_vendor/chardet/gb2312prober.py
289
1754
######################## 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...
gpl-3.0
1,301,027,188,495,775,500
37.130435
69
0.707526
false
Blake-R/pylijm
setup.py
1
1112
from __future__ import absolute_import, division, print_function, unicode_literals from os import path from setuptools import setup, find_packages with open(path.join(path.dirname(__file__), 'README.md'), 'r') as fp: long_description = fp.read() setup( name='pylijm', version='1.1b2', description='Py...
gpl-3.0
3,693,763,719,986,715,600
31.705882
82
0.635791
false
david-zwicker/py-utils
utils/data_structures/parameter_mixin.py
1
1714
''' Created on Oct 31, 2016 @author: David Zwicker <dzwicker@seas.harvard.edu> ''' import copy class ParameterMixin(object): """ a mixin which manages a dictionary of parameters assigned to classes """ parameters_default = {} def __init__(self, parameters=None, check_validity=True): ...
mit
4,660,017,678,840,337,000
37.088889
79
0.556593
false
witgo/spark
external/kinesis-asl/src/main/python/examples/streaming/kinesis_wordcount_asl.py
23
3611
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
-554,790,329,346,671,740
43.036585
100
0.731376
false
chrsrds/scikit-learn
examples/neighbors/plot_nca_illustration.py
1
2974
""" ============================================= Neighborhood Components Analysis Illustration ============================================= An example illustrating the goal of learning a distance metric that maximizes the nearest neighbors classification accuracy. The example is solely for illustration purposes. Ple...
bsd-3-clause
7,918,378,202,830,263,000
29.659794
78
0.640551
false
gannetson/django
tests/view_tests/urls.py
82
3317
# -*- coding: utf-8 -*- from functools import partial from os import path from django.conf.urls import include, url from django.conf.urls.i18n import i18n_patterns from django.utils._os import upath from django.utils.translation import ugettext_lazy as _ from django.views import defaults, i18n, static from . import v...
bsd-3-clause
2,451,511,888,627,460,000
31.841584
135
0.658426
false
shivaenigma/electrum
gui/qt/__init__.py
2
8471
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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...
gpl-3.0
5,144,486,895,392,387,000
33.57551
119
0.598867
false
Eficent/odoomrp-wip
procurement_orderpoint_no_confirm/wizard/orderpoint_procurement.py
26
1434
# -*- coding: utf-8 -*- ############################################################################## # # This program 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 #...
agpl-3.0
-8,810,684,653,632,542,000
42.454545
78
0.599024
false
jonasschnelli/bitcoin
test/functional/test_framework/util.py
3
19892
#!/usr/bin/env python3 # Copyright (c) 2014-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Helpful routines for regression testing.""" from base64 import b64encode from binascii import unhexlif...
mit
-3,186,931,323,742,834,000
34.521429
112
0.628192
false
maelnor/nova
nova/api/openstack/__init__.py
14
16979
# 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
-7,686,937,366,296,350,000
38.670561
79
0.580482
false
mythmon/airmozilla
airmozilla/popcorn/renderer.py
2
4098
import datetime import os import tempfile import time from uuid import uuid4 import boto from boto.s3.key import Key from funfactory.urlresolvers import reverse from popcoder.popcoder import process_json from django.db import transaction from django.conf import settings from django.utils import timezone from airmozi...
bsd-3-clause
2,697,221,147,785,136,000
27.859155
77
0.646901
false
adrian-soto/QEdark_repo
tools/bandsndos/bandsndos_Ge.py
4
20068
# # Adrian Soto # 22-12-2014 # Stony Brook University # ################################################ # Plot band structure and DOS from the # output of the bands.x program in the # Quantum Espresso package. # # Features: # 1) Allows for scissor correction (band shift) # 2) # ###################################...
gpl-2.0
-594,981,161,698,743,200
21.372352
126
0.547489
false
jean/apx
apx/sprites.py
1
13169
# - coding: utf-8 - # Copyright (C) 2013-2014 Toms Bauģis <toms.baugis at gmail.com> import math import random from gi.repository import GObject as gobject from lib import graphics from lib.pytweener import Easing from lib import game_utils from lib import layout import colors class Label(layout.Label): def _...
mit
3,349,360,464,583,691,000
30.806763
122
0.52339
false
mdmintz/seleniumspot
seleniumbase/core/s3_manager.py
2
3083
""" Manager for dealing with uploading/managing files on Amazon S3 """ from boto.s3.connection import S3Connection from boto.s3.key import Key from seleniumbase.config import settings already_uploaded_files = [] class S3LoggingBucket(object): """ A class to upload log files from tests to Amazon S3. Those...
mit
-5,704,961,647,347,512,000
37.5375
77
0.596821
false
rodrigob/keras
tests/manual/check_autoencoder.py
56
5533
from __future__ import absolute_import from __future__ import print_function from keras.datasets import mnist from keras.models import Sequential, model_from_config from keras.layers.core import AutoEncoder, Dense, Activation, TimeDistributedDense, Flatten from keras.layers.recurrent import LSTM from keras.layers.embed...
mit
-8,563,514,909,860,956,000
40.291045
155
0.704862
false
ModioAB/caramel
tests/__init__.py
1
1242
#! /usr/bin/env python # vim: expandtab shiftwidth=4 softtabstop=4 tabstop=17 filetype=python : import unittest from itertools import zip_longest import transaction from caramel.models import ( init_session, DBSession, ) from . import fixtures class ModelTestCase(unittest.TestCase): @classmethod de...
agpl-3.0
5,379,644,946,055,856,000
27.227273
72
0.643317
false
sofianehaddad/ot-svn
python/test/t_NumericalMathFunction_analytical.py
2
4116
#! /usr/bin/env python from openturns import * from math import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: elementaryFunctions = Description(0) elementaryFunctions.add("sin") elementaryFunctions.add("cos") elementaryFunctions.add("tan") elementaryFunctions.add("asin") elementaryFunction...
mit
-4,054,251,512,921,180,700
37.46729
98
0.607386
false
pchmieli/h2o-3
h2o-py/tests/testdir_algos/gbm/pyunit_DEPRECATED_cv_carsGBM.py
1
6869
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import random import inspect def cv_carsGBM(): # read in the dataset and construct training set (and validation set) cars = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars_20mpg.csv")) # choose the type...
apache-2.0
7,929,925,258,972,900,000
45.412162
131
0.640413
false
SoftwareDefinedBuildings/smap
python/smap/drivers/noaaforecast.py
6
4847
""" Copyright (c) 2011, 2012, Regents of the University of California 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 l...
bsd-2-clause
7,362,184,585,455,655,000
36.573643
100
0.658552
false
tinkerthaler/odoo
addons/account_asset/wizard/account_asset_change_duration.py
84
6005
# -*- encoding: 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 t...
agpl-3.0
-7,639,321,018,840,044,000
44.839695
138
0.598335
false
b0ttl3z/SickRage
lib/guessit/rules/properties/screen_size.py
20
2893
#!/usr/bin/env python # -*- coding: utf-8 -*- """ screen_size property """ from rebulk.remodule import re from rebulk import Rebulk, Rule, RemoveMatch from ..common.validators import seps_surround from ..common import dash def screen_size(): """ Builder for rebulk object. :return: Created Rebulk object ...
gpl-3.0
-726,648,889,365,586,600
36.571429
110
0.547874
false
gymnasium/edx-platform
lms/djangoapps/certificates/management/commands/gen_cert_report.py
11
4330
""" Generate a report of certificate statuses """ from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from django.db.models import Count from opaque_keys.edx.keys import CourseKey from six import text_type from lms.djangoapps.certificates.models import Generat...
agpl-3.0
2,723,222,540,697,338,400
33.365079
93
0.600693
false
and2egg/philharmonic
philharmonic/tests/test_explorer.py
1
1636
from mock import patch from nose.tools import * import pandas as pd import philharmonic @patch('philharmonic.simulator.simulator.run') def test_explore_ga_weights(mock_run): philharmonic._setup('philharmonic.settings.ga_explore') from philharmonic import conf conf.parameter_space = 'GAWeights' from p...
gpl-3.0
-5,804,493,849,844,702,000
38.902439
78
0.707824
false
keedio/hue
desktop/core/ext-py/Django-1.6.10/django/template/loader_tags.py
105
10201
from collections import defaultdict from django.conf import settings from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\ token_kwargs, Variable from django.template.loader import get_template from django.utils.safestring import mark_safe from django.utils import six register = Library(...
apache-2.0
6,353,378,223,894,457,000
37.49434
123
0.613175
false
christabor/MoAL
MOAL/computer_organization/bcd.py
1
2704
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (dxdstudio@gmail.com)""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) from MOAL.helpers.display import Section from MOAL.helpers.display import divider from MOAL.helpers.display import print_h4 from MOAL....
apache-2.0
651,016,219,648,002,600
35.540541
77
0.60392
false
svebk/DeepSentiBank_memex
workflows/mark-precomp-sim/mark-precomp-sim.py
1
1410
import json from pyspark import SparkContext, SparkConf def prepare_mark_precomp(data): key = str(data).rstrip() #print("[prepare_mark_precomp] data: {}".format(data)) return [(key, [key, "info", "precomp_sim", "True"])] def mark_precomp_sim(hbase_man_in, hbase_man_out): in_rdd = hbase_man_in.read_h...
bsd-2-clause
-5,247,407,465,378,237,000
38.166667
94
0.66383
false
sberrevoets/scottberrevoets.com
pelicanconf.py
1
1886
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # Site information AUTHOR = 'Scott Berrevoets' SITENAME = 'Scott Berrevoets' SITEURL = 'https://scottberrevoets.com' # Show line numbers in code snippets MARKDOWN = { 'extension_configs': { 'markdown.extensions.codehilite': ...
mit
8,446,761,385,672,392,000
25.942857
100
0.652704
false
woggle/mesos-old
third_party/boto-2.0b2/boto/ec2/regioninfo.py
44
1524
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 res...
apache-2.0
5,426,603,267,029,916,000
43.823529
74
0.736877
false
tensorflow/privacy
research/pate_2017/input.py
1
13234
# 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
306,232,124,895,973,950
32.419192
150
0.674928
false
salfab/CouchPotatoServer
libs/elixir/ext/encrypted.py
30
4330
''' An encryption plugin for Elixir utilizing the excellent PyCrypto library, which can be downloaded here: http://www.amk.ca/python/code/crypto Values for columns that are specified to be encrypted will be transparently encrypted and safely encoded for storage in a unicode column using the powerful and secure Blowfis...
gpl-3.0
-1,439,619,629,673,980,200
33.919355
79
0.632333
false
BrandonHe/sdl_core
src/3rd_party-static/jsoncpp/devtools/fixeol.py
247
1941
import os.path def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ): """Makes sure that all sources have the specified eol sequence (default: unix).""" if not os.path.isfile( path ): raise ValueError( 'Path "%s" is not a file' % path ) try: f = open(path, 'rb') exce...
bsd-3-clause
-8,929,622,813,354,981,000
29.809524
86
0.531685
false
GGoussar/scikit-image
doc/examples/color_exposure/plot_adapt_rgb.py
9
4535
""" ========================================= Adapting gray-scale filters to RGB images ========================================= There are many filters that are designed to work with gray-scale images but not with color images. To simplify the process of creating functions that can adapt to RGB images, scikit-image p...
bsd-3-clause
-5,974,210,333,678,623,000
35.869919
79
0.662845
false
BehavioralInsightsTeam/edx-platform
lms/djangoapps/experiments/utils.py
9
2910
from student.models import CourseEnrollment from django_comment_common.models import Role from courseware.access import has_staff_access_to_preview_mode from course_modes.models import ( get_cosmetic_verified_display_price ) from courseware.date_summary import ( verified_upgrade_deadline_link, verified_upgrade_...
agpl-3.0
6,255,224,221,551,051,000
35.375
111
0.657388
false
lfalvarez/nouabook
elections/migrations/0012_auto__add_field_votainteligentemessage_author_ville.py
1
12058
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'VotaInteligenteMessage.author_ville' db.add_column(u'elec...
gpl-3.0
-7,082,355,164,755,617,000
73.438272
175
0.558633
false
sirchia/CouchPotatoServer
libs/migrate/versioning/template.py
62
2874
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil import sys from pkg_resources import resource_filename from migrate.versioning.config import * from migrate.versioning import pathed class Collection(pathed.Pathed): """A collection of templates of a specific type""" _mask = None de...
gpl-3.0
4,807,138,626,659,229,000
29.903226
80
0.601949
false
gdimitris/ChessPuzzlerBackend
Virtual_Environment/lib/python2.7/site-packages/werkzeug/testapp.py
294
9398
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
mit
-4,036,940,097,011,677,700
39.86087
83
0.694084
false
heladio/my-blog
pelica-env/lib/python2.7/site-packages/pip/req/req_install.py
31
44179
from __future__ import absolute_import import logging import os import re import shutil import sys import tempfile import warnings import zipfile from distutils.util import change_root from distutils import sysconfig from email.parser import FeedParser from pip._vendor import pkg_resources, six from pip._vendor.dist...
mit
801,696,598,206,643,800
37.052541
79
0.53376
false
madjelan/scikit-learn
sklearn/linear_model/passive_aggressive.py
106
9705
# Authors: Rob Zinkov, Mathieu Blondel # License: BSD 3 clause from .stochastic_gradient import BaseSGDClassifier from .stochastic_gradient import BaseSGDRegressor from .stochastic_gradient import DEFAULT_EPSILON class PassiveAggressiveClassifier(BaseSGDClassifier): """Passive Aggressive Classifier Read mor...
bsd-3-clause
-3,070,681,040,939,324,400
34.163043
79
0.559093
false
Azure/azure-sdk-for-python
tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py
1
10235
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
-7,209,925,384,981,617,000
37.333333
116
0.596092
false
pascalguru/florincoin
qa/rpc-tests/invalidateblock.py
123
3175
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test InvalidateBlock code # from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy imp...
mit
-3,151,018,509,446,238,000
40.776316
95
0.642205
false
marcusramberg/dotfiles
bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/extras/network/openvswitch_port.py
49
4068
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, David Stygstra <david.stygstra@gmail.com> # # This file is part of Ansible # # This module 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 ...
mit
523,663,506,862,391,550
28.266187
88
0.575221
false
alexmerser/overholt
tests/api/product_tests.py
10
1352
# -*- coding: utf-8 -*- """ tests.api.product_tests ~~~~~~~~~~~~~~~~~~~~~~~ api product tests module """ from ..factories import CategoryFactory, ProductFactory from . import OverholtApiTestCase class ProductApiTestCase(OverholtApiTestCase): def _create_fixtures(self): super(ProductApiTestC...
mit
6,235,635,121,588,235,000
26.591837
65
0.590976
false
hickey/amforth
tools/amforth-shell.py
2
56764
#!/usr/bin/python # # pySerial based upload & interpreter interaction module for amforth. # # Copyright 2011 Keith Amidon (camalot@picncipark.org) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software...
gpl-2.0
-7,163,688,477,277,138,000
41.679699
123
0.557607
false
Benoss/django-elasticsearch-debug-toolbar
elastic_panel/test/test_toolbar.py
1
1590
# -*- coding: utf-8 -*- import unittest from django.conf import settings settings.configure() from debug_toolbar.toolbar import DebugToolbar from django.http import HttpResponse from django.test import RequestFactory from elasticsearch.connection import Connection from elastic_panel import panel class ImportTest(u...
mit
2,364,048,763,756,485,600
35.953488
102
0.661422
false
dr-venkman/TizenRT
os/drivers/sercomm/loadwriter.py
13
1050
#!/usr/bin/python ########################################################################### # # Copyright 2016 Samsung Electronics 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 ...
apache-2.0
-809,574,098,586,014,700
28.166667
75
0.60381
false
asmeurer/urllib3
test/test_retry.py
1
5845
import unittest from urllib3.packages.six.moves import xrange from urllib3.util.retry import Retry from urllib3.exceptions import ( ConnectTimeoutError, ReadTimeoutError, MaxRetryError ) class RetryTest(unittest.TestCase): def test_string(self): """ Retry string representation looks the way ...
mit
4,668,894,725,808,256,000
36.467949
95
0.633875
false
MiroK/dolfin
test/unit/python/fem/test_solving.py
3
2436
#!/usr/bin/env py.test """Unit tests for the solve function""" # Copyright (C) 2011 Anders Logg # # This file is part of DOLFIN. # # DOLFIN 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 versi...
gpl-3.0
-4,492,538,070,890,875,000
27
77
0.644499
false
sarahgrogan/scikit-learn
sklearn/feature_selection/base.py
70
4221
# -*- coding: utf-8 -*- """Generic feature selection mixin""" # Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman # License: BSD 3 clause from abc import ABCMeta, abstractmethod from warnings import warn import numpy as np from scipy.sparse import issparse, csc_matrix from ..base import TransformerMixin f...
bsd-3-clause
-5,202,843,066,322,409,000
33.598361
79
0.581142
false
chauhanhardik/populo_2
lms/djangoapps/verify_student/migrations/0009_auto__change_softwaresecurephotoverification_window_id_default_none.py
84
9796
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self): # Changing field 'SoftwareSecurePhotoVerification.window'. Setting its default value to None if db.backend_name == 'mysql': db.execute('ALTER TAB...
agpl-3.0
5,489,848,128,403,182,000
81.319328
209
0.57646
false
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/learn/python/learn/utils/__init__.py
112
1300
# 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...
mit
-730,234,331,442,259,600
47.148148
101
0.743846
false