repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
embray/numpy
numpy/core/function_base.py
1
6203
from __future__ import division, absolute_import, print_function __all__ = ['logspace', 'linspace'] from . import numeric as _nx from .numeric import array, result_type def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None): """ Return evenly spaced numbers over a specified interval. ...
bsd-3-clause
2,456,239,778,640,963,600
32.349462
79
0.579075
false
3.506501
false
false
false
Bathlamos/Project-Euler-Solutions
solutions/p500.py
1
1313
# # Solution to Project Euler problem 500 # Philippe Legault # # https://github.com/Bathlamos/Project-Euler-Solutions from lib import primes_up_to from fractions import Fraction import heapq import sys # The totient function gives us the number of divisors # If n is the smallest number with 2^500500 divisors # an...
mit
6,644,714,128,898,769,000
24.269231
65
0.676314
false
2.89207
false
false
false
PragmaticMates/django-clever-selects
setup.py
1
1314
#!/usr/bin/env python from setuptools import setup setup( name='django-clever-selects', version='0.8.2', description='Chained select box widget for Django framework using AJAX requests.', long_description=open('README.rst').read(), author='Pragmatic Mates', author_email='info@pragmaticmates.co...
mit
6,410,312,218,537,401,000
33.578947
86
0.626332
false
4.055556
false
false
false
alexei-matveev/ccp1gui
viewer/vtkgraph.py
1
159557
# # This file is part of the CCP1 Graphical User Interface (ccp1gui) # # (C) 2002-2005 CCLRC Daresbury Laboratory # # 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 ...
gpl-2.0
-3,450,154,984,053,313,500
34.871628
150
0.543436
false
3.906498
false
false
false
kusha/voiceid
setup.py
1
3941
# -*- coding: utf-8 -*- from distutils.core import setup f = open('README', 'r') long_desc = f.read() f.close() import sys import os import os.path import subprocess which = 'which' if sys.platform == 'win32': which = 'where' basedir = os.path.dirname(os.path.join(os.getcwd(), sys.argv[0])) def my_check_ou...
gpl-3.0
-2,090,894,788,496,591,400
36.533333
250
0.605176
false
3.466139
false
false
false
the-useless-one/ludo_parse
parser.py
1
1421
#!/usr/bin/env python3 import re import regex def parse_tags(subject): tags = regex.TAGS.findall(subject) new_tags = [] for tag in tags: new_tags.append(re.split(r'\s|[\'-]', tag)) tags = list(new_tags) del new_tags return tags def parse_title(subject): title = regex.TITLE.find...
gpl-3.0
-8,984,806,235,142,567,000
23.929825
63
0.555947
false
3.304651
false
false
false
chrisjsewell/ipypublish
ipypublish/filters_pandoc/format_label_elements.py
1
11317
""" a panflute filter to format elements types that may contain reference labels, i.e. Math, Image and Table. The :py:mod:`ipypublish.filters_pandoc.prepare_labels` filter should be run first to access the functionality below: If the parent of the element is a Span (or Div for Table), with a class labelled-Math/label...
bsd-3-clause
5,785,280,997,774,662,000
30.262431
101
0.571795
false
3.731289
false
false
false
chewable/django
tests/regressiontests/generic_inline_admin/tests.py
1
3231
# coding: utf-8 from django.test import TestCase from django.conf import settings # local test models from models import Episode, Media class GenericAdminViewTest(TestCase): fixtures = ['users.xml'] def setUp(self): # set TEMPLATE_DEBUG to True to ensure {% include %} will raise # exceptions...
bsd-3-clause
-5,246,692,950,409,339,000
41.513158
116
0.628598
false
3.828199
true
false
false
sazlin/data-structures
priorityq.py
1
2174
from min_heap import MinHeap from functools import total_ordering @total_ordering class PrioritizedItem(object): def __init__(self, pri, value): self.pri, self.value = pri, value self._order = 0 def __eq__(self, other): if hasattr(other, 'pri'): if self.pri == other.pri: ...
mit
-2,486,523,923,738,306,600
27.233766
75
0.545078
false
3.748276
false
false
false
seanfisk/lsf-ibutils
tests/ibsub/test_output.py
1
3517
from datetime import datetime from pytest import fixture, raises from lsf_ibutils.ibsub.output import build_command, BuildScript from tests.helpers import assert_exc_info_msg @fixture def flags_simple(): return [ ['-J', 'awesomename'], ['-P', 'awesomeproj'], ['-n', '10'], ] @fixtur...
mit
8,930,932,653,532,631,000
27.136
79
0.587432
false
3.283847
true
false
false
happz/ducky
ducky/tools/profile.py
1
2579
try: import cPickle as pickle except ImportError: import pickle import collections import optparse import sys from six import itervalues def read_profiling_data(logger, files_in): from ..profiler import ProfileRecord data = collections.defaultdict(ProfileRecord) for path in files_in: logger.info('Re...
mit
1,348,565,821,697,300,200
26.147368
167
0.672741
false
3.591922
false
false
false
stephansigg/IPSN_localisation_passive-DF
preprop/Pcap_Parser.py
1
5352
# -*- coding: utf-8 -*- import pcapy import Storage_Classes from collections import defaultdict #from scapy.layers.all import * from scapy.layers.dot11 import Dot11, RadioTap ################################################################ VERBOSE = 1 ### auxiliary functions ### def show_short(p,...
gpl-2.0
-9,124,044,256,335,444,000
24.107317
110
0.467676
false
3.613774
false
false
false
ericdanz/ReinforcingRobots
phong_simulator.py
1
9120
import numpy as np import cv2 class Simulator: def __init__(self,reward,screen_size=64,state_space=10): self.number_of_actions = 3 self.screen_size=screen_size self.state_space=state_space self.reset(reward) def do_action(self,action,side="right",simple_AI=False): if si...
mit
-1,666,729,734,341,328,400
49.949721
299
0.603728
false
3.277039
false
false
false
turbinenreiter/micropython
py/makeqstrdefs.py
1
5123
""" This script processes the output from the C preprocessor and extracts all qstr. Each qstr is transformed into a qstr definition of the form 'Q(...)'. This script works with Python 2.6, 2.7, 3.3 and 3.4. """ import re import argparse import os # Python 2/3 compatibility: # - iterating through bytes is different...
mit
-4,396,874,824,264,489,000
31.630573
102
0.588132
false
3.552705
false
false
false
infinity0n3/python-fabtotum
fabtotum/loaders/gerber/cam.py
1
9051
#! /usr/bin/env python # -*- coding: utf-8 -*- # copyright 2014 Hamilton Kibbe <ham@hamiltonkib.be> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICE...
gpl-3.0
7,016,250,359,280,716,000
31.095745
98
0.586676
false
4.566599
false
false
false
mrooney/wxbanker
wxbanker/plots/cairopanel.py
1
5383
import wx import datetime from wxbanker.plots import plotfactory from wxbanker.lib.pubsub import Publisher try: try: from wxbanker.plots import baseplot except plotfactory.BasePlotImportException: raise plotfactory.PlotLibraryImportException('cairo', 'python-numpy') from wxbanker.cairoplot ...
gpl-3.0
6,188,196,234,802,893,000
35.127517
131
0.579788
false
4.041291
false
false
false
PetukhovVictor/compiler
src/Compiler/VM/Helpers/environment.py
1
5179
# -*- coding: utf-8 -*- class Environment: """ Compile-time environment """ var_counter_root = 0 # Счетчик переменных для stack memory var_counter = 0 # Счетчик переменных для stack memory vars = {} # Переменные в stack memory label_counter = 0 # Счетчик меток la...
mit
-8,491,999,339,216,818,000
36.217742
115
0.583532
false
2.985123
false
false
false
LabSoftwareUTP/CodeGeneratorUTP
apps/account/views.py
1
14005
#encoding:utf-8 from django.shortcuts import render, render_to_response, get_object_or_404 from django.http import HttpResponseRedirect from django.template import RequestContext #Django Auth from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm from django.contrib.auth import login, authenti...
gpl-3.0
9,064,110,904,417,787,000
38.013928
242
0.62035
false
4.053546
false
false
false
kalpak92/HackerRank-30-Days-of-Code
Day 24/solution.py
1
1218
class Node: def __init__(self,data): self.data = data self.next = None class Solution: def insert(self,head,data): p = Node(data) if head==None: head=p elif head.next==None: head.next=p else: ...
unlicense
-7,651,488,631,681,651,000
25.727273
48
0.481117
false
4.288732
false
false
false
arunkgupta/gramps
gramps/plugins/view/citationtreeview.py
1
23344
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009-2010 Nick Hall # Copyright (C) 2011 Tim G L Lyons # # 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...
gpl-2.0
6,414,045,414,478,618,000
39.882662
80
0.539239
false
4.439711
false
false
false
mizhgun/HTResearch
HTResearch/WebCrawler/WebCrawler/scrapers/link_scraper.py
1
3997
from sgmllib import SGMLParseError from datetime import datetime from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from ..items import ScrapedUrl from HTResearch.DataModel.model import PageRankInfo, PageRankVector, UrlCountPair from HTResearch.Utilities.url_tools import UrlUtility from HTResearch.Util...
gpl-3.0
7,652,967,383,905,732,000
33.162393
120
0.538154
false
4.547213
false
false
false
janicduplessis/buck
scripts/perf_test_hg.py
1
13958
#!/usr/bin/env python """Performance test to compare the performance of buck between two revisions. The general algorithm is: Checkout <revisions_to_go_back - 1> Warm up the cache: Set .buckversion to old revision, build all targets Set .buckversion to new revision, build all targets For each revision to test: ...
apache-2.0
-2,182,387,697,595,379,500
31.460465
93
0.570426
false
3.642484
true
false
false
lixiangning888/whole_project
web/account/views.py
1
5514
# -*- coding: UTF-8 -*- import os import sys reload(sys) sys.setdefaultencoding("utf-8") import requests import tempfile import random from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext from forms import CaptchaForm import forms from django.co...
lgpl-3.0
2,137,130,964,909,222,000
39.833333
181
0.665677
false
3.64682
false
false
false
dalf/searx
searx/engines/arxiv.py
1
2124
# SPDX-License-Identifier: AGPL-3.0-or-later """ ArXiV (Scientific preprints) """ from lxml import html from datetime import datetime from searx.utils import eval_xpath_list, eval_xpath_getindex # about about = { "website": 'https://arxiv.org', "wikidata_id": 'Q118398', "official_api_documentation": 'htt...
agpl-3.0
5,641,960,097,389,188,000
27.32
115
0.607815
false
3.493421
false
false
false
arrivance/gyazo-to-imgur
src/utility.py
1
3148
import praw import urllib.request import json import requests import requests.auth import os.path import re from imgurpython import ImgurClient from bs4 import BeautifulSoup imgur_gif_regex = re.compile("https?:\/\/i\.imgur\.com\/[a-z0-9]+.gif") def gyazo_link_parser(link): """ Parses Gyazo links into their ...
mit
-6,784,113,215,698,100,000
32.489362
126
0.664867
false
3.58951
false
false
false
dontnod/weblate
weblate/utils/state.py
1
1125
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
gpl-3.0
-873,950,253,735,207,700
31.057143
72
0.716578
false
3.528302
false
false
false
jabber-at/hp
hp/account/managers.py
1
1957
# -*- coding: utf-8 -*- # # This file is part of the jabber.at homepage (https://github.com/jabber-at/hp). # # This project is free software: you can redistribute it and/or modify it under the terms of the GNU General # Public License as published by the Free Software Foundation, either version 3 of the License, or (at...
gpl-3.0
2,321,791,714,501,246,500
38.14
109
0.706183
false
4.137421
false
false
false
xiaoweih/DLV
networks/mnist/mnist.py
1
1199
import os, struct from array import array from cvxopt.base import matrix def read(digits, dataset = "training", path = "."): """ Python function for importing the MNIST data set. """ if dataset is "training": fname_img = os.path.join(path, 'train-images-idx3-ubyte') fname_lbl = os.path...
gpl-3.0
-4,677,121,384,857,606,000
32.305556
70
0.6005
false
3.066496
false
false
false
vchrisb/emc_phoenix2
agenda/migrations/0001_initial.py
1
1272
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-07 21:45 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
mit
-1,310,765,290,528,547,000
36.411765
136
0.599057
false
4.311864
false
false
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.2/Lib/xml/sax/expatreader.py
1
9022
""" SAX driver for the Pyexpat C module. This driver works with pyexpat.__version__ == '2.22'. """ version = "0.20" from xml.sax._exceptions import * # xml.parsers.expat does not raise ImportError in Jython import sys if sys.platform[:4] == "java": raise SAXReaderNotAvailable("expat not available in Java", None...
mit
8,313,813,958,857,831,000
33.045283
82
0.621924
false
4.178786
false
false
false
jondlove/dropback
src/backup.py
1
13717
# -*- coding: utf-8 -*- """ dropback.backup ~~~~~~~~~~~~~~ The main application; backs up directory to dropbox Must be run as Python2, as Dropbox Library doesn't support Python3 yet :author: Jonathan Love :copyright: (c) 2015 by Doubledot Media Ltd. :license: See README.md and LICENSE for...
gpl-2.0
5,737,241,105,658,440,000
39.347059
194
0.636218
false
3.872671
true
false
false
ph1l/halo_radio
sendmail.py
1
1470
#/usr/local/bin/python # sendmail.py # # a simple interface for injecting mail to the local mail delivery # agent # import os,string,re #import log DISABLED=0 VALID_CHARS = string.ascii_letters + string.digits + "@.+-_,:" VALID_CHARS_RE = "([^-@\+\._,:A-Za-z0-9])" def shell_escape(s): global VALID_CHARS, VALID...
gpl-2.0
2,844,144,156,163,820,500
26.735849
73
0.562585
false
2.922465
false
false
false
moduspwnens/boa-chat
boa-nimbus/lambda/RoomMessageLogFetcherFunction/index.py
1
4838
"""RoomMessageLogFetcherFunction Fetches recent room messages. """ from __future__ import print_function import os import json import time import operator from multiprocessing.pool import ThreadPool import boto3 import botocore from apigateway_helpers.exception import APIGatewayException from apigateway_helpers.hea...
mit
-6,236,123,443,316,950,000
26.971098
126
0.609136
false
3.818469
false
false
false
zachriggle/pwndbg
pwndbg/memoize.py
1
3672
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Caches return values until some event in the inferior happens, e.g. execution stops because of a SIGINT or breakpoint, or a new library/objfile are loaded, etc. """ from __future__ import absolute_import from __future__ import division from __future__ import print_funct...
mit
-1,047,262,569,452,376,600
21.807453
78
0.576253
false
3.565049
false
false
false
CSD-Public/stonix
src/tests/rules/unit_tests/zzzTestRuleBootloaderPerms.py
1
4511
#!/usr/bin/env python3 ############################################################################### # # # Copyright 2019. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contrac...
gpl-2.0
7,479,471,075,306,054,000
38.226087
79
0.577477
false
4.506494
true
false
false
nitely/Spirit
spirit/user/migrations/0002_auto_20150728_0447.py
1
1997
# -*- coding: utf-8 -*- from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('spirit_user', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='user', name='comment_count'...
mit
7,818,107,861,815,617,000
30.698413
420
0.530295
false
4.507901
false
false
false
ronaldahmed/labor-market-demand-analysis
shallow parsing models/sequences/extended_feature.py
1
35122
#from sequences.id_feature import IDFeatures from sequences.id_feature_bigram import IDFeatures from sequences.label_dictionary import * import os, sys import re, string import pdb, ipdb import unicodedata path_utils = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(path_utils) from util...
mit
-7,375,652,183,799,610,000
39.590278
130
0.466439
false
3.748797
false
false
false
fparrel/regepe
wamp-src/cgi-bin/rebuild-nocgi.py
1
1828
#!c:/Python27/python.exe import cgi import os import traceback from mapparser import ParseMap from gpxparser import ParseGpxFile from model import Track from orchestrator import ProcessTrkSegWithProgress from config import maps_root from cgiparser import FormParseInt,FormParseStr,FormParseOptions,FormParseBool from lo...
gpl-3.0
-8,015,313,166,204,521,000
33.490566
108
0.671772
false
3.146299
false
false
false
federicomariamassari/willow-tree
willowtree/graph.py
1
3396
def graph(z, q, gamma, t, P): ''' Plot the willow tree. Input --------------------------------------------------------------------------- z, q: np.arrays, required arguments. The discrete density pairs, output of the function 'sampling'. gamma: float, required argument. Weighting para...
mit
624,350,979,028,879,900
35.12766
79
0.554181
false
3.303502
false
false
false
akaszynski/vtkInterface
pyvista/utilities/helpers.py
1
23177
"""Supporting functions for polydata and grid objects.""" import signal import collections import ctypes import enum import logging import warnings from threading import Thread import numpy as np import scooby import vtk import vtk.util.numpy_support as nps import pyvista from .fileio import from_meshio class Fiel...
mit
3,241,677,735,579,653,000
31.782178
115
0.626354
false
3.89464
false
false
false
globant/fasta_title_editor
fte/settings.py
1
4984
import os # Django settings for fte project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. '...
gpl-3.0
-6,714,923,324,137,730,000
32.675676
115
0.681982
false
3.680945
false
false
false
jwilber/twosampyle
twosampyle/tests/test_PermTest.py
1
1930
import pytest import pandas as pd import numpy as np import matplotlib.pyplot as plt from twosampyle.permtest import PermTest # ask Stefan: should I create data in each test or create some here and then use it in test? # also ask about naming convention def test_DiffMeansForSameDataShouldBeZero(): data = pd.DataF...
gpl-3.0
8,804,493,941,038,826,000
29.15625
114
0.690674
false
2.43073
true
false
false
anubhav929/eden
controllers/patient.py
1
4840
# -*- coding: utf-8 -*- """ Patient Tracking """ module = request.controller if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------------------------------------------------- def index(): "Module's Home Page" module_name = setti...
mit
-6,626,938,169,221,314,000
30.428571
203
0.464876
false
4.548872
false
false
false
mohit1993/UIETCode
ADA/knapsack.py
2
2048
from __future__ import division def ratioSelection(data = [],n=0,M=0): for i in range(n): if M < data[i][1]: data[i][2] = M/data[i][1] break else: data[i][2] = 1 M = M - data[i][1] return data def calculateProfit(data,n): profit = 0.0 for i in range(n): profit = profit + data[i][0]*data[i][2] ...
gpl-2.0
2,425,367,118,966,138,000
23.380952
87
0.620605
false
2.476421
false
false
false
airypi/airypi
test_ui.py
1
1153
from airypi import monkey monkey.patch_all() from airypi.device import Device from airypi.ui import Label, Button, SwitchButton from airypi.server import setup @Device.register_for(Device.RPI) class RPiHandler(): def __init__(self): self.label = Label('Hey') self.button = Button("Hello") ...
apache-2.0
-2,473,582,930,277,723,600
31.055556
80
0.614918
false
3.294286
false
false
false
scheckmedia/RemoteDslrApi
RemoteDslrApi/announce.py
1
2340
from zeroconf import Zeroconf, ServiceInfo import socket import RemoteDslrApi class AutoAnnounce(object): def __init__(self, port, ssl=False, run=True): """ Announces network settings via mdns :type self: AutoAnnounce :param self: AutoAnnounce :type port: int ...
gpl-3.0
1,311,487,945,573,193,500
29.802632
167
0.504274
false
4.534884
false
false
false
pchretien/tweetbot
tweetbot.py
1
1980
import tweepy import time import serial import random consumer_key="" consumer_secret="" access_token="" access_token_secret="" ser = serial.Serial('COM7', 19200, timeout=0) # Initialize the tweepy API auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret)...
gpl-2.0
-8,108,885,524,373,593,000
21.247191
91
0.668182
false
2.848921
false
false
false
yuvipanda/jupyterhub-kubernetes-spawner
jupyterhub_config.py
1
1287
import os import socket c.JupyterHub.spawner_class = 'kubespawner.KubeSpawner' c.JupyterHub.ip = '127.0.0.1' c.JupyterHub.hub_ip = '127.0.0.1' # Don't try to cleanup servers on exit - since in general for k8s, we want # the hub to be able to restart without losing user containers c.JupyterHub.cleanup_servers = Fals...
bsd-3-clause
8,844,383,519,870,322,000
32
77
0.725719
false
2.872768
false
false
false
mochrul/zorp
pylib/Zorp/Base.py
1
2353
############################################################################ ## ## Copyright (c) 2000-2015 BalaBit IT Ltd, Budapest, Hungary ## Copyright (c) 2015-2018 BalaSys IT Ltd, Budapest, Hungary ## ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General...
gpl-2.0
4,274,379,390,091,782,000
26.682353
76
0.555886
false
4.278182
false
false
false
Martin-Jung/Code_Snippets
PyVidexec.py
1
5902
#!/usr/bin/env python # -*- coding: utf-8 -*- # terminal based Media Organisator # Author: Martin Jung # Date: 2011 # Imports import imdb # aptitude install python-imdbpy import sqlite3 # aptitude install python-sqlite import os, sys, getopt, fnmatch # Video Datatype Endings ext = ['*.avi','*.mkv'] extB = map(lambd...
gpl-2.0
-2,873,218,964,263,788,000
28.959391
105
0.582514
false
2.756656
false
false
false
kimhc6028/pathnet-pytorch
plotter.py
1
2461
import argparse import os import pickle import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') parser = argparse.ArgumentParser(description='PyTorch MNIST Example') parser.add_argument('--mnist', action='store_true', default=False, help='open mnist result') args = parser.parse_a...
bsd-3-clause
5,344,219,166,284,127,000
28.297619
95
0.578627
false
3.060945
false
false
false
mediapredict/resigner
resigner/server.py
1
2267
from functools import wraps import time from django.http import Http404, HttpResponseBadRequest from .models import ApiKey from .utils import get_signature, get_settings_param, \ SERVER_TIME_STAMP_KEY, SERVER_API_SIGNATURE_KEY, SERVER_API_KEY def signed_req_required(view_func): def check_signature(request, ...
gpl-3.0
-6,293,677,851,237,864,000
30.486111
91
0.561535
false
4.359615
false
false
false
colindjk/tin_can_telephone
client.py
1
1667
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import socket import fileinput import thread import json TCP_IP = '127.0.0.1' TCP_PORT = 3000 BUFFER_SIZE = 1024 user = '' user_to = '' def receive(): #print ("home") while True: #print("waiting to receive") received...
mit
2,225,167,353,198,725,400
25.783333
98
0.55009
false
3.34739
false
false
false
jayhetee/dask
dask/dataframe/core.py
1
46137
from __future__ import division from itertools import count from math import sqrt from functools import wraps import bisect import uuid from hashlib import md5 from toolz import merge, partial, first, partition from operator import getitem, setitem from datetime import datetime import pandas as pd import numpy as np i...
bsd-3-clause
3,909,309,426,802,544,600
32.311913
96
0.553699
false
3.715033
false
false
false
IceCubeDev/hackerschool
WebServer/1.0/JUNK/web/HttpRequest.py
1
4925
__author__ = 'Ivan Dortulov' import re ## # This class represents an Http-Request to a server. # class HttpRequest(object): ## # Default constructor. # # Creates an empty Http-Request. def __init__(self, request_string = ''): ## @var contentEncoding # The character set of the en...
gpl-2.0
-2,512,538,130,684,985,300
28.497006
100
0.519594
false
4.066887
false
false
false
tacaswell/awj
awj.py
1
3473
import os import os.path import time import heapq from collections.abc import MutableMapping from random import shuffle from glob import glob import feather class AWJ(MutableMapping): '''LRU cache for DataFrames backed by on-disk feather files Parameters ---------- cache_path : str or Path ...
bsd-3-clause
8,049,506,427,344,451,000
27.702479
78
0.564354
false
3.651945
false
false
false
geertj/draco2
setup.py
1
2535
# vi: ts=8 sts=4 sw=4 et # # setup.py: distutils setup script for Draco2 # # This file is part of Draco2. Draco2 is free software and is made available # under the MIT license. Consult the file "LICENSE" that is distributed # together with this file for the exact licensing terms. # # Draco2 is copyright (c) 1999-2007 b...
mit
2,065,160,672,990,538,200
31.088608
77
0.584615
false
3.467852
false
false
false
Swimlane/sw-python-client
swimlane/core/fields/usergroup.py
1
4855
from swimlane.core.resources.usergroup import UserGroup, User from swimlane.exceptions import ValidationError from .base import MultiSelectField class UserGroupField(MultiSelectField): """Manages getting/setting users from record User/Group fields""" field_type = ( 'Core.Models.Fields.UserGroupField,...
mit
4,098,259,566,760,494,600
36.346154
116
0.608857
false
4.315556
false
false
false
mtskelton/django-simple-export
simple_export/management/commands/simple_import.py
1
1820
import base64 import importlib import sys from metamagic.json import dumps, dumpb, loadb from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Import a model' def add_arguments(self, parser): parser.add_argument('-i,--import', dest='import', help='File to import fr...
bsd-2-clause
-4,704,408,079,934,055,000
29.847458
85
0.526374
false
4.053452
false
false
false
Harlekuin/fyn
fyn/analyse.py
1
1536
import pandas as pd import numpy as np from .loader import load_return_data class Analysis: def __init__(self, price_df, income_df=None): self.price_df = price_df if income_df is not None: self.income_df = income_df self.start_date = price_df.index[0] self.end_date = p...
mit
-3,195,515,005,974,780,000
31
102
0.587891
false
3.58042
false
false
false
RedhawkSDR/framework-codegen
redhawk/codegen/lang/automake.py
1
1504
# # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK core. # # REDHAWK core 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 ...
lgpl-3.0
4,230,885,022,721,244,700
33.976744
79
0.694149
false
4.212885
false
false
false
Jumpscale/jumpscale6_core
apps/agentcontroller/tests/new/agentcontroller_basic_new__test.py
1
1128
from JumpScale import j import unittest descr = """ test basic functioning of agentcontroller new way """ organization = "jumpscale" author = "kristof@incubaid.com" license = "bsd" version = "1.0" category = "agentcontroller.basic.new" enable=True priority=2 ROLE='node' class TEST(unittest.TestCase): def setUp...
bsd-2-clause
-7,637,466,015,583,056,000
27.923077
176
0.677305
false
3.377246
true
false
false
isandlaTech/cohorte-3rdparty
herald/src/main/python/herald/transports/http/servlet.py
1
8511
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Herald HTTP transport servlet :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.0.1 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); yo...
apache-2.0
6,559,875,741,348,939,000
31.861004
80
0.574433
false
4.33792
false
false
false
JoseTomasTocino/SiteUp
web/siteup_api/migrations/0002_auto__del_httpchecklog__del_pingchecklog__del_portchecklog__del_dnsche.py
1
14033
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'HttpCheckLog' db.delete_table(u'siteup_api_httpchecklog...
gpl-2.0
-2,434,716,387,487,851,500
69.17
195
0.57828
false
3.647777
false
false
false
pcatherine/hipsografia
hipsografia/settings.py
1
3262
""" Django settings for hipsografia project. Generated by 'django-admin startproject' using Django 1.8.2. 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/settings/ """ # Build ...
mit
-8,477,057,102,840,739,000
26.652542
116
0.667995
false
3.352518
false
false
false
ferdkuh/rlkart
src/sdl2_defs.py
1
1790
import ctypes as C import numpy as np # SDL 1.2 keycodes - damn them to hell! SDLK_UP = 1073741906 SDLK_DOWN = 1073741905 SDLK_RIGHT = 1073741903 SDLK_LEFT = 1073741904 SDLK_RETURN = 13 SDLK_LCTRL = 224 SDLK_LSHIFT = 225 SDLK_X = 27 SDLK_C = 6 SDLK_Z = 29 SDLK_W = 26 SDLK_A = 4 SDLK_S = 22 SDLK_D = 7 # key to button ...
gpl-3.0
-995,961,740,964,054,400
23.861111
78
0.644134
false
2.342932
false
false
false
google/digitalbuildings
tools/rdf_generator/rdfformat/generator/rdflib_function_handler.py
1
5845
# Copyright 2020 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
apache-2.0
-7,739,675,408,457,715,000
36.229299
78
0.681608
false
3.941335
false
false
false
Eksmo/calibre
src/calibre/ebooks/metadata/zip.py
1
2526
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import os from calibre.utils.zipfile import ZipFile from calibre.ptempfile import TemporaryDirectory from calibre import CurrentDir def get_metadata(stream): from calibre.ebooks.metadata.m...
gpl-3.0
3,995,910,982,531,155,500
37.861538
117
0.551465
false
4.022293
false
false
false
Yukarumya/Yukarum-Redfoxes
python/mach/mach/main.py
1
21294
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # This module provides functionality for the command-line build tool # (mach). It is packaged as a module because everyt...
mpl-2.0
7,372,844,424,091,616,000
34.848485
135
0.620081
false
4.390515
false
false
false
ByrdOfAFeather/AlphaTrion
Project/migrations/0006_answerint_answertext.py
1
1491
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-24 21:39 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
mit
5,712,211,587,216,231,000
40.416667
205
0.627767
false
4.153203
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/ad_group_ad_asset_view_service/client.py
1
19661
# -*- coding: utf-8 -*- # Copyright 2020 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...
apache-2.0
-3,053,468,120,426,213,000
45.044496
220
0.632063
false
4.3069
false
false
false
jeffsilverm/nbmdt
datalink.py
1
9602
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Dealing with the DataLink layer in the OSI model # Media Access Control (Ethernet addresses) # # import enum import sys from typing import Dict, List import constants from interfaces import PhysicalInterface from utilities import OsCliInter, os_name, the_os class ...
gpl-2.0
-3,515,354,064,092,672,000
47.741117
157
0.595918
false
3.772888
false
false
false
untergeek/es_stats_zabbix
es_stats_zabbix/defaults/settings.py
1
1596
""" Define settings and constants """ from os import access, path, R_OK APIS = ['health', 'clusterstate', 'clusterstats', 'nodeinfo', 'nodestats'] NODETYPES = ['cluster', 'coordinating', 'master', 'data', 'ml', 'ingest'] FILEPATHS = [ path.join(path.expanduser('~'), '.es_stats_zabbix', 'config.yml'), path.j...
apache-2.0
-7,781,029,328,566,349,000
21.166667
78
0.60401
false
3.432258
false
false
false
wutali/sauron
sauron/metrics/MySQLMetric.py
1
1353
import pymysql from sauron.metrics import Metric, MetricException class MySQLMetric(Metric): def __init__(self, name, host=None, user=None, passwd=None, **kwargs): Metric.__init__(self, name, **kwargs) self.reconfig(name, host, user, passwd) def reconfig(self, name, host=None, user=None, pass...
mit
-89,575,939,668,446,560
31.214286
91
0.536585
false
4.087613
false
false
false
didorothy/Consulting
src/cm/models.py
1
6428
from decimal import Decimal import datetime from django.db import models from django.contrib.localflavor.us.models import USStateField from django.conf.urls.static import static PAYMENT_TYPES = ( ('cash', 'Cash'), ('check', 'Check'), ('credit card', 'Credit Card'), ) # Create your models here. class Cus...
bsd-3-clause
-7,360,653,995,284,417,000
34.910615
132
0.646235
false
3.929095
false
false
false
peuyeum/peuyeum
apps/controllers/ntb.py
1
1266
import sys sys.path.append('../../') from lib.cilok import urlEncode16,tokenuri,setTTL,keyuri from lib.sampeu import getWMTS from apps.models import calendar from apps.templates import batik class Controller(object): def home(self,uridt='null'): provinsi = 'ntb' provloc = '117.231158, -8.240186' mapzoom = '9' ...
agpl-3.0
-4,661,415,375,234,321,000
30.675
89
0.647709
false
2.096026
false
false
false
andrewjrobinson/SportsReview
sportsreview/aftertouches/about_ui.py
1
7310
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'aftertouches/about.ui' # # Created: Sat Apr 19 21:32:18 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.1 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_Dialog(object): def se...
lgpl-3.0
-7,611,732,618,618,143,000
66.06422
567
0.716689
false
3.81325
false
false
false
googleads/google-ads-python
examples/account_management/link_manager_to_client.py
1
5798
#!/usr/bin/env python # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
5,637,114,491,854,350,000
36.895425
80
0.679545
false
4.12669
false
false
false
akshmakov/Dolfin-Fijee-Fork
test/unit/book/python/chapter_1_files/stationary/poisson/mat2x_p2D.py
1
2579
""" As mat2_p2D.py, but the boundary conditions are different. Here, u=0 on x=0 and u=1 on x=1, while du/dn=0 on y=0 and y=1. This yields a solution u(x,y)=x, regardless of the values of k. """ from dolfin import * import sys, math, numpy mesh = UnitSquareMesh(4, 6) # Define a MeshFunction over two subdomains subdom...
gpl-3.0
7,804,644,734,904,039,000
25.587629
66
0.685537
false
2.907554
false
false
false
PopCap/GameIdea
Engine/Source/ThirdParty/HTML5/emsdk/emscripten/1.30.0/embuilder.py
1
3755
#!/usr/bin/env python2 ''' Tool to manage building of various useful things, such as libc, libc++, native optimizer, as well as fetch and build ports like zlib and sdl2 ''' import os, sys import tools.shared as shared if len(sys.argv) < 2 or sys.argv[1] in ['-v', '-help', '--help', '-?', '?']: print ''' Emscripten...
bsd-2-clause
-5,594,605,283,958,160,000
28.566929
141
0.576032
false
3.419854
false
false
false
umlfri/umlfri2
umlfri2/application/commands/diagram/hideelements.py
1
2392
from collections import namedtuple from umlfri2.application.events.diagram import ElementHiddenEvent, ConnectionHiddenEvent from ..base import Command HiddenVisualDescription = namedtuple('HiddenVisualDescription', ('z_order', 'visual')) class HideElementsCommand(Command): def __init__(self, diagram, elements)...
gpl-3.0
109,195,305,890,814,860
37.580645
98
0.636288
false
4.397059
false
false
false
aikramer2/spaCy
examples/training/train_tagger.py
1
3370
#!/usr/bin/env python # coding: utf8 """ A simple example for training a part-of-speech tagger with a custom tag map. To allow us to update the tag map with our custom one, this example starts off with a blank Language class and modifies its defaults. For more details, see the documentation: * Training: https://spacy.i...
mit
-1,809,022,347,242,269,200
33.040404
80
0.632344
false
3.323471
false
false
false
gregreen/legacypipe
py/legacypipe/run-calib.py
1
1473
#! /usr/bin/env python import os import numpy as np from astrometry.util.fits import fits_table from common import run_calibs, DecamImage, Decals if __name__ == '__main__': import optparse parser = optparse.OptionParser() parser.add_option('--force', action='store_true', default=False, ...
gpl-2.0
3,117,109,952,046,821,400
28.46
90
0.56687
false
3.347727
false
false
false
oskusalerma/gfract
make_palettes.py
1
1270
#!/usr/bin/env python import glob import re import sys # base filenames of palette files, e.g. "blues" palettes = set() # output file out = open("palettes.cpp", "w") def die(msg): print "Failed: %s" % msg sys.exit(1) # what variable name should we use for the given base filename def varName(basename): ...
gpl-2.0
-8,442,336,650,528,161,000
19.483871
70
0.554331
false
3.075061
false
false
false
gsmcmullin/piksi_firmware
scripts/acq_results.py
1
3642
#!/usr/bin/env python # Copyright (C) 2011-2014 Swift Navigation Inc. # Contact: Colin Beighley <colin@swift-nav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS I...
gpl-3.0
6,417,700,200,067,634,000
31.230088
78
0.617243
false
3.155979
false
false
false
codito/pomito
pomito/plugins/ui/qt/task_widget.py
1
8099
# -*- coding: utf-8 -*- """Task widget for pomito.""" import logging from PyQt5 import QtCore, QtGui, QtWidgets from pomito.plugins.ui.qt.qt_task import Ui_TaskWindow from pomito.plugins.ui.qt.utils import get_elided_text, Worker, WorkerCompletedEvent from pomito.task import Task logger = logging.getLogger("pomito.p...
mit
8,305,566,896,109,492,000
35.647059
102
0.556859
false
4.218229
false
false
false
globocom/NagiosQL-API
src/nagiosql/settings.py
1
3772
# Copyright 2012 NagiosQL-API authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # Django settings for nagiosqlapi project. TESTING=False from environment_settings import * DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Leandro...
bsd-3-clause
-5,595,989,357,902,311,000
30.173554
88
0.730117
false
3.463728
false
false
false
ryfeus/lambda-packs
Opencv_pil/source36/numpy/core/shape_base.py
1
28183
from __future__ import division, absolute_import, print_function __all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'block', 'hstack', 'stack', 'vstack'] import functools import operator import types import warnings from . import numeric as _nx from . import overrides from .numeric import array, asanyar...
mit
8,208,641,112,379,040,000
30.773393
80
0.586488
false
3.770805
false
false
false
dsweet04/rekall
rekall-agent/rekall_agent/locations/files.py
1
4635
#!/usr/bin/env python2 # Rekall Memory Forensics # Copyright 2016 Google Inc. All Rights Reserved. # # Author: Michael Cohen scudette@google.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation...
gpl-2.0
2,623,319,981,320,262,000
32.586957
80
0.60151
false
4.149508
false
false
false
FutureSharks/invokust
invokr.py
1
4806
#!/usr/bin/env python3 import argparse import logging import sys import json from invokust.aws_lambda import LambdaLoadTest, results_aggregator def print_stat(type, name, req_count, median, avg, min, max, rps): return "%-7s %-50s %10s %9s %9s %9s %9s %10s" % ( type, name, req_count, ...
mit
2,701,416,338,839,517,000
33.826087
133
0.550146
false
3.671505
true
false
false
maweis1981/hey001
mayversion/mayversion/microblog/feeds.py
1
4918
from atomformat import Feed from django.core.urlresolvers import reverse from django.conf import settings from django.contrib.sites.models import Site from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.shortcuts import get_object_or_404 from microblog.mode...
lgpl-3.0
3,199,532,781,147,204,000
35.161765
142
0.631151
false
3.757066
false
false
false
eranroz/hmm
scripts/simple_hmm.py
1
6325
import argparse import os from hmm_kit import HMMModel import pandas as pd import numpy as np from hmm_kit import bwiter from sklearn.cluster import KMeans import pickle as pkl def train_model(input_path, kernel, states, emission=None, transition=None, model_name=None, html=False): input_dir = os.path.dirname(os...
mit
-380,506,314,642,591,550
40.887417
119
0.644901
false
3.677326
false
false
false
nirvik/iWant
iwant/core/engine/server.py
1
25217
from twisted.internet import defer, interfaces from twisted.internet.protocol import Factory from zope.interface import implements from fuzzywuzzy import fuzz import os from struct import pack from fileindexer import fileHashUtils from fileindexer.piece import piece_size from iwant.core.messagebaker import bake, unbake...
mit
9,208,707,954,152,924,000
38.525078
107
0.549709
false
4.282779
false
false
false
FederatedAI/FATE
python/fate_client/pipeline/component/sbt_feature_transformer.py
1
1350
# # Copyright 2019 The FATE 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 appli...
apache-2.0
5,498,678,916,968,567,000
38.735294
76
0.72963
false
3.93586
false
false
false
chubbymaggie/simuvex
simuvex/procedures/libc___so___6/strncmp.py
1
5377
import simuvex from simuvex.s_type import SimTypeString, SimTypeLength, SimTypeInt import logging l = logging.getLogger("simuvex.procedures.libc.strncmp") class strncmp(simuvex.SimProcedure): #pylint:disable=arguments-differ def run(self, a_addr, b_addr, limit, a_len=None, b_len=None): #pylint:disable=argume...
bsd-2-clause
7,802,502,097,634,712,000
42.715447
155
0.582295
false
3.304856
false
false
false
poppy-project/pypot
pypot/dynamixel/io/io_320.py
1
7538
from itertools import repeat from .abstract_io import (AbstractDxlIO, _DxlControl, _DxlAccess, DxlTimeoutError, DxlCommunicationError) from .. import conversion as conv from ..protocol import v2 as v2 class Dxl320IO(AbstractDxlIO): _protocol = v2 def set_wheel_mode(self, ids): ...
gpl-3.0
7,808,115,764,563,616,000
29.395161
82
0.496683
false
3.161913
false
false
false
thomasrstorey/recipesfordisaster
actions/mound.py
1
4209
''' add.py Takes a list of input ingredient names. Imports each if not already present. If already present, duplicates and rotates the ingredient. Thomas Storey 2016 ''' import sys import argparse import bpy import numpy as np import os import bmesh from math import * from mathutils import * import random def getO...
mit
-4,195,201,903,273,755,000
28.027586
83
0.630316
false
3.280592
false
false
false
nebril/fuel-web
nailgun/nailgun/test/unit/test_task.py
1
12513
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requir...
apache-2.0
-6,188,009,642,606,273,000
33.855153
79
0.620235
false
3.894491
true
false
false
uclouvain/osis
program_management/ddd/service/write/update_and_postpone_mini_training_version_service.py
1
5095
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-2,581,886,989,959,690,000
41.099174
116
0.703769
false
3.762186
false
false
false
rvianello/rdkit
rdkit/Chem/UnitTestLipinski.py
4
6329
# # Copyright (C) 2003-2006 Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ unit testing code for Lipinski parameter ...
bsd-3-clause
-1,871,869,085,419,146,500
36.898204
100
0.618423
false
3.036948
true
false
false