repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
solooboroten/fedora-livecd
imgcreate/kickstart.py
1
20592
# # kickstart.py : Apply kickstart configuration to a system # # Copyright 2007, Red Hat 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; version 2 of the License. # # This program is dis...
gpl-2.0
1,327,125,252,375,814,700
32.924217
128
0.595037
false
sergeneren/anima
anima/env/base.py
1
17632
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Anima Istanbul # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause import os from anima import logger, log_file_handler from anima.recent import RecentFileManager class EnvironmentBase(obj...
bsd-2-clause
-7,131,568,699,548,201,000
30.542039
80
0.609176
false
Mankee/CS419
wsgi/openshift/schedules/views.py
1
2686
import logging from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, redirect from django_cas.views import _service_url, _login_url from models import CredentialsModel, Event from...
apache-2.0
-4,304,884,770,091,513,300
36.84507
112
0.702904
false
bfalacerda/strands_executive
task_executor/scripts/example_add_cosafe_client.py
2
3508
#! /usr/bin/env python import rospy import actionlib from actionlib_msgs.msg import GoalStatus from strands_executive_msgs.msg import ExecutePolicyAction, ExecutePolicyFeedback, ExecutePolicyGoal, MdpStateVar, StringIntPair, StringTriple, MdpAction, MdpActionOutcome, MdpDomainSpec, MdpTask, Task from strands_executiv...
mit
7,696,492,989,779,846,000
37.141304
201
0.631129
false
cernbox/wopiserver
src/localiface.py
1
7218
''' localiface.py Local storage interface for the IOP WOPI server Author: Giuseppe.LoPresti@cern.ch, CERN/IT-ST ''' import time import os import warnings from stat import S_ISDIR # module-wide state config = None log = None homepath = None def _getfilepath(filepath): '''map the given filepath into the target na...
gpl-3.0
3,878,232,960,349,696,500
40.245714
131
0.681629
false
haracejacob/darknet-python-flask
app.py
1
6131
# -*- coding: utf-8 -*- import os from os.path import splitext, basename import time import datetime import logging import flask import werkzeug import optparse import tornado.wsgi import tornado.httpserver from flask import jsonify from PIL import Image from PIL import ImageDraw import cStringIO as StringIO import ur...
mit
-8,258,458,316,918,674,000
32.502732
76
0.63709
false
jdcald13/Winning_Texas_Holdem_Strategy
app/hand.py
1
2626
from app.deck import Deck class Hand(Deck): """In real play we would also need to know the total number of players so that we could deal the cards out in the correct order. However, here we are only interested in our hand (we never fully know our opponent's hand); which will later be compared to an opening ra...
mit
-5,951,038,077,747,133,000
54.87234
206
0.606626
false
TomTranter/OpenPNM
openpnm/network/__init__.py
1
5934
r""" **openpnm.network** ---- This module contains the ``GenericNetwork`` class, whose main purpose is to manage the topological representation of the Network. It also houses a collection of Network generators. ---- **Available Network Generators** OpenPNM includes a variety of Network generators. The basically...
mit
3,996,471,672,911,377,400
53.944444
79
0.454331
false
ErenTD/Eren-s-Music-Bot
musicbot/playlist.py
1
12272
import os.path import datetime import traceback from random import shuffle from itertools import islice from collections import deque from urllib.error import URLError from youtube_dl.utils import ExtractorError, DownloadError, UnsupportedError from .utils import get_header from .lib.event_emitter import EventEmitte...
mit
4,468,694,328,803,419,600
36.644172
122
0.563233
false
Pettythug/ForThisClass
assignment7/broker.py
1
2885
from network import Listener, Handler, poll handlers = {} # map client handler to user name names = {} # map name to handler subs = {} # map tag to handlers def broadcast(msg): for h in handlers.keys(): h.do_send(msg) class MyHandler(Handler): count = 0; def on_open(self): handlers[sel...
mit
3,542,157,346,691,514,000
35.987179
82
0.375737
false
airanmehr/Scan
Libs/Util.py
1
2178
''' Copyleft Mar 08, 2017 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: airanmehr@gmail.com ''' import numpy as np; np.set_printoptions(linewidth=200, precision=5, suppress=True) import pandas as pd; pd.options.display.max_rows = 20; pd.options.display.expand_frame_repr = False import seaborn as sns im...
mit
4,540,748,270,361,257,000
30.114286
148
0.68641
false
jreback/pandas
pandas/tests/frame/indexing/test_setitem.py
1
13480
import numpy as np import pytest from pandas.core.dtypes.base import registry as ea_registry from pandas.core.dtypes.dtypes import DatetimeTZDtype, IntervalDtype, PeriodDtype from pandas import ( Categorical, DataFrame, Index, Interval, NaT, Period, PeriodIndex, Series, Timestamp, ...
bsd-3-clause
8,025,559,734,795,429,000
32.784461
88
0.528116
false
ceibal-tatu/pygobject
gi/pygtkcompat.py
1
14279
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab # # Copyright (C) 2011-2012 Johan Dahlin <johan@gnome.org> # # This library 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 Founda...
lgpl-2.1
8,445,934,827,913,439,000
30.451542
84
0.640101
false
h3biomed/ansible
lib/ansible/modules/network/cloudengine/ce_switchport.py
1
27421
#!/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
8,632,139,386,570,024,000
33.063354
123
0.553773
false
yunojuno/django-juno-testrunner
setup.py
1
1383
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-juno-testrunner', version='0.4.1', description='A ...
mit
3,243,954,591,741,133,000
38.514286
117
0.610991
false
HackLab-Almeria/clubpythonalm-taller-bots-telegram
01-Chat Bot/Teclados - Api 2.0/Teclado1.py
1
2361
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Ejemplo: Teclado Virtual 1 (Api 2.0) Libreria: pyTelegramBotAPI 2.0 [ok] Python: 3.5.1 """ from telebot import types # Importamos el API correspondiente para usar teclados virtuales import telebot import sys TOKEN='AQUÍ EL NUMERO DE VUESTRO TOKEN' # Identificador ...
mit
6,601,520,652,176,615,000
36.854839
118
0.73285
false
polyaxon/polyaxon
core/polyaxon/k8s/custom_resources/operation.py
1
1229
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
1,260,142,692,166,638,600
28.261905
74
0.701383
false
devilry/devilry-django
devilry/devilry_admin/tests/subject_for_period_admin/test_subject_redirect.py
1
2259
import mock from django.conf import settings from django.http import Http404 from django.test import TestCase from cradmin_legacy import cradmin_testhelpers from model_bakery import baker from devilry.devilry_admin.views.subject_for_period_admin import subject_redirect class TestSubjectRedirect(TestCase, cradmin_t...
bsd-3-clause
3,487,144,100,941,223,000
46.0625
113
0.729969
false
triump0870/RemindMeLater
src/profiles/migrations/0001_initial.py
1
1204
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import uuid class Migration(migrations.Migration): dependencies = [ ('authtools', '0003_auto_20160128_0912'), ] operations = [ migrations.CreateModel...
mit
-7,514,481,914,761,045,000
34.411765
102
0.503322
false
brianhouse/housepy
osc.py
1
3521
#!/usr/bin/env python3 """ Example: import time from osc import * try: address = sys.argv[1] except: address = "/hello/world" try: data = sys.argv[2] except: data = None def message_handler(location, address, data): print(location) prin...
mit
-2,130,635,583,753,808,100
28.341667
112
0.550412
false
mmpagani/oq-hazardlib
openquake/hazardlib/calc/hazard_curve.py
1
5948
# coding: utf-8 # The Hazard Library # Copyright (C) 2012-2014, GEM Foundation # # 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 # License, or (at your option) any...
agpl-3.0
7,406,639,656,955,995,000
43.646617
78
0.675312
false
uai/VZI
09/py/sorting.py
1
1314
# sorting some stuff 2 # https://www.youtube.com/watch?v=-xXvxj0SaQ4 import sys import random import time # import timeit # v pripade max. recursion limitu # sys.setrecursionlimit(1500) # viz. https://stackoverflow.com/questions/3323001/maximum-recursion-depth nums = list() n = 10 for i in range(0, n): # print(...
bsd-3-clause
6,548,840,141,799,127,000
17.507042
74
0.582953
false
kartikshah1/Test
concept/views.py
1
1365
""" Views for Concept API """ from django.contrib.auth.decorators import login_required from django.shortcuts import render, get_object_or_404 from elearning_academy.permissions import InInstructorOrContentDeveloperMode from courseware.permissions import IsOwner from courseware.models import Concept @login_require...
mit
-4,125,520,641,924,915,000
33.125
98
0.737729
false
wavesoft/robob
robob/pipe/app.py
1
1444
import shlex from robob.pipe import PipeBase class Pipe(PipeBase): """ Implementation of the application pipe item """ def configure(self, config): """ Configure cmdline """ # Prepare self.binary = config['binary'] self.args = [] self.stdin = None # Parse arguments if 'args' in config: if ...
apache-2.0
7,895,432,236,760,590,000
19.628571
89
0.639197
false
ask/flakeplus
flakeplus/__init__.py
1
7179
# -*- coding: utf-8 -*- """Additional pyflakes""" # :copyright: (c) 2012-2016 by Ask Solem. # :license: BSD, see LICENSE for more details. from __future__ import absolute_import from __future__ import with_statement VERSION = (1, 1, 0) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ =...
bsd-3-clause
-723,099,010,128,184,200
30.765487
79
0.531411
false
skosukhin/spack
var/spack/repos/builtin/packages/snbone/package.py
1
2737
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-3,598,552,296,907,631,600
41.765625
79
0.620022
false
timdiels/zeroinstall
zeroinstall/zerostore/cli.py
1
7291
"""Code for the B{0store} command-line interface.""" # Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. from zeroinstall import _ import sys, os from zeroinstall.zerostore.manifest import verify, get_algorithm, copy_tree_with_verify from zeroinstall import zerostore,...
lgpl-2.1
-8,336,675,680,161,674,000
28.759184
186
0.667124
false
datapythonista/pandas
pandas/tests/frame/test_stack_unstack.py
1
72472
from datetime import datetime from io import StringIO import itertools import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Period, Series, Timedelta, date_range, ) import pandas._testing as tm ...
bsd-3-clause
6,102,745,059,497,143,000
34.044487
88
0.485443
false
polysquare/cmake-module-common
conanfile.py
1
1305
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.12" class CMakeModuleCommonConan(ConanFile): name = "cmake-module-common" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" url = "http://github.com/polysquare/cmake-module-co...
mit
8,907,373,018,090,672,000
32.461538
73
0.574713
false
Yangqing/caffe2
caffe2/python/operator_test/ceil_op_test.py
1
1592
# Copyright (c) 2016-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
-2,875,960,689,764,800,000
29.615385
78
0.638191
false
abhikeshav/ydk-py
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ipv4_telnet_cfg.py
1
5518
""" Cisco_IOS_XR_ipv4_telnet_cfg This module contains a collection of YANG definitions for Cisco IOS\-XR ipv4\-telnet package configuration. This module contains definitions for the following management objects\: ipv6\-telnet\: IPv6 telnet configuration ipv4\-telnet\: ipv4 telnet Copyright (c) 2013\-2015 by Cis...
apache-2.0
1,648,462,373,414,770,000
26.04902
321
0.546756
false
Marcdnd/electrum-cesc
plugins/qrscanner.py
1
13378
from electrum_cesc.util import print_error from urlparse import urlparse, parse_qs from PyQt4.QtGui import QPushButton, QMessageBox, QDialog, QVBoxLayout, QHBoxLayout, QGridLayout, QLabel, QLineEdit, QComboBox from PyQt4.QtCore import Qt from electrum_cesc.i18n import _ import re import os from electrum_cesc import Tr...
mit
2,894,233,677,867,080,000
33.658031
165
0.5746
false
OptimalPayments/Python_SDK
src/PythonNetBanxSDK/ThreeDSecure/EnrollmentChecks.py
1
3265
''' Created on 18-Apr-2016 @author: Asawari.Vaidya ''' from PythonNetBanxSDK.CardPayments.Card import Card from PythonNetBanxSDK.common.DomainObject import DomainObject from PythonNetBanxSDK.common.Error import Error from PythonNetBanxSDK.common.Link import Link class EnrollmentChecks(DomainObject): def __i...
mit
6,267,941,849,149,330,000
21.680556
63
0.515773
false
Shatnerz/ringplus
ringplus/auth.py
1
4820
"""OAuth2 handlers and some utility functions for RingPlus.""" from __future__ import print_function import requests from requests_oauthlib import OAuth2, OAuth2Session from bs4 import BeautifulSoup class OAuthHandler(object): """OAuth Authentication Handler. OAuthHandler is used to simplify the OAuth2 a...
mit
-689,304,542,838,251,500
36.952756
78
0.636929
false
jimsize/PySolFC
pysollib/games/wavemotion.py
1
4084
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # ---------------------------------------------------------------------------## # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free softwa...
gpl-3.0
563,173,693,865,608,500
31.15748
79
0.55142
false
Mathew/psychoanalysis
psychoanalysis/apps/pa/migrations/0002_auto__del_participant.py
1
7476
# -*- 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): # Deleting model 'Participant' db.delete_table(u'pa_participant') # Removing M2M table for field us...
mit
6,745,956,246,311,314,000
60.286885
187
0.560059
false
plum-umd/pasket
pasket/encoder.py
1
48157
import math import cStringIO import os import copy as cp from itertools import chain, ifilter, ifilterfalse from functools import partial import re import operator as op from string import Template as T import logging from lib.typecheck import * import lib.const as C from lib.enum import enum import util import sampl...
mit
-3,296,324,012,821,895,000
30.475163
95
0.578628
false
cloudrain21/memcached-1
testsuite/breakdancer/engine_test.py
1
7385
#!/usr/bin/env python import os import sys import breakdancer from breakdancer import Condition, Effect, Action, Driver TESTKEY = 'testkey' ###################################################################### # Conditions ###################################################################### class ExistsConditio...
bsd-3-clause
-7,667,654,003,206,512,000
25.281139
121
0.53067
false
artemix9/mlpy
mlpy.py
1
2876
# Copyright (C) 2016 Artem Kozlov. All rights reserved. Contacts: <artemix-dev@yandex.ru> # Multilayer perceptron module for Python 3 from copy import deepcopy as new import numpy as np import json class Neuron: inputs = [] weights = [] output = 0.0 # The 'weights' variable must be a list of neuron ...
gpl-3.0
1,807,188,544,151,770,000
32.835294
142
0.567455
false
ithinksw/philo
philo/signals.py
1
2901
from django.dispatch import Signal #: Sent whenever an Entity subclass has been "prepared" -- that is, after the processing necessary to make :mod:`.AttributeProxyField`\ s work has been completed. This will fire after :obj:`django.db.models.signals.class_prepared`. #: #: Arguments that are sent with this signal: #: ...
isc
5,403,604,978,678,147,000
47.366667
405
0.725957
false
beiko-lab/gengis
bin/Lib/site-packages/numpy/oldnumeric/fix_default_axis.py
1
8326
""" This module adds the default axis argument to code which did not specify it for the functions where the default was changed in NumPy. The functions changed are add -1 ( all second argument) ====== nansum nanmax nanmin nanargmax nanargmin argmax argmin compress 3 add 0 ====== take 3 rep...
gpl-3.0
-6,043,871,192,939,689,000
26.611684
78
0.490632
false
redhat-openstack/heat
heat/engine/resources/software_config/cloud_config.py
1
2132
# # 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
-692,358,450,047,824,900
34.533333
78
0.689024
false
jrichte43/ProjectEuler
Problem-0194/solutions.py
1
1346
__problem_title__ = "Coloured Configurations" __problem_url___ = "https://projecteuler.net/problem=194" __problem_description__ = "Consider graphs built with the units A: and B: , where the units are " \ "glued along the vertical edges as in the graph . A configuration of " \ ...
gpl-3.0
-4,165,816,755,729,612,000
39.727273
100
0.540179
false
ThiefMaster/sqlalchemy
lib/sqlalchemy/dialects/postgresql/psycopg2.py
1
26982
# postgresql/psycopg2.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: postgresql+psycopg2 :name: psycopg2 :dbapi: psycopg2...
mit
5,201,154,178,368,682,000
36.114168
85
0.641687
false
bhaugen/nova
distribution/view_helpers.py
1
28699
from decimal import * import datetime from operator import attrgetter from django.forms.formsets import formset_factory from django.contrib.sites.models import Site from models import * from forms import * try: from notification import models as notification except ImportError: notification = None def is_n...
mit
-3,354,612,000,780,010,000
35.327848
96
0.559671
false
tensorflow/models
official/vision/beta/projects/movinet/configs/movinet.py
1
4058
# Copyright 2021 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
-9,146,474,159,486,402,000
27.780142
77
0.73928
false
andela/codango
codango/resources/models.py
1
1889
from cloudinary.models import CloudinaryField from community.models import Community from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import models class Resource(models.Model): LANGUAGE_TAGS = ( ('PYTHON', 'Python'), ('RUBY', 'Ruby'), ...
mit
-2,677,900,237,199,745,000
31.016949
76
0.637374
false
TribeMedia/synapse
synapse/storage/client_ips.py
2
4803
# -*- coding: utf-8 -*- # Copyright 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
1,665,801,080,157,915,600
32.124138
79
0.553196
false
openspending/ckanext-budgets
ckanext/budgets/controllers.py
1
2310
import json import ckan.plugins.toolkit as toolkit import ckan.model import pylons import dateutil.parser from budgetdatapackage import BudgetDataPackage, BudgetResource import logging log = logging.getLogger(__name__) class BudgetDataPackageController(toolkit.BaseController): def descriptor(self, id, resource_...
agpl-3.0
7,718,835,142,215,778,000
33.477612
72
0.608225
false
yunify/qingcloud-cli
qingcloud/cli/iaas_client/actions/notification/verify_notification_item.py
1
2163
# ========================================================================= # Copyright 2012-present Yunify, Inc. # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compliance with the Licens...
apache-2.0
-4,494,124,505,304,918,000
43.142857
98
0.585761
false
EderSantana/seya
seya/layers/imageproc.py
1
4991
"""Note: this code was modified from: https://github.com/lpigou/Theano-3D-ConvNet/blob/master/LICENSE by @lpigou and collaborators """ import numpy as np import theano.tensor as T import keras.backend as K from keras.layers.core import Layer class NormLayer(Layer): """ Normalization layer """ def __init__(s...
bsd-3-clause
2,430,868,583,431,697,400
32.952381
83
0.537167
false
NMGRL/pychron
pychron/git/hosts/local.py
1
1669
# =============================================================================== # Copyright 2019 ross # # 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/LICE...
apache-2.0
922,089,579,292,431,400
32.38
85
0.59257
false
cooldome/Nim-gdb
nim.py
1
8490
import gdb import re ################################################################################################# ##### Type pretty printers ################################################################################################# class NimTypePrinter(gdb.types.TypePrinter): "Nim type printer, one pr...
mit
-7,555,962,532,464,927,000
28.275862
141
0.538869
false
shygiants/ChangeGAN
change-gan/change-gan/models/change_gan.py
1
16146
""" Contains the definition of the ChangeGAN architecture. """ import multiprocessing import tensorflow as tf from gan_utils import encoder, decoder, transformer, discriminator, preprocess_image slim = tf.contrib.slim default_image_size = 256 def model_fn(inputs_a, inputs_b, learning_rate, num_blocks=9, is_traini...
mit
2,200,847,747,076,158,000
36.812646
132
0.565775
false
wangzheng0822/algo
python/07_linkedlist/linked_list_algo.py
1
2395
""" 1) Reverse singly-linked list 2) Detect cycle in a list 3) Merge two sorted lists 4) Remove nth node from the end 5) Find middle node Author: Wenru """ from typing import Optional class Node: def __init__(self, data: int, next=None): self.data = data self._next =...
apache-2.0
-448,324,623,278,686,500
24.445652
91
0.579667
false
etale-cohomology/unicorns
activation_functions.py
1
7428
# Copyright (c) 2016, Diego Alonso Cortez, diego@mathisart.org # Code released under the BSD 2-Clause License # Inspired by: Michael Nielsen, Mocha # http://neuralnetworksanddeeplearning.com # https://github.com/pluskid/Mocha.jl import numpy as np import abc # Define "skeleton" classes that do nothing but ...
bsd-2-clause
-3,485,144,952,076,071,400
34.058252
99
0.655627
false
TheDeverEric/noesis-importers
Eric Van Hoven/tex_AmericanChopper_csi.py
1
1790
#------------------------------------------------------------------------------- # Name: American Chopper CSI Image (Tested with XBOX Only) # Purpose: Import Texture # # Author: Eric Van Hoven # # Created: 07/07/2018 # Copyright: (c) Eric Van Hoven 2018 # Licence: <MIT License> #-----...
mit
-7,782,279,928,896,052,000
27.344262
80
0.567039
false
weapp/miner
shared/objectid.py
1
9362
# Copyright 2009-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
mit
-345,590,328,993,939,400
30.416107
80
0.579897
false
wateraccounting/wa
Collect/RFE/monthly.py
1
3465
# -*- coding: utf-8 -*- import sys import pandas as pd import calendar import os from DataAccess import DownloadData import wa.General.data_conversions as DC import wa.General.raster_conversions as RC def main(Dir, Startdate='', Enddate='', latlim=[-50, 50], lonlim=[-180, 180], cores=False, Waitbar = 1): ...
apache-2.0
-4,120,924,246,631,314,000
38.827586
157
0.588745
false
Zlopez/chess
chess/figures/queen.py
1
4620
""" Implementation of Bishop figure in chess command line client. """ import logging import math from . import figure from ..board import Board class Queen(figure.Figure): """ Queen figure for chess implementation. """ def _is_move_correct(self, x_index, y_index): # Move x_index or y_...
gpl-3.0
5,723,919,041,787,688,000
33.222222
91
0.514069
false
ad-m/django-teryt-tree
teryt_tree/dal_ext/views.py
1
1263
from dal import autocomplete from teryt_tree.models import JednostkaAdministracyjna class VoivodeshipAutocomplete(autocomplete.Select2QuerySetView): def get_queryset(self): qs = JednostkaAdministracyjna.objects.voivodeship().all() if self.q: qs = qs.filter(name__istartswith=self.q) ...
bsd-3-clause
-9,305,648,048,797,586
27.704545
66
0.637371
false
pyfarm/pyfarm-agent
setup.py
1
5292
# No shebang line, this module is meant to be imported # # Copyright 2013 Oliver Palmer # # 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 # # U...
apache-2.0
7,502,455,223,679,567,000
35.75
78
0.641723
false
goodwillcoding/RIDE
src/robotide/editor/editors.py
1
12638
# Copyright 2008-2015 Nokia Solutions and Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
8,504,961,411,227,969,000
34.105556
94
0.630954
false
ingenieroariel/inasafe
safe/engine/impact_functions_for_testing/BNPB_earthquake_guidelines.py
1
5972
"""Impact function based on Padang 2009 post earthquake survey This impact function estimates percentual damage to buildings as a function of ground shaking measured in MMI. Buildings are currently assumed to be represented in OpenStreetMap with attributes collected as during the July 2011 Indonesian mapping competiti...
gpl-3.0
-3,609,612,572,815,342,000
37.282051
79
0.534494
false
TUM-LIS/faultify
analysis/optimization/matlab/viterbi/plotData.py
1
17455
import scipy.io p1_1_0 = scipy.io.loadmat('manualOpt_fine_part1_snr0.mat') p2_1_0 = scipy.io.loadmat('manualOpt_fine_snr0.mat') p3_1_0 = scipy.io.loadmat('manualOpt_fine_part3_snr0.mat') p1_2_0 = scipy.io.loadmat('manualOpt_fine_part1_FDRE_snr0.mat') p2_2_0 = scipy.io.loadmat('manualOpt_fine_part2_FDRE_snr0.mat') p3...
gpl-2.0
6,216,856,939,200,127,000
49.302594
167
0.662446
false
cloudera/Impala
tests/metadata/test_partition_metadata.py
1
10955
# 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 u...
apache-2.0
-78,445,492,894,843,780
46.838428
90
0.694751
false
caedesvvv/lintgtk
lintgtk/__init__.py
1
1090
# 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 it will be useful, but ...
gpl-2.0
-5,886,326,020,855,658,000
40.923077
79
0.731193
false
z-Wind/Python_Challenge
Level14_spiralImg.py
1
2358
# http://www.pythonchallenge.com/pc/return/italy.html __author__ = 'chihchieh.sun' from PIL import Image import urllib.request from io import BytesIO def getImg(url): # User Name & Password password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() top_level_url = 'http://www.pythonchalle...
mit
-8,320,253,825,786,456,000
28.623377
79
0.542409
false
CCLab/sezam
apps/authority/urls.py
1
2016
""" authority urls """ #from django.conf import settings from django.conf.urls import patterns, url from haystack.query import SearchQuerySet from haystack.views import SearchView from apps.browser.forms import ModelSearchForm urlpatterns = patterns('apps.authority.views', # Both `display_authorities` and `search...
bsd-3-clause
-4,936,085,818,441,163,000
36.333333
80
0.636409
false
kennedyshead/home-assistant
homeassistant/components/plum_lightpad/__init__.py
1
2434
"""Support for Plum Lightpad devices.""" import logging from aiohttp import ContentTypeError from requests.exceptions import ConnectTimeout, HTTPError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, EVENT_HOMEAS...
apache-2.0
-6,322,286,563,704,237,000
28.325301
88
0.666393
false
hunse/pytest
_pytest/pytester.py
1
37858
""" (disabled by default) support for testing pytest and pytest plugins. """ import gc import sys import traceback import os import codecs import re import time import platform from fnmatch import fnmatch import subprocess import py import pytest from py.builtin import print_ from _pytest.main import Session, EXIT_OK...
mit
108,018,001,310,943,410
33.668498
82
0.580828
false
Orhideous/nidhogg
tests/test_legacy.py
1
5496
from nidhogg.common.models import User from nidhogg.common.utils import generate_token from nidhogg.protocol.legacy import request as req from nidhogg.protocol.legacy import exceptions as exc from tests import BaseTestCase class LegacyRequestTest(BaseTestCase): def test_wrong_argument(self): with self.as...
gpl-3.0
737,082,699,798,673,200
30.050847
76
0.586426
false
jamesward-demo/air-quick-fix
AIRQuickFixServer/pyamf/remoting/gateway/django.py
1
3714
# Copyright (c) 2007-2008 The PyAMF Project. # See LICENSE for details. """ Gateway for the Django framework. This gateway allows you to expose functions in Django to AMF clients and servers. @see: U{Django homepage (external)<http://djangoproject.com>} @author: U{Arnar Birgisson<mailto:arnarbi@gmail.com>} @since:...
apache-2.0
8,034,444,590,400,092,000
29.195122
80
0.636241
false
ColdrickSotK/storyboard
storyboard/tests/common/test_hook_priority.py
1
1522
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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
7,812,888,462,680,532,000
38.025641
78
0.749671
false
isaacyeaton/global-dyn-non-equil-gliding
Code/squirrel.py
1
13697
from __future__ import division import numpy as np from scipy import interpolate import pandas as pd def load_run(run_num, df): """Load in trial data. Parameters ---------- run_num : int Which run to load. df : DataFrame The DataFrame loaded from the original excel file. Re...
mit
-4,676,687,735,099,849,000
23.458929
78
0.557494
false
tensorflow/probability
tensorflow_probability/python/bijectors/bijector_test.py
1
35232
# Copyright 2018 The TensorFlow Probability Authors. # # 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 o...
apache-2.0
-8,731,417,941,040,100,000
35.098361
89
0.661387
false
NLeSC/embodied-emotions-scripts
embem/debates/debates2csv.py
1
4854
#!/usr/bin/env python # -.*- coding: utf-8 -.*- """Script to extract counts for words in word field. Usage: debates2csv.py <xml-file or directory containing xml files> 2014-11-18 j.vanderzwaan@esciencecenter.nl """ import argparse import xml.etree.ElementTree as ET import re from collections import Counter import os ...
apache-2.0
807,590,557,542,389,000
43.127273
79
0.468892
false
resync/resync
resync/hashes.py
1
4083
"""util.py: A collection of utility functions for source and/or client.""" import base64 import hashlib class Hashes(object): """Compute hash digests for ResourceSync. These are all base64 encoded according to the rules of http://www.ietf.org/rfc/rfc4648.txt MD5 ResourceSync defined to be the s...
apache-2.0
-3,536,747,152,276,613,000
34.198276
81
0.613764
false
totcoindev/totcoin
qa/rpc-tests/multi_rpc.py
1
4587
#!/usr/bin/env python2 # Copyright (c) 2015 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 mulitple rpc user config option rpcauth # from test_framework.test_framework import BitcoinTestFrame...
mit
5,949,845,305,899,907,000
36.909091
129
0.641596
false
erigones/api_openvpn
exceptions.py
1
2259
from rest_framework.exceptions import APIException from django.core.exceptions import ValidationError from django.utils.encoding import force_text def validate_only_one_instance(obj): model = obj.__class__ if (model.objects.count() > 0 and obj.id != model.objects.get().id): raise Validatio...
bsd-3-clause
8,523,195,803,407,811,000
29.540541
105
0.677291
false
olegnev/dx-toolkit
src/python/dxpy/scripts/dx_build_app.py
1
48240
#!/usr/bin/env python # # Copyright (C) 2013-2015 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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 a...
apache-2.0
-4,026,534,068,323,847,000
49.197711
306
0.617081
false
has2k1/plydata
plydata/eval.py
1
7150
# Credit: https://github.com/pydata/patsy import __future__ import sys import numbers import inspect from functools import lru_cache __all__ = ["EvalEnvironment"] def _all_future_flags(): flags = 0 for feature_name in __future__.all_feature_names: feature = getattr(__future__, feature_name) ...
bsd-3-clause
3,623,312,421,378,813,000
36.239583
79
0.599021
false
jmwright/cadquery-freecad-module
Libs/pint/testsuite/test_quantity.py
1
48047
# -*- coding: utf-8 -*- from __future__ import division, unicode_literals, print_function, absolute_import import copy import math import operator as op from pint import DimensionalityError, OffsetUnitCalculusError, UnitRegistry from pint.unit import UnitsContainer from pint.compat import string_types, PYTHON3, np, ...
lgpl-3.0
-3,559,116,201,255,252,500
47.280402
130
0.517559
false
kohout/djangocms-getaweb-products
djangocms_product/models.py
1
10145
# -*- coding: utf-8 -*- from cms.models.pluginmodel import CMSPlugin from cms.models.pagemodel import Page from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext as _ from django.utils.timezone import utc from easy_thumbna...
unlicense
-9,202,939,927,887,959,000
28.835294
78
0.616719
false
totalgood/twote
twote/pw_model.py
1
6558
import datetime from collections import Mapping import peewee as pw from playhouse.shortcuts import model_to_dict, dict_to_model from playhouse.csv_utils import dump_csv import pandas as pd import gzip from secrets import DB_NAME, DB_PASSWORD, DB_USER import models db = pw.SqliteDatabase('tweets.db') psql_db = pw.Po...
mit
8,448,318,166,340,821,000
36.261364
147
0.60735
false
taedori81/shoop
shoop/admin/modules/products/__init__.py
1
4165
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from collections import Counter fr...
agpl-3.0
4,579,189,671,847,036,400
37.564815
115
0.561345
false
hpk42/numpyson
test_numpyson.py
1
7235
import datetime as dt from functools import partial import inspect import pytest import numpy as np import pandas as pd from pandas.util.testing import assert_index_equal, assert_series_equal, assert_frame_equal from numpy.testing import assert_equal assert_series_equal_strict = partial(assert_series_equal, check_dty...
mit
-594,982,396,743,412,500
33.617225
120
0.609399
false
daleroberts/luigi-examples
loadconfig.py
1
1551
import tempfile import logging import luigi import time import random import os from datetime import datetime from os.path import join as pjoin, dirname, exists, basename, abspath CONFIG = luigi.configuration.get_config() CONFIG.add_config_path(pjoin(dirname(__file__), 'loadconfig.cfg')) # Set global config TEMPDIR ...
unlicense
2,018,563,003,085,412,400
23.234375
71
0.642166
false
leiferikb/bitpop
build/scripts/slave/gtest/json_results_generator.py
1
17419
# 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. """A utility class to generate JSON results from given test results and upload them to the specified results server. """ from __future__ import with_st...
gpl-3.0
3,123,908,108,397,054,500
32.955166
80
0.660543
false
numberoverzero/finder
scripts/scraper_converter.py
1
2574
''' Usage: python scraper_converter.py scraped.db Processes the cards scraped using the gatherer downloader and adds sane attributes fields for querying (int pow/toughness, cmc) and saves the output to the app's database location. Card attributes are saved according to finder.models.Card ''' import os import sqlso...
mit
-6,135,808,375,069,640,000
30.012048
102
0.635198
false
chitr/neutron
neutron/agent/linux/pd.py
1
14123
# Copyright 2015 Cisco Systems # 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...
apache-2.0
830,436,446,756,060,500
38.339833
78
0.553636
false
voostar/WangWangExcavator
py2exe_script/TrapForBB.py
1
6634
#! #--* coding=utf-8 *-- import urllib2 from bs4 import BeautifulSoup as bs import base64 import subprocess import re import time import logging import os, sys # Define FILE_PATH = "./web_links.txt" URLDICT = { u"南宁市科技局": "http://www.nnst.gov.cn", u"南宁市工信委": "http://219.159.80.227/info/infopen.h...
apache-2.0
-5,009,635,365,505,735,000
29.636364
84
0.542478
false
geraldspreer/the-maker
makerProjectLanguages.py
1
4952
#!/usr/bin/python # -*- coding: utf-8 -*- possibleLanguages = { "Afar": "a", "Abkhazian": "ab", "Afrikaans": "af", "Akan": "ak", "Albanian": "sq", "Amharic": "am", "Arabic": "ar", "Aragonese": "an", "Armenian": "hy", "Assamese": "as", "Avaric": "av", "Avestan": "ae", ...
gpl-3.0
3,721,244,761,717,408,000
20.814978
50
0.446486
false
gen2brain/comic-utils
comicutils/gui.py
1
13537
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import glob import time import shutil try: from PyQt4.QtGui import * from PyQt4.QtCore import * except ImportError, err: sys.stderr.write("Error: %s%s" % (str(err), os.linesep)) sys.exit(1) try: from comicutils.ui.cc_ui import Ui_...
gpl-3.0
3,185,777,950,968,541,000
37.240113
110
0.584915
false
NuWro/nuwro
src/rew/validation/qel_ratio.py
1
1176
import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages particles = ("numu", "numubar") energies = (500, 1000, 1500) mas = (800, 1000, 1200) dyns = ("cc", "nc") inpath = "qelma" def plot(what): with PdfPages("rew_val_qelma_ratio_{}.pdf".format(what)) as pdf: ...
gpl-3.0
3,190,528,384,730,777,000
33.617647
151
0.482143
false
ben-e-whitney/mpi-tutorial
scripts/c.py
1
3280
import os class Macro: def __init__(self, name, value): self.name = name self.value = value def __str__(self): return '#define {nam} {val}'.format(nam=self.name, val=self.value) class Typedef: def __init__(self, type_specifier, declarator): self.type_specifier = type_speci...
gpl-3.0
19,194,634,387,759,416
29.091743
79
0.509756
false
electric-cloud/EC-WebSphere
src/main/resources/project/wsadmin_scripts/stop_app.py
1
1413
# # Copyright 2015 Electric Cloud, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
3,546,637,956,825,736,700
29.06383
85
0.726822
false
deinfoxication/backend
deinfoxication/__init__.py
1
2134
"""Main application module.""" import glob import importlib import itertools import os from functools import lru_cache from celery import Celery from flask import Flask from flask_click_migrate import Migrate from flask_sqlalchemy import SQLAlchemy from raven.contrib.flask import Sentry from sqlalchemy import MetaData...
agpl-3.0
-4,141,000,078,140,775,400
31.830769
111
0.666823
false
elryndir/GuildPortal
PortalRaid/urls.py
1
1319
from PortalRaid.views import NewCharacterFormView, ServerListView, ListCharactersUser, DetailsCharacter,\ DetailsCharacterFromAPI, RaidListView, RaidDetailView, SignUpRaidView, ClassCharacterAPI __author__ = 'Alexandre Cloquet' from django.conf.urls import patterns, include, url from django.contrib import admin ...
mit
5,455,320,312,811,561,000
61.857143
130
0.611069
false
nirgal/ngw
core/views/messages.py
1
18534
''' Messages managing views ''' import email import json from datetime import date, timedelta from email.message import EmailMessage from email.utils import formatdate from importlib import import_module from django import forms from django.conf import settings from django.contrib import messages from django.contrib....
bsd-2-clause
4,930,909,412,600,218,000
34.437859
79
0.561886
false