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
harikishen/addons-server
src/olympia/api/fields.py
1
10385
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.utils.encoding import smart_text from django.utils.translation import get_language, ugettext_lazy as _ from rest_framework import fields, serializers from olympia.amo.utils import to_language from olymp...
bsd-3-clause
9,180,062,847,117,697,000
37.040293
79
0.62494
false
4.318087
false
false
false
mppmu/secdec
examples/box1L/integrate_box1L.py
1
1796
from __future__ import print_function from pySecDec.integral_interface import IntegralLibrary import sympy as sp # load c++ library box1L = IntegralLibrary('box1L/box1L_pylink.so') # choose integrator box1L.use_Vegas(flags=2) # ``flags=2``: verbose --> see Cuba manual # integrate str_integral_without_prefactor, str_...
gpl-3.0
-5,924,396,011,331,012,000
50.314286
146
0.712695
false
2.963696
false
true
false
pombredanne/unuk
src/unuk/contrib/eventweb/resources.py
1
1601
import logging from unuk.core import exceptions logger = logging.getLogger('eventweb') class WSGIResource(object): def __init__(self, server): self.server = server self.handler = server.handler def __call__(self, environ, start_response): handler = self.handler.get_ha...
bsd-3-clause
-2,716,399,108,737,009,700
32.375
76
0.571518
false
4.374317
false
false
false
hyperopt/hyperopt-nnet
hpnnet/nips2011_dbn.py
1
5468
""" Deep Belief Network (DBN) search spaces used in [1] and [2]. The functions in this file return pyll graphs that can be used as the `space` argument to e.g. `hyperopt.fmin`. The pyll graphs include hyperparameter constructs (e.g. `hyperopt.hp.uniform`) so `hyperopt.fmin` can perform hyperparameter optimization. Se...
bsd-3-clause
-6,206,191,359,409,669,000
34.051282
78
0.544989
false
3.428213
false
false
false
petertseng/x-common
bin/check-immutability.py
1
1580
#!/usr/bin/env python import json import subprocess import sys oldf = sys.argv[1] newf = sys.argv[2] immutable_keys = ('property', 'input', 'expected') # Use jq to flatten the test data, and parse it old = json.loads(subprocess.run([f"jq -r '[.. | objects | select(.uuid != null)]' {oldf}"], stdout=subprocess.PIPE,...
mit
-3,237,632,367,559,430,000
28.259259
151
0.640506
false
3.442266
false
false
false
ssfrr/advenshare
mouserver/mouserver/server.py
1
6082
import websocket import json import logging import coloredlogs import sys import ssl from getopt import gnu_getopt, GetoptError from mouserver_ext import grab_window, Window import random import string import time class Mouserver: def __init__(self, ws_url, session, window): self.ws_url = ws_url ...
mit
6,848,767,843,313,734,000
30.189744
87
0.554916
false
3.663855
false
false
false
dmlc/tvm
python/tvm/topi/vision/rcnn/roi_align.py
1
3987
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
9,211,143,365,963,043,000
35.916667
98
0.605217
false
3.146803
false
false
false
tasleson/lvm-dubstep
lvmdbus/cmdhandler.py
1
14945
# Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2. # # You should have received a copy of the GNU General Public License # a...
gpl-2.0
-7,792,544,381,953,663,000
23.14378
79
0.658147
false
2.718756
false
false
false
gmimano/commcaretest
corehq/apps/reports/filters/fixtures.py
1
5198
import json from django.core.urlresolvers import reverse from django.utils.translation import ugettext_noop from corehq.apps.fixtures.models import FixtureDataType, FixtureDataItem from corehq.apps.locations.util import load_locs_json, location_hierarchy_config from corehq.apps.reports.filters.base import BaseReportFil...
bsd-3-clause
-391,699,841,776,118,460
40.919355
130
0.563294
false
3.758496
false
false
false
mathieudesro/pathos
pathos/pp_map.py
1
7526
#!/usr/bin/env python # Based on code by Kirk Strauser <kirk@strauser.com> # Rev: 1139; Date: 2008-04-16 # (also see code in pathos.pp) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of so...
bsd-3-clause
8,449,697,180,205,107,000
40.811111
84
0.671273
false
3.80101
false
false
false
HSASec/ProFuzz
Connector_tcp.py
1
1675
import socket import sys import getopt import DataGenerator import time import thread tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM) usage = sys.argv[0] +' -h <host> -p <port> [-l <length>] [-c <command>]' def main(argv): try: opts, args = getopt.getopt(sys.argv[1:],"h:p:l:") e...
gpl-3.0
-1,375,576,282,421,108,200
22.661765
72
0.492537
false
4.115479
false
false
false
ergoregion/Rota-Program
Rota_System/Saving/Excell/Population.py
1
5654
__author__ = 'Neil Butcher' from Error import ExcellImportExportError import xlwt, xlrd from Rota_System.Roles import GlobalRoleList, role from Rota_System.Worker import Worker from Rota_System.StandardTimes import date_string, get_date def name(an_object): return an_object.name class PopulationSavingObject(ob...
mit
-4,878,196,566,270,454,000
33.901235
119
0.581889
false
3.843644
false
false
false
kirchenreich/osm-api-cache
osmcache/models.py
1
2003
from sqlalchemy import ( BigInteger, Binary, Column, DateTime, Integer, Numeric, String, ) from sqlalchemy.dialects.postgresql import JSON, TIMESTAMP from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.sql import func Base = declarative_base() class OsmBase(Base): ...
mit
-8,110,983,343,575,887,000
24.0375
75
0.688967
false
3.609009
false
false
false
coassets/initial-d
sample_project/urls.py
1
1537
from django.conf.urls.defaults import * from django.conf import settings from crm.xmlrpc import rpc_handler # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # crm and contactinfo URLs (required) (r'^crm/', include('crm.urls')...
gpl-2.0
-1,501,874,727,447,595,000
30.367347
76
0.615485
false
3.677033
false
false
false
ajrbyers/mondroid
src/monitor/management/commands/install_droids.py
1
1680
from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.core.mail import send_mail from django.conf import settings from monitor import models from crontab import CronTab import os import sys try: action = sys.argv[1:][1] except: action = '' def fi...
gpl-2.0
6,182,176,925,109,408,000
26.557377
148
0.685119
false
3.071298
false
false
false
probablytom/msci-model
resp_base/ResponsibleWorkflows.py
1
2256
from theatre_ag.theatre_ag.workflow import treat_as_workflow from .Constraints import Deadline from random import random, choice class CourseworkWorkflow: def __init__(self): self.agent = None self.competence = {'essays_written': 0.95, 'working_programs': 0.95} def...
mit
5,694,300,392,099,812,000
39.285714
122
0.655142
false
3.876289
false
false
false
frisk028/flask-app-umn-courses
courses/public/forms.py
1
5377
# -*- coding: utf-8 -*- from flask_wtf import Form from wtforms import TextField, SelectField, SelectMultipleField, widgets from wtforms.validators import DataRequired import json import os class MultiCheckboxField(SelectMultipleField): widget = widgets.ListWidget(prefix_label=False) option_widget = widgets.C...
mit
-3,242,450,863,080,279,000
54.43299
134
0.590664
false
3.675325
false
false
false
rjschwei/azure-sdk-for-python
unreleased/azure-mgmt-intune/setup.py
1
2533
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
mit
7,684,601,118,646,094,000
31.896104
91
0.597315
false
3.921053
false
false
false
WilJoey/tn_ckan
ckan/controllers/group.py
1
36100
import re import os import logging import genshi import cgi import datetime from urllib import urlencode from pylons.i18n import get_lang import ckan.lib.base as base import ckan.lib.helpers as h import ckan.lib.maintain as maintain import ckan.lib.navl.dictization_functions as dict_fns import ckan.logic as logic imp...
mit
8,639,835,599,501,780,000
38.496718
93
0.531163
false
4.158507
false
false
false
anthonyfok/frescobaldi
frescobaldi_app/snippet/insert.py
1
9303
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # 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,613,117,712,532,106,000
31.872792
101
0.603031
false
4.05713
false
false
false
skylifewww/pangolinland
article/models.py
1
11009
# -*- coding: utf-8 -*- from django.contrib.auth.models import User # from iosDevCourse.users.models import User from django.db import models from embed_video.fields import EmbedVideoField from django.core.urlresolvers import reverse from mptt.models import MPTTModel, TreeForeignKey from ckeditor.fields import RichT...
mit
3,099,177,084,353,075,700
37.350877
147
0.647575
false
3.555628
false
false
false
cuckoobox/cuckoo
cuckoo/data/web/local_settings.py
1
1355
# Copyright (C) 2013 Claudio Guarnieri. # Copyright (C) 2014-2017 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import web.errors # Maximum upload size (10GB, so there's basically no limit). MAX_UPLOAD_SIZE = 10*1024*1024*...
mit
-6,930,075,890,209,785,000
33.74359
82
0.743911
false
3.43038
false
false
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.1/Lib/textwrap.py
1
15708
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> __revision__ = "$Id: textwrap.py 67747 2008-12-13 23:20:54Z antoine.pitrou $" import string, re __all__ = ['TextWrapper', 'wrap', 'fill', 'ded...
mit
-7,864,780,077,585,546,000
39.380463
80
0.592564
false
4.16879
false
false
false
Karosuo/Linux_tools
xls_handlers/xls_sum_venv/lib/python3.6/site-packages/xlsxwriter/chart_column.py
1
3545
############################################################################### # # ChartColumn - A class for writing the Excel XLSX Column charts. # # Copyright 2013-2019, John McNamara, jmcnamara@cpan.org # from . import chart class ChartColumn(chart.Chart): """ A class for writing the Excel XLSX Column ch...
gpl-3.0
-2,085,466,959,176,181,800
26.061069
79
0.464598
false
4.44793
false
false
false
vvoland/py3status
py3status/modules/weather_owm.py
1
29150
# -*- coding: utf-8 -*- """ Display ultimately customizable weather. This module allows you to specify an icon for nearly every weather scenario imaginable. The default configuration options lump many of the icons into a few groups, and due to the limitations of UTF-8, this is really as expressive as it gets. This mo...
bsd-3-clause
1,267,535,162,416,054,500
34.735547
85
0.576739
false
3.771647
true
false
false
collective/zettwerk.users
setup.py
1
1553
from setuptools import setup, find_packages import os version = '0.2.dev0' install_requires = [ 'setuptools', # -*- Extra requirements: -*- ] tests_require = [ 'mocker', ] setup(name='zettwerk.users', version=version, description="Additional user information for Plone", ...
gpl-2.0
-6,070,823,635,687,436,000
31.354167
84
0.607856
false
3.797066
false
false
false
iron-bun/python_scripts
scrape_your_plate/scrape_your_plate.py
1
7791
#!/usr/bin/env python3 # # Scrape recipes from pepperplate.com. # import requests from bs4 import BeautifulSoup import lxml.html import json import time import getpass import re import os class pepperplate_recipe: def __init__(self, id, html): self.id = id self.soup = BeautifulSoup(html) def...
unlicense
8,452,935,934,564,985,000
31.327801
165
0.566294
false
3.65089
false
false
false
tuxofil/sort-media
sort_media.py
1
14535
#!/usr/bin/env python """ This script helps to sort images and videos by date and time. It searches given source directory recursively for media files (images and movies), fetch date and time information from them and copies it (or moves, see '--move' command line option) to destination directory. New file location ...
bsd-2-clause
-3,257,157,324,738,049,000
31.15708
77
0.581218
false
3.821983
false
false
false
alfa-addon/addon
plugin.video.alfa/channels/tnaflix.py
1
7036
# -*- coding: utf-8 -*- #------------------------------------------------------------ import sys PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int if PY3: import urllib.parse as urlparse # Es muy lento en PY2. En PY3 es nativo else: import...
gpl-3.0
-8,309,674,059,046,816,000
44.070513
139
0.61556
false
3.43143
false
false
false
wittrup/crap
whitespace/definitions.py
1
2242
whspchars = "\t\n " nonwhite = bytearray(set(range(0x00, 0x100)) - {9, 10, 32}) """http://compsoc.dur.ac.uk/whitespace/tutorial.html Whitespace tutorial The only lexical tokens in the whitespace language are Space (ASCII 32), Tab (ASCII 9) and Line Feed (ASCII 10). By only allowing line feed as a token, CR/LF problems...
mit
-2,076,799,982,940,555,000
58.026316
216
0.665031
false
4.03964
false
false
false
Nicotine-Plus/nicotine-plus
pynicotine/plugins/multipaste/__init__.py
1
2462
# COPYRIGHT (C) 2020-2021 Nicotine+ Team # COPYRIGHT (C) 2009 Daelstorm <daelstorm@gmail.com> # COPYRIGHT (C) 2008 Quinox <quinox@users.sf.net> # # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pub...
gpl-3.0
7,843,400,834,001,445,000
35.746269
120
0.639318
false
3.817054
false
false
false
Dubrzr/dsfaker
dsfaker/generators/date.py
1
1107
import numpy from . import Generator, ScalingOperator, BoundedGenerator class RandomDatetime(Generator): def __init__(self, generator: BoundedGenerator, start: numpy.datetime64, end: numpy.datetime64, unit): """ A timezone-aware class to generate datetimes between start and end (inclusive) follow...
mit
7,846,631,893,601,746,000
43.28
134
0.64589
false
3.582524
false
false
false
Jaapp-/cloudomate
cloudomate/gateway/bitpay.py
1
2301
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os from math import pow import electrum.bitcoin as bitcoin from electrum import paymentrequest as pr from future import standard_library from future.moves.urllib ...
lgpl-3.0
-7,944,241,061,399,661,000
31.408451
115
0.646675
false
3.705314
false
false
false
wheeler-microfluidics/teensy-minimal-rpc
rename.py
1
2609
from __future__ import absolute_import import sys import pandas as pd from path_helpers import path def main(root, old_name, new_name): names = pd.Series([old_name, new_name], index=['old', 'new']) underscore_names = names.map(lambda v: v.replace('-', '_')) camel_names = names.str.split('-').map(lambda x...
gpl-3.0
-8,312,201,469,927,363,000
36.811594
78
0.558835
false
4.201288
false
false
false
jerjou/gssheet
gssheet/spreadsheet.py
1
9422
import cgi import csv import datetime import json import re import oauth2 class Cell: def __init__(self, xml): self.row = xml['gs$cell']['row'] self.col = xml['gs$cell']['col'] self.value = xml['gs$cell']['inputValue'] self.edit_url = (l['href'] for l in xml['link'] if 'edit' == l['rel']).next() d...
bsd-2-clause
-3,269,858,196,076,954,000
27.638298
90
0.573445
false
3.308287
false
false
false
mcfletch/django-assets
django_assets/env.py
1
8523
import imp import threading from importlib import import_module from django.apps import apps from django.contrib.staticfiles import finders from django.conf import settings from webassets.env import ( BaseEnvironment, ConfigStorage, Resolver, url_prefix_join) from django_assets.glob import Globber, has_magic __...
bsd-2-clause
5,771,456,800,310,562,000
33.228916
78
0.611756
false
4.225583
true
false
false
JeromeParadis/django-activity-stream
actstream/migrations/0007_auto__add_field_follow_started.py
1
6331
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: # timezone support for django > 1.4 from django.utils import timezone tz = timezone except ImportError: tz = d...
bsd-3-clause
8,487,151,324,711,568,000
71.770115
204
0.561365
false
3.715376
false
false
false
cedricbonhomme/Grenouille
watcher.py
1
2434
#! /usr/bin/env python # -*- coding: utf-8 -*- # Grenouille - An online service for weather data. # Copyright (C) 2014 Cédric Bonhomme - http://cedricbonhomme.org/ # # 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 th...
agpl-3.0
-7,473,430,504,389,210,000
25.445652
79
0.637896
false
3.748844
false
false
false
strogo/djpcms
djpcms/apps/cache.py
1
5941
from copy import deepcopy from django.core.cache import cache from django.contrib.sites.models import Site from django.db.models import signals from django.http import Http404 from djpcms import sites from djpcms.models import Page from djpcms.views import appsite from djpcms.views.baseview import pageview class Pa...
bsd-3-clause
7,900,610,637,577,406,000
31.464481
105
0.529709
false
4.192661
false
false
false
nafitzgerald/allennlp
allennlp/modules/token_embedders/embedding.py
1
13971
import gzip import logging from overrides import overrides import numpy import torch from torch.nn.functional import embedding import h5py from allennlp.common import Params from allennlp.common.checks import ConfigurationError from allennlp.common.file_utils import cached_path from allennlp.data import Vocabulary fr...
apache-2.0
-4,872,697,086,478,548,000
46.359322
108
0.610622
false
4.495174
false
false
false
arannasousa/pagseguro_xml
exemplos/testes_assinatura.py
1
6513
# coding=utf-8 # --------------------------------------------------------------- # Desenvolvedor: Arannã Sousa Santos # Mês: 12 # Ano: 2015 # Projeto: pagseguro_xml # e-mail: asousas@live.com # --------------------------------------------------------------- import loggin...
gpl-2.0
5,631,187,900,823,134,000
26.476793
118
0.590078
false
2.973059
false
false
false
sailorsenergy/windb2
bin/insert-mesowest-data.py
1
5096
#!/usr/bin/env python3 # # # Mike Dvorak # Postdoc # UC Berkeley # Civil and Environmental Engineering # dvorak@berkeley.edu # # Created: 2013-07-09 # Modified: 2016-01-22 # # # Description: Inserts CSV files from Mesowest (mesowest.utah.edu). The CSV files are the type you get when you save # the "CSV" files, which ar...
gpl-3.0
-6,013,748,427,673,454,000
31.458599
187
0.681515
false
3.153465
false
false
false
hansbrenna/NetCDF_postprocessor
area_calculator.py
1
1415
# -*- coding: utf-8 -*- """ Created on Thu Jun 25 13:07:42 2015 @author: hanbre """ from __future__ import print_function from math import * import numpy as np R=6378*1000 #Earth's radius lat1=radians(12.31579) #latitude and longitude boundaries for the calculation lat2=radians(16.10526) lon1=268.5 lon2=272.5 P=29.7...
gpl-3.0
-8,894,281,081,695,982,000
25.222222
96
0.708127
false
2.394247
false
false
false
cowlicks/odo
odo/into.py
1
4707
from __future__ import absolute_import, division, print_function import functools from toolz import merge from multipledispatch import Dispatcher from .convert import convert from .append import append from .resource import resource from .utils import ignoring import datashape from datashape import discover from d...
bsd-3-clause
-1,310,497,420,108,693,200
29.967105
90
0.656682
false
3.805174
false
false
false
dgilland/alchy
setup.py
1
1592
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def parse_requirements(filename): return [line.strip() for line in read(filename).strip().split('\n') ...
mit
8,434,848,589,541,545,000
29.615385
71
0.606784
false
4.082051
false
false
false
vivekpabani/projecteuler
python/012/problem_012.py
1
1116
#!/usr/bin/env python """ Problem Definition : The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle n...
apache-2.0
-4,799,293,626,819,717,000
18.578947
174
0.594086
false
3.117318
false
false
false
seakers/daphne_brain
AT/analysis/AnomalyDetectionAgreements.py
1
5289
import logging from django.shortcuts import render from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status import pandas as pd import numpy as np import json def fill_neighbors(series, radius): n = series.shape[0] ...
mit
6,911,759,693,028,830,000
43.445378
135
0.615239
false
3.675469
false
false
false
RocketRedNeck/PythonPlayground
pidSim2.py
1
20497
# -*- coding: utf-8 -*- """ pidSim2.py A simulation of a vision control to steering PID loop accounting for communication and processing latency and variation; demonstrates the impact of variation to successful control. THIS VERSION models the control as a 1st order input (velocity) and then integrates once to get po...
mit
8,180,067,789,737,755,000
43.56087
133
0.694346
false
3.550494
false
false
false
chebee7i/twitter
data/rsync.py
1
1182
""" Script to backup Twitter data using rsync. A lockfile ensures that this script does not run until the previous run has finished. """ from __future__ import print_function import errno import fcntl import glob import os import subprocess import sys import time import configparser config = configparser.ConfigPa...
unlicense
-8,303,988,705,077,570,000
21.730769
75
0.598139
false
3.636923
true
false
false
cortesi/qtile
libqtile/widget/mpd2widget.py
1
5933
from . import base from libqtile.log_utils import logger from six import u, text_type from socket import error as socket_error from mpd import MPDClient, ConnectionError, CommandError # Shortcuts # TODO: Volume inc/dec support keys = { # Left mouse button "toggle": 1, # Right mouse button "stop": 3, ...
mit
8,775,754,530,389,253,000
28.517413
87
0.578797
false
4.114424
false
false
false
mitsuhiko/celery
celery/bin/celerybeat.py
1
4325
#!/usr/bin/env python """celerybeat .. program:: celerybeat .. cmdoption:: -s, --schedule Path to the schedule database. Defaults to ``celerybeat-schedule``. The extension ".db" will be appended to the filename. .. cmdoption:: -f, --logfile Path to log file. If no logfile is specified, ``stderr`` is us...
bsd-3-clause
2,549,191,977,450,604,500
29.892857
77
0.602081
false
4.049625
false
false
false
yuxiang-zhou/AnimeTracker
AnimeFetcher/anime_updater_78land.py
1
2889
#!/usr/bin/python3 import sys import BaseHTTPServer import cgi import json import threading import urllib2 import time from bs4 import BeautifulSoup from pymongo import MongoClient import datetime reload(sys) sys.setdefaultencoding('utf-8') num_retry = 12 period = int(3600*12) con = MongoClient...
mit
-7,170,149,306,758,141,000
26.60396
133
0.610246
false
3.305492
false
false
false
yddgit/hello-python
send_email/send_email_html_plain.py
1
2564
#!/usr/bin/env python # -*- coding: utf-8 -*- from email import encoders from email.header import Header from email.utils import parseaddr, formataddr from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib # 格式化邮件地址,如果包含中文需要通过Header对象进行编码 def _format_addr(s): name, addr...
apache-2.0
-8,638,957,130,049,513,000
34.098039
141
0.73352
false
1.625795
false
false
false
Ezhil-Language-Foundation/open-tamil
tamilmorse/tamil_morse_code.py
1
2127
## -*- coding: utf-8 -*- # (C) 2018 Muthiah Annamalai # This file is part of Open-Tamil project # You may use or distribute this file under terms of MIT license ## from __future__ import print_function import codecs import json from solthiruthi import resources from .huffman import huffman, print_huffman_code_cwl de...
mit
7,503,958,441,565,421,000
28.136986
73
0.594264
false
2.874324
false
false
false
neilLasrado/frappe
frappe/desk/search.py
1
6239
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # Search from __future__ import unicode_literals import frappe, json from frappe.utils import cstr, unique, cint from frappe.permissions import has_permission from frappe import _ from six import string_types import re ...
mit
-7,745,082,749,918,084,000
34.248588
151
0.678314
false
3.184788
false
false
false
MDSLab/s4t-iotronic
iotronic/db/sqlalchemy/models.py
1
6812
# -*- encoding: utf-8 -*- # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICE...
apache-2.0
8,382,822,558,443,551,000
29.410714
78
0.642543
false
3.935298
false
false
false
chromium/chromium
tools/cygprofile/check_orderfile.py
7
2870
#!/usr/bin/env vpython # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Check that symbols are ordered into a binary as they appear in the orderfile. """ import logging import optparse import sys impor...
bsd-3-clause
936,724,482,510,614,900
32.764706
80
0.650871
false
3.942308
false
false
false
woutervanwijk/mopidy
mopidy/utils/path.py
1
6823
from __future__ import unicode_literals import Queue as queue import logging import os import stat import string import threading import urllib import urlparse import glib logger = logging.getLogger(__name__) XDG_DIRS = { 'XDG_CACHE_DIR': glib.get_user_cache_dir(), 'XDG_CONFIG_DIR': glib.get_user_config_d...
apache-2.0
1,331,943,284,067,081,500
29.324444
79
0.625531
false
3.6961
true
false
false
paramsingh/lazycoin
funcs.py
1
1056
import socket def send_data(sock,data): sock.sendall(data) def receive_data(sock,size = 4096): data = bytes() while size: recv = sock.recv(size) if not recv: raise ConnectionError() data += recv size -= len(recv) return data def nDigit(s,size): s = str(s) if(len(s)<size): s = '0'*(size-len(s))+s ...
mit
6,221,665,157,644,711,000
21.956522
68
0.699811
false
2.633416
false
false
false
rarbg/ZeroNet
src/Worker/WorkerManager.py
1
7098
from Worker import Worker import gevent, time, logging, random MAX_WORKERS = 10 # Worker manager for site class WorkerManager: def __init__(self, site): self.site = site self.workers = {} # Key: ip:port, Value: Worker.Worker self.tasks = [] # {"evt": evt, "workers_num": 0, "site": self.site, "inner_path": inne...
gpl-2.0
5,870,406,172,953,979,000
33.794118
210
0.67681
false
3.278522
false
false
false
ewels/MultiQC
multiqc/modules/biobambam2/biobambam2.py
1
1974
#!/usr/bin/env python """ MultiQC module to parse output from biobambam2 """ from __future__ import print_function from collections import OrderedDict import logging from multiqc.modules.base_module import BaseMultiqcModule from multiqc.modules.picard import MarkDuplicates # Initialise the logger log = logging.getL...
gpl-3.0
4,941,387,552,553,416,000
32.457627
87
0.636778
false
3.825581
false
false
false
stevegt/librabinpoly
test/benchmark.py
1
1127
#!/usr/bin/python from ctypes import * import sys import timeit sys.path.append('..') import rabinpoly as lib fn = sys.argv[1] libc = CDLL("libc.so.6") fopen = libc.fopen fread = libc.fread feof = libc.feof fread.argtypes = [c_void_p, c_size_t, c_size_t, c_void_p] window_size = 32 min_block_size = 2**14 avg_block...
gpl-2.0
2,347,288,876,777,289,000
19.87037
67
0.573203
false
2.8175
false
false
false
DeStars/omniture_python
omniture_python/omniture_wrapper.py
1
2260
import binascii import urllib2 import json from hashlib import sha1 import base64 import datetime import calendar import time __author__ = 'DeStars' class OmnitureWrapper: def __init__(self, user_name, secret): self._user_name = user_name self._secret = secret def __create_header(self): ...
mit
-2,951,056,399,141,589,500
36.04918
104
0.615929
false
3.883162
false
false
false
idiotic/idiotic
idiotic/util/blocks/teapot.py
1
1895
from idiotic.util.resources import http from idiotic import block import logging import asyncio import aiohttp import time log = logging.getLogger(__name__) class Teapot(block.Block): def __init__(self, name, **config): super().__init__(name, **config) self.name = name self.config = {"add...
mit
-4,488,406,143,664,696,000
36.156863
120
0.530871
false
4.201774
true
false
false
mupi/escolamupi
payments/migrations/0001_initial.py
1
7873
# -*- 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): # Adding model 'UserPayments' db.create_table(u'payments_userpayments', (...
agpl-3.0
5,020,216,592,489,578,000
64.616667
195
0.573733
false
3.629783
false
false
false
wieden-kennedy/spring-jpa-hibernate-templator
generator/Generator.py
1
2025
from os import chdir,mkdir from os.path import join,exists class Generator: def __init__(self,generator_type,root_dir,basepackage,java_source_dir,model=None): if generator_type: self.type=generator_type if root_dir: self.root_dir=root_dir if basepackage: ...
bsd-3-clause
1,190,702,424,003,001,900
33.338983
105
0.601975
false
3.629032
false
false
false
youdar/work
work/Clashes/Old work/compare_delta.py
1
3072
from __future__ import division import Test_internal_clashscore import os,sys ''' Collect clash information from PROBE in resraints_manager and compare them ''' def get_files_data(): '''() -> list,list reads files RM_clash_results PROBE_clash_results in folder: C:\Phenix\Dev\Work\work\Clashes\junk R...
mit
-8,545,692,545,632,096,000
32.769231
117
0.657552
false
2.860335
false
false
false
wannabegeek/PyFIX
pyfix/session.py
1
1093
import logging class FIXSession: def __init__(self, key, targetCompId, senderCompId): self.key = key self.senderCompId = senderCompId self.targetCompId = targetCompId self.sndSeqNum = 0 self.nextExpectedMsgSeqNum = 1 def validateCompIds(self, targetCompId, senderCompId...
cc0-1.0
8,573,742,107,478,617,000
35.433333
124
0.660567
false
3.583607
false
false
false
bladyjoker/python-oauth2
oauth2/messages.py
1
3611
## Authorization AuthorizationRequestParam = tuple AuthorizationRequestType = str AUTHCODE_AUTHREQTYPE = AuthorizationRequestType('code') IMPLICIT_AUTHREQTYPE = AuthorizationRequestType('token') class AuthorizationRequest(object): def __init__(self, request_type: AuthorizationRequestType, params: [AuthorizationRequ...
gpl-2.0
8,317,927,578,722,036,000
29.344538
97
0.751592
false
3.522927
false
false
false
sandeepklr/gridmap
gridmap/job.py
1
35680
# -*- coding: utf-8 -*- # Written (W) 2008-2012 Christian Widmer # Written (W) 2008-2010 Cheng Soon Ong # Written (W) 2012-2014 Daniel Blanchard, dblanchard@ets.org # Copyright (C) 2008-2012 Max-Planck-Society, 2012-2014 ETS # This file is part of GridMap. # GridMap is free software: you can redistribute it and/or m...
gpl-3.0
7,930,880,811,626,348,000
35.745623
112
0.544142
false
4.213012
false
false
false
jmanoel7/my_dot_files
.local/share/gedit/plugins/xmlhelper.py
1
14182
# -*- coding: utf8 -*- # XML Helper for GEdit # # Copyright (c) 2007 Matej Cepl <matej@ceplovi.cz> # Additional Author : Ajith Sen G. S. <ajithsengs@gmail.com> # Additional Author : Oliver Sauder <os@esite.ch> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associ...
gpl-3.0
-6,545,584,575,914,101,000
35.645995
78
0.570582
false
3.815443
false
false
false
monetario/core
monetario/views/api/decorators.py
1
4822
import functools from flask import jsonify as flask_jsonify from flask import request from flask import url_for def jsonify(exclude=None): """ This decorator generates a JSON response from a Python dictionary or a SQLAlchemy model. """ def decorator(f): @functools.wraps(f) def wra...
bsd-3-clause
1,515,050,096,615,621,600
29.327044
80
0.518872
false
3.784929
false
false
false
dbuch/systemd
man/90-rearrange-path.py
1
1400
#!/usr/bin/python3 """ Proof-of-concept systemd environment generator that makes sure that bin dirs are always after matching sbin dirs in the path. (Changes /sbin:/bin:/foo/bar to /bin:/sbin:/foo/bar.) This generator shows how to override the configuration possibly created by earlier generators. It would be easier ...
gpl-2.0
-3,990,370,177,937,099,000
33.9
85
0.609599
false
3.371981
false
false
false
he7d3r/revscoring
revscoring/features/wikitext/datasources/sentences.py
1
1893
from deltas.segmenters import MatchableSegment from revscoring.datasources import Datasource from revscoring.datasources.meta import indexable class Revision: def __init__(self, name, revision_datasources): super().__init__(name, revision_datasources) self.sentences = Datasource( se...
mit
-941,986,875,014,066,800
29.047619
75
0.593767
false
4.273138
false
false
false
jimsize/PySolFC
pysollib/games/matriarchy.py
1
8074
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # ---------------------------------------------------------------------------## # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free softwa...
gpl-3.0
-6,562,917,565,485,467,000
33.801724
79
0.523037
false
3.466724
false
false
false
GoogleCloudPlatform/gsutil
gslib/impersonation_credentials.py
1
2566
# -*- coding: utf-8 -*- # Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
-9,101,236,373,902,733,000
39.730159
80
0.625877
false
4.623423
false
false
false
tytso/xfstests-bld
kvm-xfstests/test-appliance/files/usr/lib/python3/dist-packages/junitparser/cli.py
2
1595
from argparse import ArgumentParser from glob import iglob from itertools import chain from . import JUnitXml, version def merge(paths, output): """Merge xml report.""" result = JUnitXml() for path in paths: result += JUnitXml.fromfile(path) result.update_statistics() result.write(output...
gpl-2.0
4,698,021,028,848,066,000
26.982456
82
0.626332
false
3.852657
false
false
false
pmonta/GNSS-DSP-tools
acquire-galileo-e5aq.py
1
3231
#!/usr/bin/env python import optparse import numpy as np import scipy.signal import scipy.fftpack as fft import gnsstools.galileo.e5aq as e5aq import gnsstools.nco as nco import gnsstools.io as io import gnsstools.util as util # # Acquisition search # def search(x,prn,doppler_search,ms): fs = 3*10230000.0 n = ...
mit
-4,065,531,073,665,987,000
30.067308
153
0.672547
false
2.622565
false
false
false
macosforge/ccs-calendarserver
contrib/tools/tables.py
1
9609
## # Copyright (c) 2009-2017 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
-7,932,836,984,542,855,000
33.941818
118
0.605058
false
3.939729
false
false
false
yalewoosoft/shadowsocks
speedtest_thread.py
1
7027
#!/usr/bin/python # -*- coding: UTF-8 -*- import logging import time import sys import os import configloader import importloader from speedtest import speedtest from shadowsocks import common, shell class Speedtest(object): def __init__(self): import threading self.event = threading.Event() ...
apache-2.0
-3,055,601,498,901,799,000
35.984211
231
0.468336
false
4.343016
true
false
false
lamthientruc/vac
benchmarks/Time/ASASPTIME_Hier/ASASPTIME/agtHiertoNonHierAdapt.py
2
10522
#!/usr/bin/env python import sys fn = sys.argv[1] #input file with temporal hierarchies #format input file #[Hierarchies] #1>2>t1 #3>4>t2 #[UA0] #u1 2 4 3 > t1 #u2 2 4 3 > t1 #u9 4 2 > t5 #rs 1 > t1 # for initial enabled roles #rs 2 > t1 #[Rules] #can_assign #can_revoke on = sys.argv[2] #output file with no hier...
bsd-2-clause
6,503,462,406,943,212,000
24.916256
103
0.529177
false
2.769676
false
false
false
JioCloud/oslo.vmware
oslo/vmware/common/loopingcall.py
2
4594
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
-2,428,121,379,658,182,700
30.682759
78
0.585329
false
4.517207
false
false
false
gfitzp/sql-connections
sqlconnections_oracle.py
1
5552
# The MIT License (MIT) # # Copyright © 2015 Glenn Fitzpatrick # # 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,...
mit
-3,997,224,486,578,959,000
22.521186
121
0.590885
false
4.433706
false
false
false
flgiordano/netcash
+/google-cloud-sdk/lib/googlecloudsdk/calliope/cli_tree.py
1
9923
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
bsd-3-clause
1,056,222,635,158,947,700
34.439286
80
0.612617
false
4.231557
false
false
false
xmendez/wfuzz
src/wfuzz/plugins/payloads/shodanp.py
1
1602
from wfuzz.externals.moduleman.plugin import moduleman_plugin from wfuzz.plugin_api.payloadtools import ShodanIter from wfuzz.plugin_api.base import BasePayload from wfuzz.fuzzobjects import FuzzWordType @moduleman_plugin class shodanp(BasePayload): name = "shodanp" author = ("Xavi Mendez (@xmendez)",) ve...
gpl-2.0
-1,685,633,677,487,755,800
26.152542
76
0.56804
false
3.787234
false
false
false
pgiri/asyncoro
py3/asyncoro/asyncfile.py
1
36873
"""This file is part of asyncoro; see http://asyncoro.sourceforge.net for details. This module provides API for asynchronous file and pipe processing. They work with Windows, Linux, OS X and likely other UNIX variants. Note that regular (on-disk) files don't support asynchronous I/O, as they are non-blocking and can't...
mit
-483,532,685,367,652,300
39.12296
98
0.496488
false
4.453261
false
false
false
jeffkaufman/diplomator
disp.py
1
16620
""" Usage: $ ls IMAGE_L.gif icons COORDINATES statusfile $ python disp.py datafilesdir statusfile tmp.png """ import sys import os.path from random import random import Image, ImageDraw from math import sqrt, acos, sin ILLEGAL_PLACEMENT = (5,5) # The special value 5,5 for coordinates indicates illegal...
gpl-2.0
7,914,423,068,613,350,000
25.849758
135
0.581649
false
3.057395
false
false
false
nicolasfauchereau/paleopy
paleopy/core/WR.py
1
7469
import os import sys import numpy as np import pandas as pd import h5py import json from ..markov import get_probs from ..utils import seasons_params from ..plotting import heatmap from ..plotting import bar from ..utils import make_sig class WR: """ base class for weather regimes calculations and plots ...
mit
420,959,520,509,369,000
35.612745
96
0.543312
false
3.822416
false
false
false
nickattree/Minijets
mj_morpho.py
1
3063
# -*- coding: utf-8 -*- """ Created on Sat Feb 20 10:51:13 2016 @author: noa """ # Theoretical time evolution of minijet gradient def theory(M): return np.arctan((1.0 - np.cos(M))/(2.0 * np.sin(M) - 1.5 * M)) * 180.0 / np.pi # Currently uses graphical comparison method - inefficient and slow # Also accuracy dep...
mit
3,180,090,542,250,781,700
33.426966
105
0.634019
false
2.661164
false
false
false
kikocorreoso/brython
www/src/Lib/interpreter.py
1
14285
import sys import tb as traceback from browser import console, document, window, html, DOMNode from browser.widgets.dialog import Dialog _credits = """ Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information.""" _cop...
bsd-3-clause
-2,024,490,416,110,576,000
37.608108
91
0.533567
false
4.293658
false
false
false
raqqun/tweetcommander
packages/requests_oauthlib/core.py
1
2328
# -*- coding: utf-8 -*- from __future__ import unicode_literals from ..oauthlib.common import extract_params from ..oauthlib.oauth1 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER) CONTENT_TYPE_FORM_URLENCODED = 'application/x-www-form-urlencoded' CONTENT_TYPE_MULTI_PART = 'multipart/form-data' import sys ...
gpl-3.0
6,963,956,816,960,503,000
37.163934
82
0.629296
false
3.854305
false
false
false
GBPeters/upair
bot/gatwick.py
1
3495
""" Module for harvesting data from the Gatwick Aviation Society (GAS) aircraft database DO NOT USE """ # Imports import requests from bs4 import BeautifulSoup from db.pghandler import Connection # Constants GAS_URL = "http://www.gatwickaviationsociety.org.uk/modeslookup.asp" GAS_FIELDS = {"Registration": "registrat...
gpl-3.0
6,033,836,778,019,814,000
29.391304
93
0.596567
false
3.548223
false
false
false
pyfa-org/Pyfa
gui/builtinMarketBrowser/pfSearchBox.py
1
9376
# noinspection PyPackageRequirements import wx import gui.utils.color as colorUtils import gui.utils.draw as drawUtils from gui.utils.helpers_wxPython import HandleCtrlBackspace SearchButton, EVT_SEARCH_BTN = wx.lib.newevent.NewEvent() CancelButton, EVT_CANCEL_BTN = wx.lib.newevent.NewEvent() TextEnter, EVT_TEXT_ENTER...
gpl-3.0
4,457,695,793,184,732,700
30.783051
111
0.575405
false
3.893688
false
false
false
b4ux1t3/piday2017
runtests.py
1
2166
""" This is just a way to see which method alluded to in the README will produce the best result. Think of it as a test, I guess. """ import randompi import statistics import time print("Starting timer") start_time = time.time() # Basically, I'm going to make a bunch of lists holding a thousand (1000) of values of ...
mit
-6,844,707,654,209,961,000
36.344828
103
0.677747
false
3.622074
false
false
false
lgarren/spack
var/spack/repos/builtin/packages/r-multtest/package.py
1
1752
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
2,030,379,986,413,075,500
45.105263
126
0.674087
false
3.808696
false
false
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_11_01/aio/operations/_local_network_gateways_operations.py
1
24340
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
1,005,753,911,172,090,200
50.350211
209
0.656163
false
4.347981
true
false
false
ViGLug/django-phpbb-extender
api/views.py
1
2642
#from django.contrib.auth.models import User, Group from rest_framework import filters, generics from .serializers import ( UserSerializer, ForumSerializer, TopicSerializer, PostSerializer, ) class UsersReadView(generics.ListAPIView): serializer_class = UserSerializer model = serializer_class.M...
agpl-3.0
-8,175,664,467,557,067,000
32.443038
65
0.723694
false
3.758179
false
false
false
dropzonemathmo/SocialMediaLinksRecommend
TwitterScraper/TwitterURLs.py
1
4012
""" TwitterURLs.py is a class that can be used to obtain the URLs of user tweets """ #import all secret keys for twitter access from Secret import * #import TwitterAPI from TwitterAPI import TwitterAPI #Global Printing Variable VERBOSE = False class TwitterURLs(): """ Twitter URLs enables access to the URLs pos...
gpl-2.0
8,145,693,527,491,492,000
25.746667
131
0.667498
false
3.853987
false
false
false
xapple/plumbing
plumbing/graphs/__init__.py
1
11246
# Built-in modules # import os, time, inspect, getpass from collections import OrderedDict # Internal modules # from plumbing.common import split_thousands, camel_to_snake from plumbing.cache import property_cached # First party modules # from autopaths import Path from autopaths.file_path import FilePath ...
mit
-97,055,972,161,673,570
42.758755
105
0.557265
false
3.673963
false
false
false
bitxbay/BitXBay
pywa.py
1
8297
#!/usr/bin/env python #-*- coding: utf-8 -*- pywversion="2.1.7" never_update=False # # jackjack's pywallet.py # https://github.com/jackjack-jj/pywallet # forked from Joric's pywallet.py # beta_version = ('a' in pywversion.split('-')[0]) or ('b' in pywversion.split('-')[0]) missing_dep = [] from bsddb.db import *...
gpl-3.0
9,194,209,195,237,866,000
29.284672
103
0.579246
false
3.417216
false
false
false