repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
PoprostuRonin/memes-api
parsers/kwejk.py
1
2459
from parsel import Selector from utils import download, find_id_in_url, catch_errors, get_last_part_url from data import ImageContent, GalleryContent, VideoContent, Meme, Author, Tag, Page def scrap(url): html = download(url) return parse(html) def parse(html): document = Selector(text=html) memes =...
mit
6,889,839,348,887,342,000
25.44086
84
0.595364
false
3.322973
false
false
false
mbarnes/commissaire
features/steps/hosts.py
2
6095
# Copyright (C) 2016 Red Hat, Inc # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in ...
gpl-3.0
-7,102,307,496,693,006,000
31.768817
79
0.651189
false
3.649701
false
false
false
EndPointCorp/lg_ros_nodes
lg_common/src/lg_common/test_helpers.py
1
2700
import time import rospy from interactivespaces_msgs.msg import GenericMessage TEST_MESSAGE_TEMPLATE = """ {{ "name": "foobar_name", "description": "test_description", "resource_uri": "test_foobar_uri", "slug": "test_foobar_slug", "duration": 0, "windows": [ {windows} ] }} """ TOUCH_WINDOW_TEMPLATE...
apache-2.0
-1,901,124,844,072,943,600
22.478261
133
0.58037
false
3.448276
false
false
false
zombiezen/turbohvz
hvz/model/identity.py
1
15661
#!/usr/bin/env python # # model/identity.py # TurboHvZ # # Copyright (C) 2008 Ross Light # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
gpl-3.0
1,482,967,572,738,742,800
32.463675
78
0.593385
false
4.430269
false
false
false
xia2/workflows
workflows/recipe/wrapper.py
1
7999
from __future__ import absolute_import, division, print_function import workflows.recipe class RecipeWrapper(object): '''A wrapper object which contains a recipe and a number of functions to make life easier for recipe users. ''' def __init__(self, message=None, transport=None, recipe=None, **kwargs): ...
bsd-3-clause
1,529,886,499,157,076,000
40.020513
82
0.658832
false
4.488777
false
false
false
blue-yonder/storefact
storefact/_urls.py
1
4053
# -*- coding: utf-8 -*- from uritools import urisplit TRUEVALUES = (u'true',) def url2dict(url, raise_on_extra_params=False): """ :param url: Access-URL, see below for supported forms :return: Parameter dictionary suitable for get_store() memory:// redis://[[password@]host[:port]][/db] fs...
bsd-3-clause
-5,771,757,283,891,569,000
35.845455
196
0.606958
false
3.605872
false
false
false
pravsripad/mne-python
examples/decoding/plot_ems_filtering.py
9
4717
""" ============================================== Compute effect-matched-spatial filtering (EMS) ============================================== This example computes the EMS to reconstruct the time course of the experimental effect as described in :footcite:`SchurgerEtAl2013`. This technique is used to create spatia...
bsd-3-clause
-70,742,310,059,473,970
35.284615
79
0.674369
false
3.541291
false
false
false
benrudolph/commcare-hq
custom/penn_state/reports.py
3
5330
import copy from couchdbkit.exceptions import ResourceNotFound from no_exceptions.exceptions import Http403, Http404 from corehq.apps.users.models import CommCareUser from corehq.apps.groups.models import Group from corehq.apps.reports.standard import CustomProjectReport from .models import LegacyWeeklyReport from ....
bsd-3-clause
5,721,039,623,887,304,000
32.3125
80
0.551782
false
4.053232
false
false
false
fernjager/pyclimb
lib/units.py
1
10566
#PyClimb - "The Only Way is Up" #Copyright (C) 2007 wegstar #This program is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation; either version 2 of the License, or #(at your option) any later version. #This program...
gpl-2.0
8,971,702,160,887,613,000
28.513966
124
0.664395
false
2.813099
true
false
false
ariddell/hcatool
doc/source/conf.py
1
1908
# -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. e...
mpl-2.0
-1,417,649,707,551,839,200
29.285714
79
0.668239
false
3.778218
false
false
false
ur-whitelab/arc-vision
arcvision/line_detection_processor.py
1
10037
import numpy as np import asyncio, cv2 from .utils import * from .processor import Processor class LineDetectionProcessor(Processor): ''' Detects drawn lines on an image (NB: works with a red marker or paper strip) This will not return knowledge of connections between reactors (that logic should be in Det...
bsd-3-clause
4,380,333,769,876,004,000
54.453039
209
0.615323
false
4.178601
false
false
false
gdorion/advent-of-code
2016/python/day12.py
1
1491
#!/bin/env python # # Adventofcode.com # # Author : Guillaume Dorion # Email : gdorion@gmail.com # raw = open('day12.txt').read().splitlines() registers = {'a': 0, 'b': 0, 'c' : 1, 'd' : 0} instructions = [] for l in raw: components = l.split(' ') ins = components[0] rid = components[1] offset =...
mit
-8,043,422,877,539,764,000
20
90
0.523139
false
3.276923
false
false
false
stadt-karlsruhe/ckanext-extractor
ckanext/extractor/tests/test_plugin.py
1
5479
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2016-2018 Stadt Karlsruhe (www.karlsruhe.de) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
agpl-3.0
3,971,573,992,151,247,400
37.858156
81
0.643183
false
3.953102
true
false
false
prheenan/GeneralUtil
python/LibUtil/SQL/SqlAlchemyBridge.py
2
1878
# force floating point division. Can still use integer with // from __future__ import division # This file is used for importing the common utilities classes. import numpy as np import matplotlib.pyplot as plt # need to add the utilities class. Want 'home' to be platform independent from os.path import expanduser home ...
gpl-2.0
-6,612,256,316,322,649,000
32.535714
80
0.72098
false
3.987261
false
false
false
goshow-jp/Kraken
Python/kraken/core/objects/attributes/scalar_attribute.py
1
1593
"""Kraken - objects.Attributes.ScalarAttribute module. Classes: ScalarAttribute - Base Attribute. """ from kraken.core.objects.attributes.number_attribute import NumberAttribute from kraken.core.kraken_system import ks class ScalarAttribute(NumberAttribute): """Float Attribute. Implemented value type checking ...
bsd-3-clause
1,592,623,913,393,074,000
22.441176
90
0.588198
false
4.340599
false
false
false
deathnik/img-search
ims/core/search.py
1
4448
import json import struct from ims.metrics import hist_distance from ims.util import Heap, debug_log ELEMENT_SIZE = 4 class _Selector(object): def __init__(self, heap_size, name=''): self.heap_size = heap_size self.name = name def __call__(self, iterator): heap = Heap(capacity=self....
gpl-3.0
-1,917,686,084,437,713,000
38.017544
112
0.610387
false
4.032638
true
false
false
noonat/deathbeam
src/deathbeam/aliens.py
1
3502
from __future__ import absolute_import import math from . import defs from .actors import Actor, register_actor from .particles import TurretBullet from .sounds import AmbientSound, Sound @register_actor class Mothership(Actor): BEAM_COLORS = [ (0, 1, 1, 0.5), (1, 0.5, 0.5, 0.5), (1, 1, ...
mit
-3,389,300,621,457,895,000
31.728972
76
0.563963
false
3.080035
false
false
false
obulpathi/bitcoinpy
bitcoinpy/bitcoinrpc/connection.py
1
23197
# Copyright (c) 2010 Witchspace <witchspace81@gmail.com> # # 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,...
mit
8,541,596,963,048,509,000
34.908669
98
0.630469
false
4.633839
false
false
false
uvemas/ViTables
vitables/filenodeutils.py
1
2507
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved # Copyright (C) 2008-2019 Vicent Mas. All rights reserved # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License...
gpl-3.0
4,437,010,268,472,824,000
31.986842
83
0.684882
false
3.798485
false
false
false
sp0rkie/quick-dirty-site-monitoring
monitor.py
1
1934
import csv import re import time import calendar import os # 3rd party import requests # local import config REQUEST_METHODS = ['GET', 'POST', 'PUT', 'HEAD'] CSV_FIELDS = ['timestamp', 'response_time', 'status_code', 'down'] for site in config.SITES: if 'url' not in site: print 'No URL for that site: %s' ...
gpl-3.0
3,936,199,424,676,353,000
25.493151
98
0.60031
false
3.561694
false
false
false
rasputine/xdy
dice.py
1
2117
import re from random import randint def parseString(rollString): breakdown={} # Regex to grab anything that looks like a standard die roll # e.g. 1d6, d20, 2d8, up to 99d99 baseroll = re.match(r'([0-9]{,2}[dD][1-9][0-9]?)',rollString) if not baseroll: raise ValueError("Invalid roll string: %s"%(roll...
mit
-6,880,932,412,609,031,000
27.027397
69
0.634861
false
2.686548
false
false
false
TinyOS-Camp/DDEA-DEV
DDEA-QUASAR/quasar_reader.py
1
1806
# -*- coding: utf-8 -*- """ Created on Wed Apr 16 10:56:40 2014 @author: deokwoo """ from __future__ import division # To forace float point division from qdf import quasar from twisted.internet import defer, reactor from twisted.internet.defer import inlineCallbacks, Deferred def dlrv(result, files): s_data = di...
gpl-2.0
-6,591,984,516,735,727,000
28.129032
107
0.655039
false
3.259928
false
false
false
belokop/indico_bare
indico/MaKaC/webinterface/pages/paperReviewingDisplay.py
2
3709
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
7,148,980,809,888,300,000
30.974138
141
0.695605
false
3.72016
false
false
false
nils-wisiol/ddns
src/ddns/database.py
1
5489
#!/usr/bin/python ############################################################################### # # # ddns - A dynamic DNS client for IPFire # # Copyright (C) 2014 IPFire development team ...
gpl-3.0
3,255,780,566,642,056,700
30.011299
91
0.580616
false
3.843838
false
false
false
MarcosCommunity/odoo
comunity_modules/account_financial_report_webkit/report/common_partner_balance_reports.py
22
16179
# -*- encoding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright Camptocamp SA 2011 # SQL inspired from OpenERP original code # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
5,806,480,750,018,773,000
44.446629
104
0.553743
false
4.384553
false
false
false
blahgeek/xiami_downloader
xiami.py
1
2448
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by i@BlahGeek.com at 2014-04-19 import os import sys import tempfile import shutil from BeautifulSoup import BeautifulStoneSoup from rex import rex from urlparse import urlparse from argparse import ArgumentParser from lib.http import download from lib.progress i...
mit
-5,267,871,602,304,245,000
30.792208
124
0.641748
false
3.438202
false
false
false
jamiecurle/django-omblog
omblog/decorators.py
2
1460
from django.core.cache import cache from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from omblog import settings as o_settings from omblog.cache import get_key def login_required(fn): """will redirect to the admin login page if a user is not authed""" def _login_re...
bsd-3-clause
7,441,785,590,815,659,000
31.444444
70
0.609589
false
4.044321
false
false
false
enigmampc/catalyst
catalyst/exchange/utils/exchange_utils.py
1
18481
import hashlib import json import os import pickle import shutil from datetime import date, datetime import pandas as pd from catalyst.assets._assets import TradingPair from six import string_types from six.moves.urllib import request from catalyst.constants import DATE_FORMAT, SYMBOLS_URL from catalyst.exchange.exch...
apache-2.0
-1,107,145,130,667,968,300
21.986318
79
0.591851
false
3.883379
false
false
false
Lehoang89/Python-plot
Histogram/export_3d.py
1
1437
import numpy as np from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm as CM from matplotlib import mlab as ML import numpy as NP import matplotlib.pyplot as PLT import re import math x = [] y = [] z= [] u = [] v = [] w = [] count = 0 f = open("10mm_true.txt") for line in iter(f): xa = line.split...
cc0-1.0
305,400,866,816,532,740
19.239437
90
0.551148
false
2.534392
false
false
false
gytdau/holiday-thingy
holiday_bot/run.py
1
2528
from slackbot.bot import Bot from slackbot.bot import listen_to from slackbot.bot import respond_to from holiday_bot.slackbot_settings import * import json, re, pdb, time, schedule, threading, sys, logging from holiday_bot.Messenger import Messenger from holiday_bot import google_calendar, nlp, commands logging.basicCo...
mit
8,625,916,811,084,066,000
24.535354
80
0.630142
false
3.907264
false
false
false
Harvard-ATG/canvas-utils
rubricassessments/rubricassessments.py
1
11470
from settings.secure import OAUTH_TOKEN, CANVAS_URL from canvas_sdk.methods import submissions, assignments, courses from canvas_sdk.utils import get_all_list_data from canvas_sdk import RequestContext import sys import os.path import logging import json import argparse import xlwt import datetime logging.basicConfig(...
bsd-3-clause
5,841,404,994,522,247,000
41.802239
138
0.650305
false
3.951085
false
false
false
algorhythms/LeetCode
341 Flatten Nested List Iterator.py
1
4303
""" Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integers or other lists. Example 1: Given the list [[1,1],2,[1,1]], By calling next repeatedly until hasNext returns false, the order of elements returned by next shoul...
mit
169,066,892,837,021,380
27.496689
118
0.545201
false
4.078673
false
false
false
kgullikson88/HET-Scripts
FitTellurics.py
1
13978
import sys import os from scipy.interpolate import InterpolatedUnivariateSpline as interp import numpy as np import matplotlib.pyplot as plt from astropy.io import fits as pyfits from astropy import units, constants import TelluricFitter import DataStructures from astropy import units, constants import FittingUtilitie...
gpl-3.0
1,628,285,478,181,695,500
42.409938
115
0.51345
false
3.650562
false
false
false
timothycrosley/thedom
thedom/base.py
1
54962
''' base.py This library defines the most basic (abstract) dom element from which all other elements are derived Copyright (C) 2015 Timothy Edmund Crosley 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...
gpl-2.0
6,085,252,589,610,849,000
33.286962
117
0.567574
false
4.980246
false
false
false
amullins83/pygame_practice
main.py
1
1375
import pygame from game_logic import PongLogic from game_ui import PongUI from game_event import PongEvent class Pong(object): """Pong game""" def __init__(self, width, height): super(Pong, self).__init__() self.width = width self.height = height self.size = (self.width, self.h...
mit
-7,057,467,526,445,851,000
22.706897
56
0.570182
false
3.777473
false
false
false
quantopian/pgcontents
pgcontents/crypto.py
1
6943
""" Interface definition for encryption/decryption plugins for PostgresContentsManager, and implementations of the interface. Encryption backends should raise pgcontents.error.CorruptedFile if they encounter an input that they cannot decrypt. """ import sys import base64 from functools import wraps from cryptography....
apache-2.0
-2,377,460,655,948,116,500
27.223577
79
0.645398
false
4.055491
false
false
false
kubeflow/pipelines
samples/test/lightweight_python_functions_v2_pipeline_test.py
1
3695
# Copyright 2021 The Kubeflow Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
6,152,953,533,428,986,000
30.853448
80
0.473072
false
4.419856
false
false
false
SMERM/TR-2015-2016
A.A.-2015-2016/20160125/Pro_crescendi_gliss.py
1
1747
import math # t0(inizio del processo), t1(fine del processo), w0(durata iniziale della cella), w1(durata finale della cella) freq0(frequenza iniziale), freq1(frequenza finale) phi= 0.6180339 def accelerando_gliss(t0,t1,w0,w1,freq0,freq1): totdur= t1-t0 ftime= totdur*phi # durata del processo di accelerando p0= 0....
cc0-1.0
8,231,680,839,043,874,000
40.595238
165
0.672582
false
2.065012
false
false
false
lfrdm/medpy
bin/others/extract_minimal_markers.py
2
6061
#!/usr/bin/python """Creates minimal foreground and background markers for a volume through its reference mask.""" # build-in modules from argparse import RawTextHelpFormatter import argparse import logging import os import scipy # third-party modules import numpy from nibabel.loadsave import load, save from nibabel...
gpl-3.0
-4,551,538,474,973,417,000
38.875
125
0.645768
false
3.807161
false
false
false
rachel3834/lcogt-commissioning
scripts/sinistro.py
1
1622
# -*- coding: utf-8 -*- """ Created on Mon Jul 18 14:08:21 2016 @author: rstreet """ class SinistroFrame: def __init__(self, image_file): self.image_file = image_file self.raw_quad_dims = ( 2080, 2048 ) self.bias_sec = ( 1, 2048, 2049, 2080 ) # Pixel range: xmin, xmax, ymin, y...
gpl-3.0
1,930,499,721,030,770,400
35.863636
89
0.466708
false
3.533769
false
false
false
tgingold/ghdl
python/setup.py
1
1631
#!/usr/bin/env python import distutils.command.build_py from distutils.core import setup import re def get_version(): # Try from version.py. Reads it to avoid loading the shared library. r = re.compile("^__version__ = '(.*)'\n") try: l = open('libghdl/version.py').read() m = r.match(l) ...
gpl-2.0
-966,755,910,366,196,400
28.654545
79
0.627223
false
3.640625
false
false
false
qdw-luke/arcadia-airlines
test.py
1
2301
from math import pi import os import csv from bokeh.models import HoverTool from bokeh.plotting import ColumnDataSource, figure, show, output_file, save import pyodbc import numpy as np data_path = os.path.join(os.curdir, 'data', 'Output1.csv') coord_path = os.path.join(os.curdir, 'data', 'airports.csv') origins = {...
mit
35,420,817,247,663,948
22.02
100
0.667101
false
2.762305
false
false
false
Symantec/load-runner
load_runner/remote.py
1
2675
# Copyright 2014 Symantec. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
-2,058,902,217,868,362,500
37.214286
77
0.656075
false
4.29374
false
false
false
opennorth/represent-canada
fabfile.py
1
3803
import os from functools import wraps from fabric.api import cd, env, run, task from fabric.network import ssh ssh.util.log_to_file('paramiko.log') def _require_db(target): """Decorator to enforce env.read_only_db""" @wraps(target) def inner(*args, **kwargs): if env.read_only_db: rai...
mit
-9,155,094,053,948,188,000
24.52349
105
0.610045
false
3.476234
false
false
false
esbozos/megax
centinela_cms/centinela/views.py
1
3514
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.views import generic from django.conf import settings from django.utils impo...
mit
5,169,075,796,127,857,000
33.792079
115
0.666762
false
3.553084
false
false
false
thomaswilley/geeknews
gn/gnsite/forms.py
1
1269
from django.forms import ModelForm, ValidationError, Textarea from gnsite.models import Post from django.utils.translation import ugettext as _ class PostForm(ModelForm): class Meta: model = Post fields = ['title', 'link', 'desc'] widgets = { 'desc': Textarea(attrs={'cols': 60, ...
mit
5,333,099,846,388,323,000
29.95122
61
0.562648
false
4.244147
false
false
false
takahito-tejima/OpenSubdiv-exp
examples/python/utility.py
1
3247
# # Copyright 2013 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # # 6. T...
apache-2.0
-2,318,116,140,018,119,000
30.833333
76
0.610718
false
3.227634
false
false
false
philanthropy-u/edx-platform
lms/djangoapps/grades/migrations/0013_persistentsubsectiongradeoverride.py
21
1201
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from coursewarehistoryextended.fields import UnsignedBigIntOneToOneField class Migration(migrations.Migration): dependencies = [ ('grades', '0012_computegradessetting'), ] operations = [ ...
agpl-3.0
-183,943,342,400,203,200
40.413793
119
0.631973
false
4.383212
false
false
false
wangke0809/bjutNet
setup.py
1
3180
#!/usr/bin/env python # -*- coding: utf-8 -*- # Note: To use the 'upload' functionality of this file, you must: # $ pip install twine import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command # Package meta-data. NAME = 'bjutNet' DESCRIPTION = '连接北工大校园网的SDK' URL...
mit
-5,057,447,287,140,802,000
27.178571
86
0.620406
false
3.69555
false
false
false
darkdrei/GestionRegistro
usuario/urls.py
1
1429
from django.conf.urls import url import views from django.views.generic import TemplateView from django.contrib.auth.decorators import login_required #empleado urlpatterns = [ url(r'^login/empleado/$',login_required(views.LoginEmpleado.as_view()) ,name='login_empleado'), url(r'^add/empleado/$',login_re...
mit
3,754,330,519,699,195,400
40.029412
114
0.692092
false
2.89858
false
true
false
Guitar-Machine-Learning-Group/guitar-transcriber
dataset.py
1
2586
import os import numpy as np class Dataset(object): """ This class represents a dataset and consists of a list of SongData along with some metadata about the dataset """ def __init__(self, songs_data=None): if songs_data is None: self.songs_data = [] else: self...
mit
-9,177,001,418,677,709,000
23.396226
113
0.564192
false
3.611732
false
false
false
ctogle/msched
src/msched/controllers/grunt.py
1
2471
import msched.core.tools as tl import msched.core.controller as cn import time,mpi4py from mpi4py import MPI ############################################################################### ############################################################################### def enqueue(state): r,l = state['radio'],sta...
mit
-9,114,693,732,537,562,000
30.679487
79
0.448401
false
4.327496
false
false
false
ea4gja/mrig
mrigd/ic_r8500.py
1
8893
#!/usr/bin/env python # # File: ic_r8500.py # Version: 1.0 # # mrigd: IC_r8500 class definition # Copyright (c) 2006-2008 Martin Ewing # # 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 ve...
gpl-2.0
9,211,766,387,360,449,000
41.347619
85
0.54155
false
2.977235
false
false
false
SINTEF-Infosec/Incident-Information-Sharing-Tool
incidents/forms.py
1
6005
from django import forms import uuid from datetimewidget.widgets import DateTimeWidget from incidents.models import * class AttachmentForm(forms.ModelForm): class Meta: model = Attachment fields = ('format', 'file') widgets = { 'format': forms.Select(attrs={'aut...
apache-2.0
-2,055,566,047,271,081,200
32.932203
156
0.557036
false
4.549242
false
false
false
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/631_DeliciousTopChoiceMeat/__init__.py
1
3351
# Made by Renji v0.1 import sys from com.l2scoria import Config from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest qn = "631_DeliciousTopChoiceMeat" #NPC TUNATUN = 31537 #ITEMS T...
gpl-3.0
-1,791,153,600,066,437,400
32.52
119
0.612355
false
2.94723
false
false
false
ulido/pgfplots.py
pgfplots/figure.py
1
1498
from .util import _OptionsDict, note_pdf_encode from .axis import Axis class Figure(object): """Figure class to hold a single PGF figure. To add an axis call the add_axes method. To produce LaTeX code, call str(figure).""" def __init__(self, options={}, note=None): """Initialize a new Figure insta...
gpl-2.0
-8,756,210,382,363,844,000
38.421053
79
0.594126
false
3.962963
false
false
false
vigilo/vigiconf
src/vigilo/vigiconf/tests/all/LDAPS.py
1
1585
# -*- coding: utf-8 -*- #pylint: disable-msg=C0301,C0111,W0232,R0201,R0903,W0221 # Copyright (C) 2011-2020 CS GROUP - France # License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html> from __future__ import unicode_literals from vigilo.vigiconf.lib.confclasses.validators import arg, String, Bool from vigilo.vig...
gpl-2.0
6,951,814,662,537,532,000
31.979167
91
0.617183
false
3.525612
false
false
false
kartoza/jakarta-flood-maps
django_project/flood_mapper/forms/add_flood_status_report.py
1
2571
# -*- coding: utf-8 -*- """**Forms used to add new flood status reports** .. tip:: The AddFloodStatusReport form class is essentially a model form with the addition of related fields village and rw. """ __author__ = 'Christian Christelis <christian@kartoza.com>' __revision__ = '$Format:%H$' __date__ = '08/12/2...
bsd-2-clause
8,058,074,762,150,604,000
31.544304
76
0.556593
false
3.626234
false
false
false
hasteur/g13bot_tools_new
pywikibot/site_detect.py
3
10741
# -*- coding: utf-8 -*- """Classes for detecting a MediaWiki site.""" # # (C) Pywikibot team, 2010-2015 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' # import json import re from requests import RequestException import pywikibot ...
mit
4,625,051,923,198,749,000
33.536977
91
0.551252
false
4.172883
false
false
false
christopherjenness/ML-lib
ML/discriminantanalysis.py
1
3933
""" Linear, Quadratic and Regularized discriminant analysis. Regularized discriminant analysis is a compromise between linear discrimenent analysis and quadratic discrimenent analysis. If you wish to add the constraint that the covariance matrix be diagonal (independent features), use Naive Bayes instead. """ import ...
mit
-4,366,610,609,910,096,400
39.132653
79
0.593694
false
4.105428
false
false
false
adaptive-learning/proso-apps
proso/django/db.py
1
1160
from contextlib import closing from django.db import connection import csv import re def dump_table(table_name, pk_column, batch_size, dest_file): with closing(connection.cursor()) as cursor: cursor.execute('SELECT COUNT(*) FROM {}'.format(table_name)) count, = cursor.fetchone() for offset in ...
mit
281,542,680,948,859,780
34.151515
127
0.610345
false
3.892617
false
false
false
m4h4n/python-telegram-bot
telegram/bot.py
2
23991
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015 Leandro Toledo de Souza <leandrotoeldodesouza@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by # the ...
gpl-3.0
6,185,400,908,549,091,000
31.50813
79
0.554875
false
4.659351
false
false
false
EricssonResearch/calvin-base
calvin/runtime/north/calvinlib.py
1
3958
# -*- coding: utf-8 -*- # Copyright (c) 2017 Ericsson AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
-494,599,815,981,060,200
29.921875
102
0.608388
false
4.325683
false
false
false
chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend
tests/unit/dataactvalidator/test_b5_object_class_program_activity_1.py
1
1403
from tests.unit.dataactcore.factories.staging import ObjectClassProgramActivityFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'b5_object_class_program_activity_1' def test_column_headers(database): expected_subset = {'row_number', 'gross_outlay_amount_by_pro_fyb', '...
cc0-1.0
4,482,483,461,465,462,300
44.258065
111
0.696365
false
3.372596
true
false
false
ReckoningReckoner/conferenceX
conferenceX/views.py
1
5383
from conferenceX.flask_app import app, db from conferenceX.models import HTML, Person, Question, User, Sponsor from conferenceX.models import DATABASE_DICT from flask import render_template, session, redirect, url_for, request from flask import flash, abort import json def get_table_from_str(table): """ Given a s...
apache-2.0
-7,696,415,179,632,550,000
28.415301
79
0.587776
false
3.993323
false
false
false
petricm/DIRAC
ResourceStatusSystem/PolicySystem/StateMachine.py
2
9578
""" StateMachine This module contains the basic blocks to build a state machine ( State and StateMachine ). And the RSS implementation of it, using its own states map. """ from DIRAC import S_OK, S_ERROR, gLogger __RCSID__ = '$Id$' class State( object ): """ State class that represents a single step on ...
gpl-3.0
6,527,057,393,117,463,000
32.964539
115
0.612341
false
3.874595
true
false
false
geometalab/osmaxx-frontend
osmaxx/excerptexport/migrations/0001_initial.py
2
7173
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-23 11:42 from __future__ import unicode_literals from django.conf import settings import django.contrib.gis.db.models.fields from django.core.files.storage import FileSystemStorage from django.db import migrations, models import django.db.models.deletion i...
mit
7,859,348,990,958,127,000
50.235714
217
0.616478
false
4.287507
false
false
false
heartsucker/securedrop
securedrop/alembic/versions/15ac9509fc68_init.py
2
3356
"""init Revision ID: 15ac9509fc68 Revises: Create Date: 2018-03-30 21:20:58.280753 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '15ac9509fc68' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_table('journalists', ...
agpl-3.0
-342,859,747,703,576,100
37.574713
79
0.665077
false
3.445585
false
false
false
jupierce/openshift-tools
ansible/roles/lib_openshift_3.2/build/lib/service.py
13
3668
# pylint: skip-file # pylint: disable=too-many-instance-attributes class ServiceConfig(object): ''' Handle service options ''' # pylint: disable=too-many-arguments def __init__(self, sname, namespace, ports, selector=None, ...
apache-2.0
1,127,175,304,063,221,400
28.111111
78
0.538168
false
4.089186
false
false
false
yongshengwang/hue
desktop/core/ext-py/guppy-0.1.10/guppy/gsl/SpecNodes.py
37
16306
#._cv_part guppy.gsl.SpecNodes ## # Specification entity object # # Collects information about a particular system entity or aspect. # # The entity is of a general kind # It is defined by the particular aspects defined for it # The aspects must be 'compatible', which can be relatively checked. # The specobject is use...
apache-2.0
3,234,125,153,876,644,400
24.438378
89
0.607506
false
3.162529
false
false
false
KnowNo/reviewboard
reviewboard/reviews/ui/image.py
5
2859
from __future__ import unicode_literals from django.utils.html import escape from djblets.util.templatetags.djblets_images import crop_image from reviewboard.reviews.ui.base import FileAttachmentReviewUI class ImageReviewUI(FileAttachmentReviewUI): name = 'Image' supported_mimetypes = ['image/*'] allow...
mit
3,748,597,488,857,108,000
34.7375
76
0.568381
false
4.125541
false
false
false
radekstepan/FlaskBudget
presenters/expenses.py
1
30706
#!/usr/bin/python # -*- coding: utf -*- # framework from datetime import date from flask import Blueprint, session, render_template, redirect, request, flash from flask.helpers import url_for, make_response # presenters from presenters.auth import login_required # models import entries from models.expenses import Ex...
cc0-1.0
-294,949,231,017,759,940
46.168971
126
0.549078
false
4.247614
false
false
false
Vagab0nd/SiCKRAGE
tests/pp_tests.py
1
5615
""" Test post processing """ import os.path import shutil import unittest from sickchill import settings from sickchill.oldbeard.helpers import make_dirs from sickchill.oldbeard.name_cache import add_name from sickchill.oldbeard.postProcessor import PostProcessor from sickchill.tv import TVEpisode, TVShow from tests ...
gpl-3.0
-3,807,840,731,034,930,000
35.940789
176
0.621193
false
3.832765
true
false
false
UManPychron/pychron
docs/user_guide/operation/scripts/examples/argus/measurement/jan_ic_peak_hop3_no_eq.py
2
1723
#!Measurement ''' ''' #counts #baselines BASELINE_COUNTS= 75 BASELINE_DETECTOR= 'H1' BASELINE_MASS= 34.2 BASELINE_BEFORE= False BASELINE_AFTER= True BASELINE_SETTLING_TIME= 15 #equilibration EQ_TIME= eqtime INLET= 'R' OUTLET= 'O' EQ_DELAY= 3.0 ACTIVE_DETECTORS = ('H1','AX','L2') FITS = ('Ar40H1:parabolic','Ar40AX:pa...
apache-2.0
-4,023,022,375,579,353,600
22.930556
89
0.662217
false
2.752396
false
false
false
lj8385174/PyComms
MPU6050/Examples/main_threads_test.py
1
7657
from __future__ import print_function import time import math import mpu6050 import hmc5883l import bmp085 import thread from gpsdData import * global stop def fileOpen(fileToWrite,bufferring = 100): if fileToWrite!=None: try: file1 = open(fileToWrite,'w',bufferring) except: print('file open f...
mit
4,044,621,002,327,832,000
25.586806
93
0.578556
false
3.077572
false
false
false
zingale/hydro_examples
compressible/slow_shock.py
1
1201
# derive the Riemann initial conditions for a slow moving shock from the # shock jump conditions. # # We'll consider a right moving shock. We know that the shock speed is # # S = u_r + c_r [ (pstar/p_r) (gamma+1)/(2 gamma) + (gamma-1)/(2 gamma) ]^(1/2) # # We can pick a (pstar/p_r) and a rho_r, which then defines c_r...
bsd-3-clause
2,363,927,017,142,312,000
29.025
85
0.591174
false
2.397206
false
false
false
alanjds/xhtml2pdf
sx/pisa3/pisa_tables.py
1
14058
# -*- coding: ISO-8859-1 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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
-8,521,409,160,592,392,000
32.631579
122
0.534784
false
3.761841
false
false
false
seeul8er/DroneBridge
communication/DroneBridgeLib/DroneBridge/DroneBridge.py
1
14915
# # This file is part of DroneBridgeLib: https://github.com/seeul8er/DroneBridge # # Copyright 2019 Wolfgang Christl # # 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.a...
apache-2.0
4,138,563,526,371,423,000
48.551495
122
0.631981
false
3.727818
false
false
false
gmimano/commcaretest
corehq/apps/sms/api.py
1
33084
import logging from django.conf import settings from celery.task import task from dimagi.utils.modules import to_function from corehq.apps.sms.util import clean_phone_number, create_billable_for_sms, format_message_list, clean_text from corehq.apps.sms.models import SMSLog, OUTGOING, INCOMING, ForwardingRule, FORWARD_...
bsd-3-clause
-2,009,863,365,310,793,200
40.25187
197
0.601227
false
4.1678
false
false
false
dhermes/project-euler
python/complete/no113.py
1
1424
#!/usr/bin/env python # Increasing number: # For up to n digits, each number can be # a_1...a_n # d_1 = a_1, d_2 = a_2 - a_1, etc. where # d_1 + d_2 + ... + d_j = a_j <= 9 # We need to allow the sum to be less than 9, # so we have some other B such that # d_1 + d_2 + ... + d_n + B = 9, then # we have (n + 1) bins for ...
apache-2.0
1,778,887,969,809,378,000
29.956522
64
0.60323
false
2.67167
false
false
false
ronaldahmed/robot-navigation
neural-navigation-with-lstm/MARCO/nltk_contrib/unimelb/tacohn/hmm/demo.py
2
1698
# # Natural Language Toolkit: Hidden Markov Model extensions # # Copyright (C) 2004 University of Melbourne # Author: Trevor Cohn <tacohn@cs.mu.oz.au> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT # # $Id: demo.py,v 1.1 2004/07/16 02:10:06 trevorcohn1 Exp $ # """ Demonstration of the optimised...
mit
1,080,422,120,166,282,000
31.037736
79
0.697291
false
3.132841
false
false
false
abetusk/www.meowcad.com
cgi/libmodImport.py
1
1891
#!/usr/bin/python import re import cgi import cgitb import sys import json import uuid import subprocess as sp import Cookie import redis import meowaux as mew import os cgitb.enable(); staging_base = "/home/meow/stage" u_id = -1 print "Content-Type: application/json" print cookie = Cookie.SimpleCookie() cookie...
agpl-3.0
3,389,724,976,551,455,000
20.988372
106
0.620307
false
2.900307
false
false
false
cupy/cupy
cupy/polynomial/polynomial.py
1
1299
import cupy def polyvander(x, deg): """Computes the Vandermonde matrix of given degree. Args: x (cupy.ndarray): array of points deg (int): degree of the resulting matrix. Returns: cupy.ndarray: The Vandermonde matrix .. seealso:: :func:`numpy.polynomial.polynomial.polyvander...
mit
2,681,441,163,758,112,000
27.23913
79
0.613549
false
3.427441
false
false
false
MoisesTedeschi/python
Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/site-packages/hyperlink/_url.py
1
72479
# -*- coding: utf-8 -*- u"""Hyperlink provides Pythonic URL parsing, construction, and rendering. Usage is straightforward:: >>> from hyperlink import URL >>> url = URL.from_text(u'http://github.com/mahmoud/hyperlink?utm_source=docs') >>> url.host u'github.com' >>> secure_url = url.replace(scheme=u'htt...
gpl-3.0
-4,269,299,046,719,132,000
36.720979
126
0.576316
false
3.924927
false
false
false
jpmeijers/muninplugins
D-Link router/get_modem_line_info.py
1
3782
#!/usr/bin/python ''' A Munin plugin to graph D-Link DSL-2750U Router's ADSL connection quality Copyright (C) 2014 NC Thompson & JP Meijers 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 Fo...
gpl-2.0
-7,984,070,328,035,977,000
29.015873
91
0.620836
false
3.156928
false
false
false
emilydolson/forestcat
pyrobot/brain/ravq.py
1
17084
import numpy.oldnumeric as Numeric import math, random, sys from pyrobot.tools.circularlist import CircularList __author__ = "Jeremy Stober" __version__ = "$Revision: 2587 $" class ModelList(CircularList): def __init__(self, bucketSize=5): CircularList.__init__(self) self.bucketSize = bucketSize ...
agpl-3.0
4,586,709,806,596,947,000
34.740586
138
0.563041
false
3.860791
false
false
false
mbakker7/ttim
ttim/util.py
1
4294
import numpy as np import matplotlib.pyplot as plt class PlotTtim: def plot(self, win=None, newfig=True, figsize=None): """Plot layout Parameters ---------- win : list or tuple [x1, x2, y1, y2] """ if newfig: ...
mit
-5,758,173,613,336,218,000
33.087302
80
0.490219
false
3.793286
false
false
false
metacloud/photon
photon/config.py
1
6572
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2017 Cisco Systems, Inc. # # 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 r...
mit
-6,222,718,856,824,118,000
33.229167
79
0.606056
false
4.510638
true
false
false
akvo/akvo-rsr
akvo/rsr/models/result/indicator_reference.py
1
2594
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from .indicator import Indicator from...
agpl-3.0
2,675,736,764,848,285,000
44.508772
97
0.661527
false
4.217886
false
false
false
dami0/public
main.py
1
11482
#!/usr/bin/python from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.stacklayout import StackLayout from kivy.uix.checkbox import CheckBox from kivy.uix.togglebutton import ToggleButton f...
isc
-3,798,126,263,277,226,500
31.712251
85
0.598589
false
3.760891
false
false
false
furgerf/kaggle-projects
titanic/titanic_kaggle.py
1
11164
import os import numpy as np import matplotlib.pyplot as plot import re from kaggle import Kaggle class TitanicKaggle(Kaggle): """ Solver for the Titanic kaggle problem. """ PREDICTOR_COLUMN_NAME = 'Survived' ID_COLUMN_NAME = 'PassengerId' ALL_FEATURES = ['Embarked', 'Parch', 'SibSp', 'Pclass', 'Sex', 'A...
apache-2.0
-4,958,988,780,953,018,000
44.942387
175
0.62191
false
2.887739
false
false
false
ImpGuard/instaparse
src/pygenStatic.py
1
2987
from codegen import CodeGenerator from util import InstaParseFile def pygenStaticHelpers(): helpers = """ def readline(inputFile, className): \tline = inputFile.readline() \tif line == "": \t\traise ValueError("Parser Error: Reached end of file while parsing object \\"" + className + "\\".") \treturn line.strip() ...
mit
629,495,020,287,319,900
36.3375
112
0.723803
false
3.341163
false
false
false
InfectedPacket/TerrorCat
Message.py
1
13343
#!/usr/bin/env python # # Copyright (C) 2015 Jonathan Racicot # # 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 later version. # # This...
lgpl-3.0
-7,584,620,245,899,071,000
26.010121
70
0.57888
false
2.837125
false
false
false
dev-marco/website-tester
src/urlfinder.py
1
7529
# -*- coding: utf-8 -*- import re, html.parser, urlutils, abc class URLFinder (object, metaclass = abc.ABCMeta): def _start (self, code, canonical, charset): charset = charset.lower() self.__code = code self.__canonical = canonical self.__charset = charset def _change_charset...
apache-2.0
-891,130,605,890,471,600
29.605691
143
0.489839
false
4.304746
false
false
false
elijh/bitmask_client
src/leap/bitmask/util/password.py
1
1861
# -*- coding: utf-8 -*- # password.py # Copyright (C) 2013 LEAP # # 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 later version. # # Th...
gpl-3.0
-498,595,217,932,866,900
31.086207
71
0.700161
false
4.182022
false
false
false
Bayesian-Skulls/carpool_app
crons.py
1
4007
import os import mandrill from faker import Faker from random import randint, choice from seeder import generate_location_json from flask.ext.script import Manager from carpool_app import create_app, db from carpool_app.tasks import build_carpools, send_unconfirmed_email from seeder import generate_vehicle from datetim...
mit
-8,019,972,200,251,517,000
33.543103
89
0.623659
false
3.457291
false
false
false
allenai/deep_qa
deep_qa/layers/encoders/attentive_gru.py
3
7918
from overrides import overrides from keras.engine import InputSpec from keras import backend as K from keras.layers.recurrent import GRU, _time_distributed_dense class AttentiveGru(GRU): """ GRUs typically operate over sequences of words. The motivation behind this encoding is that a weighted average los...
apache-2.0
6,697,285,613,534,899,000
51.437086
114
0.604698
false
3.996971
false
false
false
dials/dials
extensions/simple_background_ext.py
1
4655
class SimpleBackgroundExt: """An extension class implementing simple background subtraction.""" name = "simple" @staticmethod def phil(): from libtbx.phil import parse phil = parse( """ outlier .help = "Outlier rejection prior to background fit" { ...
bsd-3-clause
-5,473,165,277,891,520,000
30.033333
81
0.546724
false
4.537037
false
false
false
django-extensions/django-extensions
tests/management/commands/test_sqldsn.py
1
7558
# -*- coding: utf-8 -*- from io import StringIO from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from unittest.mock import patch MYSQL_DATABASE_SETTINGS = { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbatabase'...
mit
1,973,249,071,160,454,400
36.979899
109
0.667505
false
3.533427
true
false
false
saviour123/sturdy-octo-train
soccerpundits/views.py
1
2132
import requests import os from django.shortcuts import render, get_object_or_404, redirect from django.views.decorators.cache import cache_page from .models import Post from .forms import PostForm from django.utils import timezone CACHE_TTL = 60 * 15 def post_list(request): posts = Post.objects.filter(published...
mit
3,770,068,387,049,892,400
31.8
94
0.635084
false
3.466667
false
false
false