repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
infrae/mobi.devices
src/mobi/devices/device.py
1
1082
# Copyright (c) 2010 Infrae. All rights reserved. # See also LICENSE.txt. from zope.interface import implements from mobi.interfaces.devices import (IDevice, IStandardDeviceType, IAdvancedDeviceType, IBasicDeviceType) class Device(object): implements(IDevice) def __init__(self, user_agent, type_, platfor...
bsd-3-clause
8,176,920,588,485,336,000
26.74359
64
0.634011
false
3.92029
false
false
false
epuzanov/ZenPacks.community.CIMMon
ZenPacks/community/CIMMon/CIM_PowerSupply.py
1
1628
################################################################################ # # This program is part of the CIMMon Zenpack for Zenoss. # Copyright (C) 2012-2013 Egor Puzanov. # # This program can be used under the GNU General Public License version 2 # You can find full information here: http://www.zenoss.com/oss ...
gpl-2.0
-1,031,220,522,249,168,900
33.638298
80
0.636364
false
3.708428
false
false
false
yitian134/chromium
chrome/test/pyautolib/download_info.py
11
2596
# Copyright (c) 2011 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. """DownloadInfo: python representation for downloads visible to Chrome. Obtain one of these from PyUITestSuite::GetDownloadsInfo() call. class MyDownlo...
bsd-3-clause
-840,851,314,685,816,600
31.860759
79
0.647535
false
4.031056
true
false
false
nickstenning/honcho
tests/test_environ.py
1
7862
# coding=utf-8 import collections import textwrap import pytest from honcho import environ @pytest.mark.parametrize('content,commands', [ [ """ FOO=bar """, {'FOO': 'bar'} ], [ """ FOO=bar BAZ=qux """, {'FOO': 'bar', 'BAZ': 'qux'} ...
mit
5,054,413,168,229,101,000
22.017647
76
0.491055
false
3.328796
true
false
false
tklovett/MaudeMiner
MaudeMiner/core/loader/utils.py
1
1559
import os import fileinput from MaudeMiner.settings import TXTS_PATH # This is a hack to give me an immutable integer. # This lets me import a reference instead of just he integer LINES_IN_CURRENT_FILE = [None] def file_openhook(filename, mode): # determine number of lines in this file infile = open(filename, mode)...
mit
5,551,240,985,160,369,000
26.857143
92
0.710712
false
2.963878
false
false
false
jautero/asylum
project/config/wsgi.py
4
2067
# -*- coding: utf-8 -*- """ WSGI config for asylum project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via th...
mit
-2,498,897,355,584,144,000
38.75
79
0.767296
false
3.870787
false
false
false
h4ck3rm1k3/swimming
get.py
1
4096
import requests import os import json import pprint import time def extract(d): box = [None,None,None,None] for x in d: #print x['latitude'],x['longitude'] if box[0] is None: box[0]= x['latitude'] elif box[0] > x['latitude'] : box[0]= x['latitude'] if...
gpl-2.0
-8,128,539,364,200,799,000
21.021505
157
0.463867
false
3.160494
false
false
false
volpino/Yeps-EURAC
scripts/scramble/scripts/Cheetah.py
1
1786
import os, sys, shutil # change back to the build dir if os.path.dirname( sys.argv[0] ) != "": os.chdir( os.path.dirname( sys.argv[0] ) ) # find setuptools scramble_lib = os.path.join( "..", "..", "..", "lib" ) sys.path.append( scramble_lib ) import get_platform # fixes fat python 2.5 from ez_setup import use_set...
mit
176,909,587,555,694,180
27.806452
68
0.577828
false
3.032258
false
false
false
jfterpstra/bluebottle
bluebottle/auth/views.py
1
4457
from django.shortcuts import resolve_url from django.utils.translation import ugettext_lazy as _ from django.views.decorators.csrf import csrf_protect from django.contrib.auth.tokens import default_token_generator from django.contrib.auth.forms import PasswordResetForm from django.db import connection from django.core....
bsd-3-clause
-5,120,101,895,721,738,000
37.422414
92
0.647296
false
4.369608
false
false
false
crs4/biodoop-core
bl/core/utils/pspawner.py
1
6231
# BEGIN_COPYRIGHT # # Copyright (C) 2009-2013 CRS4. # # This file is part of biodoop-core. # # biodoop-core 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 optio...
gpl-3.0
-5,481,709,119,503,269,000
32.86413
80
0.625742
false
3.44635
false
false
false
UfSoft/python-perl
setup.py
1
3147
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4 ts=4 fenc=utf-8 # ============================================================================= # $Id: setup.py 83 2006-11-21 20:45:51Z s0undt3ch $ # ============================================================================= # $URL: http://ispmanc...
bsd-3-clause
-1,245,525,501,981,934,800
31.78125
82
0.563076
false
3.655052
false
false
false
manujbh/myKivyApp01
myKivyApp01/myKivyApp01/myKivyApp01.py
1
5366
import kivy import sqlite3 import string from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.properties import ObjectProperty from kivy.properties imp...
mit
-4,871,661,461,855,619,000
39.969466
142
0.6612
false
3.710927
false
false
false
lwalstad-pivotal/unified-demonstration-sentiment_01
firehose/tweet_listener.py
1
4371
import cPickle import datetime import json import os import random import sys import time from profanity import profanity import requests import tweepy import helper_functions # connect to redis r = helper_functions.connect_redis_db() # twitter compute URL, from manifest SENTIMENT_COMPUTE_URL=os.getenv('SENTIMENT_C...
mit
4,400,393,548,886,200,000
35.731092
112
0.634866
false
3.505213
false
false
false
tpazderka/pysaml2
tests/test_02_saml.py
2
51349
#!/usr/bin/env python # -*- coding: utf-8 -*- # """Tests for saml2.saml""" __author__ = 'roland.hedberg@adm.umu.se (Roland Hedberg)' try: from xml.etree import ElementTree except ImportError: from elementtree import ElementTree import saml2 import saml2_data, ds_data import xmldsig as ds from saml2 import...
bsd-2-clause
4,651,747,145,212,740,000
41.332234
87
0.62973
false
3.604197
true
false
false
vyshakn/ProjectEye
calibrate_copy.py
1
4473
# Incorrect Code import numpy as np import cv2 from time import sleep print "Welcome\n" numBoards = 50 #how many boards would you like to find board_sz = (7,4) square_sz = 2.9 # termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) # Arrays to store object po...
mit
7,687,879,525,663,276,000
28.82
207
0.662419
false
2.593043
false
false
false
jonfoster/pyxb1
tests/datatypes/test-integer.py
1
1985
from pyxb.exceptions_ import * import unittest import pyxb.binding.datatypes as xsd class _TestIntegerType (object): """Base class for testing any datatype that descends from integer. Subclasses should define class variables: THIS_TYPE = the xsd datatype class PARENT_TYPE = the next dominating type in...
apache-2.0
3,419,733,535,565,290,500
37.921569
103
0.61864
false
3.583032
true
false
false
esdalmaijer/PyGaze
pygaze/_screen/psychopyscreen.py
1
25745
# -*- coding: utf-8 -*- # # This file is part of PyGaze - the open-source toolbox for eye tracking # # PyGaze is a Python module for easily creating gaze contingent experiments # or other software (as well as non-gaze contingent experiments/software) # Copyright (C) 2012-2013 Edwin S. Dalmaijer # # ...
gpl-3.0
246,580,278,750,322,270
37.607692
157
0.546553
false
4.143731
false
false
false
bigr/map1
mapnik/simpler_render.py
1
1993
# coding: utf-8 from math import pi,cos,sin,log,exp,atan import mapnik, json, codecs DEG_TO_RAD = pi/180 RAD_TO_DEG = 180/pi def minmax (a,b,c): a = max(a,b) a = min(a,c) return a class GoogleProjection: def __init__(self,levels=18): self.Bc = [] self.Cc = [] self.zc = [] ...
agpl-3.0
5,263,288,706,477,023,000
25.573333
71
0.554942
false
2.355792
false
false
false
thetestpeople/Geist
geist_tests/test_filters.py
2
3727
import unittest from geist import Location, LocationList, GUI from geist.backends.fake import GeistFakeBackend from geist.filters import (SortingFinder, LocationFinderFilter, SliceFinderFilter) class TestLocationFinderFilter(unittest.TestCase): def setUp(self)...
mit
2,087,140,805,986,406,100
45.012346
77
0.571505
false
3.842268
true
false
false
highweb-project/highweb-webcl-html5spec
extensions/common/api/externs_checker_test.py
3
2214
#!/usr/bin/env python # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import unittest from externs_checker import ExternsChecker sys.path.append( os.path.join(os.path.dirname(os....
bsd-3-clause
-7,048,496,449,603,850,000
34.142857
79
0.666667
false
3.385321
true
false
false
jpancoast-kenzan/spinnaker-terraform
support/check_python_prereqs.py
2
1462
#!/usr/bin/env python import sys import imp import re def main(argv): cloud_provider = sys.argv[1] reqd_module_names_and_versions = {} reqd_module_names_and_versions['requests'] = '2.2.1' reqd_module_names_and_versions['json'] = '2.0.9' reqd_module_names_and_versions['docopt'] = '0.6.2' if ...
apache-2.0
-6,296,570,726,998,351,000
30.782609
183
0.576607
false
3.44
false
false
false
medialab/climateDebateExplorer
ENB-data/metadata_csv_generator.py
1
5742
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import os, sys import itertools import time import codecs from clean_data import Cleaner # the valid uptodate event_bulletinurl.csv in OUT_DATA folder LINK_TO_EVENT="event_bulletinurl.csv" CLEANING="cleaning_sections_metadata.json" #ENB_DATA = "enb_section_js...
mit
-1,607,661,774,160,912,000
32.372093
118
0.554007
false
3.28
false
false
false
telefar/stockEye
select/stockclass.py
1
4574
# -*- coding:utf-8 -*- import numpy as np from datetime import timedelta import math class Stock: def __init__(self): self.changePrices = [] self.dates = [] self.openPrices = [] self.closePrices = [] self.v_ma5 = [] self.volume = [] self.name = u"" s...
bsd-3-clause
1,936,776,889,046,274,000
32.632353
109
0.501968
false
3.595912
false
false
false
flumotion-mirror/flumotion-fragmented-streaming
flumotion/component/muxers/fmp4/packetizer.py
1
3833
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU Lesser General Pub...
lgpl-2.1
-3,846,024,395,203,525,000
34.165138
78
0.579181
false
3.728599
false
false
false
Aeva/slocky
slocky/packet.py
1
1876
# This file is part of Slocky # # Slocky 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. # # Slocky is distributed in the hope that it...
gpl-3.0
-4,127,219,127,368,534,500
26.588235
71
0.652985
false
3.991489
false
false
false
ChrisDBaldwin/PythonChallenge
challenge1.py
1
1088
# Python Challenge 1 # Chris Baldwin # Completed # The easy way to do this is with string maketrans() # Strategy: set up the alphabet and the cipher key # for each character in the string, if the character is a letter, find its location in the alphabet # then print the letter from the key at that location # the STRING ...
mit
-6,429,061,389,803,361,000
35.3
214
0.72886
false
3.047619
false
false
false
jnidzwetzki/bboxdb
bin/experiments/experiment_streamdistribution.py
1
2146
#!/usr/bin/python # # Calculate the statistical values for the # fixed cell experiment # ############################################ import sys import re import math import numpy from array import array # Check args if len(sys.argv) < 2: print "Usage:", sys.argv[0], "<filename>" sys.exit(0) # Regex experi...
apache-2.0
4,604,473,412,538,059,000
20.676768
91
0.681267
false
3.342679
false
false
false
speedyleion/vim-jira
tests/test_jira_window.py
1
4148
#!/usr/bin/env python # encoding: utf-8 import unittest import vimrunner import os dirname = os.path.dirname(os.path.abspath(__file__)) class VimTest(unittest.TestCase): """ This is the class that all tests for working with Vim should derive from. If you are playing on windows you may need to hack up v...
unlicense
-4,617,827,200,593,976,000
36.369369
91
0.619576
false
4.078663
true
false
false
QudevETH/PycQED_py3
pycqed/analysis_v3/helper_functions.py
1
44759
import logging log = logging.getLogger(__name__) import re import os import h5py import itertools import numpy as np from numpy import array # Needed for eval. Do not remove. from copy import deepcopy from collections import OrderedDict from more_itertools import unique_everseen from pycqed.analysis import analysis_to...
mit
3,883,441,213,549,558,000
39.432701
86
0.560736
false
3.934511
false
false
false
rathodmartin/oc
tools/tst/ftputil-2.8/ftputil/ftp_error.py
1
4376
# Copyright (C) 2003-2011, Stefan Schwarzer <sschwarzer@sschwarzer.net> # See the file LICENSE for licensing terms. """ ftp_error.py - exception classes and wrappers """ # "Too many ancestors" # pylint: disable = R0901 import ftplib import sys from ftputil import ftputil_version # You _can_ import these with `fro...
epl-1.0
-2,694,521,747,957,094,400
26.696203
73
0.64808
false
3.875996
false
false
false
youtalk/mindstorms_ros
nxt/nxt_ros/scripts/nxt_ros.py
1
14373
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2010, 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...
apache-2.0
7,755,093,887,853,832,000
34.401478
88
0.578585
false
3.548013
false
false
false
seocam/mirror-test
colab/accounts/migrations/0004_auto_20150311_1818.py
3
1511
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def trim_fields(apps, schema_editor): trim_extra_account(apps, schema_editor, "facebook") trim_extra_account(apps, schema_editor, "github") trim_extra_account(apps, schema_editor, "twitter") def trim_...
gpl-2.0
-5,673,431,477,270,591,000
29.22
96
0.583719
false
4.007958
false
false
false
YeasterEgg/spotify_classify
mood/linear_discriminant_analysis.py
1
1117
import os import MySQLdb import pandas as pd from sklearn import model_selection from sklearn.externals import joblib from sklearn.discriminant_analysis import LinearDiscriminantAnalysis def read_database(mysql, moods_tuple): return pd.read_sql_query("SELECT spotify_id, mood, acousticness, danceability, duration_ms,...
mit
-2,837,613,905,769,692,700
41.961538
297
0.725157
false
2.962865
false
false
false
davidam/python-examples
lexer/parsetab.py
1
3657
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2018 David Arroyo Menéndez # Author: David Arroyo Menéndez <davidam@gnu.org> # Maintainer: David Arroyo Menéndez <davidam@gnu.org> # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
gpl-3.0
2,744,558,931,764,047,400
58.901639
724
0.645594
false
2.663265
false
false
false
team-vigir/flexbe_behavior_engine
flexbe_states/src/flexbe_states/operator_decision_state.py
1
1338
#!/usr/bin/env python from flexbe_core import EventState, Logger class OperatorDecisionState(EventState): ''' Implements a state where the operator has to manually choose an outcome. Autonomy Level of all outcomes should be set to Full, because this state is not able to choose an outcome on its own. ...
bsd-3-clause
-8,998,601,661,800,875,000
42.16129
98
0.675635
false
4.489933
false
false
false
thaim/ansible
lib/ansible/modules/network/check_point/cp_mgmt_run_ips_update.py
20
2269
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
mit
-6,838,586,456,576,662,000
28.855263
142
0.709123
false
3.80067
false
false
false
sam-roth/Keypad
keypad/core/observable_list.py
1
1468
import collections.abc from .signal import Signal class ObservableList(collections.abc.MutableSequence): @Signal def items_will_change(self, slice_, value): pass @Signal def items_did_change(self, slice_): pass @Signal def will_remove_items(self, slice_): pass...
gpl-3.0
5,037,135,828,339,799,000
20.588235
54
0.572888
false
3.832898
false
false
false
tiborsimko/invenio-accounts
invenio_accounts/utils.py
1
2247
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2017-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Utility function for ACCOUNTS.""" import uuid from datetime import datetime from...
mit
-3,299,832,805,019,816,000
27.807692
73
0.645305
false
3.707921
false
false
false
Netflix/lemur
lemur/auth/permissions.py
1
2532
""" .. module: lemur.auth.permissions :platform: Unix :synopsis: This module defines all the permission used within Lemur :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <kglisson@netflix.com> """ from functools i...
apache-2.0
7,984,740,184,717,095,000
32.76
85
0.687204
false
4.0512
false
false
false
rajul/tvb-framework
tvb/adapters/visualizers/cross_coherence.py
1
2541
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # documentation-folder for more details. See also http:/...
gpl-2.0
2,685,126,299,496,239,000
39.333333
91
0.730815
false
3.514523
false
false
false
chrissmejia/SpreadLabs
SpreadLabs/settings.py
1
6137
""" SpreadLabs - Social media suite Copyright (C) 2015 Christopher Mejia Montoya - me@chrissmejia.com - chrissmejia.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, eit...
agpl-3.0
-1,138,634,521,001,131,400
28.796117
146
0.701483
false
3.418942
false
false
false
ngageoint/scale
scale/recipe/messages/update_recipe_definition.py
1
6206
"""Defines a command message that evaluates and updates a recipe""" from __future__ import unicode_literals import logging from django.db import transaction from job.models import JobType from messaging.messages.message import CommandMessage from recipe.definition.definition import InvalidDefinition from recipe.defin...
apache-2.0
-2,879,293,326,447,228,400
37.308642
128
0.618273
false
4.09637
false
false
false
travisjwarren/train_track
train_track/views.py
1
1686
__author__ = 'traviswarren' from datetime import datetime from braces.views import LoginRequiredMixin from django.views import generic from django.shortcuts import get_object_or_404 from django.core.exceptions import PermissionDenied from train_track.apps.event.models import Event, Calendar class HomeTemplate(gen...
gpl-3.0
-4,700,255,114,977,034,000
28.596491
97
0.713523
false
3.93007
false
false
false
scholer/py2cytoscape
py2cytoscape/util/dataframe.py
1
2033
import pandas as pd from . import cytoscapejs as cyjs def from_dataframe(df, source_col='source', target_col='target', interaction_col='interaction', name='From DataFrame', edge_attr_cols=[]): """ Utility to convert Pandas DataFrame object into Cytoscape.js JSON :param df: :param s...
mit
1,902,536,667,581,686,300
24.4125
95
0.541564
false
4.017787
false
false
false
lbjworld/article-search
article-manager/site/article_manager/urls.py
1
1315
# coding: utf-8 """article_manager URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home...
mit
6,989,356,897,966,486,000
37.676471
93
0.713308
false
3.478836
false
false
false
AustralianSynchrotron/nexel
nexel/snapshot.py
1
13151
import base64 from Crypto.Random import random import datetime import json import logging from nexel.config.accounts import Accounts from nexel.config.settings import Settings from nexel.config.datamounts import Datamounts import string from os.path import join from tornado.ioloop import IOLoop from nexel.util.openstac...
bsd-3-clause
-272,623,493,597,622,600
37.565982
145
0.544369
false
3.836348
false
false
false
jpgrayson/pyvcd
setup.py
1
1574
# encoding: utf-8 from setuptools import setup setup( name='pyvcd', author='Peter Grayson', author_email='jpgrayson@gmail.com', description='Python VCD file support.', long_description='\n\n'.join( open(f, 'rb').read().decode('utf-8') for f in ['README.rst', 'LICENSE.txt']), ur...
mit
-7,554,231,972,954,751,000
35.604651
74
0.600381
false
4.153034
false
false
false
hubertokf/lupsEdgeServer
projects/lupsEdgeServer/core/moduleOfRules/schedulerEdge.py
2
1942
from datetime import datetime import json import time import re import os import threading from apscheduler.schedulers.background import BackgroundScheduler class SchedulerEdge(object): #instacia do objeto e inicia o escalonador def __init__(self): def run_thread(): while(True): ...
mit
9,219,263,496,187,991,000
41.217391
170
0.631308
false
3.671078
false
false
false
Twinstar2/Python_Master_scripts
Energy_Profile/add_aa_connections_for_one_file.py
1
7389
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import sys import os import re import itertools import numpy as np # argparse for information parser = argparse.ArgumentParser() parser.add_argument("-pf", "--pdb_file", help="pdb file for a single energy file " ...
mit
-4,927,225,602,661,912,000
36.69898
108
0.472459
false
3.890995
false
false
false
edwardfang/Electronic_Car_DIY
client.py
1
1277
# -*- coding: utf-8 -* import threading,serial,time,struct,socket connected = True #port = '/dev/ttyAMA0' keys = [0,0,0,0,0] def handle_data(data,socket_id = None): #print(str(data),"sa") #global keys #print(ord(data[0])) # if ord(data[0]) != 0: # keys[0] = 1 # else: # keys[0] = 0 socket_id.send(data) # ...
lgpl-3.0
533,269,636,931,319,800
19.015873
56
0.605075
false
2.280289
false
false
false
wardweistra/hipfrog
tests/test_values.py
2
20932
mock_installdata = { "oauthId": "f3100c47-9936-40e8-a8aa-12314e8da8f0", "capabilitiesUrl": "https://api.hipchat.com/v2/capabilities", "roomId": 2589171, "groupId": 46617, "oauthSecret": "Jgtf1Baj5KrSpXHZ7d7OkH3Krwr6cotspI7kJm9C"} mock_capabilitiesData = { 'description': 'Group chat and IM built...
lgpl-3.0
-1,354,403,802,168,487,700
30.754173
99
0.433814
false
4.03743
false
false
false
lanfker/tdma_imac
src/aodv/bindings/modulegen__gcc_ILP32.py
29
433522
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
5,654,860,317,963,573,000
62.631587
999
0.599882
false
3.73742
false
false
false
linktlh/Toontown-journey
toontown/estate/DistributedTrunkAI.py
2
8219
from toontown.estate.DistributedClosetAI import DistributedClosetAI from toontown.toon.ToonDNA import ToonDNA, HAT, GLASSES, BACKPACK, SHOES from direct.distributed.ClockDelta import globalClockDelta import ClosetGlobals class DistributedTrunkAI(DistributedClosetAI): notify = directNotify.newCategory('Distributed...
apache-2.0
8,694,584,935,813,566,000
46.508671
191
0.622947
false
3.703921
false
false
false
fenglb/mysite
eguard/limscrawler.py
1
2322
import requests from bs4 import BeautifulSoup class ConnectionError(Exception): def __inti__(self, value): self.value = value def __str__(self): return repr(self.value) search_user_link = "http://121.192.191.146/lims/!people/list" headers = {'content-type':'application/x-www-form-urlencoded', ...
cc0-1.0
-6,142,289,956,498,972,000
27.170732
99
0.566234
false
3.323741
false
false
false
felipead/breakout
source/breakout/game/GameEngine.py
1
10251
from datetime import datetime from OpenGL.GL import * from OpenGL.GLUT import * from pygame.font import Font from pygame.constants import K_q, K_r, K_SPACE, K_p from breakout.util.Drawing import Drawing from breakout.model.Color import Color from breakout.util.MouseButton import MouseButton from breakout.game.GameStat...
gpl-2.0
-5,396,577,016,792,809,000
34.842657
141
0.613891
false
3.727636
false
false
false
shakamunyi/mesos
support/mesos-gtest-runner.py
4
9368
#!/usr/bin/env python # # 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 # "...
apache-2.0
1,927,726,011,108,527,900
32.577061
79
0.597353
false
4.238914
true
false
false
wasit7/book_pae
pae/forcast/src/convert_sub_home_tojson.py
2
4355
# -*- coding: utf-8 -*- """ Created on Wed May 25 00:18:25 2016 @author: Methinee """ import pandas as pd import json from collections import defaultdict countEachSubSort = 0 key_sub_sort = defaultdict(list) subjects = [] countSub = 0 link = [] out={} sources=[] targets=[] df_file = pd.read_csv('../data/df_dropSub_l...
mit
5,279,006,092,509,670,000
21.6875
94
0.654879
false
2.936615
false
false
false
GoogleCloudPlatform/python-docs-samples
appengine/standard_python3/cloudsql/main_mysql_pooling.py
1
2434
# Copyright 2018 Google LLC # # 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, s...
apache-2.0
3,748,722,887,701,017,600
35.328358
75
0.704191
false
3.418539
false
false
false
Billups/TileStache
tests/vector_tests.py
2
8462
from unittest import TestCase, skipIf import json import os from osgeo import ogr from shapely.geometry import Point, LineString, Polygon, MultiPolygon, asShape from . import utils # Note these tests rely on the fact that Travis CI created a postgis db. # If you want to run them locally, create a similar PostGIS da...
bsd-3-clause
5,371,311,928,275,046,000
38.915094
112
0.599858
false
3.999055
true
false
false
ziir/caliopen.api.user
caliopen/api/user/authentication.py
1
3477
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import base64 from zope.interface import implements, implementer from pyramid.interfaces import IAuthenticationPolicy, IAuthorizationPolicy from pyramid.security import Everyone, NO_PERMISSION_REQUIRED from caliopen.base.user.core import ...
agpl-3.0
1,970,101,063,717,547,300
26.595238
74
0.635605
false
4.515584
false
false
false
dheesbeen/Mage2Gen
mage2gen/snippets/system.py
1
13457
# A Magento 2 module generator library # Copyright (C) 2016 Derrick Heesbeen # # This file is part of Mage2Gen. # # Mage2Gen is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
gpl-3.0
-6,353,901,814,291,881,000
37.448571
144
0.669391
false
3.320257
true
false
false
termoshtt/continuate
continuate/test_newton.py
1
2731
# -*- coing: utf-8 -*- from . import newton, get_default_options import numpy as np from unittest import TestCase def f1(v): x = v[0] y = v[1] return np.array([(x - 1) * (x - 2) * (x - 3) * (x - 4), (y - 2) ** 3]) def f2(v): x = v[0] y = v[1] return np.array([x * x + 1, y * y + 2]) class...
mit
-8,548,724,398,286,342,000
29.344444
84
0.546686
false
2.93972
true
false
false
fsantini/python-e3dc
e3dc/_e3dc_rscp_local.py
1
2907
#!/usr/bin/env python # Python class to connect to an E3/DC system through the internet portal # # Copyright 2017 Francesco Santini <francesco.santini@gmail.com> # Licensed under a MIT license. See LICENSE for details import socket from ._rscpLib import rscpFrame, rscpEncode, rscpFrameDecode, rscpDecode, rscpFindTag f...
mit
6,031,563,532,992,224,000
29.925532
85
0.616787
false
3.998624
false
false
false
alex/django-filter
tests/models.py
1
5563
from django import forms from django.db import models from django.utils.translation import ugettext_lazy as _ REGULAR = 0 MANAGER = 1 ADMIN = 2 STATUS_CHOICES = ( (REGULAR, 'Regular'), (MANAGER, 'Manager'), (ADMIN, 'Admin'), ) # classes for testing filters with inherited fields class SubCharField(models...
bsd-3-clause
8,223,372,427,839,426,000
26.136585
93
0.647492
false
3.931449
false
false
false
windskyer/k_nova
paxes_nova/network/powerkvm/agent/ovs_port_add.py
1
8679
# # ================================================================= # ================================================================= from nova import utils from nova.openstack.common import log as logging from powervc_nova.network.powerkvm.agent import commandlet from powervc_nova.network.powerkvm.agent import mu...
apache-2.0
-3,559,766,922,159,140,000
38.45
78
0.528748
false
4.367891
false
false
false
django-json-api/django-rest-framework-json-api
example/tests/integration/test_non_paginated_responses.py
2
5515
from unittest import mock import pytest from django.urls import reverse pytestmark = pytest.mark.django_db @mock.patch( "rest_framework_json_api.utils" ".get_default_included_resources_from_serializer", new=lambda s: [], ) def test_multiple_entries_no_pagination(multiple_entries, client): expected = { ...
bsd-2-clause
892,972,104,767,814,700
40.780303
101
0.357933
false
5.323359
true
false
false
brettschneider/python_promise_keeper
promise_keeper.py
1
10821
#!/usr/bin/env python """ promise_keeper module provides the PromiseKeeper class. The PromiseKeeper class makes asynchronous programming easier by managing threads and execution for the developer. Sample usage: >>> from promise_keeper import PromiseKeeper >>> from time import sleep >>> from random import...
mit
2,317,809,260,321,375,000
31.593373
88
0.577581
false
4.074172
false
false
false
egglang/sonicky
py/examples/slide_operator_example.py
1
1775
# -*- coding: utf-8 -*- # # Copyright 2017 egglang <t.egawa@gmail.com> # # 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 ...
apache-2.0
-1,730,209,631,638,399,000
31.888889
78
0.686761
false
3.535857
false
false
false
editxt/editxt
editxt/platform/mac/ui/findpanel.py
1
20074
# -*- coding: utf-8 -*- # EditXT # Copyright 2007-2016 Daniel Miller <millerdev@gmail.com> # # This file is part of EditXT, a programmer's text editor for Mac OS X, # which can be found at http://editxt.org/. # # EditXT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
gpl-3.0
5,494,794,054,774,313,000
38.054475
89
0.689848
false
3.431453
false
false
false
jonnyli1125/discordant
discordant/utils.py
2
6789
import asyncio import re import shlex from datetime import datetime import discord def split_every(s, n): return [s[i:i + n] for i in range(0, len(s), n)] def is_url(s): # good enough for now lmao return bool(re.match(r'^https?:\/\/.*', s)) def long_message(output, truncate=False, max_chars=2000, ...
mit
2,603,717,165,453,198,300
28.637555
79
0.585531
false
3.455703
false
false
false
WarwickAnimeSoc/aniMango
library/admin.py
1
6290
from django import forms from django.contrib import admin, messages from django.contrib.admin.helpers import ActionForm from django.contrib.auth.models import User from .models import Item, Series, Request, ArchivedRequest class ItemInline(admin.StackedInline): model = Item extra = 1 raw_id_fields = ('pa...
mit
-7,052,399,118,411,945,000
31.42268
119
0.563434
false
4.201737
false
false
false
rogerthat-platform/rogerthat-backend
src/rogerthat/models/apps.py
1
7505
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # 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
-5,150,443,080,329,055,000
34.070093
117
0.691939
false
3.58063
false
false
false
truhoang/3d-coverage-solo
src/mavros/nuttx_crc32.py
2
3732
# -*- coding: utf-8 -*- # vim:set ts=4 sw=4 et: # # Copyright 2014 Vladimir Ermakov. # # This file is part of the mavros package and subject to the license terms # in the top-level LICENSE file of the mavros repository. # https://github.com/mavlink/mavros/tree/master/LICENSE.md __all__ = ( 'nuttx_crc32', ) CRC32_...
mit
8,687,194,251,629,844,000
64.473684
99
0.777063
false
1.700228
false
false
false
e2jk/vallenato.fr
bin/aprender.py
1
15003
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of Vallenato.fr. # # Vallenato.fr 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 # ...
agpl-3.0
-1,403,242,323,720,891,400
45.593168
215
0.654802
false
3.376772
false
false
false
quantmind/pulsar-queue
tests/example/jobs/standard.py
1
3954
import time import asyncio import threading import greenlet from pq import api class TestError(Exception): pass class RunPyCode(api.Job): '''execute python code in *code*. There must be a *task_function* function defined which accept key-valued parameters only.''' timeout = 60 def __call__(self, ...
bsd-3-clause
-8,253,893,866,866,829,000
21.465909
79
0.603945
false
3.730189
false
false
false
jaantollander/Legendre
src_legacy/testing/ringbuffer.py
4
1904
# coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np from src_legacy.fourier_series.buffer import Ringbuffer from src_legacy.fourier_series.buffer import RingbufferOld def tests(): m...
mit
601,081,689,049,432,000
22.8125
76
0.555672
false
3.18928
false
false
false
anish/buildbot
master/buildbot/test/unit/test_db_logs.py
1
23637
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
525,231,732,507,910,400
38.329451
94
0.594026
false
3.581364
true
false
false
MasTerXP/tornado_tdc_example
Tutorial 3/t3_nearly_realworld_api.py
1
3543
import sqlite3 as sqlite import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import json from tornado.options import define, options define("port", default=8888, help="run on the given port", type=int) class BaseHandler(tornado.web.RequestHandler): def set_default_headers(sel...
apache-2.0
-3,339,451,010,931,097,000
32.433962
100
0.6105
false
3.932297
false
false
false
PiJoules/PID-Controller
genetic.py
1
3874
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from operator import add from random import random, choice class Genetic(object): """Genetic algorithm or something. I don't know.""" def __init__(self, population_size): self._population_size = population_size ...
unlicense
2,001,994,622,189,784,600
29.503937
107
0.594992
false
4.848561
false
false
false
lfblogs/aiopy
aiopy/db/exc.py
2
1309
# -*- coding: UTF-8 -*- __author__ = "Liu Fei" __github__ = "http://github.com/lfblogs" __all__ = [ "select", "execute" ] """ """ import asyncio import logging logging.basicConfig(level=logging.INFO) @asyncio.coroutine def select(sql, args, size=None): logging.info('SQL: {}'.format(sql)) global __...
gpl-3.0
2,620,524,710,351,010,000
26.270833
95
0.578304
false
4.027692
false
false
false
sebastienhupin/qxrad
qooxdoo/tool/pylib/generator/code/qcEnvClass.py
1
3229
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2006-2011 1&1 Internet AG, Germany, http://www.1und1.de # # License: # LGPL: http://www.gnu.org/li...
lgpl-3.0
-3,411,433,382,042,495,500
34.877778
117
0.599257
false
4.056533
false
false
false
lampwins/netbox
netbox/ipam/api/serializers.py
1
9067
from collections import OrderedDict from rest_framework import serializers from rest_framework.reverse import reverse from rest_framework.validators import UniqueTogetherValidator from taggit_serializer.serializers import TaggitSerializer, TagListSerializerField from dcim.api.nested_serializers import NestedDeviceSer...
apache-2.0
-1,633,335,478,317,100,500
34.556863
119
0.66935
false
4.128871
false
false
false
dmnfarrell/mirseqapp
models/menu.py
1
2974
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.logo...
apache-2.0
-7,888,447,196,642,511,000
35.268293
79
0.485878
false
3.847348
false
false
false
TheImagingSource/tiscamera
examples/python/01-list-properties.py
1
5810
#!/usr/bin/env python3 # Copyright 2017 The Imaging Source Europe GmbH # # 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 a...
apache-2.0
-4,044,110,919,452,730,000
38.794521
111
0.481583
false
5.277021
false
false
false
Anaatti/Steam-crawler
src/request.py
1
3092
import threading import time import urllib2, httplib, socket from settings import * from util import Progress request_lock = threading.Lock() request_time = 0.0 request_amount = 0.0 def get_req_time(): with request_lock: return request_time / max(request_amount, 1.0) def wait_error(): progress = Pro...
mit
-5,363,673,476,940,712,000
32.608696
100
0.600259
false
3.720818
false
false
false
Frikanalen/frikanalen
packages/fkweb/fk/migrations/0009_add_legally_required_fields.py
1
2303
# Generated by Django 2.2.10 on 2020-05-05 14:39 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import phonenumber_field.modelfields def set_editor_if_only_one_member(apps, schema_editor): Organization = apps.get_model('fk', 'Organization') for org i...
lgpl-3.0
-4,217,130,219,088,964,000
38.706897
195
0.644377
false
3.963855
false
false
false
gvangool/django-rest-hooks
rest_hooks/utils.py
1
2872
def get_module(path): """ A modified duplicate from Django's built in backend retriever. slugify = get_module('django.template.defaultfilters.slugify') """ from django.utils.importlib import import_module try: mod_name, func_name = path.rsplit('.', 1) mod = import_modul...
isc
8,659,745,884,383,246,000
32.788235
90
0.60968
false
4.120516
false
false
false
PaulWay/insights-core
insights/parsers/tests/test_dmesg.py
1
1370
from insights.parsers.dmesg import DmesgLineList from insights.tests import context_wrap MSGINFO = """ lo: Dropping TSO features since no CSUM feature. bnx2 0000:0b:00.0: irq 86 for MSI/MSI-X bnx2 0000:0b:00.0: eth0: using MSIX (null): Dropping TSO features since no CSUM feature. (null): Dropping TSO6 features since n...
apache-2.0
3,690,210,814,938,551,000
41.8125
160
0.673723
false
2.527675
false
false
false
francois-durand/svvamp
svvamp/VotingSystems/Kemeny.py
1
3765
# -*- coding: utf-8 -*- """ Created on Sat Oct 4 17:28:18 2014 Copyright François Durand 2014, 2015 fradurand@gmail.com This file is part of SVVAMP. SVVAMP 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 Founda...
gpl-3.0
-8,591,536,608,058,365,000
35.173077
78
0.690242
false
3.612872
false
false
false
itucsdb1606/itucsdb1606
lokasyonlar.py
1
3020
import json import datetime import re import os import psycopg2 as dbapi2 from flask import Flask from flask import render_template from flask import redirect from flask import request from flask.helpers import url_for class Lokasyon: def __init__(self, name, baskent, gps, yerel_dil, photo): self.name = n...
gpl-3.0
-2,026,811,370,189,219,800
26.327273
113
0.576514
false
2.924125
false
false
false
vivekdurai/judis-re
courtnic.py
1
4721
import tempfile import re import os import urllib import urlparse import string import utils class Courtnic(utils.BaseCourt): def __init__(self, name, rawdir, metadir, statsdir, updateMeta = False): utils.BaseCourt.__init__(self, name, rawdir, metadir, statsdir, updateMeta) self.baseurl = 'htt...
gpl-3.0
-4,441,408,623,176,804,000
33.713235
90
0.531879
false
3.831981
false
false
false
lenarother/moderna
moderna/util/validators.py
1
5530
#!/usr/bin/env python # # validators.py # # RNA 3D structure prediction. # # http://iimcb.genesilico.pl/moderna/ # __author__ = "Magdalena Rother, Tomasz Puton, Kristian Rother" __copyright__ = "Copyright 2008, The Moderna Project" __credits__ = ["Janusz Bujnicki"] __license__ = "GPL" __maintainer__ = "Magdalena Rothe...
gpl-3.0
-642,945,043,853,541,100
35.381579
118
0.677758
false
3.667109
false
false
false
rsnakamura/oldape
apetools/commons/generators.py
1
3071
WRITEABLE = 'w' EOSection = '' def find(glob, start=None): """ Matches all below cwd or start-directory :param: - `glob`: A file-glob to match interesting files - `start`: The top path (finds files below the top) :yield: Matching file name """ if start is None: start...
apache-2.0
846,884,033,388,171,400
22.806202
95
0.554217
false
4.259362
false
false
false
emkailu/PAT3DEM
bin/p3motioncor2checkerror.py
1
1429
#!/usr/bin/env python import os import sys import argparse import math def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <motioncor2run.log> Check the following errors: 1. The global alignment did not go smaller than 0.5 within specified iterations. 2. The local alignment did ...
mit
4,829,747,566,796,227,000
27.58
89
0.631211
false
3.021142
false
false
false
yunity/yunity-core
karrot/history/models.py
1
3725
from datetime import timedelta from django.db.models import JSONField from django.db import models from django.db.models import IntegerField from django.db.models.expressions import RawSQL, When, Case from django.dispatch import Signal from django.utils import timezone from django_enumfield import enum from karrot.ba...
agpl-3.0
-7,067,505,252,242,159,000
31.391304
98
0.607248
false
3.816598
false
false
false
consbio/seedsource-core
seedsource_core/django/seedsource/management/commands/add_region.py
1
2512
import glob import os import shutil from tempfile import mkdtemp from zipfile import ZipFile import fiona from django.contrib.gis.geos import LinearRing, Polygon from django.contrib.gis.geos.collections import MultiPolygon from django.core.management.base import BaseCommand from django.db import transaction from raste...
bsd-3-clause
-6,244,347,999,882,215,000
33.410959
118
0.561704
false
4.575592
false
false
false
jwkozel/demobx
boxsdk/client.py
1
8504
# coding: utf-8 from __future__ import unicode_literals import json from .config import API from .session.box_session import BoxSession from .network.default_network import DefaultNetwork from .object.user import User from .object.folder import Folder from .object.search import Search from .object.events import Event...
apache-2.0
-1,829,790,396,283,794,000
32.480315
117
0.557267
false
4.361026
false
false
false
MaxTyutyunnikov/lino
obsolete/src/lino/wwgui/SitePage.py
1
2901
raise "no longer used. import from webware_ui!" from WebKit.SidebarPage import SidebarPage from WebKit.Page import Page from quixote.html import htmltext from lino import __version__ class ParamSpec: def __init__(self,shortName,s2v,v2s=str): self.shortName = shortName self.v2s = v2s self.s2v = s2v ...
gpl-3.0
-4,495,287,689,991,736,000
20.977273
70
0.608411
false
2.661468
false
false
false
alex-groshev/SpyPy
aggregatorspy.py
1
1024
#!/usr/bin/env python import sys import time import Queue from confspy import ConfSpyPy from dataspy import DataSpyPy from procspy import ProcSpyPy, DocumentProcessor def main(): start = time.time() if len(sys.argv) < 2: print 'Please, specify a number of records to process and regular...
mit
-8,413,311,596,269,243,000
24.947368
110
0.630859
false
3.506849
true
false
false
B-MOOC/edx-platform
common/djangoapps/auth_exchange/views.py
116
3743
# pylint: disable=abstract-method """ Views to support exchange of authentication credentials. The following are currently implemented: 1. AccessTokenExchangeView: 3rd party (social-auth) OAuth 2.0 access token -> 1st party (open-edx) OAuth 2.0 access token 2. LoginWithAccessTokenView: 1st party (...
agpl-3.0
-3,364,208,810,426,215,000
43.035294
103
0.716538
false
4.282609
false
false
false