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
Onirik79/aaritmud
data/proto_rooms/villaggio-zingaro/villaggio-zingaro_room_locanda.py
1
1355
# -*- coding: utf-8 -*- #= DESCRIZIONE ================================================================= """ Inietta una bimba in locanda. """ #= IMPORT ====================================================================== import random from src.database import database from src.defer import defer_random_time...
gpl-2.0
7,353,757,211,943,525,000
25.54902
80
0.517725
false
3.359801
false
false
false
Donkyhotay/MoonPy
zope/security/tests/test_checker.py
1
24043
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
gpl-3.0
150,918,352,054,562,050
37.224165
80
0.614441
false
4.249381
true
false
false
c4mb0t/django-setman
testproject/core/migrations/0001_initial.py
2
4372
# encoding: 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('core_userprofile', ( ('id', self.gf('django.db.m...
bsd-3-clause
-3,425,025,220,831,337,500
60.577465
182
0.558554
false
3.785281
false
false
false
MichaelVL/osm-analytic-tracker
HumanTime.py
1
2895
import datetime, pytz import re import tzlocal def date2human(when, slack_secs=180): """ Convert timestamp to human-friendly times, like '3 minutes ago' """ if not when: return None now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc) diff = now-when secs = diff.seconds days = diff...
gpl-2.0
-3,093,306,471,708,067,300
30.813187
90
0.562003
false
3.632371
false
false
false
DataViva/dataviva-site
dataviva/apps/build_graph/views.py
1
3965
# -*- coding: utf-8 -*- import re from flask import Blueprint, render_template, g, jsonify, request from dataviva.apps.general.views import get_locale from dataviva.apps.embed.models import Build, App from dataviva.api.rais.services import Industry as CnaeService from dataviva.api.secex.services import Product as Secex...
mit
-1,822,615,599,357,939,200
26.727273
101
0.588398
false
3.568857
false
false
false
polyaxon/polyaxon-api
polyaxon_lib/polyaxonfile/local_runner.py
1
4049
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import atexit import json import os import signal import subprocess import sys import time from six.moves import xrange from multiprocessing import Process from tensorflow.python.platform import tf_logging as logging from po...
mit
5,097,832,108,795,529,000
25.81457
93
0.61472
false
3.523934
false
false
false
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/vm/_completers.py
9
1524
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
3,530,653,606,838,533,000
42.542857
98
0.652231
false
4.021108
false
false
false
isaac-s/cloudify-manager
rest-service/manager_rest/flask_utils.py
1
3338
######### # Copyright (c) 2013 GigaSpaces Technologies 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 # # Unless...
apache-2.0
-3,778,302,000,744,430,000
34.892473
77
0.685141
false
3.776018
true
false
false
SetBased/py-etlt
test/helper/AllenTest.py
1
2762
import unittest from etlt.helper.Allen import Allen class AllenTest(unittest.TestCase): """ Test cases for class Allen algebra. """ # ------------------------------------------------------------------------------------------------------------------ def _test1(self, expected, x, y): relat...
mit
-4,219,810,705,451,695,000
40.848485
120
0.34323
false
4.061765
true
false
false
USGSDenverPychron/pychron
pychron/rpc/rpcable.py
1
1606
# =============================================================================== # Copyright 2012 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/licens...
apache-2.0
-2,558,149,608,230,918,000
42.405405
81
0.537983
false
4.695906
true
false
false
vdenPython/wwwgaseng
wwwgaseng/settings.py
1
3071
""" Django settings for wwwgaseng project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pa...
apache-2.0
666,975,278,690,597,100
25.646018
78
0.679734
false
3.21238
false
false
false
modicum/wyoming
source/conf.py
1
11524
# -*- coding: utf-8 -*- # # wyoming documentation build configuration file, created by # sphinx-quickstart on Mon Jan 25 11:12:20 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
mit
3,484,720,184,999,613,400
30.486339
79
0.705658
false
3.644529
true
false
false
Lothilius/python-jumble
Permutations.py
1
2071
# Files: Permutations.py # # Description: Creats permutations of an entered word. # __author__ = 'lothilius' import math class Permutations(): """This module contains functions to generate all unique permutations of a string, and to count permutations. """ def countOccurrences(word): # c...
mit
-8,432,174,870,537,733,000
31.359375
73
0.568807
false
4.305613
false
false
false
hexlism/xx_net
gae_proxy/local/gae_handler.py
1
28513
#!/usr/bin/env python # coding:utf-8 import errno import time import struct import zlib import functools import re import io import string import socket import ssl import httplib import Queue import urlparse import threading from proxy import xlog from connect_manager import https_manager from appids_manager import ...
bsd-2-clause
-704,005,076,090,287,700
39.930935
135
0.530495
false
3.947682
false
false
false
jschultz/Gooey
gooey/python_bindings/config_generator.py
1
2477
import os import sys from gooey.gui.windows import layouts from gooey.python_bindings import argparse_to_json from gooey.gui.util.quoting import quote def create_from_parser(parser, source_path, cmd_args, **kwargs): auto_start = kwargs.get('auto_start', False) if hasattr(sys, 'frozen'): run_cmd = ...
mit
-7,430,879,707,997,304,000
44.735849
169
0.612434
false
3.574315
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering_py3.py
1
4752
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-2,799,743,572,390,819,000
54.255814
339
0.681187
false
4.020305
false
false
false
NelleV/pyconfr-test
symposion_project/settings.py
1
6854
# -*- coding: utf-8 -*- # Django settings for account project import os.path import posixpath PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG # tells Pinax to serve media through the stat...
bsd-3-clause
2,700,904,606,327,757,300
29.327434
122
0.695506
false
3.445953
false
false
false
rrrrrr8/vnpy
vnpy/api/fcoin/vnfcoin.py
1
8705
# encoding: UTF-8 from __future__ import print_function import hashlib import hmac import json import ssl import traceback import base64 from queue import Queue, Empty from multiprocessing.dummy import Pool from time import time from urlparse import urlparse from copy import copy from urllib import urlencode from thr...
mit
-5,416,593,543,440,437,000
27.914966
104
0.407246
false
4.457787
false
false
false
patpatpatpatpat/digestus
digestus/users/migrations/0002_auto_20160411_0706.py
1
1042
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-04-11 07:06 from __future__ import unicode_literals import django.contrib.auth.models import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] ...
bsd-3-clause
4,507,607,847,754,448,000
36.214286
409
0.619962
false
4.151394
false
false
false
jhamman/xarray
xarray/core/dask_array_ops.py
1
3415
import numpy as np from . import dtypes, nputils def dask_rolling_wrapper(moving_func, a, window, min_count=None, axis=-1): """Wrapper to apply bottleneck moving window funcs on dask arrays """ import dask.array as da dtype, fill_value = dtypes.maybe_promote(a.dtype) a = a.astype(dtype) # in...
apache-2.0
-4,649,155,484,743,141,000
34.206186
85
0.610542
false
3.513374
false
false
false
jds2001/ocp-checkbox
plainbox/plainbox/impl/checkbox.py
1
11485
# This file is part of Checkbox. # # Copyright 2012, 2013 Canonical Ltd. # Written by: # Zygmunt Krynicki <zygmunt.krynicki@canonical.com> # # Checkbox 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 ...
gpl-3.0
1,173,677,311,311,144,000
32.97929
79
0.60714
false
4.614303
false
false
false
PXke/invenio
invenio/ext/logging/wrappers.py
1
19138
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 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 ...
gpl-2.0
5,910,561,714,720,999,000
36.452055
115
0.564845
false
4.167683
false
false
false
nguy/brawl4d
LMA/controller.py
1
10240
""" Support for LMA data display in brawl4d. These are meant to be lightweight wrappers to coordinate data formats understood by the lmatools package. """ import numpy as np from lmatools.flashsort.autosort.LMAarrayFile import LMAdataFile from stormdrain.bounds import Bounds, BoundsFilter from stormdra...
bsd-2-clause
341,399,929,400,334,140
45.130631
125
0.578906
false
3.985987
false
false
false
bsmithers/CLIgraphs
histogram.py
1
8515
#!/usr/bin/env python2 from __future__ import division import itertools import math import sys import numpy import scipy.stats import cligraph import utils """ TODO: - Auto-detect number of bins - Fixed width or variable width bins - Stacked bins, overlapped bins or bins next to each other - Change which side of bi...
agpl-3.0
-3,073,636,207,774,765,000
37.881279
100
0.593188
false
3.90955
false
false
false
CReSIS/OPS
conf/tools/createUserExample.py
1
1232
# After editing the script (e.g. with gedit), run this script by following these steps: # (1) Switch to root user: sudo -i # (2) Activate VirtualEnv: source /usr/bin/venv/bin/activate # (3) Open a Python shell with Django environment: python /var/django/ops/manage.py shell # (4) Run this script: execfile('createU...
gpl-3.0
2,488,223,651,397,870,000
36.333333
89
0.75487
false
3.072319
false
false
false
boxlab/UltraEnc-X
0.3.1/model/main_functions.py
1
1133
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' impelement the main functions required by enc.py. ''' from random import randint from model.requirements import lmap, repeat def generate_otp(sheets, strength, length): for sheet in range(sheets): filename = "uexor_%s.uep" % (str(sheet),) ...
gpl-3.0
-55,255,850,452,821,720
24.177778
72
0.578994
false
3.866894
false
false
false
dpausp/arguments
tests/concepts/document/test_documents.py
1
1326
import factory from assert_helpers import assert_difference, assert_no_difference from ekklesia_portal.datamodel import Document from webtest_helpers import assert_deform, fill_form def test_create_document(client, db_query, document_factory, proposition_type_factory, logged_in_department_admin): department = lo...
agpl-3.0
-8,858,794,118,393,888,000
38
115
0.723982
false
3.574124
false
false
false
kn-bibs/dotplot
dotplot/matrices.py
1
3681
"""This module works with similarity matrices of aminoacids""" import os available_matrices = { 'PAM120': 'matrices/PAM120.txt' } class SimilarityMatrix: def __init__(self, name): filename = available_matrices[name] # get the raw matrix from file matrix = self.read_raw_matrix(filen...
lgpl-3.0
4,772,096,541,550,794,000
30.194915
77
0.549307
false
3.936898
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway.py
1
3220
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
6,252,235,653,991,100,000
40.818182
110
0.618012
false
4.065657
false
false
false
shumingch/molecule_simulation
init.py
1
2823
#init from camera from bge import logic, render from particle import Particle from mathutils import Vector, Matrix gdict = logic.globalDict def draw(): camera = scene.objects["Camera"] string = "BondCraft" ###draws bonds and changes text before frame load atoms = gdict["atoms"].copy() for atom ...
mit
-7,731,772,127,578,801,000
28.416667
70
0.552604
false
3.794355
false
false
false
stosdev/zebra-supervisor
judge/models/profile.py
1
1441
# -*- coding: utf-8 -*- """Module containing judge user profiles and various utilities.""" from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from django.db import models from django.contrib.auth.models import User from django.db.models.signals impor...
gpl-3.0
-5,783,652,171,932,656,000
34.146341
79
0.628036
false
4.16474
false
false
false
phobson/bokeh
scripts/version_update.py
1
2576
import os import re import sys def check_input(new_ver): """ Ensure that user input matches the format X.X.X """ pat = r'\d+.\d+.\d+' if not re.match(pat, new_ver): print("The new version must be in the format X.X.X (ex. '0.6.0')") return True def version_update(new_ver, file_array): ...
bsd-3-clause
-1,888,264,344,816,569,000
32.454545
104
0.571817
false
3.430093
false
false
false
pmaigutyak/mp-shop
delivery/models.py
1
2389
from django.db import models from django.utils.translation import ugettext_lazy as _ class DeliveryMethod(models.Model): name = models.CharField(_('Name'), max_length=255) code = models.CharField(_('Code'), max_length=255, unique=True) def __str__(self): return self.name class Meta: ...
isc
5,401,627,924,899,312,000
23.628866
78
0.580159
false
4.001675
false
false
false
jcfr/mystic
examples/constraint1_example01.py
1
1202
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 1997-2015 California Institute of Technology. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE """ Example: - Minimize R...
bsd-3-clause
-6,508,856,531,346,199,000
23.530612
78
0.686356
false
3.385915
false
false
false
sahpat229/POLLUTION
POLLUTION/settings.py
1
3175
""" Django settings for POLLUTION project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
mit
-2,247,838,034,777,714,000
25.239669
91
0.689764
false
3.535635
false
false
false
cklb/PyMoskito
pymoskito/simulation_modules.py
1
14724
import logging from copy import copy from abc import ABCMeta, abstractmethod from collections import OrderedDict from PyQt5.QtCore import QObject pyqtWrapperType = type(QObject) __all__ = ["SimulationModule", "SimulationException", "Trajectory", "Feedforward", "Controller", "Limiter", "ModelMixe...
bsd-3-clause
5,801,520,427,617,726,000
27.927308
84
0.609006
false
4.672802
false
false
false
mcedit/mcedit
albow/menu_bar.py
1
1799
# # Albow - Menu bar # from pygame import Rect from widget import Widget, overridable_property class MenuBar(Widget): menus = overridable_property('menus', "List of Menu instances") def __init__(self, menus=None, width=0, **kwds): font = self.predict_font(kwds) height = font.get_linesize...
isc
-3,368,339,507,747,398,700
25.850746
67
0.496943
false
3.527451
false
false
false
justinhayes/cm_api
python/src/cm_api/endpoints/roles.py
1
8270
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
-4,214,432,242,808,278,500
31.431373
83
0.655381
false
3.70188
true
false
false
jablonskim/jupyweave
jupyweave/output_manager.py
1
1220
from os import makedirs from os.path import join, dirname import uuid class OutputManager: """Responsible for managing """ def __init__(self, output_settings, input_filename): self.__data_dir = output_settings.data_directory(input_filename) self.__data_dir_url = output_settings.data_dir_url(i...
mit
6,834,835,077,078,132,000
32.888889
80
0.622951
false
3.77709
false
false
false
brianhelba/pylibtiff
libtiff/tests/test_simple.py
2
1148
import os from tempfile import mktemp from numpy import * from libtiff import TIFF def test_write_read(): for itype in [uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, float64, complex64, complex128]: image = array([[1, 2, 3], [4, 5,...
bsd-3-clause
-65,418,931,846,777,350
24.511111
57
0.495645
false
3.28
false
false
false
oskar456/turrisclock
fakegpio.py
1
1282
#!/usr/bin/env python # vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with from __future__ import print_function class GPIO: """ Class representing one fake GPIO signal for debugging purposes """ def __init__(self, name, directio...
mit
-854,122,664,214,825,900
29.52381
131
0.592824
false
4.044164
false
false
false
nclsHart/glances
glances/plugins/glances_monitor.py
1
4261
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances 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 Lic...
lgpl-3.0
-6,686,539,748,320,270,000
34.508333
89
0.58836
false
4.136893
false
false
false
huggingface/pytorch-transformers
src/transformers/modeling_flax_pytorch_utils.py
1
9873
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # 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
-9,171,087,745,011,735,000
42.685841
179
0.63861
false
3.47274
false
false
false
timm/sandbox
py/cocomo/poly.py
1
3693
import random def tunings(_ = None): Within(txt="loc", lo=2, hi=2000) prep([ # vlow low nom high vhigh xhigh # scale factors: 'Flex', 5.07, 4.05, 3.04, 2.03, 1.01, _],[ 'Pmat', 7.80, 6.24, 4.68, 3.12, 1.56, _],[ 'Prec', 6.20, 4.96, 3.72, 2.48, 1.24, _],[ 'Resl', 7.07, 5.65, 4.24...
bsd-3-clause
9,033,717,283,063,394,000
34.171429
68
0.461143
false
2.150844
false
false
false
ufieeehw/IEEE2017
ieee2017_tf_broadcaster/nodes/tf_broadcaster.py
1
3127
#!/usr/bin/env python ''' TF Broadcaster: Keeps track of the various coordinate frames on the vehicle in relation to the map and each other. ''' from __future__ import division import rospy import tf from nav_msgs.msg import Odometry from std_msgs.msg import Float64 __author__ = "Anthony Olive" __maintainer__ = "...
mit
7,645,632,687,140,517,000
35.360465
96
0.707387
false
2.900742
false
false
false
juanshishido/okcupid
utils/permutation.py
1
2439
import numpy as np from scipy.stats import ttest_ind from sklearn.metrics import accuracy_score def _diff_means(m, arr): """Calculate the difference-in-means statistic. This is based on an input array, `arr`, where the first `m` observations correspond to a particular class. Parameters ----------...
mit
4,915,322,422,834,123,000
25.802198
76
0.595326
false
3.946602
false
false
false
rikiji/gnome-wsname-applet
wsname.py
1
6204
#!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk import gnomeapplet import gobject import wnck import sys import codecs import random # debugging # import os # new_stdout = open ("/tmp/debug.stdout", "w") # new_stderr = open ("/tmp/debug.stderr", "w") # os.dup2(new_stdout.fileno(), sys.stdout.filen...
gpl-2.0
1,066,744,528,332,039,600
30.979381
110
0.644262
false
3.377246
false
false
false
robin900/sqlalchemy
test/ext/test_indexable.py
2
10585
from sqlalchemy.testing import assert_raises import sqlalchemy as sa from sqlalchemy import testing from sqlalchemy import Integer, Text from sqlalchemy.sql.sqltypes import ARRAY, JSON from sqlalchemy.testing.schema import Column from sqlalchemy.orm import Session from sqlalchemy.testing import fixtures from sqlalchemy...
mit
6,000,683,169,161,101,000
27.302139
81
0.525083
false
3.588136
true
false
false
python-ning/blog
blogchen/blog/migrations/0006_auto_20150831_2257.py
1
1727
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('blog', '0005_auto_20150830_2306'), ] operations = [ migrations.AddField( model_...
mpl-2.0
593,842,880,430,225,500
37.377778
163
0.593515
false
3.040493
false
false
false
tobes/raspberry-DMX
dmx2.py
1
2777
# -*- coding: utf-8 -*- # http://www.jonshouse.co.uk/rpidmx512.cgi from twisted.internet import protocol, reactor, endpoints from pigpio import pi, pulse as pig_pulse, OUTPUT PORT = 50007 # pins PIN_DI = 18 # Driver Input PIN_DE = 23 # Driver output enable (high to enable) PIN_RE = 24 # Receive output enable (...
gpl-2.0
-6,033,140,081,946,384,000
20.030303
77
0.602305
false
3.265882
false
false
false
paulfurley/festival-weather
festivalweather/parser.py
1
3354
from __future__ import unicode_literals import datetime import pytz import lxml.etree from .two_hourly_forecast import TwoHourlyForecast """ The Norwegian weather service API 1.9 returns a pretty cool data format, albeit encoded in XML. It contains two types of forecasts: 1. point-in-time (from="2014-08-03T19...
mit
-4,074,040,419,337,598,000
32.54
79
0.651163
false
3.209569
false
false
false
dask-image/dask-ndfourier
dask_ndfourier/_compat.py
1
1574
# -*- coding: utf-8 -*- """ Content here is borrowed from our contributions to Dask. """ import numpy import dask.array def _fftfreq_block(i, n, d): r = i.copy() r[i >= (n + 1) // 2] -= n r /= n * d return r def _fftfreq(n, d=1.0, chunks=None): """ Return the Discrete Fourier Transform s...
bsd-3-clause
138,433,240,379,861,860
22.848485
79
0.550191
false
2.975425
false
false
false
williamsjj/twisted_cql
examples/session_client_example.py
1
1142
# -*- coding: utf-8-*- # ################################################################### # FILENAME: examples/session_client_example.py # PROJECT: # DESCRIPTION: Cassandra session wrappers. # # ################################################################### # (C)2015 DigiTar, All Rights Reserved # ############...
bsd-2-clause
-7,293,982,450,228,258,000
34.71875
78
0.465849
false
5.464115
false
false
false
abhijitbangera/ecommerce
src/products/models.py
1
4589
from django.db import models from django.core.urlresolvers import reverse from django.db.models.signals import post_save from django.utils.text import slugify from django.utils.safestring import mark_safe # Create your models here. class ProductQuerySet(models.query.QuerySet): def active(self): return self.filter(a...
mit
-8,218,578,092,329,610,000
31.323944
112
0.755066
false
3.061374
false
false
false
bradleyhd/netsim
nodes_vs_routing_speed.py
1
2878
import matplotlib.pyplot as plt import numpy as np import math from scipy.optimize import curve_fit def linear(x, a, b): return a * x + b def quadratic(x, a, b, c): return a * x**2 + b * x + c def exponential(x, a, b, c): return a * x**b + c fig = plt.figure(num=None, figsize=(12, 8), dpi=300, facecolor='k', ...
gpl-3.0
-1,239,813,979,495,446,500
34.9875
649
0.69458
false
2.394343
false
false
false
waynesun09/virt-test
virttest/remote.py
1
44950
""" Functions and classes used for logging into guests and transferring files. """ import logging import time import re import os import shutil import tempfile import aexpect import utils_misc import rss_client import base64 from remote_commander import remote_master from remote_commander import messenger from autote...
gpl-2.0
-2,009,604,876,020,462,600
38.778761
105
0.573593
false
4.123097
false
false
false
jonyachen/hearboi
record_2.py
1
1234
""" PyAudio exmple: Record a few seconds of audio and save to a WAVE file. """ import pyaudio import wave import sys from dejavu import Dejavu CHUNK = 8192 FORMAT = pyaudio.paInt16 CHANNELS = 1L RATE = 48000 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "/sounds/output.wav" if sys.platform == 'darwin': CHANNELS = 1 ...
mit
899,650,144,295,158,300
18.587302
64
0.62966
false
3.054455
false
false
false
benoitc/dj-revproxy
revproxy/store.py
1
4409
# -*- coding: utf-8 - # # This file is part of dj-revproxy released under the MIT license. # See the NOTICE for more information. import os import types import uuid try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.conf import settings from restkit.tee import Te...
mit
2,846,753,884,410,019,300
27.62987
67
0.57927
false
3.730118
false
false
false
t3dev/odoo
addons/website_sale_digital/controllers/main.py
5
4569
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import io from werkzeug.utils import redirect from odoo import http from odoo.http import request from odoo.addons.sale.controllers.portal import CustomerPortal from odoo.addons.website_sale.controllers.ma...
gpl-3.0
5,739,313,354,150,287,000
40.536364
206
0.612607
false
4.199449
false
false
false
chilleo/ALPHA
module/CalculateGeneralizedDStatisticClass.py
1
11045
from PyQt4 import QtCore from sys import * import os import subprocess # if platform == 'win32': # path.insert(0, "../CommandLineFiles") # elif platform == 'darwin': # path.insert(0, "..\\CommandLineFiles") # import CalculateGeneralizedDStatistic import sys from CommandLineFiles.RunDGEN import run_saved_dge...
mit
8,902,405,438,152,815,000
48.308036
252
0.612404
false
3.569813
false
false
false
foursquare/pants
tests/python/pants_test/engine/legacy/test_graph_integration.py
1
5480
# coding=utf-8 # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import unittest from pants.build_graph.address_lookup_error import AddressLookupError fr...
apache-2.0
-5,469,494,609,122,167,000
39
236
0.657117
false
3.355787
true
false
false
kevinrigney/PlaylistDatabase
ReplaceVideoUrl.py
1
4628
#!/usr/bin/env python3 # Find videos with duplicates: SELECT Track.track_name, Artist.artist_name,Track.youtube_link FROM Track JOIN Artist WHERE Track.artist_id = Artist.id GROUP BY Track.youtube_link HAVING count(*) >=2 from PlaylistDatabase import PlaylistDatabase db = PlaylistDatabase(config_file='PlaylistData...
mit
2,339,863,320,914,901,000
37.566667
276
0.624028
false
3.477085
false
false
false
zhengwsh/InplusTrader_Linux
InplusTrader/backtestEngine/api/ext.py
1
1329
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
mit
7,158,395,297,280,410,000
29.906977
80
0.708804
false
3.553476
false
false
false
edgedb/edgedb
edb/testbase/serutils.py
1
2605
# mypy: ignore-errors # # This source file is part of the EdgeDB open source project. # # Copyright 2019-present MagicStack Inc. and the EdgeDB 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 ...
apache-2.0
-1,057,744,096,127,017,600
20.178862
74
0.693282
false
3.501344
false
false
false
VisionInternet/visionLiveSDK-Python
setup.py
1
1303
# -*- coding: utf-8 -*- ############################################################################## # # Python visionLive API # Copyright 2017 Vision Internet (http://www.visioninternet.com) # ############################################################################## from setuptools import setup, find_pac...
gpl-3.0
2,381,504,976,160,644,000
33.315789
93
0.561013
false
4.189711
false
false
false
zjutjsj1004/third
boost/tools/build/src/tools/rc.py
1
7483
# Status: being ported by Steven Watanabe # Base revision: 47077 # # Copyright (C) Andre Hentz 2003. Permission to copy, use, modify, sell and # distribute this software is granted provided this copyright notice appears in # all copies. This software is provided "as is" without express or implied # warranty, ...
mit
-4,228,239,602,701,784,600
36.178571
109
0.616865
false
3.682579
false
false
false
aganezov/bg
bg/distances.py
1
1464
# -*- coding: utf-8 -*- import networkx as nx def get_all_cycles(breakpoint_graph): visited = set() cycles = [] for vertex in breakpoint_graph.nodes(): if vertex in visited: continue try: cycle = nx.find_cycle(breakpoint_graph.bg, vertex) new = False ...
mit
3,728,780,150,982,258,000
31.533333
129
0.612022
false
3.632754
false
false
false
psf/black
src/black/numerics.py
1
1843
""" Formatting numeric literals. """ from blib2to3.pytree import Leaf def format_hex(text: str) -> str: """ Formats a hexadecimal string like "0x12B3" """ before, after = text[:2], text[2:] return f"{before}{after.upper()}" def format_scientific_notation(text: str) -> str: """Formats a numer...
mit
-7,455,265,180,297,510,000
27.353846
78
0.607705
false
3.510476
false
false
false
ebmdatalab/openprescribing
openprescribing/dmd/forms.py
1
2175
from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Field, ButtonHolder, Submit from crispy_forms.bootstrap import InlineCheckboxes obj_types_choices = [ ("vtm", "VTMs"), ("vmp", "VMPs"), ("amp", "AMPs"), ("vmpp", "VMPPs"), ("ampp", "AMPPs")...
mit
-4,931,881,564,602,365,000
30.071429
104
0.622069
false
3.849558
false
false
false
maas/maas
src/maasserver/fields.py
1
29287
# Copyright 2012-2017 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Custom model and form fields.""" __all__ = [ "CIDRField", "EditableBinaryField", "Field", "HostListFormField", "IPListFormField", "IPv4CIDRField", ...
agpl-3.0
-6,963,579,217,191,655,000
31.83296
79
0.599515
false
4.186249
false
false
false
davidgardenier/frbpoppy
tests/lognlogs/local.py
1
1611
"""Check the log N log F slope of a local population.""" import numpy as np import matplotlib.pyplot as plt from frbpoppy import CosmicPopulation, Survey, SurveyPopulation from frbpoppy.population import unpickle from tests.convenience import plot_aa_style, rel_path MAKE = True if MAKE: population = CosmicPopu...
mit
1,427,555,761,050,062,300
26.305085
74
0.628181
false
2.782383
false
false
false
lorin/umdinst
umdinst/setup/verifyperms.py
1
3064
#!/usr/bin/env python import os from stat import * def parent(path): """Return the parent of the specified directory""" # Remove the trailing slash, if any if path.endswith('/'): return os.path.dirname(path[:-1]) else: return os.path.dirname(path) def create_and_set_permissions(di...
bsd-3-clause
-636,487,300,372,576,000
38.282051
141
0.679178
false
3.938303
false
false
false
davemehringer/keplerpp
apps/plotter_mayavi.py
1
10321
# plotter_mayavi.py # Copyright (C) 2016 David Mehringer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versi...
gpl-3.0
2,115,478,447,945,871,400
26.670241
88
0.556148
false
3.404024
false
false
false
linsalrob/EdwardsLab
mongodb/load_models.py
1
1140
""" Create a mongo database if it doesn't exist and load a bunch of data into it. We need a directory with one or more JSON files in it. We look for JSON on the end of the filename. e.g. python load_models.py -d /data/Genotype-Phenotype-Modeling/models/Citrobacter/Citrobacter/models/ -n fba_models -c citrobacter """ ...
mit
-2,236,823,401,457,467,000
32.529412
131
0.658772
false
3.433735
false
false
false
neuhofmo/RecBlast
RecBlastUtils.py
1
10025
#! /usr/bin/env python2 # A set of tools, functions, aliases and more used in RecBlast. import os import tarfile import zipfile from time import strftime, sleep import re import subprocess from Bio import Entrez import shutil Entrez.email = "recblast@gmail.com" Entrez.tool = "RecBlast" TEMP_FILES_PATH = os.getcwd() ...
mit
-6,327,078,877,724,079,000
35.587591
118
0.6399
false
3.496686
false
false
false
seanfisk/lsf-ibutils
docs/source/conf.py
1
8703
# -*- coding: utf-8 -*- # # This file is based upon the file generated by sphinx-quickstart. However, # where sphinx-quickstart hardcodes values in this file that you input, this # file has been changed to pull from your module's metadata module. # # This file is execfile()d with the current directory set to its contai...
mit
-767,821,976,746,909,600
31.473881
79
0.708376
false
3.844081
false
false
false
tobyclemson/terraform-aws-vpc-auto-peering
lambdas/auto_peering/auto_peering/vpc_peering_routes.py
1
4260
from botocore.exceptions import ClientError class VPCPeeringRoutes(object): def __init__(self, vpc1, vpc2, vpc_peering_relationship, ec2_gateways, logger): self.vpc1 = vpc1 self.vpc2 = vpc2 self.vpc_peering_relationship = vpc_peering_relationship s...
mit
4,196,186,921,195,466,000
37.727273
80
0.56385
false
4.018868
false
false
false
dhoffman34/django
django/template/defaulttags.py
1
52686
"""Default tags used by the template system, available to all templates.""" from __future__ import unicode_literals import os import sys import re from datetime import datetime from itertools import groupby, cycle as itertools_cycle import warnings from django.conf import settings from django.template.base import (No...
bsd-3-clause
-833,096,168,356,587,800
33.593565
171
0.575675
false
4.2523
false
false
false
mattcongy/itshop
docker-images/taigav2/taiga-back/taiga/events/events.py
1
3483
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
mit
4,587,529,563,126,168,600
31.53271
94
0.644642
false
3.668072
false
false
false
kivymd/KivyMD
kivymd/uix/banner.py
1
11889
""" Components/Banner ================= .. seealso:: `Material Design spec, Banner <https://material.io/components/banners>`_ .. rubric:: A banner displays a prominent message and related optional actions. .. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/banner.png :align: c...
mit
-5,465,859,003,321,030,000
25.12967
164
0.61948
false
3.602727
false
false
false
facebookresearch/fastText
python/doc/examples/bin_to_vec.py
1
1120
#!/usr/bin/env python # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import from __future__ import division from __future__ import print_fu...
mit
-808,605,955,784,245,900
26.317073
73
0.611607
false
3.745819
false
false
false
whausen/part
src/adhocracy/lib/text/mdx_showmore.py
1
2762
"""Showmore extension for Markdown. To hide something with [more...], surround the corresponding text with triple parentheses, e.g. (((text_to_be_hidden))). In order to show the text, you have to include the following Javascript in your code, which depends on the availability of jquery. $('.showmore').each(funct...
agpl-3.0
-2,644,980,990,746,216,000
28.698925
79
0.543085
false
3.793956
false
false
false
jszymon/pacal
pacal/__init__.py
1
3420
"""PaCal, the probabilistic calculator.""" from __future__ import print_function from . import params import numpy as _np from pylab import show _np.seterr(all="ignore") from .utils import Inf from .distr import DiscreteDistr from .distr import exp, log, atan, min, max, sqrt, sign, sin, cos, tan, tanh, sigmoid f...
gpl-3.0
3,216,944,426,521,795,600
32.203883
93
0.738304
false
3.266476
false
false
false
xtiankisutsa/MARA_Framework
tools/androwarn/androwarn/core/core.py
1
16646
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of Androwarn. # # Copyright (C) 2012, Thomas Debize <tdebize at mail.com> # All rights reserved. # # Androwarn 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 Fr...
lgpl-3.0
-755,324,748,976,787,000
34.568376
168
0.70191
false
3.308029
false
false
false
milankl/swm
calc/misc/c_diss_plot.py
1
3966
from __future__ import print_function path = '/home/mkloewer/python/swm/' import os; os.chdir(path) # change working directory import numpy as np from scipy import sparse import time as tictoc from netCDF4 import Dataset import glob import matplotlib.pyplot as plt # OPTIONS runfolder = [2,3] ## read data for r,i in z...
gpl-3.0
1,328,140,129,446,161,700
27.73913
112
0.61296
false
2.120856
false
false
false
h-matsuo/memTracker
lib/track.py
1
8958
#!/usr/bin/python # coding: UTF-8 """ Implementation of command: track """ __author__ = "Hiroyuki Matsuo <h-matsuo@ist.osaka-u.ac.jp>" # ===== Configuration ========================================================== # ----- Disk I/O tracking ------------------------------------------------------ #DEVICE_NAME = "mm...
mit
3,676,295,319,247,016,400
28.275748
122
0.53813
false
3.660989
false
false
false
bruecksen/isimip
isi_mip/climatemodels/migrations/0088_attachment.py
1
1304
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-11-26 14:51 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import isi_mip.climatemodels.models class Migration(migrations.Migration): dependencies = [ ('climatemodels', '0087_...
mit
-4,246,487,658,960,444,000
43.965517
132
0.661043
false
3.927711
false
false
false
HackerBaloo/SublimeOpenInTotalCommander
Open in Total Commander.py
1
2176
import os import os.path import subprocess import sublime import sublime_plugin def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) def which(program): fpath, fname = os.path.split(program) if fpath: if is_exe(program): return program e...
mit
-5,479,836,569,828,957,000
30.477612
113
0.555147
false
3.96357
false
false
false
oblique-labs/pyVM
rpython/rtyper/normalizecalls.py
1
16966
from rpython.annotator import model as annmodel, description from rpython.flowspace.argument import Signature from rpython.flowspace.model import (Variable, Constant, Block, Link, checkgraph, FunctionGraph, SpaceOperation) from rpython.rlib.objectmodel import ComputedIntSymbolic from rpython.rtyper.error import Typ...
mit
-9,057,449,203,302,139,000
40.279805
101
0.590357
false
4.162414
false
false
false
betatim/osf-cli
osfclient/__main__.py
1
4648
from __future__ import print_function import sys import six import argparse from textwrap import dedent from .cli import clone, fetch, list_, remove, upload, init from . import __version__ def main(): description = dedent(""" osf is a command-line program to up and download files from osf.io. These ...
bsd-3-clause
9,018,315,386,468,274,000
37.733333
77
0.598322
false
4.384906
false
false
false
culot/homebooking
storage.py
1
15856
import logging as log import sqlite3 class Database(): "Class to manage interactions with database" def __init__(self): self.connection = sqlite3.connect('book.db') self.connection.row_factory = sqlite3.Row try: self.sanity_checks() except Exception: sel...
bsd-3-clause
4,993,846,659,523,634,000
38.344913
187
0.550013
false
3.806963
false
false
false
eli261/jumpserver
apps/orgs/mixins/api.py
1
1880
# -*- coding: utf-8 -*- # from django.shortcuts import get_object_or_404 from rest_framework.viewsets import ModelViewSet from rest_framework_bulk import BulkModelViewSet from common.mixins import IDInCacheFilterMixin from ..utils import set_to_root_org from ..models import Organization __all__ = [ 'RootOrgViewMi...
gpl-2.0
-5,117,398,041,462,295,000
30.864407
78
0.675
false
3.836735
false
false
false
umangv/LitHub
LitHub/fbconnect/forms.py
1
2017
# Copyright 2011 Kalamazoo College Computer Science Club # <kzoo-cs-board@googlegroups.com> # This file is part of LitHub. # # LitHub 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 v...
gpl-3.0
2,665,399,981,494,819,300
40.163265
75
0.672286
false
3.986166
false
false
false
gumyns/home-automation
hardware_old/arm/toolchainGenerator.py
1
2209
#!/usr/bin/python import os import sys import subprocess devices = ['STM32F030x6'] template = """set(ENV{{PATH}} {gcc_dir}) set(GCC_ARM_DIRECTORY {gcc_dir}) add_definitions(-D{device}) set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_C_COMPILER_WORKS 1) set(CMAKE_CXX_COMPILER_WORKS 1) set(C...
apache-2.0
2,180,668,552,278,348,300
40.679245
332
0.712992
false
2.664656
false
false
false
mateuszmalinowski/visual_turing_test-tutorial
kraino/utils/print_metrics.py
1
5116
#!/usr/bin/env python from __future__ import print_function """ Selects and prints metrics. Author: Mateusz Malinowski Email: mmalinow@mpi-inf.mpg.de """ import os from uuid import uuid4 from compute_wups import get_metric_score as wups_score from compute_wups import get_class_metric_score as class_wups_score fro...
mit
7,413,126,285,437,841,000
38.053435
118
0.611024
false
3.148308
false
false
false
manish211/coveralls-python
tests/test_cli.py
1
2270
# coding: utf-8 import os from mock import patch, call import pytest import coveralls from coveralls.api import CoverallsException import coveralls.cli @patch.dict(os.environ, {'TRAVIS': 'True'}, clear=True) @patch.object(coveralls.cli.log, 'info') @patch.object(coveralls.Coveralls, 'wear') def test_debug(mock_wear...
mit
-4,962,825,633,529,102,000
32.382353
108
0.712335
false
2.940415
true
false
false
risteon/nimble
nimble/sources/datasets.py
1
1222
# -*- coding: utf-8 -*- from __future__ import absolute_import import os from ..composition import LabeledDataSource from .images import ImageFileSource from .labels import TransformMatrixSource class KittiOdometrySource(LabeledDataSource): """Read images and ground truth poses of the Kitti dataset. http:/...
mit
-552,109,552,399,370,430
34.941176
112
0.660393
false
3.748466
false
false
false
enotx/ebook_librarian
src/classification.py
1
13177
#!/usr/bin/env python # -*- coding: utf-8 -*- from PyQt5.QtCore import (QAbstractItemModel, QFile, QIODevice, QItemSelectionModel, QModelIndex, Qt, QRect, QCoreApplication, QMetaObject) from PyQt5 import QtWidgets from PyQt5.uic import loadUi from config import CLASSIFICATION_FILE_NAME class TreeItem(object...
gpl-3.0
-2,900,626,491,082,333,000
30.299287
96
0.595052
false
4.252017
false
false
false
soxfmr/engineshooter
engineshooter/spiders/engine/baidu.py
1
6685
# -*- coding: utf-8 -*- import re import os import scrapy import random import string import tempfile import webbrowser from os.path import join from urllib import urlencode from StringIO import StringIO from engineshooter.items import SearchResultItem class BaiduEngine: name = 'baidu' BASE_URL = 'https://ww...
mit
4,947,824,558,868,805,000
36.768362
113
0.581301
false
4.056432
false
false
false
mclaughlin6464/pdnn
models/dnn_reg.py
1
11677
''' @Author Sean McLaughiln This is my copy of the dnn module. I'm adding some features so I can use DNN for regression rather than just classification. ''' import cPickle import gzip import os import sys import time import collections import numpy import theano import theano.tensor as T from theano.tensor.shared_ra...
apache-2.0
-713,601,744,639,500,700
40.703571
136
0.553139
false
3.696423
false
false
false