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
musicbrainz/picard
picard/util/preservedtags.py
1
1689
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2018 Laurent Monin # Copyright (C) 2019-2020 Philipp Wolfer # # 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 Fou...
gpl-2.0
4,244,656,388,158,089,000
29.709091
80
0.678508
false
3.728477
true
false
false
daniellawrence/nodefactinfo
nodefactinfo/api/query.py
1
6534
#!/usr/bin/env python # -*- coding: utf-8 -*- import re from collections import namedtuple PUPPETDB_HOST = 'localhost' PUPPETDB_PORT = 49205 OPERATORS = [ '=', '~', '>', '<' ] # RE_OPERATOR = r'(?P<fact>.+)(\s+|)(?P<operator>[%s])(\s+|)(?P<value>.*)' \ % "".join(OPERATORS) def unique_...
bsd-3-clause
5,307,277,186,351,919,000
25.778689
79
0.602694
false
3.814361
false
false
false
tbenthompson/rupturotops
source/linear_viscoelastic/full_elastic.py
1
3161
from math import pi from utilities import A_integral import scipy.integrate as integrate import numpy as np from core.debug import _DEBUG assert(np) #derived by differentiating the slip for slips delta z apart def surface_elastic_half_space(slip_distribution, x): A = A_integral(slip_distribution, x, 1, 0) # pr...
lgpl-3.0
8,968,231,698,233,265,000
34.920455
66
0.609934
false
2.993371
false
false
false
heychenbin/tomato
src/iostream.py
1
8094
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- # Filename: iostream.py # Author: Chenbin # Time-stamp: <2014-08-15 Fri 14:19:04> import collections import errno import socket import ioloop _ERRNO_WOULDBLOCK = (errno.EWOULDBLOCK, errno.EAGAIN) # These errnos indicate that a connection has been abruptly terminate...
apache-2.0
6,714,020,151,474,172,000
29.659091
87
0.533358
false
4.094082
false
false
false
Jeanselme/Search_Engine
IndexManip/TextIndexManip.py
1
1373
""" Search Engine by Vincent Jeanselme and Matthieu Clin vincent.jeanselme@gmail.com """ import re from collections import Counter from IndexManip.AbstractIndexManip import abstractIndexReader, abstractIndexWriter import Utils.WordProcessing as wp class textIndexReader(abstractIndexReader): """ Reads texts inde...
gpl-3.0
2,010,162,159,631,057,000
23.087719
82
0.702112
false
3.120455
false
false
false
telerik/cloudbase-init
cloudbaseinit/tests/metadata/fake_json_response.py
1
3286
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudbase Solutions Srl # # 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/LICEN...
apache-2.0
-5,651,424,474,619,065,000
56.649123
78
0.560256
false
2.747492
false
false
false
GetBlimp/blimp-workers
templates/backups/run-backup.py
1
3326
import os import urlparse import subprocess import smtplib import getpass import re from email.mime.text import MIMEText import pyrax env_file = '/home/ubuntu/blimp.env' def run(): print('---> Getting latest backup of {}...'.format(heroku_app_name)) latest_backup_url = subprocess.check_output( ['he...
mit
-1,851,651,325,519,789,000
28.963964
75
0.567048
false
3.45379
false
false
false
mribeirodantas/nsuchat
server.py
1
1677
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of NSUChat, the Not So Unsafe Chat. # # Copyright (©) 2014 Marcel Ribeiro Dantas # # <mribeirodantas at fedoraproject.org> # # NSUChat is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as # publi...
gpl-3.0
4,923,853,859,388,459,000
34.659574
73
0.667064
false
3.707965
false
false
false
liujuan118/Antiphishing
disguise_header.py
1
2758
# coding = 'utf-8' import math import config as cfg import re import jieba import urllib.request from urllib import error from sklearn.feature_extraction.text import TfidfVectorizer # 手机 user_agent = r'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 ...
gpl-3.0
5,841,510,622,486,836,000
33.21519
151
0.680977
false
2.423318
false
true
false
jhanley634/testing-tools
problem/tput_174608/plot_throughput.py
1
3863
#! /usr/bin/env python3 # Copyright 2017 John Hanley. # # 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, m...
mit
-5,748,376,837,984,065,000
33.491071
79
0.635775
false
3.566944
false
false
false
amarin/oupyc
oupyc/inthreads/statistics.py
1
7850
# -*- coding: utf-8 -*- import logging from datetime import datetime, timedelta from time import sleep from oupyc.queues import NamedAndTypedQueue from oupyc.stdthreads import ExitEventAwareThread, QueueProcessorThread __author__ = 'AMarin' _l = logging.getLogger(__name__) _l.setLevel(logging.INFO) debug, info, warni...
gpl-2.0
6,353,057,340,818,063,000
35.013761
117
0.621019
false
3.659674
false
false
false
Aninstance/invoicing
aninstance/settings.py
1
10559
""" Django settings for aninstance project. """ import os # # # GENERAL BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = 'ewt7vvulgjq=hdn8(s15sqqzu&fa4+igtr57*-1-3#1$!h%tpz' DOCKERIZED = True # Note: Remember to change to True for docker deployment! DEBUG = False # Note: Remember ...
gpl-3.0
7,853,271,484,029,434,000
32.201258
117
0.598219
false
3.442452
false
false
false
piru/letsencrypt
letsencrypt/plugins/webroot.py
1
5066
"""Webroot plugin.""" import errno import logging import os import stat import zope.interface from acme import challenges from letsencrypt import errors from letsencrypt import interfaces from letsencrypt.plugins import common logger = logging.getLogger(__name__) class Authenticator(common.Plugin): """Webroo...
apache-2.0
-5,227,368,657,563,658,000
39.854839
125
0.617252
false
3.939347
false
false
false
Preffer/teain
mysite/settings.py
1
2527
""" Django settings for mysite project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
apache-2.0
-6,057,974,296,425,103,000
23.77451
71
0.676692
false
3.166667
false
false
false
ConnorMac/stokvel.io
fabfile.py
1
4566
import os import dotenv import yaml from io import BytesIO from fabric.api import env, local, run, task, settings, abort, put, cd, prefix, get, sudo, shell_env, open_shell, prompt, lcd from fabric.colors import red, green, yellow, white from fabric.context_managers import hide from fabric.contrib.project import rsync_...
mit
3,725,357,722,207,000,600
25.241379
125
0.59724
false
3.609486
true
false
false
kacperski1/budgie-script-applet
script.py
1
1518
#!/usr/bin/env python3 """ script -- A widget displaying output of a script that lets you interact with it. """ import gi.repository, subprocess, sys gi.require_version('Budgie', '1.0') gi.require_version('Wnck', '3.0') from gi.repository import Budgie, GObject, Wnck, Gtk, Gio, GLib class ScriptPlugin(GObject.GObje...
gpl-2.0
-3,155,369,080,191,551,000
32
155
0.647563
false
3.380846
false
false
false
mysql/mysql-utilities
mysql-test/t/clone_db_exclude.py
1
3369
# # Copyright (c) 2010, 2014, Oracle and/or its affiliates. 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 as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in th...
gpl-2.0
-2,373,407,804,315,957,000
34.840426
78
0.626892
false
3.72677
true
false
false
redhat-openstack/python-neutronclient
quantumclient/tests/unit/test_cli20_network.py
1
17339
# Copyright 2012 OpenStack LLC. # 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...
apache-2.0
8,447,864,865,643,692,000
40.780723
78
0.539766
false
3.86686
true
false
false
leaffan/pynhldb
utils/_check_transactions.py
1
4188
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import re src = r"transactions_2015.txt" keywords_src = r"transaction_keywords.txt" parser = argparse.ArgumentParser( description=( 'Checks hockey transaction protocols for unusual terms, ' + 'i.e. typos etc.')) parser.add_argument( ...
mit
-245,035,027,271,545,400
35.103448
79
0.586676
false
3.759425
false
false
false
jdahlin/thunder
thunder/reference.py
1
1668
from thunder.fields import Field from thunder.info import get_obj_info class ReferenceField(Field): def __init__(self, local_field, remote_cls, remote_attr='_id', **kwargs): if not isinstance(local_field, Field): # pragma nocoverage raise TypeError( "first argument must be a F...
lgpl-2.1
5,044,704,829,991,441,000
33.75
77
0.570144
false
3.888112
false
false
false
LaboratoireMecaniqueLille/crappy
crappy/actuator/oriental.py
1
3585
# coding: utf-8 from time import sleep from .actuator import Actuator from .._global import OptionalModule try: import serial except (ModuleNotFoundError, ImportError): serial = OptionalModule("pyserial") ACCEL = b'.1' # Acceleration and deceleration times class Oriental(Actuator): """To drive an axis with ...
gpl-2.0
8,907,024,979,773,874,000
26.790698
76
0.606137
false
3.298068
false
false
false
jhaals/filebutler-upload
filebutler_upload/filehandler.py
1
1557
from httputils import post from utils import ProgressBar from urlparse import urljoin class Filemanager: def __init__(self, url, username, password): self.headers = {'Accept': 'application/json'} self.username = username self.password = password self.url = url def list(self): ...
bsd-3-clause
-2,296,075,185,178,992,400
27.833333
87
0.547848
false
4.398305
false
false
false
btrent/knave
pychess/Utils/lutils/ldata.py
1
21090
from operator import or_ from pychess.Utils.const import * #from pychess.Utils.lutils.lmove import RANK, FILE from bitboard import * def RANK (cord): return cord >> 3 def FILE (cord): return cord & 7 ################################################################################ #######################################...
gpl-3.0
-3,169,295,882,910,161,400
34.208681
87
0.43504
false
2.826699
false
false
false
ederc/LA-BENCHER
scripts/bench-plasma.py
1
15422
#!/usr/bin/python import sys import fnmatch import os import shutil import argparse from argparse import RawTextHelpFormatter import time import math import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') import pylab as pl from matplotlib.ticker import MultipleLocator, FormatStrFo...
gpl-3.0
5,336,413,194,590,045,000
35.545024
86
0.646025
false
3.175211
false
false
false
defivelo/db
apps/orga/tests/factories.py
1
1314
# defivelo-intranet -- Outil métier pour la gestion du Défi Vélo # Copyright (C) 2016 Didier Raboud <me+defivelo@odyx.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 the Free Software Foundation, either version...
agpl-3.0
-299,020,157,012,748,800
36.457143
74
0.748284
false
3.70339
false
false
false
brachiel/rotcbot
RotcWatcher.py
1
2884
# vim: set tabstop=4 expandtab sw=4: import urllib import string import MasterServer class Watcher(object): def __init__(self): self.server_info = dict() def update_server_list(self): server_list = MasterServer.getServerList() if not server_list: # Master server didn't answer ...
gpl-3.0
-4,387,041,340,182,364,000
30.010753
87
0.569348
false
3.961538
false
false
false
tallstreet/jaikuenginepatch
invite/tests.py
1
3241
import logging from django.conf import settings from django.core import mail from common import api from common import util from common import tests class SmokeTest(tests.ViewTestCase): def test_invite_email_logged_in(self): r = self.login_and_get('hermit', '/invite/email/ACTORINVITE') self.assertWellform...
apache-2.0
-6,118,772,717,702,209,000
32.760417
74
0.652576
false
3.310521
true
false
false
OpenNumismat/open-numismat-tracker
OpenNumismat/Collection/HeaderFilterMenu.py
1
13684
from PyQt5.QtCore import Qt from PyQt5.QtSql import QSqlQuery from PyQt5.QtWidgets import * from OpenNumismat.Collection.CollectionFields import FieldTypes as Type from OpenNumismat.Tools.Gui import createIcon from OpenNumismat.Settings import Settings class FilterMenuButton(QPushButton): DefaultType = 0 Sel...
gpl-3.0
-4,298,559,597,488,016,400
33.21
85
0.551082
false
4.352417
false
false
false
IQSS/gentb-site
apps/predict/urls.py
2
2054
# # Copyright (C) 2017 Maha Farhat # # 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 License, or # (at your option) any later version. # # This program is distribu...
agpl-3.0
-3,061,693,881,197,445,600
35.678571
85
0.655794
false
3.661319
false
false
false
Resmin/Resmin
resmin/apps/pm/views.py
1
8744
from django.http import Http404, HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.template import RequestContext from django.contrib import messages from django.contrib.auth.decorators import login_required from django.utils.translation import ugettext as _ from django.utils impor...
gpl-3.0
8,088,496,200,432,249,000
37.862222
91
0.650961
false
4.136235
false
false
false
ValiValpas/pgp-mime
setup.py
1
2034
# Copyright (C) 2014 Johannes Schlatow <johannes.schlatow@googlemail.com> # Copyright (C) 2012 W. Trevor King <wking@tremily.us> # # This file is part of pgp-mime. # # pgp-mime 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 Softwar...
gpl-3.0
-4,290,780,283,565,583,000
37.377358
97
0.671583
false
3.612789
false
false
false
js850/PyGMIN
playground/oxdna/quench_benchmark.py
1
1564
import random import pickle import numpy as np from pygmin.potentials.gminpotential import GMINPotential from pygmin.optimize.quench import mylbfgs, fire import oxdnagmin_ as GMIN import time from pygmin.systems import oxdna from optparse import OptionParser parser = OptionParser() parser.add_option("--tol", dest="tol...
gpl-3.0
8,611,059,962,974,568,000
33.021739
130
0.671995
false
3.178862
false
false
false
shikata-ga-nai/slack-dm-export
im.py
1
4293
from slacker import Slacker from datetime import timedelta, datetime from time import mktime import os, argparse slack = Slacker('YOUR_API_KEY_GOES_HERE') parser = argparse.ArgumentParser(description='Slack direct messages, private groups and general channel export') parser.add_argument('-g', '--groups', action='stor...
mit
2,255,016,625,815,941,400
44.189474
112
0.564407
false
3.971323
false
false
false
ViktorM/baselines
baselines/ppo1/mlp_policy.py
1
2868
from baselines.common.mpi_running_mean_std import RunningMeanStd import baselines.common.tf_util as U import tensorflow as tf import gym from baselines.common.distributions import make_pdtype class MlpPolicy(object): recurrent = False def __init__(self, name, *args, **kwargs): with tf.variable_scope(na...
mit
1,095,538,460,259,050,800
45.258065
128
0.627266
false
3.028511
false
false
false
liamnoone/Python
TVDB.py
1
3945
#!/usr/bin/python3 import re import os import requests import sys import Rename as r from bs4 import BeautifulSoup # TVDb API Key API_KEY = "C2AA47AACAA7C7B2" # The file types the script will work on FILE_TYPES = ["AVI", "MP4", "MKV", "SRT"] # Characters which aren't allowed in file names ILLEGAL_CHARACTERS = ["/", "...
mit
-1,004,648,319,935,917,200
38.828283
131
0.573928
false
3.316232
false
false
false
ddurieux/alignak
libexec/link_vmware_host_vm.py
1
6289
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2010: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel <h.goebel@goebel-consult.de> # # This file is part of Shinken. # # Shinken is free software: you can re...
agpl-3.0
190,758,863,200,381,980
32.631016
109
0.603912
false
3.533146
false
false
false
jvantuyl/untwisted
untwisted/magic.py
1
1431
from usual import xmap, zmap class hold(object): """ This class is used to wait events from a given Mode class. """ def __init__(self, target, *event_list): # Where we wait the event from. self.target = target self.event_list = event_list def __call__(self, mod, seq): ...
mit
7,330,630,409,237,792,000
32.27907
66
0.566038
false
4.123919
false
false
false
jtux270/translate
FreeIPA/freeipa-3.0.0/ipalib/plugins/baseldap.py
1
80460
# Authors: # Pavel Zuna <pzuna@redhat.com> # # Copyright (C) 2009 Red Hat # see file 'COPYING' for use and warranty information # # 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 versio...
gpl-3.0
2,504,683,206,455,296,000
35.522923
152
0.563535
false
4.175186
false
false
false
cython-testbed/pandas
asv_bench/benchmarks/panel_ctor.py
1
1794
import warnings from datetime import datetime, timedelta from pandas import DataFrame, Panel, DatetimeIndex, date_range class DifferentIndexes(object): goal_time = 0.2 def setup(self): self.data_frames = {} start = datetime(1990, 1, 1) end = datetime(2012, 1, 1) for x in rang...
bsd-3-clause
-4,020,718,878,747,447,300
28.409836
76
0.548495
false
3.423664
false
false
false
mvantellingen/wsgi-basic-auth
tests/test_wsgi_basic_auth.py
1
4300
from webtest import TestApp import wsgi_basic_auth def wsgi_app(environ, start_response): body = b'this is private! go away!' headers = [ ('Content-Type', 'text/html; charset=utf8'), ('Content-Length', str(len(body))) ] start_response('200 OK', headers) return [body] def test_no...
mit
634,258,651,918,421,400
32.076923
70
0.686512
false
3.383163
true
false
false
isb-cgc/ISB-CGC-data-proc
tcga_etl_pipeline/mirna/mirna/transform.py
1
3161
#!/usr/bin/env python # Copyright 2015, Institute for Systems Biology. # 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 app...
apache-2.0
874,641,554,640,090,600
40.592105
144
0.695982
false
3.731995
false
false
false
songrun/VectorSkinning
src/triangle.py
1
7947
import sys import subprocess import os from numpy import asarray #triangle_path = os.path.join( "C:\\Users\\Mai\\Dropbox\\Research\\Deformation\\src\\py\\triangle", "triangle.exe") triangle_path = os.path.join( os.path.dirname( __file__ ), "triangle", "triangle" ) if not os.path.exists( triangle_path ): raise Imp...
apache-2.0
-1,096,062,144,811,840,800
35.454128
215
0.611552
false
3.573291
false
false
false
durato/grepSilon
grepSilon.py
1
1233
import sys newDelimiter="###GREPSILON###" def usage(): print "USAGE:" print sys.argv[0],"<delim>","<match>","--new-delimiter <new delimiter>","<filename>" print " " print "This script looks for <match> in blocks surrounded by beginning of file, <delim> and EOF" print "Tip: this...
mit
-2,051,654,127,201,275,000
26.4
104
0.463098
false
4.237113
false
false
false
sinsai/Sahana_eden
controllers/project.py
1
19588
# -*- coding: utf-8 -*- """ Project @author: Michael Howden (michael@sahanafoundation.org) @date-created: 2010-08-25 Project Management """ prefix = request.controller resourcename = request.function response.menu_options = [ [T("Home"), False, URL(r=request, f="index")], [T("Gap...
mit
-4,956,662,721,128,101,000
43.342593
123
0.381203
false
4.698489
false
false
false
Portsmouth-Computing/SSH-Blocking-and-Scanning
api/__init__.py
1
2831
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2018 Samuel Riches 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
-8,899,756,431,993,833,000
33.52439
111
0.692688
false
3.856948
true
false
false
chStaiger/ACES-Training
code/picas/executers.py
1
1879
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2016, Jan Bot 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, ...
mit
3,447,667,532,064,118,000
49.783784
460
0.75785
false
4.452607
false
false
false
chrrrles/c3px
app/models/bidder.py
1
1662
# Copyright (c) 2013 - The C3PX authors. # # This file is part of C3PX. # # C3PX is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later versio...
agpl-3.0
9,115,297,043,337,906,000
29.777778
71
0.735259
false
3.966587
false
false
false
martinbede/second-sight
tensorflow/python/training/supervisor.py
1
34208
# Copyright 2016 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 a...
apache-2.0
4,890,650,920,516,179,000
35.664523
80
0.680016
false
3.944649
false
false
false
yl565/statsmodels
statsmodels/tools/tests/test_tools.py
1
22076
""" Test functions for models.tools """ from statsmodels.compat.python import lrange, range import numpy as np from numpy.random import standard_normal from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_string_equal, TestCase) from nose.tools import (asse...
bsd-3-clause
-3,556,295,678,577,564,700
36.931271
83
0.583394
false
3.0517
true
false
false
ratnim/JRR-Prototyp1
boilerplate/settings/dev.py
1
1810
""" Django settings for snippod boilerplate project. This is a base starter for snippod. For more information on this file, see https://github.com/shalomeir/snippod-boilerplate """ from .common import * # from snippod_boilerplate.settings.config_dev import * # SECURITY WARNING: keep the secret key used in producti...
mit
6,413,587,704,795,760,000
21.345679
78
0.608287
false
3.249551
false
false
false
carlgao/lenga
images/lenny64-peon/usr/share/python-support/python-boto/boto/ec2/securitygroup.py
1
7583
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
-6,878,455,640,580,480,000
36.35468
77
0.510748
false
4.406159
false
false
false
sunqm/pyscf
pyscf/fci/selected_ci.py
1
41939
#!/usr/bin/env python # Copyright 2014-2021 The PySCF Developers. 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 # # U...
apache-2.0
6,511,793,452,072,909,000
41.882413
105
0.575145
false
2.795374
false
false
false
siki1793/python-web-scraping-and-apicall
top_games.py
1
1792
import requests as req import json import csv import language import country import os import catagories # import sample as s def json2csv(data,country,deviceType): file_name = country+"_top_games_new.csv" gameCSV = None if(os.path.isfile(file_name)): gameCSV = csv.writer(open(file_nam...
gpl-3.0
6,161,894,824,711,056,000
35.333333
121
0.633371
false
3.324675
false
false
false
liqiangnlp/LiNMT
scripts/attention.figure/matrix.py
1
3151
import numpy import matplotlib matplotlib.use('Agg') matplotlib.rcParams['font.sans-serif'] = ['SimHei'] matplotlib.rcParams['font.family']='sans-serif' matplotlib.rcParams['axes.unicode_minus'] = False import matplotlib.pyplot as plt import sys import json import argparse # python ***.py -s [srcfile...
mit
1,985,957,658,537,251,000
38.397436
111
0.683593
false
3.292581
false
false
false
ccxt/ccxt
python/ccxt/bitmart.py
1
95829
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange # ----------------------------------------------------------------------------- try: basestri...
mit
7,356,840,904,332,108,000
41.810992
521
0.438144
false
4.04317
false
false
false
openai/baselines
baselines/gail/adversary.py
1
4674
''' Reference: https://github.com/openai/imitation I follow the architecture from the official repository ''' import tensorflow as tf import numpy as np from baselines.common.mpi_running_mean_std import RunningMeanStd from baselines.common import tf_util as U def logsigmoid(a): '''Equivalent to tf.log(tf.sigmoid(...
mit
-3,117,168,378,418,894,000
52.724138
129
0.654258
false
3.239085
false
false
false
ningirsu/stepmania-server
test/test_smutils/test_smpacket.py
1
6465
""" Test smpacket.SMPacket module """ import unittest from smserver.smutils.smpacket import smpacket from smserver.smutils.smpacket import smcommand from smserver.smutils.smpacket import smencoder class SMPacketTest(unittest.TestCase): """ Test smpacket.SMPacket class """ def packet_testing(self, command):...
mit
4,846,509,791,557,137,000
30.072115
86
0.553458
false
3.777323
true
false
false
mastizada/dj-twilio-sms
dj_twilio_sms/decorators.py
1
4260
# -*- coding: utf-8 -*- from __future__ import unicode_literals from functools import wraps import logging from django.conf import settings from django.http import HttpResponse, HttpResponseForbidden, HttpResponseNotAllowed from django.utils import six from django.utils.encoding import force_text from django.views.dec...
mit
3,396,802,678,048,847,000
42.917526
132
0.639671
false
4.565916
false
false
false
postla/e2-gui
lib/python/Components/AVSwitch.py
1
9436
from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, \ ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigSelectionNumber, ConfigNothing, NoSave from enigma import eAVSwitch, getDesktop from SystemInfo import SystemInfo import os from boxbranding import getBoxType class AVSwitch: def setIn...
gpl-2.0
549,096,398,367,193,300
36.296443
160
0.685672
false
2.79751
true
false
false
bilke/OpenSG-1.8
SConsLocal/scons-local-0.96.1/SCons/Platform/__init__.py
2
4598
"""SCons.Platform SCons platform selection. This looks for modules that define a callable object that can modify a construction environment as appropriate for a given platform. Note that we take a more simplistic view of "platform" than Python does. We're looking for a single string that determines a set of tool-ind...
lgpl-2.1
2,230,145,696,210,333,200
35.492063
129
0.676599
false
4.161086
false
false
false
may-day/s4u2p
test.py
1
5602
from s4u2p import * import httplib import argparse parser = argparse.ArgumentParser(description="A small example program to show usage of the services for user kerberos extension.") parser.add_argument("--user", dest="user", help="user to impersonate", default="kraemer") parser.add_argument("--host", dest="host", help...
apache-2.0
6,268,468,679,633,383,000
38.450704
228
0.714923
false
3.597945
false
false
false
Jasmeet107/serapis
analyzer/analyze.py
1
3479
import pickle from pymongo import MongoClient import sentiment from sentiment.predict import SentimentPredictor import numpy as np from nltk import Tree from nltk.stem import SnowballStemmer from bson.objectid import ObjectId # db client = MongoClient() db = client.confessions class Classifier: def __init__(self)...
mit
5,941,473,230,713,107,000
36.010638
132
0.659672
false
3.92221
false
false
false
ryanbhayward/games-puzzles-algorithms
simple/stile/verify.py
1
6297
''' This is a program to check the correctness of a given sequence in a given stile search from beginning to end. For our marking scheme we had 6 different cases: - Everything is right 4/4 - If the blank has been moved instead of tiles 3/4 - If the order...
mit
7,379,628,662,046,535,000
33.988889
121
0.491027
false
3.376408
false
false
false
SINGROUP/pycp2k
examples/example_qmmm.py
1
3438
""" QM/MM test simulation """ from pycp2k import CP2K #=============================================================================== # Setup calculator calc = CP2K() calc.working_directory = "./" calc.project_name = "qmmmwater" calc.mpi_n_processes = 2 #==============================================================...
lgpl-3.0
1,999,842,533,143,844,400
24.849624
80
0.565445
false
2.348361
false
false
false
picoCTF/picoCTF-shell-manager
shell_manager/run.py
1
9240
#!/usr/bin/env python3 """ Shell Manager -- Tools for deploying and packaging problems. """ import logging, coloredlogs import shell_manager import json from argparse import ArgumentParser from shell_manager.package import problem_builder from shell_manager.bundle import bundle_problems from shell_manager.problem im...
mit
-3,014,254,315,284,850,000
64.070423
195
0.707359
false
4.036697
true
false
false
chall3ng3r/SensibleDialer
default.py
1
13777
import sys import e32 import urllib import string from socket import * import telephone import time # for contacts import contacts import re # ==================================== # Contacts Search Engine #===================================== contacts_cache = [] new_call = 0 settings = {} #######...
unlicense
-448,603,320,034,727,740
28.752232
138
0.523772
false
3.772453
false
false
false
TMU-VHDL-team2/sqrt
wiki_data/a2.py
1
1606
#!/usr/bin/env python3 MOD = 2 ** 16 def func0(): if j < 0: return x1 << -j else: return x1 >> j def func1(): if j < 0: return y >> -j else: return y << j x1 = int(input(), 16) x0 = 0 a = 0 y = 0 n = 0 c = 0 t = x1 while t > 0: t >>= 1 n += 1 n += 16 n += n &...
mit
8,376,594,813,278,211,000
17.4
41
0.344629
false
2.673504
false
false
false
RTHMaK/RPGOne
deep_qa-master/tests/layers/tuple_alignment_test.py
1
1892
# pylint: disable=no-self-use,invalid-name import numpy from keras.layers import Input from keras.models import Model from deep_qa.layers.entailment_models import MultipleChoiceTupleEntailment from deep_qa.layers.time_distributed_embedding import TimeDistributedEmbedding class TestTupleAlignment: def test_tuple_a...
apache-2.0
-8,403,957,146,806,310,000
53.057143
104
0.685518
false
3.991561
false
false
false
hanmomhanda/DesignPatterns
Observer/python/ObserverPattern.py
1
1067
class Subject: def __init__(self, name): self.name = name self.observer_set = set([]) def add_observer(self, observer): self.observer_set.add(observer) def remove_observer(self, observer): self.observer_set.remove(observer) def say_something(self, something): p...
bsd-3-clause
-6,837,187,971,453,514,000
19.14
64
0.576961
false
2.83662
false
false
false
prats226/python-amazon-product-api-0.2.8
setup.py
1
3200
#!/usr/bin/python from setuptools import setup, find_packages, Command import os.path, sys import re _here = os.path.abspath(os.path.dirname(__file__)) def version(): # This rather complicated mechanism is employed to avoid importing any # yet unfulfilled dependencies, for instance when installing under ...
bsd-3-clause
226,002,485,477,485,400
29.769231
80
0.614375
false
3.874092
true
false
false
kantai/passe-framework-prototype
django/core/cache/__init__.py
1
6868
""" Caching framework. This package defines set of cache backends that all conform to a simple API. In a nutshell, a cache is a set of values -- which can be any object that may be pickled -- identified by string keys. For the complete API, see the abstract BaseCache class in django.core.cache.backends.base. Client ...
bsd-3-clause
2,206,637,686,942,496,000
34.585492
84
0.651718
false
4.030516
false
false
false
openstack/smaug
karbor/policies/services.py
1
1419
# Copyright (c) 2017 Huawei Technologies Co., Ltd. # 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 # # ...
apache-2.0
-6,460,181,865,147,918,000
29.191489
78
0.622974
false
4.077586
false
false
false
agude/Dice
tests/test_tokenizer.py
1
1209
import pytest from dice.dice import DiceTokenizer import re def test_dice_tokenizer(): TEST_PAIRS = ( ("0d0", ("0", "d0")), ("3d6", ("3", "d6")), ("10d7+4", ("10", "d7", "+4")), ("8d12-3", ("8", "d12", "-3")), ("4d2-2L", ("4", "d2", "-2L")), ("23d24-5H", ("23", "d2...
mit
5,716,213,030,763,601,000
30.815789
79
0.424318
false
2.545263
true
false
false
ddurieux/alignak
alignak/objects/module.py
1
3719
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak 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 S...
agpl-3.0
4,155,769,349,303,789,600
31.902655
90
0.652232
false
3.613217
false
false
false
pfmoore/invoke
integration/runners.py
1
5986
import os import platform import time from mock import Mock from spec import Spec, eq_, ok_, skip from invoke import run, Local, Context, ThreadException from invoke.util import ExceptionHandlingThread from _util import assert_cpu_usage PYPY = platform.python_implementation() == 'PyPy' class Runner_(Spec): de...
bsd-2-clause
-6,842,449,338,482,756,000
42.693431
79
0.57551
false
4.186014
false
false
false
skoppisetty/idigbio-appliance
dataingestion/services/dbmodel/sql_model.py
1
22999
#!/usr/bin/env python # # Copyright (c) 2013 Liu, Yonggang <myidpt@gmail.com>, University of Florida # # This software may be used and distributed according to the terms of the # MIT license: http://www.opensource.org/licenses/mit-license.php """ This module implements the data model for the service. """ from sqlalchem...
gpl-3.0
6,663,958,351,954,959,000
31.121508
103
0.684073
false
3.62189
false
false
false
sauloal/ipython
opticalmapping/standalone/om_shared.py
1
21160
import re import operator import argparse import textwrap from collections import defaultdict from sqlalchemy.util import KeyedTuple """ #h XmapEntryID QryContigID RefContigID QryStartPos QryEndPos RefStartPos RefEndPos Orientation Confidence HitEnum QryLen RefLen Label...
mit
-5,073,535,540,909,537,000
53.117647
529
0.523535
false
3.484848
false
false
false
mekkablue/Glyphs-Scripts
Glyph Names, Notes and Unicode/Reorder Unicodes of Selected Glyphs.py
1
2444
#MenuTitle: Reorder Unicodes of Selected Glyphs # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Reorders Unicodes so that default Unicode comes first. """ from Foundation import NSArray thisFont = Glyphs.font # frontmost font selectedLayers = thisFont.selectedLaye...
apache-2.0
3,247,545,768,706,852,400
33.366197
139
0.704508
false
3.275168
false
false
false
lelandbatey/dotfiles
install.py
1
4362
#!/usr/bin/python """Python file for the installation of dotfiles.""" from __future__ import print_function from subprocess import call import datetime import argparse import os.path import shutil import os ACTION_TYPE = ("\n\n\t" "safe[default]\n\t" "bashmarks (requires 'prepvim' be run first)\n\t" "prepvim\n") HOM...
gpl-3.0
-2,973,207,155,423,768,000
33.346457
110
0.645575
false
3.779896
false
false
false
stdweird/aquilon
lib/python2.6/aquilon/aqdb/model/model.py
2
2735
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
apache-2.0
5,049,600,478,352,486,000
36.465753
80
0.660695
false
3.963768
false
false
false
ryfx/modrana
core/providers.py
1
7829
# -*- coding: utf-8 -*- # Geographic information providers from core import threads, constants class DummyController(object): """A default dummy object that implements the task controller interface that modRanaThreads have""" def __init__(self): self.status = None self.progress = None ...
gpl-3.0
3,029,443,348,740,764,700
34.265766
116
0.646315
false
4.690833
false
false
false
chfoo/wpull
wpull/testing/integration/base.py
1
3274
import logging from http import cookiejar import asyncio import tornado.web from tornado.testing import AsyncHTTPSTestCase import tornado.ioloop from wpull.testing.async import AsyncTestCase from wpull.testing.badapp import BadAppTestCase from wpull.testing.ftp import FTPTestCase from wpull.testing.goodapp import Goo...
gpl-3.0
-8,345,382,457,833,335,000
26.982906
78
0.670739
false
4.082294
true
false
false
eflglobal/filters
test/complex_test.py
1
31482
# coding=utf-8 from __future__ import absolute_import, division, print_function, \ unicode_literals from collections import OrderedDict import filters as f from filters.test import BaseFilterTestCase class FilterChainTestCase(BaseFilterTestCase): def test_implicit_chain(self): """ Chaining t...
mit
2,805,466,708,566,686,700
29.155172
78
0.457277
false
4.251452
true
false
false
socib/django-socib-cms
socib_cms/pages/migrations/0002_auto_20161202_1759.py
1
1239
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('pages', '0001_initial'), ] operations = [ migrations.AlterField( model_name='pa...
mit
-8,019,060,117,059,236,000
34.4
160
0.60452
false
4.257732
false
false
false
pagesjaunes/pydeepdiff
test/test_get_complex_diff.py
1
10557
""" Test of get_diff function """ from pydeepdiff.diff import get_diff def test_empty_diff(): diff = [] obj_a = { 'id': 'cabinetinfirmière', 'blocs_reponses': [ { 'activites_affichage_immediat': [ { 'suggestion_edito...
gpl-2.0
729,076,195,968,405,800
36.469751
198
0.315605
false
4.638326
false
false
false
yudingding6197/fin_script
debug/163/lastday.py
1
3566
#!/usr/bin/env python # -*- coding:utf8 -*- #导入需要使用到的模块 import urllib import re import pandas as pd #import pymysql import os import datetime from openpyxl import Workbook from openpyxl import load_workbook from openpyxl.writer.excel import ExcelWriter import csv #抓取特定股票, 保存到csv文本文件 def getStockByCode2E...
gpl-2.0
-171,990,707,352,734,240
33.5625
124
0.553603
false
2.766613
false
false
false
fgregg/craigslistings
craigslistings/download.py
1
1349
import requests import logging def save_rss(feed, city, cursor): section, url = feed url = url % city logging.info('%s', city) logging.info('%s', section) logging.info('%s', url) listing = requests.get(url).text cursor.execute("""INSERT INTO rss (section, url, raw, city) """ ...
mit
-6,903,678,625,833,893,000
21.864407
67
0.510007
false
4.189441
false
false
false
CSC-IT-Center-for-Science/pouta-blueprints
pebbles/client.py
1
9360
import requests import pebbles.utils class PBClient(object): def __init__(self, token, api_base_url, ssl_verify=True): self.token = token self.api_base_url = api_base_url self.ssl_verify = ssl_verify self.auth = pebbles.utils.b64encode_string('%s:%s' % (token, '')).replace('\n', ''...
mit
2,131,387,007,521,756,200
42.534884
121
0.592308
false
3.698143
false
false
false
mr-karan/coala-bears
bears/c_languages/GNUIndentBear.py
1
8024
import platform import shlex from coalib.bearlib.abstractions.Linter import linter from coalib.bearlib.spacing.SpacingHelper import SpacingHelper from coalib.bears.requirements.DistributionRequirement import ( DistributionRequirement) @linter(executable="indent" if platform.system() != "Darwin" else "gindent", ...
agpl-3.0
-8,099,440,547,859,922,000
39.525253
78
0.479686
false
4.66783
false
false
false
USGSDenverPychron/pychron
pychron/applications/pyvalve.py
1
1451
# =============================================================================== # Copyright 2013 Jake Ross # # 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...
apache-2.0
2,391,423,667,517,934,600
40.457143
81
0.577533
false
4.788779
false
false
false
plutec/megup
core/mega.py
1
35440
import re import json from Crypto.Cipher import AES from Crypto.PublicKey import RSA from Crypto.Util import Counter import os import random import binascii import requests import json import shutil from .errors import ValidationError, RequestError from .crypto import * import tempfile class Mega(object): def ...
gpl-2.0
134,284,882,122,355,710
35.200204
136
0.48671
false
3.859305
false
false
false
fabrickit/fabkit
core/agent/rpc.py
1
2154
# coding: utf-8 import oslo_messaging as messaging from oslo_config import cfg from oslo_serialization import jsonutils import fabcontext CONF = cfg.CONF _NAMESPACE = 'fabkit' _TOPIC = 'fabkit' class BaseRPCAPI(object): """Server side of the base RPC API.""" def __init__(self, service_name, target): ...
mit
2,126,414,121,440,731,000
29.771429
92
0.640204
false
4.369168
false
false
false
manishbisht/Udacity
Full Stack Web Developer Nanodegree v2/P1 - Fyyur Artist Booking Site/migrations/versions/7025dd892e17_.py
1
2586
"""empty message Revision ID: 7025dd892e17 Revises: Create Date: 2019-08-19 12:53:16.769958 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '7025dd892e17' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
mit
-391,793,965,101,744,900
37.597015
75
0.66396
false
3.354086
false
false
false
dmmmdfll/pythonista-dropbox
pythonista_dropbox/request_auth_token.py
1
5138
try: # fix insecure warning in urllib3 import urllib3.contrib.pyopenssl urllib3.contrib.pyopenssl.inject_into_urllib3() except ImportError: pass import sys try: # keychain on non-Pythonista is called keyring import keyring except ImportError: import keychain as keyring from pythonista_dropbox.adap...
isc
-1,122,142,551,217,766,800
29.402367
77
0.636824
false
3.750365
false
false
false
saopicc/killMS
Wirtinger/ClassSolverLM.py
1
6413
#!/usr/bin/env python """ killMS, a package for calibration in radio interferometry. Copyright (C) 2013-2017 Cyril Tasse, l'Observatoire de Paris, SKA South Africa, Rhodes University This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published ...
gpl-2.0
-1,293,273,131,990,387,200
30.905473
123
0.563231
false
3.017882
false
false
false
spasztor/pyCAD
source/test_objects.py
1
9317
#!/usr/bin/python """ Unit tests for objects.py """ import collections import exceptions import objects import unittest import uuid # Test all point values with point 0 or UTM coords of: 31 S 483925 2010789 # elev = 3918.63517 # Note: I used to know where this coordi...
gpl-3.0
-4,157,362,996,927,559,700
43.578947
95
0.616293
false
3.420338
true
false
false
qusp/orange3
Orange/tests/__init__.py
2
1097
import os import unittest from Orange.widgets.tests import test_setting_provider, \ test_settings_handler, test_context_handler, \ test_class_values_context_handler, test_domain_context_handler from Orange.widgets.data.tests import test_owselectcolumns try: from Orange.widgets.tests import test_widget ...
bsd-2-clause
-536,375,156,244,552,450
25.119048
66
0.665451
false
3.756849
true
false
false
CosmoJG/neural-heatmap
dependencies/rotanimate.py
1
5528
#!/usr/bin/env python # -*- coding: utf-8 -*- # # rotanimate.py # # Copyright 2016 Cosmo <cosmo@CosmoSpectre> # # 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 L...
gpl-3.0
-2,600,423,659,024,732,000
31.517647
94
0.609805
false
3.584955
false
false
false
djplaner/Malikowski
AdoptionView.py
1
8271
# # AdoptionView.py # - simple test for a view import plotly from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot import plotly.graph_objs as go from plotly.graph_objs import * class AdoptionView: """Take a Adoption object and generate a plot""" def __init__(self,adoption=None): ...
gpl-3.0
-1,359,055,342,103,378,400
37.830986
107
0.550478
false
4.054412
false
false
false
Jozhogg/iris
lib/iris/cube.py
1
143761
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
6,368,140,106,166,212,000
39.405003
79
0.54007
false
4.619421
false
false
false