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
Grumbel/scatterbackup
scatterbackup/cmd_du.py
1
2219
# ScatterBackup - A chaotic backup solution # Copyright (C) 2016 Ingo Ruhnke <grumbel@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
gpl-3.0
2,194,490,886,791,235,600
33.138462
101
0.671474
false
3.998198
true
false
false
thefirstwind/s3qloss
src/s3ql/statfs.py
1
2913
''' statfs.py - this file is part of S3QL (http://s3ql.googlecode.com) Copyright (C) 2008-2009 Nikolaus Rath <Nikolaus@rath.org> This program can be distributed under the terms of the GNU GPLv3. ''' from __future__ import division, print_function, absolute_import from .common import CTRL_NAME, QuietError, setup_logg...
gpl-3.0
4,703,652,213,013,564,000
33.270588
91
0.621009
false
3.427059
false
false
false
stadtgestalten/stadtgestalten
grouprise/features/polls/forms.py
1
6496
import django from django import forms from django.core.exceptions import ObjectDoesNotExist from grouprise.features.content import forms as content from grouprise.features.content.models import Content from . import models SimpleOptionFormSet = forms.modelformset_factory( models.SimpleOption, fields=('title...
agpl-3.0
1,499,144,372,932,176,100
38.120482
93
0.615491
false
3.902644
false
false
false
sdenton4/pipic
loadout.py
1
2850
#!/usr/bin/python import sys, getopt import subprocess import random import os, shutil usageString='loadOut.py -r <target root directory> -n <hostname>' def placefile( filename, targetdir ): command='cp '+filename+' '+targetdir subprocess.call(command, shell=True) hostcolors=['red','blue','green','yellow','...
gpl-2.0
5,719,356,166,680,423,000
29.645161
107
0.583509
false
3.454545
true
false
false
junpenglao/GLMM-in-Python
misc/pymc3_hierarchical_example.py
1
2566
# -*- coding: utf-8 -*- """ example from pymc-dev """ import pymc3 as pm import theano.tensor as T from numpy import random, sum as nsum, ones, concatenate, newaxis, dot, arange import numpy as np random.seed(1) n_groups = 10 no_pergroup = 30 n_observed = no_pergroup * n_groups n_group_predictors = 1 n_predictors = 3...
gpl-3.0
3,814,466,537,459,863,000
27.511111
125
0.63523
false
2.726886
false
false
false
jddixon/rnglib
setup.py
1
1249
#!/usr/bin/python3 # rnglib/setup.py """ Setuptools project configuration for rnglib. """ from os.path import exists from setuptools import setup long_desc = None if exists('README.md'): with open('README.md', 'r') as file: long_desc = file.read() setup(name='rnglib', version='1.3.10', autho...
mit
6,274,665,253,406,631,000
30.225
73
0.590072
false
4.149502
false
false
false
eduNEXT/edunext-ecommerce
ecommerce/enterprise/views.py
1
3252
# TODO: Refactor this to consolidate it with `ecommerce.programs.views`. from __future__ import absolute_import import logging from django.contrib import messages from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.views.generic import CreateView, ListView, TemplateView...
agpl-3.0
7,264,125,542,828,652,000
34.736264
93
0.714637
false
4.147959
false
false
false
gyoerkaa/mdltools
neverblender/nvb_aabb.py
1
4220
"""TODO: DOC.""" import mathutils def generate_tree(aabb_tree, face_list, rlevel=0): """TODO: DOC.""" if (rlevel > 128): print('Neverblender - ERROR: Could not generate aabb.\ Recursion level exceeds 100') aabb_tree = [] return if not face_list: # We are fin...
gpl-2.0
-1,740,367,169,041,450,500
33.308943
76
0.50237
false
3.843352
false
false
false
janhui/test_engine
release/mesh_netcdf/PreMeshingFunctions.py
1
9107
""" This class includes all of the functions that used by MeshOperations.py for the creation of the mesh. """ from StandardModules import * import sys from PyQt4.QtGui import * from export_geo import * class PreMesh(DefineDomain): """ Once the user has selected something from the drop-downs and click...
lgpl-2.1
4,693,597,142,777,207,000
36.264706
148
0.679807
false
3.11244
false
false
false
smahs/euler-py
25.py
1
1244
#!/usr/bin/python2 """ Statement: The Fibonacci sequence is defined by the recurrence relation: Fn = Fn-1 + Fn-2, where F1 = 1 and F2 = 1. Hence the first 12 terms will be: F1 = 1 F2 = 1 F3 = 2 F4 = 3 F5 = 5 F6 = 8 F7 = 13 F8 = 21 F9 = 34 F10 = 55 F11 = 89 F12 = 1...
mit
3,202,610,991,643,990,500
18.138462
70
0.55627
false
3.231169
false
false
false
alexandru/django-asynctasks
src/django_asynctasks/tasks.py
1
1787
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime from functools import wraps from inspect import getargspec from django_asynctasks.models import AsyncTask HIGH=1 NORMAL=2 LOW=3 def define(label, schedule=None, bucket=None, priority=2): if not schedule: schedule = 'onetime' ...
bsd-2-clause
3,137,311,310,393,275,000
30.350877
102
0.543369
false
4.117512
false
false
false
texttheater/produce
doc/samples/tokenization/src/scripts/tables.py
1
2032
"""Library for pretty-printing tables.""" import util from util import out, nl def print_table(table, rowsortkey=None, columnsortkey=None, defaultvalue=''): # Get the row and column heads: row_heads = list(table.keys()) column_heads = util.list_union(map(lambda x: x.keys(), table.values())) if rowsor...
mit
4,710,433,475,010,807,000
34.649123
77
0.629429
false
3.564912
false
false
false
markroxor/gensim
gensim/models/wrappers/varembed.py
1
4389
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2017 Anmol Gulati <anmol01gulati@gmail.com> # Copyright (C) 2017 Radim Rehurek <radimrehurek@seznam.cz> """ Python wrapper around word representation learning from Varembed models, a library for efficient learning of word representations and sentence class...
lgpl-2.1
5,230,811,754,571,886,000
40.018692
106
0.652313
false
3.642324
false
false
false
kasioumis/invenio
invenio/ext/session/model.py
1
2073
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2013, 2014 CERN. # # Invenio 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...
gpl-2.0
-5,836,776,987,267,945,000
38.113208
78
0.667149
false
4.129482
false
false
false
IntersectAustralia/asvo-tao
web/tao/deployment_tests/cone_basic.py
1
3740
""" Tests: 1. Galaxies positions are all within the light-cone geometry 2. The number of Galaxies in Catalogue 0 matches the expected number (optional) 3. The galaxy ids are unique across all light-cones (optional) """ import logging from tao_validate import ValidateJob logger = logging.getLogger('detest.'+__name__)...
gpl-3.0
-6,566,078,525,154,567,000
38.797872
89
0.552139
false
3.85567
false
false
false
deepmind/interval-bound-propagation
examples/language/utils.py
1
10260
# coding=utf-8 # Copyright 2019 The Interval Bound Propagation 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 ...
apache-2.0
4,491,862,746,991,396,000
37.716981
80
0.658285
false
3.588667
false
false
false
marcos-sb/quick-openstacked-hadoop
Alba/albaproject/mapred/fabric/fabfile.py
1
8199
from fabric.api import run, sudo, env, roles, settings, hide, execute, local, put, get, show import re, pdb import time env.connection_attempts = 250 env.timeout = 1 env.abort_on_prompts = True env.disable_known_hosts = True env.no_keys = True env.no_agent = True ##################### move to mapred environment env.u...
apache-2.0
5,768,290,729,784,638,000
28.282143
96
0.570679
false
3.003297
false
false
false
codeforamerica/comport
comport/admin/views.py
1
4390
# -*- coding: utf-8 -*- from flask import Blueprint, render_template, request, redirect, url_for, flash, abort from comport.utils import flash_errors from flask.ext.login import login_required from .forms import NewDepartmentForm, NewInviteForm, EditUserForm, EditExtractorForm from comport.department.models import Depa...
bsd-3-clause
5,361,072,941,567,465,000
39.275229
153
0.682005
false
3.509193
false
false
false
anuragjain67/django-sql-reports
sqlreports/core.py
1
3453
from collections import OrderedDict from django.http import HttpResponse from django.template import Context, Template from django.utils.html import escape from sqlreports.utils import CSVWriter, get_db_connection from sqlreports.models import SQLReport def dictfetchall(cursor): "Returns all rows from a cursor ...
mit
-7,402,006,128,133,347,000
31.271028
79
0.646394
false
4.31625
false
false
false
sirex/atviriduomenys.lt
adlt/frontpage/api.py
1
1171
from django.http import Http404 from django.contrib.auth.decorators import login_required from django.db.models import F from adlt.common.helpers import ajax import adlt.core.models as core_models @ajax.request('GET') def agent_list(request): # pylint: disable=unused-argument return [ { 'pk'...
agpl-3.0
8,084,578,697,310,724,000
29.025641
106
0.660974
false
3.394203
false
false
false
dpa-newslab/livebridge-liveblog
tests/test_post.py
1
5419
# -*- coding: utf-8 -*- # # Copyright 2016 dpa-infocom GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
-704,934,657,416,254,800
35.126667
116
0.627422
false
3.416772
true
false
false
jbkalmbach/kbmod
analysis/create_stamps.py
1
11661
import os import random import csv import numpy as np import matplotlib.pyplot as plt from skimage import measure from astropy.io import fits class create_stamps(object): def __init__(self): return def load_lightcurves(self, lc_filename, lc_index_filename): lc = [] lc_index = [] ...
bsd-2-clause
-6,406,296,244,992,474,000
38.934932
93
0.522425
false
3.305272
false
false
false
williewonka/CoTC_Tools
Check_Data.py
1
1151
__author__ = 'williewonka' #this tool checks if the provinces title exists and if this title has an owner import json # import random #dictionary that keeps track of the number of existing members of a dynastie, that way no conflicts will emerge existing_dynasties = {} #id numbering: 001 + dynasty id jsonfile = open...
gpl-2.0
4,775,298,376,574,635,000
36.16129
111
0.676803
false
3.552469
false
false
false
minlexx/pyevemon
esi_client/models/put_fleets_fleet_id_wings_wing_id_naming.py
1
3247
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class PutFleetsFleetIdWingsWingIdNaming(object): """ NOT...
gpl-3.0
5,606,025,348,482,912,000
25.834711
99
0.530336
false
4.168164
false
false
false
purpleidea/gedit-plugins
plugins/bracketcompletion/bracketcompletion.py
1
10661
# -*- coding: utf-8 -*- # # bracketcompletion.py - Bracket completion plugin for gedit # # Copyright (C) 2006 - Steve Frécinaux # # 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 vers...
gpl-2.0
-3,347,244,695,238,270,000
32.734177
90
0.54925
false
3.858125
false
false
false
blissland/blissflixx
chls/bfch_itv_player/__init__.py
1
2847
from chanutils import get_doc, select_all, select_one, get_json from chanutils import get_attr, get_text, get_text_content from playitem import PlayItem, PlayItemList, MoreEpisodesAction _FEEDLIST = [ {'title':'Popular', 'url':'http://www.itv.com'}, {'title':'All Shows', 'url':'http://www.itv.com/hub/shows'}, {'...
gpl-2.0
-5,759,560,689,227,298,000
32.104651
133
0.626273
false
2.932029
false
false
false
deapplegate/wtgpipeline
advanced_calc.py
1
10292
# entry point for the input form to pass values back to this script def setValues(tH0,tWM,tWV,tz,tmnue,tmnumu,tmnutau,tw,twp,tT0): H0 = tH0 h = H0/100 WM = tWM WV = tWV z = tz WR = 2.477E-5/(h*h) # does not include neutrinos, T0 = 2.72528 WK = 1-WM-WR-WV mnue = tmnue mnumu = tmnumu mnutau = tmnutau...
mit
-1,979,014,363,781,253,600
34.489655
137
0.518947
false
2.510856
false
false
false
szaghi/MaTiSSe
release/MaTiSSe-0.3.4/matisse/presentation/toc.py
1
7542
#!/usr/bin/env python """ toc.py, module definition of TOC class. This defines the Table of Contents of the presentation. """ # modules loading # standard library modules: these should be present in any recent python distribution import re # modules not in the standard library from yattag import Doc # global variables ...
gpl-3.0
-6,060,174,641,161,162,000
34.07907
149
0.623309
false
4.003185
false
false
false
dr-slump/bajawa
scripts/python/discover-slony-cluster.py
1
1432
#------------------------------------------------------ # $Date: 2014-06-23 08:03:15 +0000 (21 Aug 2014) $ # $Revision: 1 $ # $Author: rikih.gunawan $ #------------------------------------------------------ # # /var/lib/zabbix/scripts/discover-s...
mit
6,982,002,341,199,823,000
21.375
153
0.441341
false
3.254545
false
false
false
RincewindLangner/Game_database
V12/gamefile_load.py
1
1469
import sqlite3 # sqlite 3 database import file_check_ex # to check if there is a file import database # creating, editing, deleting the database import intCheck # check that it is an integar option = None # choose what manu option they want sqlite_file = "" # the name of the sqlite3 file option_list = (0, 1, 2, 3) # ...
gpl-3.0
1,675,010,851,396,724,500
33.162791
134
0.71341
false
3.505967
false
false
false
pipermerriam/flex
tests/validation/parameter/test_min_max_items_validation.py
1
3262
import pytest from flex.exceptions import ValidationError from flex.loading.schema.paths.path_item.operation.parameters import ( parameters_validator, ) from flex.validation.parameter import ( validate_parameters, ) from flex.constants import ( PATH, ARRAY, STRING, ) from flex.error_messages import...
mit
3,032,155,428,753,175,000
21.342466
71
0.497854
false
3.580681
true
false
false
DanHoerst/notecard
notecard/settings.py
1
3355
# Django settings for notecard project. import os import sys DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('dan hoerst', 'dhoerst1@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'or...
gpl-3.0
4,785,925,985,693,658,000
22.137931
120
0.654545
false
3.355
false
false
false
libeanim/refuelking
refuelking/api.py
1
3176
import requests import json class Tankerkoenig(): """ Wrapper for Tankerkönig-API calls. * Parameters: :api_key: ``str``; Tankerönik API key. """ def __init__(self, api_key): self.api_key = api_key def __check(self, r): """ Internal method to check whether a ...
gpl-3.0
8,470,868,410,601,090,000
30.425743
79
0.495904
false
4.187335
false
false
false
vrbacky/proceseq_16s
proceseq_16s/rdp.py
1
7027
#!/usr/bin/env python3 import csv import pydoc import subprocess import tempfile class Analyzer(): '''Analyze sequences in fasta file by RDP Classifier. Parameters ---------- fasta_file : str Path to the fasta file containing sequences to be analyzed (default: None) analyzer_file : str ...
mit
-5,823,275,120,657,471,000
35.409326
89
0.574498
false
4.345702
false
false
false
idanivanov/catdtree
tests/test_BaseDecisionTree.py
1
1761
from nose import with_setup from nose.tools import assert_equal import pandas as pd from catdtree import BaseDecisionTree class MockDecisionTree(BaseDecisionTree): def __init__(self): BaseDecisionTree.__init__(self) def _choose_best_split(self, X_part, y_part): if len(set(X_part['Sex'])) > 1...
mit
964,071,306,302,019,300
29.362069
77
0.478705
false
3.54326
false
false
false
andreav/swgit
core/OldPython.py
1
3064
#!/usr/bin/env python # Copyright (C) 2012 Andrea Valle # # This file is part of swgit. # # swgit 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 lat...
gpl-3.0
6,104,137,058,317,089,000
37.78481
88
0.559073
false
4
false
false
false
moullos/UnlimitID
UnlimitID/User/views.py
1
3180
import os import requests from flask import redirect, url_for, render_template, request, flash from forms import RegisterForm, CredentialForm from petlib.pack import encode, decode from .cred_user import CredentialUser def setUpViews(app, crypto_dir, credential_url=None, info_url=None, params=None, ipub=None): c...
bsd-2-clause
-6,402,558,580,113,435,000
39.253165
92
0.571698
false
4.162304
false
false
false
painless-software/painless-continuous-delivery
tests/acceptance/environment.py
1
2100
""" Painless environment setup for acceptance tests. Powered by behave. Visit the docs at https://behave.readthedocs.io/en/latest/tutorial.html#environmental-controls """ from contextlib import contextmanager from os import chdir, getcwd, system from os.path import dirname, join from shutil import rmtree from tempfile...
apache-2.0
1,341,203,438,349,643,800
27.767123
77
0.637143
false
4.142012
false
false
false
iotile/coretools
transport_plugins/jlink/iotile_transport_jlink/structures.py
1
4490
"""Helper routines for processing data received from an IOTile device.""" import struct from iotile.core.exceptions import HardwareError class ControlStructure: """A shared memory control structure allowing bidirectional communication with an IOTile device.""" # The control structure in RAM is 16 bytes lon...
gpl-3.0
2,727,295,139,619,318,300
36.107438
159
0.641425
false
3.942054
false
false
false
twitterdev/twitter-python-ads-sdk
twitter_ads/resource.py
1
7326
# Copyright (C) 2015 Twitter, Inc. """Container for all plugable resource object logic used by the Ads API SDK.""" import dateutil.parser import json from datetime import datetime from twitter_ads.utils import format_time from twitter_ads.enum import ENTITY, TRANSFORM from twitter_ads.http import Request from twitte...
mit
6,827,451,712,188,625,000
32.149321
89
0.585995
false
4.24942
false
false
false
cgeoffroy/son-analyze
scripts/all.py
1
2996
#! /usr/bin/env python3 # Copyright (c) 2015 SONATA-NFV, Thales Communications & Security # 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/...
apache-2.0
-6,771,787,523,066,724,000
38.421053
94
0.661549
false
3.952507
false
false
false
DragonRoman/rhevm-utils
monitoring/rhev-nagios-host-mem-used.py
1
2977
#!/usr/bin/env python # # Author: Pablo Iranzo Gomez (Pablo.Iranzo@redhat.com) # # Description: Script for monitoring host Memory status and VM's rhevm-sdk # api and produce NAGIOS valid output # # Requires rhevm-sdk to work # # This program is free software; you can redistribute it and/or modify # it under the terms o...
gpl-3.0
-3,178,408,871,091,183,000
33.218391
119
0.698018
false
3.406178
false
false
false
fhamborg/news-please
newsplease/pipeline/extractor/comparer/comparer_text.py
1
3329
import itertools class ComparerText(): """This class compares the text of the list of ArticleCandidates and sends the result back to the Comparer.""" def extract(self, item, article_candidate_list): """Compares the extracted texts. :param item: The corresponding NewscrawlerItem :para...
apache-2.0
3,257,272,962,055,773,700
41.139241
123
0.56924
false
4.267949
false
false
false
Bramsnoek/Bioinformatics_Education
Aftekenopdracht 2/main.py
1
2987
from pprint import pprint def print_personal_information(): personal_information = \ { 'name': 'Bram Snoek', 'address': 'Lithsedijk 33, 5397ea, Lith', 'phone': '0636489308', 'college major': 'Bioinformatics' } print("\n My name is {}, my address...
gpl-3.0
-2,781,386,519,122,871,300
42.304348
146
0.508537
false
4.047425
false
false
false
bluesliverx/smartthings-src
apps/wifi-104-server/lights-app.py
1
7007
#!/usr/bin/env python3 from flask import Flask, request, abort, jsonify from timeout_decorator import timeout import logging import socket import platform import os # App for uwsgi app = Flask(__name__) ENDPOINT = os.getenv('ENDPOINT', '192.168.1.104') ENDPOINT_PORT = 8899 INTERNAL_ADDRESS = [0x11, 0x0e, 0x59] BUFFE...
apache-2.0
8,989,622,392,067,946,000
33.180488
155
0.634223
false
3.621189
false
false
false
Nukesor/mitra
mitra/api/category.py
1
1531
from flask import jsonify,request from flask.ext.login import current_user from mitra import app,db from mitra.models.category import Category @app.route('/_addCategory', methods=['PUT', 'POST']) def AddCategory(): data = {} # TODO Check for valid Userinput if current_user.is_authenticated(): pars...
mit
6,259,498,564,645,138,000
29.62
84
0.596995
false
4.104558
false
false
false
MrCreosote/jgi_kbase_integration_tests
scripts/translate_jgi_project_id_to_portal_org_name.py
1
1211
#! /usr/bin/env python ''' Translates a set of JGI project IDs to their portal organism name. The input is via python fileinput (https://docs.python.org/2/library/fileinput.html). @author: gaprice@lbl.gov ''' from __future__ import print_function import fileinput import urllib2 import sys # JGI_URL = 'http://genome.j...
mit
-110,908,718,174,458,540
29.275
73
0.577209
false
3.5
false
false
false
CBA2011/ros_wasabi
devel/_setup_util.py
1
12281
#!/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code mu...
lgpl-3.0
7,057,874,097,536,871,000
41.790941
213
0.657601
false
3.811608
false
false
false
scikit-learn-contrib/categorical-encoding
tests/test_polynomial.py
1
5846
import pandas as pd from unittest import TestCase # or `from unittest import ...` if on Python 3.4+ import numpy as np import category_encoders as encoders from tests.helpers import deep_round a_encoding = [1, -0.7071067811865476, 0.40824829046386313] b_encoding = [1, -5.551115123125783e-17, -0.8164965809277261] c_en...
bsd-3-clause
-1,910,405,756,056,152,600
37.973333
106
0.57766
false
3.692988
true
false
false
wpj-cz/Spritemapper
spritecss/packing/sprites.py
1
1651
from contextlib import contextmanager import logging from ..image import Image from ..png import FormatError from . import Rect logger = logging.getLogger(__name__) class SpriteNode(Rect): def __init__(self, im, width, height, fname=None, pad=(0, 0)): Rect.__init__(self, (0, 0, width, height)) s...
mit
-4,243,201,966,748,089,300
27.964912
74
0.543913
false
3.453975
false
false
false
Svolcano/python_exercise
dianhua/worker/crawler/china_telecom/jiangsu/main.py
1
14319
#!/user/bin/env python # -*- coding:utf-8 -*- import random import re import json import traceback import sys import time import calendar import datetime from datetime import date # 这段代码是用于解决中文报错的问题 from dateutil.relativedelta import relativedelta reload(sys) sys.setdefaultencoding("utf8") if __name_...
mit
6,394,243,637,282,430,000
36.144414
124
0.483035
false
3.611713
false
false
false
thom-at-redhat/cfme_tests
scripts/install_vddk.py
1
1213
#!/usr/bin/env python2 """SSH into a running appliance and install VMware VDDK. """ import argparse import sys from urlparse import urlparse from utils.appliance import IPAppliance from utils.conf import env def log(message): print "[VDDK-INSTALL] {}".format(message) def main(): parser = argparse.Argument...
gpl-2.0
-5,883,549,056,253,606,000
30.102564
93
0.652102
false
4.0299
false
false
false
rwightman/tensorflow-litterbox
litterbox/fabric/dataset_record.py
1
2306
# Copyright (C) 2016 Ross Wightman. 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
-2,322,583,809,205,931,500
32.42029
80
0.654814
false
4.117857
false
false
false
jdob/okaara
okaara/prompt.py
1
34929
# Copyright (c) 2011-2013 Jason Dobies # # This file is part of Okaara. # # Okaara 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. # # Ok...
gpl-2.0
-922,248,598,433,704,800
35.806112
133
0.575539
false
4.348189
false
false
false
wasiahmad/Paraphrase-Identification-Task
source_code_in_theano/lstm.py
1
5735
import numpy as np import theano as theano import theano.tensor as T from theano.gradient import grad_clip import time import operator # Theano implementation of a single-layer LSTM class LSTM: def __init__(self, word_dim, hidden_dim=128, bptt_truncate=-1): # Assign instance variables self.word_di...
mit
-3,497,113,918,323,928,600
42.120301
111
0.539669
false
3.076717
true
false
false
biln/airflow
airflow/jobs.py
1
43658
# -*- coding: utf-8 -*- # # 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, software ...
apache-2.0
8,467,749,364,340,650,000
36.996519
110
0.518507
false
4.419721
false
false
false
nisavid/bedframe
bedframe/auth/_provisions.py
1
13350
"""Security provisions.""" __copyright__ = "Copyright (C) 2014 Ivan D Vasin" __docformat__ = "restructuredtext" import abc as _abc from functools import reduce as _reduce from itertools import chain as _chain, combinations as _combinations from operator import or_ as _or from spruce.collections \ import frozenus...
lgpl-3.0
6,038,507,939,569,562,000
34.505319
77
0.585094
false
4.367026
false
false
false
jfelectron/python-driver
cassandra/cqlengine/models.py
1
33196
# Copyright 2015 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
7,909,401,571,655,610,000
34.165254
209
0.596066
false
4.538693
false
false
false
felipead/cassandra-logger
integration-tests/conftest.py
1
1525
# Standard py.test configuration file. Fixtures defined here will be available in all modules. from cassandra.cluster import Cluster import pytest from log_entry import LogEntryStore # This variable tells py.test which files and folders to ignore collect_ignore = ["env"] @pytest.fixture(scope="module") def fixture...
apache-2.0
2,637,115,291,656,845,300
22.461538
94
0.719344
false
3.665865
true
false
false
dhinakg/BitSTAR
plugins/cacheutils.py
1
2177
# Copyright 2017 Starbot Discord Project # # 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
-4,483,572,499,845,762,600
45.319149
116
0.66927
false
3.74055
false
false
false
supermarkion/Life-Backup
Python/4Sum.py
1
1307
''' Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Link: https://leetcode.com/problems/4sum/#/description Example: For example, given array S = [1, 0, -1, 0, -2, ...
mit
1,927,763,487,455,768,300
28.704545
117
0.556236
false
3.580822
false
false
false
OSSOS/MOP
src/ossos/core/ossos/vospace.py
1
1041
"""This module abstracts all vospace activities. Including a switch to using username/password pairs.""" from getpass import getpass from requests.auth import HTTPBasicAuth from vos.vos import Client, Connection import sys import types import netrc import logging logging.getLogger('vos').setLevel(logging.ERROR) VOSP...
gpl-3.0
5,671,532,576,452,423,000
28.742857
105
0.607109
false
4.066406
false
false
false
malinoff/pytest
_pytest/hookspec.py
1
11977
""" hook specifications for pytest plugins, invoked from main.py and builtin plugins. """ from _pytest._pluggy import HookspecMarker hookspec = HookspecMarker("pytest") # ------------------------------------------------------------------------- # Initialization hooks called for every plugin # ----------------------...
mit
-2,296,602,434,055,089,700
36.663522
90
0.617266
false
4.61186
true
false
false
skinny121/MCEdit-TallWorlds
pymclevel/leveldbpocket.py
1
40558
import itertools import time from math import floor from level import FakeChunk, MCLevel import logging from materials import pocketMaterials import os from mclevelbase import ChunkNotPresent, ChunkMalformed import nbt import numpy import struct from infiniteworld import ChunkedLevelMixin, SessionLockLost, AnvilChunk...
isc
-1,070,274,285,691,429,800
34.546012
117
0.571675
false
3.862667
false
false
false
tkolhar/robottelo
tests/foreman/smoke/test_api_smoke.py
1
39496
# -*- encoding: utf-8 -*- """Smoke tests for the ``API`` end-to-end scenario.""" import random from fauxfactory import gen_string from nailgun import client, entities from robottelo import helpers, manifests from robottelo.api.utils import ( enable_rhrepo_and_fetchid, promote, upload_manifest, ) from robot...
gpl-3.0
-1,579,052,074,403,348,200
35.523589
115
0.593942
false
3.526753
true
false
false
liberation/sesql
sesql/daemon/cmdline.py
1
3231
# -*- coding: utf-8 -*- # Copyright (c) Pilot Systems and Libération, 2010-2011 # This file is part of SeSQL. # SeSQL 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 # (a...
gpl-2.0
5,738,396,317,340,861,000
32.298969
81
0.542105
false
3.849821
false
false
false
wukan1986/kquant_data
kquant_data/wind/tdays.py
1
1026
#!/usr/bin/env python # -*- coding: utf-8 -*- """ w.tdays("2017-02-02", "2017-03-02", "") w.tdays("2017-02-02", "2017-03-02", "Days=Weekdays") w.tdays("2017-02-02", "2017-03-02", "Days=Alldays") w.tdays("2017-02-02", "2017-03-02", "TradingCalendar=SHFE") """ import pandas as pd from .utils import asDateTime def down...
bsd-2-clause
-6,473,286,853,818,110,000
21.488889
74
0.593874
false
2.735135
false
false
false
DDMAL/Gamera
gamera/plugins/segmentation.py
1
8124
# # Copyright (C) 2001-2005 Ichiro Fujinaga, Michael Droettboom, and Karl MacMillan # # 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 l...
gpl-2.0
-1,454,504,026,732,024,300
26.08
81
0.641064
false
3.696087
false
false
false
bbglab/wok
wok/core/runstates.py
1
2959
############################################################################### # # Copyright 2009-2011, Universitat Pompeu Fabra # # This file is part of Wok. # # Wok 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...
gpl-3.0
-8,364,119,999,754,507,000
28.6
95
0.630281
false
3.161325
false
false
false
rqlite/pyrqlite
src/pyrqlite/connections.py
1
5326
from __future__ import unicode_literals import codecs import logging try: from http.client import HTTPConnection, HTTPSConnection except ImportError: # pylint: disable=import-error from httplib import HTTPConnection, HTTPSConnection try: from urllib.parse import urlparse except ImportError: # py...
mit
-7,211,873,513,507,476,000
33.36129
97
0.591626
false
4.692511
false
false
false
yaukwankiu/armor
geometry/regrid_backup2013-08-26.py
1
4802
#regrid.py # to redraw the grids, to interpolate, etc """ USE: from armor import pattern from armor.geometry import regrid reload(pattern); reload(regrid) a = pattern.a ; c = pattern.c ; a.load(); c.load(); e = regrid.regrid(a,c) e.show() """ """ input: DBZ object, new_horizontal_dimension, new_vert...
cc0-1.0
-3,683,625,517,059,778,000
33.308824
99
0.551437
false
3.09009
false
false
false
markfinal/BuildAMation
codingtools/strip_trailing_whitespace.py
1
1371
#!/usr/bin/python from convert_line_endings import convert_line_endings import os import re import sys def strip_trailing_whitespace(file_path): with open(file_path, mode='rt') as infile: lines = infile.readlines() with open(file_path, mode='wt') as outfile: for line in lines: str...
bsd-3-clause
-3,944,897,385,696,669,000
31.642857
64
0.552881
false
3.665775
false
false
false
googleapis/googleapis-gen
google/api/servicecontrol/v1/google-cloud-servicecontrol-v1-py/google/cloud/servicecontrol_v1/types/distribution.py
1
8021
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
8,883,325,737,808,401,000
35.459091
118
0.588954
false
4.466036
false
false
false
Featuretools/featuretools
featuretools/tests/entityset_tests/test_es_metadata.py
1
7723
import pandas as pd import pytest import featuretools as ft from featuretools import EntitySet, Relationship, variable_types from featuretools.tests.testing_utils import backward_path, forward_path def test_cannot_re_add_relationships_that_already_exists(es): before_len = len(es.relationships) es.add_relatio...
bsd-3-clause
-6,780,506,672,667,664,000
33.927602
93
0.663946
false
3.338668
true
false
false
digitalfox/yokadi
yokadi/ycli/taskcmd.py
1
40969
# -*- coding: UTF-8 -*- """ Task related commands. @author: Aurélien Gâteau <aurelien.gateau@free.fr> @author: Sébastien Renard <sebastien.renard@digitalfox.org> @license: GPL v3 or later """ import os import readline import re from datetime import datetime, timedelta from dateutil import rrule from sqlobject import L...
gpl-3.0
6,851,783,011,159,029,000
40.171859
147
0.559122
false
4.121743
false
false
false
Alaxe/judgeSystem
judge/migrations/0051_auto_20160521_1932.py
1
1608
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-05-21 16:32 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('judge', '0050_merge'), ] operations = [ migrations.AlterModelOptions( ...
gpl-2.0
5,183,483,593,779,452,000
40.230769
463
0.600746
false
4.231579
false
false
false
shaunduncan/breezeminder
breezeminder/views/marta.py
1
3770
import json from datetime import datetime, timedelta from flask import (flash, make_response, render_template, request) from breezeminder.app import app from breezeminder.forms.marta import MartaRouteStatusForm from breezeminder.models.marta import (Route, ...
mit
3,574,729,019,332,970,500
31.222222
91
0.590716
false
3.796576
false
false
false
liyi193328/seq2seq
seq2seq/tasks/dump_attention.py
1
5396
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
562,419,923,570,596,600
36.213793
147
0.699222
false
3.92722
false
false
false
PMBio/gptwosample
gptwosample/examples/gptwosample_confounder_example.py
1
2023
''' Small Example application of GPTwoSample ======================================== Please run script "generateToyExampleFiles.py" to generate Toy Data. This Example shows how to apply GPTwoSample to toy data, generated above. Created on Feb 25, 2011 @author: Max Zwiessele, Oliver Stegle ''' from gptwosample.data...
apache-2.0
2,073,420,866,599,686,000
31.126984
90
0.633712
false
3.136434
false
false
false
opennumber/opennumber
src/err.py
1
3722
# -*- coding: utf-8 -*- """ 该模块用于表示错误. code_map = dict(code=XError class) """ import types import constants class BaseError(Exception): code = -1 message = 'base_error' def __init__(self, message=''): if message and isinstance(message, types.UnicodeType): message = message.encode...
gpl-3.0
2,755,212,175,510,790,000
21.555556
97
0.617953
false
3.76701
false
false
false
NicoVarg99/daf-recipes
ckan/ckan/ckan/ckan/plugins/toolkit_sphinx_extension.py
1
6868
# encoding: utf-8 '''A Sphinx extension to automatically document CKAN's crazy plugins toolkit, autodoc-style. Sphinx's autodoc extension can document modules or classes, but although it masquerades as a module CKAN's plugins toolkit is actually neither a module nor a class, it's an object-instance of a class, and it...
gpl-3.0
6,916,009,595,914,275,000
35.727273
79
0.657833
false
4.402564
false
false
false
Sakshisaraswat/todoman
tests/test_cli.py
1
24483
import datetime import sys from os.path import isdir from unittest import mock from unittest.mock import patch import click import hypothesis.strategies as st import pytest from dateutil.tz import tzlocal from freezegun import freeze_time from hypothesis import given from todoman.cli import cli, exceptions from todom...
isc
-2,388,368,933,553,996,000
27.769683
79
0.622881
false
3.584627
true
false
false
au9ustine/org.au9ustine.puzzles.codility
lessons/lesson02_counting_elements/MissingInteger.py
1
1952
"""MissingInteger (https://codility.com/demo/take-sample-test/missing_integer/) Analysis: - Pigeonhole Principle - Radix sort Comment: - The problem description did not provide the default case, which puzzled me at first. After referencing solutions by others, I found some of them just create the de...
mit
-5,423,153,813,235,830,000
32.084746
163
0.614242
false
3.026357
false
false
false
wesyoung/pyzyre
pyzyre/utils/color.py
1
3935
# http://stackoverflow.com/a/1336640 # http://creativecommons.org/licenses/by-sa/3.0/ import logging # now we patch Python code to add color support to logging.StreamHandler def add_coloring_to_emit_windows(fn): # add methods we need to the class def _out_handle(self): import ctypes return ct...
mpl-2.0
-8,429,500,301,556,750,000
32.067227
100
0.608132
false
3.485385
false
false
false
google/gazoo-device
gazoo_device/capabilities/switch_power_dli_powerswitch.py
1
7104
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
7,759,900,317,060,049,000
30.856502
76
0.616836
false
3.850407
false
false
false
blazek/lrs
lrs/lrs/error/lrserror.py
1
7207
# -*- coding: utf-8 -*- """ /*************************************************************************** LrsError A QGIS plugin Linear reference system builder and editor ------------------- begin : 2013-10-02 copyright ...
gpl-2.0
2,827,248,011,770,686,500
40.653179
130
0.546767
false
4.105983
false
false
false
davy39/eric
UI/FindFileDialog.py
1
26494
# -*- coding: utf-8 -*- # Copyright (c) 2002 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to search for text in files. """ from __future__ import unicode_literals import os import re from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot from PyQt5.QtGui import QCursor from PyQt...
gpl-3.0
7,800,255,193,380,840,000
36.106443
78
0.533593
false
4.624542
false
false
false
TEAM-HRA/hra_suite
HRACore/src/hra_core/collections_utils.py
1
9983
''' Created on 25-08-2012 @author: jurek ''' import re def get_other_keys(_dict, keys): keys = [key for key in _dict if key not in keys] if len(keys) == 1: return keys[0] elif len(keys) > 1: return keys def get_any_key(**_dict): """ a method to get all keys as a list or if t...
lgpl-3.0
-4,111,708,774,639,351,300
31.838816
78
0.601222
false
4.163053
false
false
false
projectshift/shift-media
shiftmedia/storage.py
1
5190
import os from pathlib import Path from shiftmedia import utils, exceptions as x from shiftmedia.paths import PathBuilder from shiftmedia.resizer import Resizer class Storage: def __init__(self, backend, secret_key, local_temp): """ Init :param backend:, shiftmedia.backend.Backend instance...
mit
-1,391,660,566,361,394,700
33.370861
76
0.581888
false
4.172026
false
false
false
tensorflow/probability
tensorflow_probability/python/experimental/composite_tensor.py
1
12217
# Copyright 2019 The TensorFlow Probability 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 o...
apache-2.0
-5,423,151,794,369,109,000
34.826979
118
0.667185
false
3.860032
false
false
false
david672orford/pykarta
pykarta/geocoder/google.py
1
5787
# pykarta/geocoder/google.py # Copyright 2013--2018, Trinity College Computing Center # Last modified: 15 May 2018 from __future__ import print_function import string import xml.etree.cElementTree as ET from .geocoder_base import GeocoderBase, GeocoderResult, GeocoderError # See http://code.google.com/apis/maps/docu...
gpl-2.0
4,632,901,562,203,207,000
31.694915
91
0.622602
false
3.207871
false
false
false
akshaykurmi/reinforcement-learning
atari_breakout/per.py
1
4539
import os import pickle import numpy as np from tqdm import tqdm class SumTree: def __init__(self, capacity): self.capacity = capacity self.tree = np.zeros(2 * capacity - 1, dtype=np.float32) self.data = np.empty(capacity, dtype=object) self.head = 0 @property def total_p...
mit
-778,120,707,693,490,200
35.02381
114
0.584931
false
3.748142
false
false
false
team-vigir/flexbe_behavior_engine
flexbe_onboard/src/flexbe_onboard/flexbe_onboard.py
1
15565
#!/usr/bin/env python import rospy import os import sys import inspect import tempfile import threading import time import zlib import contextlib from ast import literal_eval as cast from flexbe_core import Logger, BehaviorLibrary from flexbe_core.proxy import ProxyPublisher, ProxySubscriberCached from flexbe_msgs.ms...
bsd-3-clause
7,022,887,655,904,633,000
42.477654
119
0.555284
false
4.312829
false
false
false
MikeDacre/LDDirection
LD_Direction/_run.py
1
3957
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simple functions used by the rest of the module. Functions --------- output_json Return a string rendition of a dictionary run Run a system command and return stdout, stderr, exit_code run_cmnd Run a system command with run() and return result split by newl...
mit
8,642,716,844,234,234,000
28.311111
83
0.59717
false
3.890855
false
false
false
drdangersimon/EZgal
ezgal/src/sfhs.py
1
1785
import numpy as np import collections,dusts __ver__ = '1.0' class sfh_wrapper(object): """ sfh_wrapper class. EzGal wraps this class around the sfh function. It takes care of the details of passing or not passing parameters """ func = '' # sfh function args = () # extra arguments to pass on call has_args = ...
gpl-2.0
-7,483,396,873,485,222,000
25.656716
95
0.654342
false
2.965116
false
false
false
pepetreshere/odoo
odoo/addons/base/models/res_partner.py
1
46813
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import collections import datetime import hashlib import pytz import threading import re import requests from lxml import etree from random import randint from werkzeug import urls from odoo import api, f...
agpl-3.0
7,808,116,250,079,923,000
46.475659
221
0.602529
false
4.038913
false
false
false
cartoonist/pystream-protobuf
stream/varint.py
1
1366
# coding=utf-8 """ stream.varint ~~~~~~~~~~~~~ Encode and decode an integer up to 64 bit to/from 'Varint'. See Google Protobuf library documentation for more details about Varints. :copyright: (c) 2017 by Ali Ghaffaari. :license: MIT, see LICENSE for more details. """ import sys import clic...
mit
-3,871,336,480,277,629,000
23.392857
74
0.674231
false
3.652406
false
false
false
polyaxon/polyaxon
core/polyaxon/polyflow/matrix/hyperopt.py
1
7008
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
-8,689,166,251,913,191,000
27.37247
111
0.640982
false
3.912898
false
false
false
kieranjol/IFIscripts
legacy_scripts/dpxonly.py
1
11222
#!/usr/bin/env python import subprocess import sys import os import shutil import argparse import datetime import time import csv import uuid from glob import glob from ififuncs import create_csv from ififuncs import append_csv from ififuncs import send_gmail from ififuncs import hashlib_manifest from ififuncs import d...
mit
-829,233,088,578,808,400
49.32287
214
0.627517
false
3.518971
false
false
false
janusnic/django-admin-twitter
admin_twitter/admin.py
1
5122
from django.contrib import admin from django.conf import settings from .models import Tweet from .models import Author from .models import Message from twitter import * from django.shortcuts import get_object_or_404, render from django.conf.urls import patterns, url from django.http import HttpResponse, HttpResponseRed...
gpl-3.0
-2,779,515,468,671,141,400
35.585714
164
0.613823
false
4.017255
false
false
false