repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
ella/django-ratings
django_ratings/templatetags/ratings.py
1
12532
from decimal import Decimal from django import template from django.db import models from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.template.defaultfilters import slugify from django_ratings.models import TotalRate from django_ratings.forms import R...
bsd-3-clause
-4,608,076,433,966,314,500
37.091185
130
0.56647
false
3.661116
false
false
false
dasbruns/netzob
src/netzob/Common/Models/Vocabulary/Session.py
1
13260
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocol...
gpl-3.0
9,043,246,579,454,872,000
41.216561
158
0.551675
false
4.125739
false
false
false
Brother-Simon/AutobahnTestSuite
autobahntestsuite/autobahntestsuite/case/case9_2_1.py
14
2183
############################################################################### ## ## Copyright 2011 Tavendo 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 ## ## ht...
apache-2.0
-4,340,786,548,976,465,000
37.690909
117
0.594137
false
3.926259
false
false
false
syphersec/injectors
python/meterpreter_reverse_https.py
1
2893
# # Python windows/meterpreter/reverse_http stager # (doesn't rely on shellcode) # # By: @harmj0y # import httplib, string, random, struct, ctypes, time # helper for the metasploit http checksum algorithm def checksum8(s): # hard rubyish way -> return sum([struct.unpack('<B', ch)[0] for ch in s]) % 0x100 r...
gpl-3.0
-7,692,136,107,398,896,000
39.760563
104
0.546146
false
4.204942
false
false
false
autonimo/autonimo
autonimo/views/main_view.py
1
5341
#!/usr/bin/env python # -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui from gen.ui_main_view import Ui_MainView from views.component_view import ComponentView from views.task_view import TaskView # from views.component_main_window import ComponentMainWindow # from views.routine_widget import RoutineWidget from ...
gpl-3.0
4,671,854,105,564,582,000
27.715054
100
0.611496
false
3.523087
false
false
false
nearai/program_synthesis
program_synthesis/common/tools/saver.py
1
5673
"""Tools to save/restore model from checkpoints.""" import argparse import sys import os import torch import re import json CHECKPOINT_PATTERN = re.compile('^checkpoint-(\d+)$') class ArgsDict(dict): def __init__(self, **kwargs): super(ArgsDict, self).__init__() for key, value in kwargs.items()...
apache-2.0
1,880,076,072,383,120,600
31.982558
78
0.592279
false
3.737154
false
false
false
magic2du/contact_matrix
topologyTest/GetDDIsHaveOver2InterfacesHave16-20Examples.py
1
2449
import _mysql from dealFile import * #Get of Domains which has more than 2 interfaces have 16-20 examples db=_mysql.connect(host="localhost",user="root",passwd="zxcv4321",db="DDI") #db.query("""select COUNT(*) from PPI inner join example on (ID = PPI_ID) where domain1="ACT" and domain2="ACT" and topology_1 = 6 and topo...
gpl-2.0
-4,267,599,292,644,156,000
44.351852
165
0.668028
false
3.269693
false
false
false
cajone/pychess
lib/pychess/ic/ICGameModel.py
1
15072
from __future__ import print_function import threading from pychess.compat import StringIO from pychess.System.Log import log from pychess.Utils.GameModel import GameModel from pychess.Utils.Offer import Offer from pychess.Utils.const import REMOTE, DRAW, WHITE, BLACK, RUNNING, WHITEWON, KILLED, \ TAKEBACK_OFFER,...
gpl-3.0
-6,825,854,460,330,208,000
39.735135
105
0.558519
false
3.994699
false
false
false
robocomp/robocomp
tools/robocompdsl-gui/customListWidget.py
1
1926
from PySide2.QtWidgets import QListWidget from PySide2.QtCore import Signal, Slot, Qt from PySide2 import QtCore class CustomListWidget(QListWidget): customItemSelection = Signal() def __init__(self, parent=None): super(CustomListWidget, self).__init__(parent) self.itemList = [] self....
gpl-3.0
-5,969,716,672,523,269,000
35.339623
104
0.562305
false
4.133047
false
false
false
manmeetsaini/etools
etools-module/execute.py
1
4452
''' This module will enable/disable debug for ST Voice switches and Voice switches, Phones and any generic machine using MS Windows. _________________________________________________________________________________ |-- startdebug(self,device="switch",argv) | argv option...
gpl-3.0
2,025,106,535,800,736,800
32.246154
160
0.431941
false
4.746269
false
false
false
sniemi/SamPy
statistics/bayesian/examples.py
1
5785
import pymc def pymc_linear_fit_withoutliers(data1, data2, data1err=None, data2err=None, print_results=False, intercept=True, nsample=50000, burn=5000, thin=5, return_MC=False, guess=None, verbose=0): """ Use pymc to fit a line to data with outl...
bsd-2-clause
-7,291,049,673,270,601,000
37.317881
116
0.557303
false
3.303826
false
false
false
j0r1/simpactcyan
src/tests/config/rundisttests.py
1
2994
#!/usr/bin/env python import os import sys sys.path.append(os.path.realpath(os.path.join(os.path.realpath(__file__),"../../../../util"))) import histogram import subprocess settings = [ { "type": "fixed", "params": [ ("value", 0.5) ], "plotrange": (-1, 1), "f": "samples=100000;...
gpl-3.0
5,577,433,038,708,251,000
27.788462
159
0.462592
false
2.692446
false
false
false
kyokley/MediaConverter
path.py
1
4835
import requests import os from settings import (SERVER_NAME, MEDIAVIEWER_TV_PATH_URL, MEDIAVIEWER_MOVIE_PATH_URL, WAITER_USERNAME, WAITER_PASSWORD, LOCAL_TV_SHOWS_PATHS, LOCAL_MOVIE_PATHS,...
mit
-5,957,461,500,576,863,000
31.449664
113
0.53878
false
4.448022
false
false
false
openqt/algorithms
projecteuler/pe434-rigid-graphs.py
1
1605
#!/usr/bin/env python # coding=utf-8 """434. Rigid graphs https://projecteuler.net/problem=434 Recall that a graph is a collection of vertices and edges connecting the vertices, and that two vertices connected by an edge are called adjacent. Graphs can be embedded in Euclidean space by associating each vertex with ...
gpl-3.0
7,233,314,266,194,622,000
43.388889
77
0.761577
false
3.535398
false
false
false
sideshownick/Snaking_Networks
Illogic/run_solve.py
1
1827
from pylab import * from scipy import sparse from scipy.integrate import odeint import os, time from osc_eqn import osc2 from my_parameters import * detune=0.001 alpha0=3.08 alpha1=1e-3*random(Nosc)+alpha0 alpha1=1.0/(alpha1) length1=length*stepsize+1 tlength=translength*stepsize+1 S1=zeros((Nosc,Nosc)) S1[0,5]=S1[...
gpl-2.0
2,475,075,068,369,918,500
21.280488
100
0.648057
false
2.211864
false
false
false
psylo8/midivol
midivol_win.py
1
7621
import sys import time from subprocess import call import pygame.midi class NircmdMixer(): """ Set system volume, val =[0, 65535] """ def __init__(self): self.current_volume = 0 def volume_to_int(self, volume): """ Convert 0-100 volume value to [0, 65535] range """ result = 0 try: result = int(...
gpl-3.0
174,499,710,867,700,300
30.237705
109
0.566855
false
3.723009
false
false
false
arunchaganty/contextual-comparatives
bin/summarize_evaluation.py
1
1664
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ """ from __future__ import division import csv import sys from collections import Counter def do_command(args): reader = csv.reader(args.input, delimiter="\t") writer = csv.writer(args.output, delimiter="\t") header = next(reader) assert header == "...
mit
-4,559,597,711,908,071,400
37.697674
172
0.676082
false
3.681416
false
false
false
pkimber/compose
compose/migrations/0018_auto_20170418_1445.py
1
5784
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-18 13:45 from __future__ import unicode_literals import block.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migratio...
apache-2.0
-700,877,570,277,012,400
42.164179
153
0.56639
false
4.326103
false
false
false
Juanlu001/poliastro
tests/test_frames.py
1
7645
import numpy as np import pytest from astropy import units as u from astropy.coordinates import ( CartesianRepresentation, get_body_barycentric, solar_system_ephemeris, ) from astropy.tests.helper import assert_quantity_allclose from astropy.time import Time from poliastro.bodies import ( Earth, Ju...
mit
-3,125,264,317,094,795,300
30.204082
88
0.628646
false
2.960883
true
false
false
aucor/servo
servo/models/device.py
1
2057
#coding=utf-8 from django.db import models from django.dispatch import receiver from django.utils.translation import ugettext as _ from django.db.models.signals import pre_save, post_save import gsx from servo.models.common import Tag, Attachment class Device(models.Model): sn = models.CharField(max_length=32, bl...
bsd-2-clause
1,277,555,999,983,982,600
33.216667
79
0.622017
false
3.739526
false
false
false
ekumenlabs/terminus
terminus/builders/simple_city_builder.py
1
7417
""" Copyright (C) 2017 Open Source Robotics 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...
apache-2.0
3,878,573,317,858,789,000
40.668539
119
0.55184
false
3.859001
false
false
false
nhho/hko
hko/weather_warning.py
2
1053
"""A module to retrieve weather warning data from Hong Kong Observatory""" import json import requests BASE_URL = 'http://www.weather.gov.hk/' URL_UC = 'wxinfo/json/warnsumc.xml' URL_EN = 'wxinfo/json/warnsum.xml' def weather_warning(lang='UC'): """A function to retrieve weather warning data from Hong Kong O...
mit
-331,712,446,974,401,000
28.25
99
0.554606
false
3.871324
false
false
false
twilio/twilio-python
twilio/rest/autopilot/v1/assistant/webhook.py
2
17306
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
mit
3,099,753,894,173,314,600
35.510549
103
0.62747
false
4.336257
false
false
false
coldfusion39/domi-owned
domi_owned/utilities.py
1
4849
# Copyright (c) 2017, Brandan Geise [coldfusion] # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, ...
mit
-4,950,852,801,846,686,000
32.673611
133
0.621984
false
3.036318
false
false
false
ZuluPro/moto
moto/ec2/responses/vpc_peering_connections.py
4
5068
from __future__ import unicode_literals from moto.core.responses import BaseResponse class VPCPeeringConnections(BaseResponse): def create_vpc_peering_connection(self): vpc = self.ec2_backend.get_vpc(self._get_param('VpcId')) peer_vpc = self.ec2_backend.get_vpc(self._get_param('PeerVpcId')) ...
apache-2.0
-1,107,759,523,004,262,400
37.687023
88
0.681926
false
3.149782
false
false
false
schocco/mds-web
apps/muni_scales/mscale.py
1
5171
# -*- coding: utf-8 -*- from django.utils.encoding import force_unicode from django.utils.translation import ugettext_lazy as _ class Mscale(object): """ M scale, describing the difficultiy of a single muni trail section. """ levels = (0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0) def __...
mit
-7,137,288,401,920,602,000
38.730769
102
0.500871
false
3.707825
false
false
false
Lukasa/pycohttpparser
src/pycohttpparser/api.py
1
6580
# -*- coding: utf-8 -*- """ pycohttpparser/api ~~~~~~~~~~~~~~~~~~ Defines the public API to pycohttpparser. """ from collections import namedtuple from ._pycohttpparser import lib, ffi Request = namedtuple( 'Request', ['method', 'path', 'minor_version', 'headers', 'consumed'] ) Response = namedtuple( 'Respo...
mit
-4,779,798,032,722,320,000
32.74359
78
0.587082
false
4.086957
false
false
false
kajala/citizenmatch-backend
users/migrations/0001_initial.py
1
2727
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-28 20:35 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True depen...
mit
-8,973,948,334,469,795,000
45.220339
180
0.585992
false
4.082335
false
false
false
wndhydrnt/airflow
tests/ti_deps/deps/test_valid_state_dep.py
15
1835
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
-8,289,935,792,905,820,000
34.980392
69
0.700817
false
3.963283
true
false
false
BUPT-OJ-V4/BOJ-V4
problem/forms.py
1
1986
#encoding: utf-8 from django import forms from django_select2.forms import ModelSelect2MultipleWidget # from django.contrib.auth.models import Group from .models import Problem, ProblemTag from ojuser.models import GroupProfile class ProblemForm(forms.ModelForm): is_spj = forms.NullBooleanField(widget=forms.Che...
mit
3,346,247,374,446,407,700
36.461538
95
0.50308
false
4.87
false
false
false
cgcgbcbc/django-xadmin
xadmin/plugins/chart.py
17
5683
import datetime import decimal import calendar from django.template import loader from django.http import HttpResponseNotFound from django.core.serializers.json import DjangoJSONEncoder from django.http import HttpResponse from django.utils.encoding import smart_unicode from django.db import models from django.utils....
bsd-3-clause
-6,073,751,838,963,960,000
34.742138
136
0.604082
false
3.801338
false
false
false
Henrique1792/Trab1_EngSeg
threefish.py
1
6409
#Funções de bitwise: #Como tivemos problemas de tipagem, utilizamos um tipo próprio para a criptografia #No caso, um array de 1s e 0s representando bits. #E, claro, tivemos que criar operadores pra agir sobre esse novo "tipo". def xor( a, b ): result = [0] * 8 for i in range( 7, -1, -1 ): result[i] = a...
gpl-3.0
1,621,412,275,519,312,100
32.387435
166
0.488317
false
2.660409
false
false
false
brkrishna/freelance
getpopulrrewards_com/parser.py
1
9007
# -- coding: utf-8 -- #------------------------------------------------------------------------------- # Name: parser # Purpose: # # Author: Ramakrishna # # Created: 08/09/2015 # Copyright: (c) Ramakrishna 2015 # Licence: <your licence> #------------------------------------------------------------...
gpl-2.0
3,739,803,283,532,826,000
40.316514
132
0.375597
false
5.239674
false
false
false
chrigl/docker-library
plone-chrigl-debian/src/collective.geo.file/collective/geo/file/setuphandlers.py
1
2357
import logging from zope.interface import alsoProvides from Products.CMFPlone.utils import getToolByName from Products.MimetypesRegistry.MimeTypeItem import MimeTypeItem from collective.geo.file.interfaces import IGisFile # The profile id of your package: PROFILE_ID = 'profile-collective.geo.file:default' gis_mimetype...
apache-2.0
6,949,837,277,970,015,000
33.661765
71
0.660585
false
3.659938
false
false
false
meawoppl/babyfood
babyfood/components/SMAResistor.py
1
1557
# From https://www.digikey.com/Web%20Export/Supplier%20Content/Vishay_8026/PDF/VishayBeyschlag_SolderPad.pdf?redirected=1 from babyfood.pcb.PCBUnits import mil from babyfood.features.basic import CenteredRectangle, FilledCenteredRectangle from babyfood.components.ABC import AbstractSMAComponent resistorsParams = { ...
bsd-2-clause
642,509,527,637,811,000
32.12766
121
0.574181
false
2.91573
false
false
false
cathyyul/sumo
tools/output/analyze_teleports.py
2
2656
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @file analyze_teleports.py @author Jakob Erdmann @date 2012-11-20 @version $Id: analyze_teleports.py 14425 2013-08-16 20:11:47Z behrisch $ Extract statistics from the warning outputs of a simulation run for plotting. SUMO, Simulation of Urban MObility; see http...
gpl-3.0
5,773,483,690,804,837,000
34.891892
118
0.617846
false
3.704324
false
false
false
trevor/calendarserver
txdav/caldav/datastore/scheduling/addressmapping.py
1
3402
## # Copyright (c) 2005-2014 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
3,453,919,102,478,652,000
33.714286
114
0.71017
false
4.123636
false
false
false
RachelJMorris/Text-to-Speech-projects
HowToUseEspeak/main.py
3
1040
# Run with Python 3 # install python3-espeak # /usr/lib/python3/dist-packages/espeak/espeak.py from espeak import espeak import sys done = False while ( done == False ): print() print( "1. Display voices" ) print( "2. Speak text" ) print( "3. View espeak functions" ) choice = int( input( "What do you want to ...
mit
-700,674,754,371,552,100
21.12766
55
0.597115
false
2.773333
false
false
false
kevinmel2000/sl4a
python/src/Lib/test/test_undocumented_details.py
56
1137
from test.test_support import run_unittest, have_unicode import unittest import sys class TestImplementationComparisons(unittest.TestCase): def test_type_comparisons(self): self.assertTrue(str < int or str > int) self.assertTrue(int <= str or int >= str) self.assertTrue(cmp(int, str) != 0)...
apache-2.0
-8,986,443,526,133,241,000
28.153846
56
0.559367
false
3.632588
true
false
false
frc1418/2014
driver_station/src/ui/widgets/toggle_button.py
1
2782
# # This file is part of KwarqsDashboard. # # KwarqsDashboard 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 3. # # KwarqsDashboard is distributed in the hope that it will be useful, # but...
bsd-3-clause
515,769,753,873,767,230
33.775
103
0.614666
false
4.221548
false
false
false
followcat/predator
plugins/server/run.py
1
4418
# -*- coding: utf-8 -*- import bs4 import time import flask import flask_restful from flask_restful import Resource, reqparse import tools.image class LiepinPluginSyncObject(object): committer = 'PLUGIN' def __init__(self, url, htmlsource, base64email, base64phone): self.url = url self.htm...
lgpl-3.0
8,573,186,696,191,516,000
33.186047
86
0.570748
false
3.605887
false
false
false
JaakkoAhola/DESIGN
LES2emu.py
1
35416
# Functions extracting emulator and any other data from LES output NetCDF files, # and collection of functions for generating LES inputs. # # Tomi Raatikanen 18.1.2019 # # Functions # ========= # Use Python import to make these functions available, e.g. from LES2emu import GetEmuVars, get_netcdf_variable # # a...
gpl-3.0
-796,236,915,224,271,000
29.041192
152
0.632624
false
2.454842
false
false
false
ssutee/metageta
metageta/formats/aster.py
2
11439
# -*- coding: utf-8 -*- # Copyright (c) 2013 Australian Government, Department of the Environment # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without...
mit
-5,271,356,719,638,829,000
43.756
155
0.587551
false
3.344737
false
false
false
vdloo/raptiformica
tests/unit/raptiformica/distributed/members/test_try_get_members_list.py
1
1267
from raptiformica.distributed.members import try_get_members_list from tests.testcase import TestCase class TestTryGetMembersList(TestCase): def setUp(self): self.try_machine_command = self.set_up_patch('raptiformica.distributed.members.try_machine_command') self.try_machine_command.return_value =...
mit
7,409,344,987,150,709,000
41.233333
108
0.620363
false
3.693878
true
false
false
PearsonIOKI/compose-forum
askbot/deps/group_messaging/models.py
8
15440
"""models for the ``group_messaging`` app """ import copy import datetime import urllib from askbot.mail import send_mail #todo: remove dependency? from django.template.loader import get_template from django.db import models from django.db.models import signals from django.conf import settings as django_settings from d...
gpl-3.0
-6,098,108,620,845,167,000
34.251142
88
0.608549
false
4.15277
false
false
false
tzutalin/labelImg
libs/yolo_io.py
1
4998
#!/usr/bin/env python # -*- coding: utf8 -*- import sys import os from xml.etree import ElementTree from xml.etree.ElementTree import Element, SubElement from lxml import etree import codecs from libs.constants import DEFAULT_ENCODING TXT_EXT = '.txt' ENCODE_METHOD = DEFAULT_ENCODING class YOLOWriter: def __init...
mit
1,057,282,036,230,914,300
33.232877
110
0.566026
false
3.040146
false
false
false
tongxindao/Flask-micblog
Flask-MicroBlog/web/micblog/app/__init__.py
1
1602
# coding: utf-8 import os from flask_login import LoginManager from flask_openid import OpenID from config import basedir, ADMINS, MAIL_SERVER, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_mail import Mail from momentjs import momentjs from flask...
apache-2.0
6,041,693,416,205,161,000
25.949153
119
0.709434
false
3.449024
false
false
false
veroc/Bika-LIMS
bika/lims/tests/test_hiddenanalyses.py
2
17336
from bika.lims.content.analysis import Analysis from bika.lims.testing import BIKA_FUNCTIONAL_TESTING from bika.lims.tests.base import BikaFunctionalTestCase from bika.lims.utils.analysisrequest import create_analysisrequest from bika.lims.workflow import doActionFor from plone.app.testing import login, logout from plo...
agpl-3.0
6,423,463,675,719,172,000
45.602151
92
0.65338
false
4.186428
true
false
false
hagai26/fabtools
fabtools/nodejs.py
1
5616
""" Node.js ======= This module provides tools for installing `Node.js`_ and managing packages using `npm`_. .. note: the ``simplejson`` module is required on Python 2.5 .. _Node.js: http://nodejs.org/ .. _npm: http://npmjs.org/ """ try: import json except ImportError: import simplejson as json from fabri...
bsd-2-clause
8,728,828,897,423,888,000
24.071429
87
0.585292
false
3.862448
false
false
false
plumgrid/plumgrid-nova
nova/db/sqlalchemy/migrate_repo/versions/147_no_service_zones.py
10
4133
# 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 ...
apache-2.0
-5,195,159,218,413,275,000
39.126214
79
0.598355
false
4.260825
false
false
false
smunaut/gnuradio
gr-analog/python/analog/qa_probe_avg_mag_sqrd.py
57
3007
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
2,704,701,076,577,412,000
29.683673
76
0.602261
false
2.855651
true
false
false
unicefuganda/mics
survey/views/users.py
1
4896
import json from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.contrib import messages from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required, permission_required from survey.investigator_configs import * from surve...
bsd-3-clause
8,590,943,829,444,842,000
41.206897
102
0.647467
false
3.885714
false
false
false
daVinci1980/antebuild
internals/utils.py
1
1110
import inspect import os import runpy import specs # ------------------------------------------------------------------------------------------------- def fixpath(_path, _opts): return os.path.normpath(os.path.join(_opts.pathPrefix, _path)) # ----------------------------------------------------------------------...
bsd-3-clause
4,108,960,350,575,440,400
29
99
0.474775
false
4.663866
false
false
false
codedcolors/pygrow
grow/pods/controllers/tags/builtins.py
1
5453
from datetime import datetime from grow.common import utils from grow.pods import locales as locales_lib from grow.pods.collectionz import collectionz import collections import csv as csv_lib import itertools import jinja2 import json as json_lib import markdown import re @utils.memoize_tag def categories(collection=...
mit
6,887,888,150,770,782,000
24.721698
78
0.686411
false
3.325
false
false
false
Williams224/davinci-scripts
LambdabNTupleMaker.py
1
5745
from Gaudi.Configuration import * from Configurables import DaVinci #from Configurables import AlgTool from Configurables import GaudiSequencer MySequencer = GaudiSequencer('Sequence') DaVinci.DDDBtag='dddb-20120831' DaVinci.CondDBtag='sim-20121025-vc-md100' simulation=True #only for mdst #from Configurables import ...
mit
-9,160,977,961,897,626,000
32.596491
132
0.694865
false
3.186356
true
false
false
MediaKraken/MediaKraken_Deployment
source/common/common_serial.py
1
2296
""" Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com> 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 Foundation. This program is distributed in the hope that it will be useful...
gpl-3.0
-3,219,449,462,611,585,500
31.275362
69
0.574042
false
4.510806
false
false
false
rajendrauppal/coding-interview
programming_languages/Python/iterator.py
1
2933
# for loop for iterating a list print("iterate a list") for i in [1, 2, 3, 4]: print(i) # for loop for iterating a string print("iterate a string") for c in "iteratable": print(c) # for loop for iterating a dictionary print("iterate a dictionary") for k in {"a": 1, "b": 2}: print(k) # fo...
mit
8,716,354,372,421,319,000
21.845528
72
0.568019
false
3.479241
false
false
false
daohu527/leetcode_learning
676. Implement Magic Dictionary/code.py
1
1299
class MagicDictionary(object): def __init__(self): """ Initialize your data structure here. """ self.table = {} def buildDict(self, dict): """ Build a dictionary through a list of words :type dict: List[str] :rtype: void """ for v ...
gpl-3.0
4,621,180,226,200,586,000
24.490196
116
0.468822
false
4.245098
false
false
false
arasuarun/shogun
examples/undocumented/python_modular/graphical/regression_gaussian_process_modelselection.py
26
2694
#!/usr/bin/env python from numpy import * from pylab import plot, show, legend, fill_between, figure, subplot, title def regression_gaussian_process_modelselection (n=100, n_test=100, \ x_range=5, x_range_test=10, noise_var=0.4): from modshogun import RealFeatures, RegressionLabels from modshogun import Gaussian...
gpl-3.0
560,818,344,550,251,460
27.967742
79
0.726429
false
3.092997
true
false
false
sandiegodata/age-friendly-communities
users/rashmi/income_stats.py
1
8149
#! /usr/bin/env python ################################################################################ # # income_stats.py # # Script to extract income information specific to individuals 55 and older from # the ACS archive containing it and to output the same on a per SRA and zipcode # basis for the SD cou...
mit
8,053,278,188,660,006,000
25.345638
82
0.642287
false
3.029368
false
false
false
Virginian/WES-entropy-client
src-python/WesEntropy/Engine/engine.py
1
5656
# Copyright 2014-2015 Whitewood Encryption Systems, 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 l...
apache-2.0
2,504,217,206,947,107,000
35.727273
79
0.579385
false
4.080808
false
false
false
ConorIA/wire-desktop
bin/win-hockey.py
1
2241
#!/usr/bin/env python # coding: utf-8 # # Wire # Copyright (C) 2017 Wire Swiss GmbH # # 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 ...
gpl-3.0
-7,979,401,355,987,615,000
28.88
115
0.686301
false
3.091034
false
false
false
danielhrisca/asammdf
asammdf/gui/ui/attachment.py
1
1984
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'attachment.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Attachment(object): def setupUi(self, Attachment): ...
lgpl-3.0
7,336,654,808,283,836,000
42.088889
90
0.68246
false
4.266667
false
false
false
danielhollas/AmaraUpload
download_subs.py
1
4471
#!/usr/bin/env python3 import argparse, sys, os, requests from subprocess import Popen, PIPE from pprint import pprint from api.amara_api import Amara from utils import answer_me, download_yt_subtitles from time import sleep def read_cmd(): """Function for reading command line options.""" desc = "Program for dow...
mit
8,237,329,518,348,567,000
35.647541
151
0.615075
false
3.428681
false
false
false
northern-bites/nao-man
noggin/players/BrunswickStates.py
1
5661
from ..playbook.PBConstants import (GOALIE, CHASER) import man.motion.SweetMoves as SweetMoves ### # Reimplementation of Game Controller States for pBrunswick ### def gameInitial(player): """ Ensure we are sitting down and head is snapped forward. In the future, we may wish to make the head move a bit slow...
gpl-3.0
-1,766,548,898,769,186,300
29.766304
81
0.661367
false
3.683149
false
false
false
zouzhberk/ambaridemo
demo-server/src/main/resources/scripts/relocate_host_components.py
1
16871
#!/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 "License")...
apache-2.0
7,550,866,551,426,205,000
33.501022
127
0.645249
false
3.966847
false
false
false
fablab-bayreuth/fablight
Fablight-Gui/hcl_picker.py
1
6705
from numpy import * from colorsys import * import Tkinter as tk import ttk import PIL.Image, PIL.ImageTk ir = lambda x: int(round(x)) #----------------------------------------------------------------------------------------- # H(CL) picker class H_CL_Picker: hue_panel_size = 256, 256 r0, r1 = 0.4*hue_panel...
mit
7,908,502,349,392,331,000
36.881356
130
0.489933
false
2.936925
false
false
false
aligot-project/aligot
aligot/settings.py
2
2431
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'ldxl71%#nruwupjnjy&=&9hjyg2o--gavcs...
mit
-2,162,574,461,606,079,000
22.833333
75
0.684903
false
3.263087
false
false
false
frePPLe/frePPLe
freppledb/input/commands/export.py
1
54190
# # Copyright (C) 2020 by frePPLe bv # # This library 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 later version. # # This library is distri...
agpl-3.0
6,350,968,062,602,810,000
35.393553
130
0.482285
false
4.712584
false
false
false
lukasschwab/code-golf
randomness-test.py
1
1094
# I want to test the randomness of a random number generator. # How does randomness increase as you nest pseudorandom number generators? # I thought no, but wanted to confirm for myself. # E.g. Randomly selecting from a randomly shuffled list would be two degrees. # Why use compression? Check this out: https://csclub.u...
mit
-2,690,453,327,420,816,000
29.388889
115
0.749543
false
3.683502
false
false
false
elricgit/django-social-launch
django_social_launch/tests/test_urls.py
1
7742
#Django imports from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.contrib.sessions.backends.db import SessionStore #App imports from .. import user_successfully_created_msg, referrer_url_session_key, referring_user_id_session_key from ...
bsd-3-clause
-8,356,192,776,099,714,000
34.513761
134
0.731465
false
3.212448
true
false
false
ajw107/script.xbmc.lcdproc
resources/lib/charset_hd44780.py
1
2826
''' XBMC LCDproc addon Copyright (C) 2012 Team XBMC 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....
gpl-2.0
-5,305,902,910,726,653,000
35.701299
75
0.703822
false
3.844898
false
false
false
kingjr/jr-tools
jr/gat/transformers.py
1
14857
import numpy as np from sklearn.base import TransformerMixin, BaseEstimator, clone from sklearn.linear_model import LogisticRegression from mne.parallel import parallel_func from nose.tools import assert_true class _BaseEstimator(BaseEstimator, TransformerMixin): def fit(self, X, y=None): return self ...
bsd-2-clause
-8,381,013,809,890,856,000
29.823651
79
0.558053
false
3.511463
false
false
false
Fizzadar/pyinfra
pyinfra/operations/util/service.py
1
2358
def handle_service_control( host, name, fact_cls, formatter, running, restarted, reloaded, command, status_argument='status', ): statuses = host.get_fact(fact_cls) status = statuses.get(name, None) # If we don't know the status, we need to check if it's up before starting # and/or restartin...
mit
-6,873,257,825,784,884,000
31.75
83
0.529686
false
4.782961
false
false
false
derekjchow/models
research/object_detection/models/feature_map_generators.py
1
25937
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-2,083,562,005,663,669,000
43.488851
80
0.635309
false
4.039402
true
false
false
anttisalonen/freekick
src/freekick/gui/round_robin.py
1
1369
#!/usr/bin/python import sys def round_robin(ls): clubs = list(ls) num_clubs = len(clubs) # add dummy club if necessary if num_clubs % 2 == 1: have_dummy = True clubs.append(0) num_clubs += 1 else: have_dummy = False # take last club as base baseclub = club...
agpl-3.0
-9,599,687,282,898,360
20.390625
58
0.535427
false
3.221176
false
false
false
salomax/Open-Marketplace
app/customer/models.py
3
6096
#!/usr/bin/env python # coding: utf-8 # # Copyright 2016, Marcos Salomão. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
3,363,991,501,939,403,300
24.383333
80
0.673342
false
3.958415
false
false
false
nabin-info/hackerrank.com
points-on-rectangle.py
1
1308
#!/usr/bin/python import sys def corners(pts): #x0,xN,y0,yN = [ pts[0][0], pts[0][0], pts[0][1], pts[0][1] ] ## determine our bounds x0 = pts[0][0] y0 = pts[0][1] xN = pts[0][0] yN = pts[0][1] for pt in pts: if pt[0] < x0: x0 = pt[0] if pt[1] < y0: y0 = pt[1] if pt[...
mit
4,406,431,563,262,053,400
22.781818
65
0.419725
false
2.554688
false
false
false
aipescience/queryparser
src/queryparser/testing/__init__.py
1
2934
# -*- coding: utf-8 -*- import pytest from queryparser.adql import ADQLQueryTranslator from queryparser.mysql import MySQLQueryProcessor from queryparser.postgresql import PostgreSQLQueryProcessor from queryparser.exceptions import QueryError, QuerySyntaxError def _test_parsing(query_processor, test, translate=Fals...
apache-2.0
5,287,945,565,792,071,000
31.6
75
0.620314
false
3.771208
true
false
false
ivukotic/ML_platform_tests
PerfSONAR/AD_nn.py
1
8494
#!/usr/bin/env python3 from elasticsearch import Elasticsearch, exceptions as es_exceptions from elasticsearch.helpers import scan from time import time import numpy as np import pandas as pd # import tensorflow as tf - should do it by itself from sklearn.model_selection import train_test_split from sklearn.utils i...
gpl-3.0
5,875,079,378,249,073,000
32.440945
130
0.541912
false
3.496912
true
false
false
magdamagda/geny-chorobowe
geny_chorobowe/find_disease_genes/clinvar.py
1
3242
from urllib2 import urlopen from datetime import datetime from django.db import transaction from models import * import logging logger = logging.getLogger(__name__) sourcePath = "ftp://ftp.ncbi.nlm.nih.gov/pub/clinvar/gene_condition_source_id" def updateDiseasesList(): #na poczatek wywalic wszystkie choroby z bazy ...
gpl-2.0
-3,142,552,447,835,035,600
28.481818
148
0.710056
false
2.677126
false
false
false
mlundblad/telepathy-gabble
tests/twisted/search/ceci-nest-pas-un-serveur.py
4
6299
""" Tests requesting search channels to, and performing contact searches against, fake servers which are broken in various ways. """ import dbus from twisted.words.protocols.jabber.client import IQ from twisted.words.xish import domish from gabbletest import exec_test, send_error_reply, make_result_iq from servicete...
lgpl-2.1
-4,594,219,973,480,346,600
31.469072
84
0.662962
false
3.29618
true
false
false
adam-rabinowitz/ngs_python
scripts/RNASeq_Pipeline_EMBL/EMBL_RNASeq_Functions.py
2
16201
import collections import itertools import os import re def parseModuleFile(modulefile): ''' Function to parse module file. Args: modulefile (str)- Path to tab-delimited file containing module data. The first and second columns are required and are the program and the progr...
gpl-2.0
-6,755,296,205,247,052,000
34.373362
79
0.596877
false
3.905738
false
false
false
jeffjet24/CatChores
alexa/lambda/CatChoreSkill.py
1
11110
from operator import itemgetter import boto3 import json from datetime import tzinfo, timedelta, datetime snsClient = boto3.client('sns') lambdaClient = boto3.client('lambda') catEventSNS = "arn:aws:sns:us-east-1:818316582971:CatEvent" catGetPerformedLambda = "arn:aws:lambda:us-east-1:818316582971:function:CatGetPerfo...
gpl-3.0
1,798,919,851,824,090,600
37.047945
138
0.607381
false
3.885974
false
false
false
argolab/herzog
base/event.py
1
1217
class Precondition(Exception): def __init__(self, name, **kwargs) : self.name = name self.kwargs = kwargs def __str__(self): return 'Precondition(%s)' % self.name class EventServer : def __init__(self): self._pool = {} self._desc = {} def register(sel...
gpl-2.0
236,320,206,687,170,600
25.456522
50
0.509449
false
4.255245
false
false
false
596acres/django-livinglots-mailings
livinglots_mailings/mailers.py
1
8385
from datetime import datetime, timedelta from itertools import groupby import logging from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.core.mail.message import EmailMultiAlternatives from django.template.loader import r...
agpl-3.0
-2,082,258,457,765,415,200
34.987124
100
0.623494
false
4.333333
false
false
false
alphagov/notifications-api
migrations/versions/0095_migrate_existing_svc_perms.py
1
1614
"""empty message Revision ID: 0095_migrate_existing_svc_perms Revises: 0094_job_stats_update Create Date: 2017-05-23 18:13:03.532095 """ # revision identifiers, used by Alembic. revision = '0095_migrate_existing_svc_perms' down_revision = '0094_job_stats_update' from alembic import op import sqlalchemy as sa migra...
mit
-231,256,906,441,808,160
40.384615
117
0.685874
false
3.635135
false
false
false
ntamas/python-selecta
selecta/matches.py
1
2701
from functools import total_ordering @total_ordering class Match(object): """Object representing a match in a search index. Attributes: matched_object (object): the object that was matched matched_string (string): the string representation of the object score (float): the score of the...
mit
9,098,674,901,230,635,000
32.7625
78
0.613847
false
4.43514
false
false
false
romanvm/romans_blog
romans_blog/settings/base.py
1
8236
# coding: utf-8 """ Django settings for romans_blog project. Generated by 'django-admin startproject' using Django 1.8.6. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/setting...
gpl-3.0
5,356,922,818,080,607,000
32.546939
115
0.633654
false
3.316788
false
false
false
ULHPC/easybuild-framework
easybuild/framework/easyconfig/parser.py
3
9516
# # # Copyright 2013-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (...
gpl-2.0
3,530,974,173,393,378,000
40.373913
121
0.650378
false
4.025381
true
false
false
philoliver/minisat-problem-generators
k_color.py
1
1281
#!/usr/bin/env python import argparse from k_color_minisat_problem import KColorProblem def make_args_parser(): parser = argparse.ArgumentParser( description='Generates or interpretes the k-color problem for the MiniSat solver', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--fi...
gpl-2.0
-2,309,434,677,390,948,400
27.488889
174
0.679938
false
3.670487
false
false
false
stellar/docker-stellar-core
utils/core_file_processor.py
2
6559
#!/usr/bin/env python import logging import sys import ConfigParser import os import socket import time import subprocess from string import Template import textwrap import boto.ses def format_time(epoch_time): time_format = "%Y-%m-%dT%H:%M:%S" return time.strftime(time_format, time.gmtime(epoch_time)) cla...
apache-2.0
-9,167,132,196,704,341,000
32.984456
94
0.567465
false
3.835673
true
false
false
sloww/cntslinkgit
app_printer/migrations/0009_auto_20150531_1655.py
1
4323
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_markdown.models class Migration(migrations.Migration): dependencies = [ ('app_printer', '0008_auto_20150531_1624'), ] operations = [ migrations.CreateModel( ...
gpl-2.0
-4,347,683,951,444,904,000
30.786765
146
0.517927
false
4.517241
false
false
false
jmschrei/discern
analysis/cld.py
1
1089
# discern # Contact: Jacob Schreiber (jmschr@cs.washington.edu) from cancer_analyses import * import pandas as pd import argparse import sys def parse_command_line(): ''' Parse the command line and return the parser. ''' parser = argparse.ArgumentParser( description="Read in Data" ) parser.add_argument( '-n', ...
mit
-6,341,495,483,213,560,000
24.952381
85
0.694215
false
3.008287
false
false
false
arpho/mmasgis5
mmasgis/mysql_sqlalchemy_class.py
1
4833
#!/usr/bin/python # -*- coding: latin-1 - from sqlalchemy import Column, Integer, Unicode,Unicode, ForeignKey, DateTime,Float,Boolean from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import backref, mapper, relation, sessionmaker echo=False #def __init__...
mit
-1,064,273,608,022,488,800
26.305085
108
0.725222
false
2.479733
true
false
false
ruibarreira/linuxtrail
usr/lib/python3/dist-packages/orca/scripts/apps/gnome-documents/script_utilities.py
4
1531
# Orca # # Copyright (C) 2013 The Orca Team. # # Author: Joanmarie Diggs <jdiggs@igalia.com> # # 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 Foundation; either # version 2.1 of the License, or (at ...
gpl-3.0
4,387,624,754,159,167,000
30.895833
68
0.700196
false
3.653938
false
false
false
BurntSushi/nflfan
nflfan/provider.py
1
24616
from __future__ import absolute_import, division, print_function from collections import namedtuple import json import os import re import sys import time import requests from bs4 import BeautifulSoup import nfldb import nflfan.config __pdoc__ = {} _user_agent = 'Mozilla/5.0 (X11; Linux x86_64)' # _user_agent = ...
unlicense
1,224,262,221,576,702,000
33.188889
121
0.56252
false
3.717306
false
false
false
dallingham/regenerate
regenerate/writers/asm_equ.py
1
2211
# # Manage registers in a hardware design # # Copyright (C) 2008 Donald N. Allingham # # 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...
gpl-2.0
-8,399,737,680,129,126,000
33.015385
84
0.6237
false
3.962366
false
false
false
publicscience/brain
app/models.py
1
2321
import datetime from app import db class Tweet(db.Document): created_at = db.DateTimeField(default=datetime.datetime.now, required=True) tid = db.IntField(required=True, unique=True) body = db.StringField(required=True, unique=True) username = db.StringField(required=True, max_length=50) meta = { ...
mit
7,952,930,502,741,536,000
28.379747
79
0.637656
false
3.767857
false
false
false
kerneltask/micropython
tests/misc/sys_settrace_features.py
7
2491
import sys try: sys.settrace except AttributeError: print("SKIP") raise SystemExit def print_stacktrace(frame, level=0): # Ignore CPython specific helpers. if frame.f_globals["__name__"].find("importlib") != -1: print_stacktrace(frame.f_back, level) return print( "%2d...
mit
3,555,715,638,384,300,500
22.064815
80
0.596146
false
3.558571
false
false
false