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
jimmy201602/webterminal
webterminal/urls.py
1
2666
"""django_gateone URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
gpl-3.0
-5,852,111,364,259,177,000
47.472727
172
0.667292
false
3.275184
false
false
false
CantemoInternal/django-knowledge
knowledge/models.py
1
11769
from knowledge import settings import django from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from knowledge.managers import QuestionManager, ResponseManager from knowledge.signals import knowledge_post_save from ckeditor.fields im...
isc
-4,791,415,197,419,086,000
29.648438
150
0.611947
false
4.062478
false
false
false
couchbase/couchbase-python-client
couchbase_core/supportability.py
1
3356
import warnings from functools import wraps from couchbase_core import operation_mode def deprecate_module_attribute(mod, deprecated=tuple()): return warn_on_attribute_access(mod, deprecated, "deprecated") class Level(object): desc = None # type: str msg_params = "msg_params" def __new__(cls, f...
apache-2.0
6,842,166,957,740,762,000
25.015504
152
0.595054
false
4.158612
false
false
false
mscross/pysplit
pysplit/hygroup.py
1
3448
from __future__ import division, print_function import os class HyGroup(object): """ Class for initializing ``HyPath`` container object. :superclass: for ``TrajectoryGroup`` and ``ClusterGroup``. """ def __init__(self, trajectories): """ Initialize ``HyGroup``. Paramet...
bsd-3-clause
4,139,247,179,591,793,000
27.495868
71
0.515661
false
4.829132
false
false
false
lancekim/GSCR
doublet.py
1
8228
# -*- coding: utf-8 -*- """ Created on Wed Jul 08 10:03:13 2015 @author: kimlanc """ import matplotlib import matplotlib.pyplot as plt import numpy # Flow as function of reactor power and deltaT def power(DT,Vdot,rho=1000,cp=4200): # Power [MWt], DT [degC or K], Vdot [m3/day], rho [kg/m3], cp [J/kgK] ...
mit
7,690,345,686,047,002,000
35.409091
93
0.634176
false
2.299609
false
false
false
agiovann/CalBlitz
DemoSegmentationLowSNR.py
1
1549
# -*- coding: utf-8 -*- """ Created on Tue Jun 30 20:56:07 2015 @author: agiovann """ #% add required packages import h5py import calblitz as cb import time import pylab as pl import numpy as np import cv2 #% set basic ipython functionalities #pl.ion() #%load_ext autoreload #%autoreload 2 #%% filename='ac_001_001.tif...
gpl-3.0
8,105,674,939,501,965,000
31.270833
149
0.739187
false
2.506472
false
false
false
KenjiTakahashi/gayeogi
setup.py
1
2130
# -*- coding: utf-8 -*- # This is a part of gayeogi @ http://github.com/KenjiTakahashi/gayeogi/ # Karol "Kenji Takahashi" Wozniak © 2010 - 2012 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ...
gpl-3.0
4,816,389,766,803,162,000
35.067797
78
0.657425
false
3.529022
false
false
false
slitvinov/lammps-sph-multiphase
src/Make.py
1
70429
#!/usr/bin/python # Make.py tool for managing packages and their auxiliary libs, # auto-editing machine Makefiles, and building LAMMPS # Sytax: Make.py -h (for help) import sys,os,commands,re,copy # switch abbrevs # switch classes = created class for each switch # lib classes = auxiliary package libs # build class...
gpl-2.0
2,604,151,837,042,854,400
33.831355
86
0.596856
false
3.40747
false
false
false
ilyatikhonov/imageporndirtyrubot
imageporndirtyrubot/google.py
1
3823
# -*- coding: utf-8 -*- import random from imageporndirtyrubot.exception import APIException, GoogleCaptchaAPIException try: import urlparse except ImportError: import urllib.parse as urlparse from bs4 import BeautifulSoup import requests USER_AGENTS = [ 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit...
isc
-108,432,324,995,369,220
38.333333
127
0.652542
false
2.92034
false
false
false
OTL/otl_diff_drive
src/otl_diff_drive/dynamixel.py
1
2626
#! /usr/bin/env python import rospy import roslib roslib.load_manifest("otl_diff_drive") from std_msgs.msg import Float64 from dynamixel_msgs.msg import JointState class Publisher: def __init__(self): left_name = rospy.get_param("~left_wheel_controller") right_name = rospy.get_param("~right_wheel...
bsd-3-clause
-5,409,719,622,398,808,000
40.68254
118
0.669459
false
3.772989
false
false
false
lujinda/gale
gale/log.py
1
2935
#!/usr/bin/env python #coding:utf-8 # Author : tuxpy # Email : q8886888@qq.com.com # Last modified : 2015-03-30 18:06:49 # Filename : log.py # Description : from __future__ import unicode_literals import logging import re access_log = logging.getLogger('access_log') gen_log = logging.getLogger('...
mit
-4,685,887,127,807,060,000
36.907895
121
0.620618
false
3.471084
false
false
false
diaohaha/passkeeper
passkeeper/core.py
1
2890
#! /usr/bin/env python # -*- coding: utf-8 -*- #author:gaoda #date:2012.7.30 #filename:passkeeper.core #descirbe:a keeper for your all kinds of password #spilt using tab from sqlalchemy import * from sqlalchemy.orm import * import string import sys import argparse from pkg_resources import resource_stream '''init th...
unlicense
-401,840,317,681,552,800
21.936508
108
0.687543
false
2.814021
false
false
false
tripzero/snetcam
snetcam/recognitionserver.py
1
6614
from wss import Server from .FaceRecognition import FaceRecognition import json import trollius as asyncio from base64 import b64decode, b64encode import numpy as np import cv2 from .recognitionprotocol import Messages, Signals, ErrorMessages class CameraBase: def __init__(self, name, maxsize=0): self.imgQueue =...
lgpl-2.1
3,357,964,108,367,705,600
24.839844
80
0.695948
false
3.161568
false
false
false
johnmgregoire/NanoCalorimetry
accal_mcattempt.py
1
2195
import numpy, h5py, pylab, copy from PnSC_h5io import * from PnSC_math import * from matplotlib.ticker import FuncFormatter def myexpformat(x, pos): for ndigs in range(5): lab=(('%.'+'%d' %ndigs+'e') %x).replace('e+0','e').replace('e+','e').replace('e0','').replace('e-0','e-') if eval(lab)==x: ...
bsd-3-clause
5,240,491,442,843,963,000
40.415094
229
0.711162
false
2.086502
false
false
false
mefyl/drake
src/drake/cmake.py
1
2676
import drake from functools import lru_cache from itertools import chain import os class CMakeBuilder(drake.Builder): def __init__(self, toolkit, srcs, dsts, vars, targets = None, path_to_cmake_source = None): ''' `srcs`: what we depend upon. `dsts`: what will be built. `vars`: dict v...
agpl-3.0
-9,146,397,234,235,553,000
30.857143
80
0.585202
false
3.307787
false
false
false
mikoim/funstuff
codecheck/codecheck-2152/app/bot.py
1
1400
#!/usr/bin/env python # -*- coding: utf-8 -*- class Bot: def __init__(self, command): self.command = command['command'] self.data = command['data'] self.hash = None def generate_hash(self): def calc(string): return modified_scientific_notation(ascii_digits(string))...
mit
3,366,161,555,170,196,500
20.875
94
0.6
false
3.655352
false
false
false
desmovalvo/virtualsib-part2
manager/lib/request_handlers.py
1
1137
#!/usr/bin/python # requirements from termcolor import * import uuid from SIBLib import SibLib from smart_m3.m3_kp import * from virtualiser import * import threading import thread #functions def NewRemoteSIB(): # debug print print colored("request_handlers> ", "blue", attrs=["bold"]) + "executing method " ...
lgpl-3.0
-5,409,106,004,655,119,000
27.425
141
0.659631
false
3.414414
false
false
false
miso-belica/sumy
sumy/_compat.py
1
2299
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from sys import version_info PY3 = version_info[0] == 3 if PY3: bytes = bytes unicode = str else: bytes = str unicode = unicode string_types = (bytes, unicode,) try: ...
apache-2.0
-6,645,591,201,484,037,000
23.98913
69
0.61157
false
4.076241
false
false
false
anoidgit/reading-comprehension
tools/select.py
1
2666
#encoding: utf-8 import sys reload(sys) sys.setdefaultencoding("utf-8") from math import sqrt def ldvec(vecf): rsd = {} unkv = False with open(vecf) as frd: for line in frd: tmp = line.strip() if tmp: tmp = tmp.decode("utf-8") ind = tmp.find(" ") key = tmp[:ind] value = tuple(float(tmpu) f...
gpl-3.0
5,682,412,338,519,073,000
19.351145
115
0.58027
false
2.230962
false
false
false
OpenSTC-Eleger/stc-patrimoine-inter
openstc.py
1
2232
# -*- coding: utf-8 -*- ############################################################################## # Copyright (C) 2012 SICLIC http://siclic.fr # # 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 Fr...
agpl-3.0
5,393,507,495,039,968,000
43.66
194
0.639337
false
3.985714
false
false
false
avenet/hackerrank
point_of_meeting.py
1
1038
import math class point: def __init__(self,x,y): self.x=x self.y=y points=[] num=int(raw_input()); for i in range(num): inp=raw_input().split(); x=long(inp[0]) y=long(inp[1]) points.append(point(x,y)) ave_x=0.0 ave_y=0.0 for i in range(num): ave_x += points[i].x; ave_y += point...
mit
-1,110,573,026,008,876,500
17.872727
105
0.560694
false
2.256522
false
false
false
rsepassi/tensor2tensor
tensor2tensor/data_generators/translate_enzh.py
1
10261
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
apache-2.0
-4,543,720,965,601,749,500
38.617761
79
0.681318
false
2.888795
false
false
false
frbayart/ncf
tools/ncf.py
1
7292
# This is a Python module containing functions to parse and analyze ncf components # This module is designed to run on the latest major versions of the most popular # server OSes (Debian, Red Hat/CentOS, Ubuntu, SLES, ...) # At the time of writing (November 2013) these are Debian 7, Red Hat/CentOS 6, # Ubuntu 12.04 LT...
gpl-3.0
972,569,121,333,639,700
35.09901
138
0.660038
false
3.593889
false
false
false
mailgun/flanker
flanker/addresslib/validate.py
1
7696
# coding:utf-8 """ Validation module that that supports alternate spelling suggestions for domains, MX record lookup and query, as well as custom local-part grammar for large ESPs. This module should probably not be used directly, use flanker.addresslib.address unles you are building ontop of the library. Public Fun...
apache-2.0
8,155,830,390,195,630,000
29.784
105
0.663591
false
3.656057
false
false
false
felinx/poweredsites
poweredsites/handlers/site.py
1
9713
# -*- coding: utf-8 -*- # # Copyright(c) 2010 poweredsites.org # # 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
-5,369,322,382,837,980,000
36.697211
119
0.570884
false
3.98237
false
false
false
nathancahill/hy
hy/compiler.py
1
63430
# -*- encoding: utf-8 -*- # # Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org> # Copyright (c) 2013 Julien Danjou <julien@danjou.info> # Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and as...
mit
-8,982,251,060,111,767,000
33.111888
79
0.505409
false
4.325648
false
false
false
clchiou/garage
py/g1/http/clients/g1/http/clients/parts/clusters.py
1
2195
from g1.apps import parameters from g1.apps import utils from .. import clusters from . import bases SESSION_LABEL_NAMES = ( # Input. 'stubs', 'executor', # Output. 'session', # Private. 'session_params', ) STUB_LABEL_NAMES = ( # Output. 'stub', # Private. 'stub_params', )...
mit
-6,111,907,195,323,289,000
23.388889
75
0.618223
false
3.664441
false
false
false
noironetworks/group-based-policy
gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/cache.py
1
5681
# Copyright (c) 2016 Cisco Systems 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 re...
apache-2.0
-7,228,520,622,868,118,000
39.29078
78
0.638444
false
4.158858
false
false
false
kyleabeauchamp/HMCNotes
code/optimize/test_optimize_hyper_xhmc_respa.py
1
2602
from hyperopt import fmin, tpe, hp import lb_loader import pandas as pd import simtk.openmm.app as app import numpy as np import simtk.openmm as mm from simtk import unit as u from openmmtools import hmc_integrators, testsystems pd.set_option('display.width', 1000) n_steps = 300 platform_name = "CUDA" precision = "mix...
gpl-2.0
-6,296,180,440,515,658,000
46.309091
190
0.750576
false
3.032634
false
false
false
EmadMokhtar/Django
django/db/backends/postgresql/schema.py
6
7111
import psycopg2 from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.backends.ddl_references import IndexColumns class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s" sql_create_sequence...
mit
6,488,772,676,977,953,000
46.724832
112
0.537477
false
4.245373
false
false
false
google-code/biocode
fastq/fastq_simple_stats.py
1
1845
#!/usr/bin/env python3.2 import argparse import gzip import os ## CONTACT: jorvis@gmail.com def main(): parser = argparse.ArgumentParser( description='Provides simple quantitative statistics for a given FASTQ file') ## output file to be written parser.add_argument('input_files', metavar='N', type=str, n...
gpl-3.0
-3,257,235,456,658,029,000
27.384615
134
0.568022
false
3.925532
false
false
false
chop-dbhi/django-redcap
djredcap/management/subcommands/fixture.py
1
1804
import sys import os import csv import json import re import math import djfixture from optparse import make_option from djredcap import _csv from django.core.management.base import BaseCommand, CommandError __project_name__ = '' class Command(BaseCommand): requires_model_validation = False db_...
bsd-3-clause
-6,043,622,218,448,486,000
35.583333
105
0.599778
false
4.026786
false
false
false
ZwickyTransientFacility/ztf_sim
ztf_sim/Fields.py
1
9443
"""Routines for working with the ZTF discrete field grid""" import numpy as np import pandas as pd import astropy.coordinates as coord import astropy.units as u from astropy.time import Time from collections import defaultdict import itertools from .utils import * from .SkyBrightness import SkyBrightness from .constan...
bsd-3-clause
5,601,274,658,674,980,000
37.230769
127
0.567404
false
3.61109
false
false
false
DeppSRL/open_bilanci
bilanci_project/bilanci/management/commands/update_bilancio_tree.py
1
4068
# coding=utf-8 __author__ = 'stefano' import logging from optparse import make_option import csv from bilanci import utils from django.conf import settings from django.core.management import BaseCommand from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from bilanci.models import Voce clas...
mit
7,063,683,970,411,185,000
34.382609
156
0.544002
false
4.412148
false
false
false
andredalton/bcc
2015/MAC0327/Desafios 1/p25.py
1
1640
# coding=utf-8 __author__ = 'andre' """ /******************************************************************************* * Aluno: André Meneghelli Vale, Núm. USP: 4898948 * Curso: Bacharelado em Ciências da Computação * Desafio 25 - Brave Balloonists * MAC0327 -- 12/08/2015 -- IME/USP, -- Prof. Cristina Gom...
apache-2.0
-1,365,748,393,821,307,100
22.357143
80
0.44893
false
3.531317
false
false
false
mtholder/pyraphyletic
ws-tests/test_study_get.py
1
5577
#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config, get_response_from_http from peyotl import convert_nexson_format DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + '/v4/study/list' #sys.stderr.write('Calling "{}"...\study_obj'.format(SUBMIT_URI)) r = test_http_json_...
bsd-2-clause
-406,477,139,857,949,200
38.553191
104
0.508159
false
3.327566
true
false
false
pulseenergy/vacation
vacation/lexer.py
1
2549
import calendar # Input commands: SHOW = 'show' # show current days remaining (optional) LOG = 'log' # print taken days off ECHO = 'echo' # print entire .vacationrc file TAKE = 'take' # take a day off ('take' is optional) CANCEL = 'cancel' # cancel a day off SET = 'set' # Set one of either rate or days RATE = 'r...
gpl-2.0
2,321,953,801,650,692,000
26.117021
78
0.603374
false
3.525588
false
false
false
petrjasek/superdesk-server
superdesk/io/aap.py
1
3866
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os i...
agpl-3.0
-3,349,998,679,714,283,000
38.050505
104
0.615365
false
4.271823
false
false
false
seewindcn/tortoisehg
src/ext/hggit/hg2git.py
1
16278
# This file contains code dealing specifically with converting Mercurial # repositories to Git repositories. Code in this file is meant to be a generic # library and should be usable outside the context of hg-git or an hg command. import os import stat import dulwich.objects as dulobjs from mercurial import ( uti...
gpl-2.0
4,837,096,907,407,240,000
36.506912
89
0.596449
false
4.264606
false
false
false
njelmer/limbcorr
limbcorr_v2.0/nje_limbcorr_v2.0.py
1
19501
#!/usr/local/bin/python ''' nje_limbcorr_v2 Author: Nicholas J. Elmer Department of Atmospheric Science, University of Alabama in Huntsville (UAH) NASA Short-term Prediction Research and Transition (SPoRT) Center Huntsville, Alabama, USA nicholas.j.elmer@nasa.gov Version: 2.0 (Last updated June 2016) Note: The...
mit
3,942,374,576,484,514,000
38.237425
99
0.598072
false
2.945325
false
false
false
jseabold/statsmodels
statsmodels/tsa/statespace/tools.py
4
66017
""" Statespace Tools Author: Chad Fulton License: Simplified-BSD """ import numpy as np from scipy.linalg import solve_sylvester import pandas as pd from statsmodels.compat.pandas import Appender from statsmodels.tools.data import _is_using_pandas from scipy.linalg.blas import find_best_blas_type from . import (_init...
bsd-3-clause
-659,106,396,831,719,200
34.05948
79
0.606011
false
3.7765
false
false
false
spacecowboy/changelog-writer
tests/test_git.py
1
1148
# -*- coding: utf-8 -*- from __future__ import print_function, division import pytest from changelog.git import Git from changelog.changelog import read_config, DEFAULT_CONFIG @pytest.fixture def config(): return read_config(DEFAULT_CONFIG) @pytest.fixture def git(): return Git() class TestGit(): de...
mit
-6,554,491,136,672,784,000
23.425532
76
0.625436
false
3.5875
true
false
false
evhub/python
src/common.py
1
33936
## INFO ######################################################################## ## ## ## Python and Cython Syntax Highlighters ## ## ===================================== ...
gpl-3.0
1,551,999,117,143,473,000
34.385819
95
0.308354
false
4.698186
false
false
false
ajenhl/django-tmapi
tmapi/models/topic_map_system_factory.py
1
6239
# Copyright 2011 Jamie Norrish (jamie@artefact.org.nz) # # 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...
apache-2.0
8,339,676,079,557,315,000
34.651429
74
0.656676
false
4.521014
false
false
false
jking6884/RESTapi
app/comments/views.py
1
4756
from flask import Blueprint, request, jsonify, make_response from app.comments.models import Comments, CommentsSchema from flask_restful import Api from app.baseviews import Resource from app.basemodels import db from sqlalchemy.exc import SQLAlchemyError from marshmallow import ValidationError comments = Blue...
mit
-2,096,622,421,608,967,000
39.719298
230
0.641085
false
4.432432
false
false
false
scrapinghub/deimos
deimos/containerizer/docker.py
1
13939
import errno from fcntl import LOCK_EX, LOCK_NB, LOCK_SH, LOCK_UN import logging import os import random import re import signal import subprocess import sys import threading import time try: # Prefer system installation of Mesos protos if available from mesos_pb2 import * from containerizer_p...
apache-2.0
6,674,247,346,102,581,000
41.367781
79
0.533037
false
4.103326
false
false
false
point97/hapifis
server/apps/survey/migrations/0078_auto__add_field_respondant_review_comment.py
1
16788
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Respondant.review_comment' db.add_column(u'survey_respondant', 'review_comment', ...
gpl-3.0
9,035,944,075,450,458,000
84.658163
207
0.547117
false
3.565845
false
false
false
Feneric/doxypypy
doxypypy/test/sample_interfaces.outbare.py
1
3345
# -*- coding: utf-8 -*- ## #Typical interfaces definition. # #Here we're just trying to make some typical interface definitions #to better test the doxypypy filter. # from zope.interface import Interface, Attribute # Public API Interfaces ## # The zeroth sample interface. # # Nothing special, just a sample in...
gpl-2.0
8,017,003,618,175,264,000
21.152318
74
0.692078
false
3.858131
true
false
false
Zoldn/matrixPreprocessing
processing/lobby/views.py
1
1139
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from django.shortcuts import HttpResponse from django.views.generic import DetailView, ListView from .models import Lobby # Create your views here. class LobbyShortView(DetailView): # One-line view of Lobby for list ...
gpl-3.0
-4,424,404,703,181,048,000
23.76087
76
0.685689
false
3.462006
false
false
false
jonasjberg/autonameow
autonameow/core/model/meowuri.py
1
15617
# -*- coding: utf-8 -*- # Copyright(c) 2016-2020 Jonas Sjöberg <autonameow@jonasjberg.com> # Source repository: https://github.com/jonasjberg/autonameow # # This file is part of autonameow. # # autonameow is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
gpl-2.0
1,694,258,840,672,679,000
30.739837
87
0.598745
false
3.841574
false
false
false
mlperf/training_results_v0.7
Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v4-512/lingvo/core/insertion.py
1
12951
# Lint as: python2, python3 # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
apache-2.0
7,070,988,415,086,680,000
37.891892
80
0.621651
false
3.245865
false
false
false
sevazhidkov/leonard
workers/uber.py
1
1042
import time import requests import telegram from libs.utils import build_bot from modules.uber import CURRENT_ORDER_URL, UPDATE_CARD bot = build_bot() while True: for u_id in bot.redis.sscan_iter('uber:requested_users'): u_id = int(u_id) token = bot.user_get(u_id, 'uber:access_token') res...
mit
-1,647,330,628,159,989,000
36.214286
78
0.595969
false
3.568493
false
false
false
memo/tensorflow
tensorflow/python/kernel_tests/fft_ops_test.py
1
14911
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,836,693,098,146,858,000
36.464824
80
0.595131
false
3.204599
true
false
false
jeid64/dcos
test_util/test_upgrade_vpc.py
1
28070
#!/usr/bin/env python3 """Integration test for onprem DC/OS upgraded from latest stable. The following environment variables control test procedure: MASTERS: integer (default=3) The number of masters to create from a newly created VPC. AGENTS: integer (default=2) The number of agents to create from a newly c...
apache-2.0
4,548,605,051,869,706,000
42.928013
118
0.584895
false
3.815414
true
false
false
gitcoinco/web
app/grants/migrations/0021_clrmatch.py
1
1084
# Generated by Django 2.1.7 on 2019-06-04 15:47 from django.db import migrations, models import django.db.models.deletion import economy.models class Migration(migrations.Migration): dependencies = [ ('grants', '0020_grant_description_rich'), ] operations = [ migrations.CreateModel( ...
agpl-3.0
589,423,797,629,105,700
36.37931
172
0.597786
false
4.137405
false
false
false
Vauxoo/stoqdrivers
stoqdrivers/printers/daruma/FS345.py
1
27524
# -*- Mode: Python; coding: iso-8859-1 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Stoqdrivers ## Copyright (C) 2005-2007 Async Open Source <http://www.async.com.br> ## 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 pub...
lgpl-2.1
1,362,924,216,586,454,000
34.423423
89
0.569794
false
3.671335
true
false
false
blackpan2/HealthNet
src/healthnet/viewLog/views.py
1
10387
from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.core.urlresolvers import reverse import os from base.views import group_required from base.models import Person, Logger, Root, Admin, Appointment, Doctor, ExtendedStay from django.contrib.auth.models impo...
mit
-2,476,711,112,846,024,700
40.883065
118
0.56176
false
4.010425
false
false
false
soarpenguin/python-scripts
switch.py
1
1337
# This class provides the functionality we want. You only need to look at # this if you want to know how this works. It only needs to be defined # once, no need to muck around with its internals. class switch(object): def __init__(self, value): self.value = value self.fall = False def __iter__(...
gpl-3.0
1,560,217,922,269,012,200
34.184211
89
0.540015
false
4.383607
false
false
false
bikestra/bdapy
basic_mcmc.py
1
8609
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <markdowncell> # # Basic Markov-Chain Monte-Carlo (MCMC) Sampling # # # ## Gibbs Sampling from Bivariate Normal Distribution (BDA 11.1) ## # # Here, we sample from a bivariate normal distribution using Gibbs sampling, although it is not simple to draw from actual...
apache-2.0
-8,355,381,544,021,743,000
35.324895
268
0.6197
false
2.932221
false
false
false
ntt-sic/heat
heat/tests/test_engine_service.py
1
100880
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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,803,689,735,689,841,000
37.666156
79
0.575089
false
4.092993
true
false
false
ArchiveTeam/panoramio-discovery
pipeline.py
1
7032
# encoding=utf8 import datetime from distutils.version import StrictVersion import hashlib import os.path import shutil import socket import sys import time import random import seesaw from seesaw.config import NumberConfigValue from seesaw.externalprocess import ExternalProcess from seesaw.item import ItemInterpolati...
unlicense
-791,547,294,092,814,700
32.327014
137
0.581911
false
3.714739
false
false
false
eirmag/weboob
modules/pap/browser.py
1
2518
# -*- coding: utf-8 -*- # Copyright(C) 2012 Romain Bignon # # This file is part of weboob. # # weboob 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 opti...
agpl-3.0
8,616,880,477,748,284,000
32.131579
101
0.609214
false
3.51676
false
false
false
atiberghien/makerscience-server
makerscience_profile/migrations/0013_auto__add_field_makerscienceprofile_authorized_contact.py
1
8971
# -*- 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 field 'MakerScienceProfile.authorized_contact' db.add_column(u'm...
agpl-3.0
8,517,946,632,187,873,000
74.394958
195
0.560027
false
3.582668
false
false
false
skibblenybbles/django-commando
commando/contrib/south/management/schemamigration.py
1
1362
from commando import management BaseSchemaMigrationCommand = management.get_command_class( "schemamigration", exclude_packages=("commando",)) if BaseSchemaMigrationCommand is not None: base = BaseSchemaMigrationCommand() class SchemaMigrationCommandOptions(management.CommandOptions): ""...
mit
-1,907,141,622,337,979,600
30.674419
92
0.629956
false
5.362205
false
false
false
JonnoFTW/htm-models-adelaide
engine/markov_model/toy.py
1
1117
from collections import defaultdict, Counter import numpy as np class MarkovModel: def __init__(self, order=3): self.order = order self.states = defaultdict(Counter) def gen(self, history): """ Based on a history, generate a prediction for next step :param history: ...
agpl-3.0
8,003,987,404,341,961,000
28.421053
79
0.547001
false
3.479751
false
false
false
gvlproject/gvldash
gvldash/util/package_helpers.py
1
1189
import os import subprocess import yaml import util from django.conf import settings from bioblend.cloudman import CloudManInstance def load_instance_metadata(): try: with open("/opt/cloudman/boot/userData.yaml", "r") as stream: ud = yaml.load(stream) return ud except: ...
bsd-3-clause
446,190,091,729,017,860
24.297872
99
0.70143
false
3.625
false
false
false
Ghini/ghini.desktop
bauble/plugins/garden/plant.py
1
53926
# -*- coding: utf-8 -*- # # Copyright 2008-2010 Brett Adams # Copyright 2015-2017 Mario Frasca <mario@anche.no>. # Copyright 2017 Jardín Botánico de Quito # # This file is part of ghini.desktop. # # ghini.desktop is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
gpl-2.0
7,588,283,427,497,083,000
37.028209
95
0.572472
false
3.979044
false
false
false
hfeeki/transifex
transifex/actionlog/models.py
1
9490
import datetime from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import s...
gpl-2.0
-5,529,228,898,035,963,000
35.5
81
0.621918
false
3.967391
false
false
false
SyntaxVoid/PyFusionGUI
pyfusion/conf/__init__.py
1
3610
"""Tools for processing configuration files.""" from ConfigParser import ConfigParser from pyfusion.conf.exceptions import DisallowedSectionType, \ ConfigSectionSyntaxError, UnknownVariableTypeError # This list contains allowed section types, i.e. [SectionType:Name] in # config files. Be sure to update the docu...
gpl-3.0
398,141,015,078,645,100
40.494253
82
0.603324
false
4.616368
true
false
false
googleapis/python-automl
samples/snippets/list_model_evaluations.py
1
3777
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
7,974,586,437,434,526,000
43.964286
88
0.680434
false
3.975789
false
false
false
Jbonnett/Mutagen-flo
mutagen/__init__.py
1
6961
#! /usr/bin/env python # # mutagen aims to be an all purpose media tagging library # Copyright (C) 2005 Michael Urman # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # $Id: __i...
gpl-2.0
-3,638,143,229,818,058,000
31.078341
77
0.616865
false
4.178271
false
false
false
patcurry/WebGIS
test/unit_tests/datasets/test_views.py
1
21045
from django.contrib.auth import get_user_model from django.urls import reverse from django.http import HttpRequest from django.test import Client from django.test import TestCase from accounts.models import Account from datasets.forms import DatasetCreateForm from datasets.forms import DatasetUpdateForm from dataset...
mit
-785,827,811,339,200,100
39.208413
135
0.602406
false
3.843721
true
false
false
stemchan/smartclip
main/migrations/0001_initial.py
1
6495
# -*- coding: utf-8 -*- import 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 'UserProfile' db.create_table('main_userprofile', ( ('id', self.gf('django.db.mod...
gpl-3.0
2,803,881,762,981,547,500
61.461538
182
0.555966
false
3.698747
false
false
false
phucdev/weatherbot
main.py
1
4313
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Weather Bot to reply to Telegram messages """ Author: Phuc Tran Truong, Marcus Ding Date: 19.07.2016 Large parts of the code are taken from the Conversationbot example (see 'python-telegram-bot' module). https://github.com/python-telegram-bot/python-telegram-bot/blob/m...
apache-2.0
3,199,279,989,549,129,700
29.678571
102
0.675902
false
3.406027
false
false
false
bchappet/dnfpy
src/dnfpy/cellular/bsRsdnfMap.py
1
5287
from dnfpy.core.map2D import Map2D import random import sys import numpy as np from dnfpy.cellular.hardlib import HardLib class BsRsdnfMap(Map2D): """ Map to handle the CellBsRsdnf in hardlib. This map use a standard XY routing scheme with 4 router by cell A spike is interpreted as a ...
gpl-2.0
4,626,366,915,624,943,000
39.984496
96
0.560242
false
4.095275
false
false
false
koreyou/word_embedding_loader
test/word_embedding_loader/saver/test_saver.py
1
1359
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, \ unicode_literals import numpy as np import pytest from numpy.testing import assert_array_equal from word_embedding_loader import word_embedding import word_embedding_loader.saver as saver @pytest.fixture def word_embeddi...
mit
6,914,148,891,601,307,000
28.413043
67
0.625277
false
3.061086
false
false
false
honeynet/beeswarm
beeswarm/server/tests/test_webapp.py
1
18568
import json import os import uuid import unittest import tempfile import shutil from datetime import datetime import zmq.green as zmq import beeswarm from beeswarm.server.misc.config_actor import ConfigActor import beeswarm.server.db.database_setup as database from beeswarm.server.db.entities import Client, Honeypot, ...
gpl-3.0
-5,494,235,331,547,918,000
36.97137
120
0.521919
false
3.392035
true
false
false
pmitros/x-analytics-scripts
xanalytics/gzipfs/xattrs.py
1
1709
""" xanalytics.gzipfs.xattrs ============== Extended-attribute support for GZIPFS """ import os import sys import errno from fs.errors import * from fs.path import * from fs.base import FS try: import xattr except ImportError: xattr = None if xattr is not None: class GZIPFSXAttrMixin(object): ...
agpl-3.0
1,479,499,540,233,441,300
22.410959
79
0.590404
false
3.983683
false
false
false
asottile/pushmanager
pushmanager/tests/test_servlet_delayrequest.py
1
2885
from contextlib import nested import mock import testify as T from pushmanager.core import db from pushmanager.core.util import get_servlet_urlspec from pushmanager.servlets.delayrequest import DelayRequestServlet from pushmanager.testing.mocksettings import MockedSettings from pushmanager.testing.testservlet import S...
apache-2.0
8,238,616,015,610,162,000
33.345238
110
0.611438
false
3.505468
true
false
false
ojdo/python-tools
shapelytools.py
1
12298
from shapely.geometry import (box, LineString, MultiLineString, MultiPoint, Point, Polygon) import shapely.ops def endpoints_from_lines(lines): """Return list of terminal points from list of LineStrings.""" all_points = [] for line in lines: for i in [0, -1]: # start and end point ...
gpl-3.0
5,492,615,102,577,660,000
33.448179
83
0.6114
false
4.295494
false
false
false
zooniverse/aggregation
blog/jungle.py
1
3581
__author__ = 'ggdhines' import matplotlib matplotlib.use('WXAgg') import aggregation_api import cv2 import numpy as np import matplotlib.pyplot as plt from aggregation_api import AggregationAPI from sklearn.cluster import KMeans import matplotlib.cbook as cbook jungle = AggregationAPI(153,"development") # jungle.__mig...
apache-2.0
4,483,105,745,553,524,000
24.956522
101
0.586428
false
3.127511
false
false
false
jacekmitrega/pyoxy
pyoxy/objectproxy.py
1
7199
# -*- coding: utf-8 -*- # Copyright 2013 Jacek Mitręga # 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
3,551,071,752,520,819,700
28.621399
74
0.563629
false
3.626196
false
false
false
jose1711/osm-mapper-tools
avnotes/avnotes.py
1
3006
#!/usr/bin/python2 import math import sys import os import re import datetime import argparse # ARRAY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_~' ARRAY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@' def string2geo(s): """ converts string into (lat,lon) tuple ...
unlicense
-6,522,971,504,023,036,000
25.13913
102
0.566534
false
3.012024
false
false
false
chemelnucfin/tensorflow
tensorflow/python/ops/dequantize_op_test.py
1
4594
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
6,358,385,431,581,038,000
39.654867
80
0.63017
false
3.324168
true
false
false
buret/pylmflib
pylmflib/mrd/subject_field.py
1
4012
#! /usr/bin/env python """! @package mrd """ from utils.attr import check_attr_type class SubjectField(): """! "Subject Field is a class representing a text string that provides domain or status information." (LMF) """ def __init__(self): """! @brief Constructor. SubjectField instances ar...
gpl-2.0
-1,920,717,527,748,159,200
38.722772
116
0.642323
false
4.497758
false
false
false
mschuurman/FMSpy
nomad/integrals/fms.py
1
2060
""" Compute Bra-ket averaged Taylor expansion integrals over trajectories traveling on adiabataic potentials """ import numpy as np import nomad.compiled.nuclear_gaussian as nuclear # Determines the Hamiltonian symmetry hermitian = True # Returns functional form of bra function ('dirac_delta', 'gaussian') basis = 'g...
lgpl-3.0
4,839,689,482,833,389,000
31.1875
86
0.587864
false
2.795115
false
false
false
p2pu/mechanical-mooc
mailgun/models.py
1
1439
import api import db from utils import parse_timestamp from django.db import transaction from collections import OrderedDict import hashlib import json @transaction.commit_manually def download_logs(): """ Download mailgun logs and store them in the database """ # use ordered dict to protect against new logs...
mit
5,371,143,881,659,041,000
30.977778
89
0.603892
false
4.008357
false
false
false
sourceperl/pyHMI
examples/hmi_mbus_4_bits.py
1
5809
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from pyHMI.Colors import * from pyHMI.DS_ModbusTCP import ModbusTCPDevice from pyHMI.Tag import Tag import time import tkinter as tk from tkinter import ttk class Devices(object): # init datasource # PLC TBox plc = ModbusTCPDevice('localhost', port=502, time...
mit
-3,998,327,581,518,065,700
39.340278
100
0.598898
false
3.027097
false
false
false
kevgliss/historical
historical/common/kinesis.py
1
1647
import sys import json import uuid import base64 import boto3 from historical.constants import CURRENT_REGION def chunks(l, n): """Yield successive n-sized chunks from l.""" for i in range(0, len(l), n): yield l[i:i + n] def determine_chunk_size(events): """Determines the number of event """ ...
apache-2.0
-512,593,945,136,840,060
22.197183
77
0.606557
false
4.007299
false
false
false
adrian2monk/snapshare
snapshare_api/migrations/0001_initial.py
1
5583
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-11-03 15:18 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
mit
4,410,166,808,397,150,000
39.456522
140
0.559556
false
4.41693
false
false
false
ajylee/gpaw-rtxs
gpaw/lrtddft/__init__.py
1
15015
"""This module defines a linear response TDDFT-class. """ from math import sqrt import sys import numpy as np from ase.units import Hartree import _gpaw import gpaw.mpi as mpi MASTER = mpi.MASTER from gpaw import debug from gpaw.poisson import PoissonSolver from gpaw.output import initialize_text_stream from gpaw.lr...
gpl-3.0
2,475,877,542,932,553,000
31.083333
79
0.498302
false
3.811881
false
false
false
ketanmukadam/scripts
bugz.py
1
4051
#!/usr/bin/python3 """ Usage: bugz.py [options] Options: -h, --help show this help message and exit -u BZ_URL, --url=BZ_URL Bugzilla URL -q Q_URL, --query=Q_URL Bugzilla Query URL -b BUGID, --bugid=BUGID Bug Id -v, --verbose ...
gpl-3.0
-2,484,955,142,072,598,500
28.143885
97
0.578869
false
3.296176
false
false
false
andres-aguayo/ASE_CodersWhoParty_Fall2017
manage.py
1
1818
# manage.py import os import unittest import coverage from flask_script import Manager from flask_migrate import Migrate, MigrateCommand COV = coverage.coverage( branch=True, include='project/*', omit=[ 'project/tests/*', 'project/server/config.py', 'project/server/*/__init__.py'...
mit
-3,234,566,621,916,702,000
19.659091
79
0.639714
false
3.636
true
false
false
akretion/odoo
addons/account/models/account_move.py
3
106955
# -*- coding: utf-8 -*- from copy import deepcopy import logging import time from datetime import date from collections import OrderedDict, defaultdict from odoo import api, fields, models, _ from odoo.osv import expression from odoo.exceptions import RedirectWarning, UserError, ValidationError from odoo.tools.misc im...
agpl-3.0
2,046,271,482,902,392,300
56.042667
296
0.600804
false
4.052247
false
false
false
nofdev/fastforward
setup.py
1
1860
import sys, os try: from setuptools import setup, find_packages except ImportError: print("fastforward now needs setuptools in order to build. Install it using" " your package manager (usually python-setuptools) or via pip (pip" " install setuptools).") sys.exit(1) from fastforward imp...
mit
-8,756,743,274,695,204,000
32.818182
80
0.600538
false
3.974359
false
false
false
pinterb/st2incubator
packs/vsphere/actions/vm_check_tools.py
1
1115
import eventlet from pyVmomi import vim from vmwarelib import inventory from vmwarelib.actions import BaseAction class VMCheckTools(BaseAction): def run(self, vm_id): # convert ids to stubs vm = inventory.get_virtualmachine(self.si_content, moid=vm_id) # To correctly understand tools s...
apache-2.0
-743,871,457,914,876,900
32.787879
76
0.681614
false
4.17603
false
false
false
wackrat/structer
structer/build_ids.py
1
1198
""" Fetch Build IDs from ELF core In --list mode, print two names for each file, one from the file note, and the other from the link map. The first file (the executable) is not in the link map. The names can differ because of symbolic links. """ from argparse import ArgumentParser from . import memmap from .elf impor...
mit
-5,940,300,679,278,646,000
36.4375
89
0.617696
false
3.533923
false
false
false
nttks/edx-platform
common/djangoapps/terrain/ui_helpers.py
1
21750
# pylint: disable=missing-docstring from lettuce import world import time import json import re import platform # django_url is assigned late in the process of loading lettuce, # so we import this as a module, and then read django_url from # it to get the correct value import lettuce.django from textwrap import de...
agpl-3.0
8,398,551,535,950,254,000
31.127031
130
0.656552
false
3.78656
false
false
false
asottile/pyterminalsize
setup.py
1
1221
import os import re import sys from setuptools import Extension from setuptools import setup if sys.platform == 'win32': versions = [ var for var in os.environ if var.startswith('VS') and var.endswith('COMNTOOLS') ] vs = sorted(versions, key=lambda s: int(re.search(r'\d+', s).group()))[-1]...
mit
876,470,174,475,902,300
32.916667
78
0.634726
false
3.780186
false
false
false
sugarguo/Flask_Blog
app/main/views.py
1
4451
#! usr/bin/python # -_- coding:utf-8 -_- ''' @author sugarguo @email sugarguo@live.com @date 2016年04月15日 @version v1.0.0 @copyright Sugarguo File main/views.py ''' import os import json import time from datetime import datetime, date from flask import...
gpl-3.0
-7,772,498,829,458,122,000
28.633333
133
0.573228
false
3.550319
false
false
false