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
MikaelSchultz/dofiloop-sentinel
sentinel/sensor/models.py
1
6540
from django.db import models from django.utils.translation import ugettext as _ from device.models import SnmpDevice from device.choices import * # Create your models here. class PartitionSensor(models.Model): snmp_device = models.ForeignKey(SnmpDevice, on_delete=models.CASCADE) enabled = models.BooleanFiel...
mit
1,307,033,748,098,659,800
21.629758
73
0.583639
false
4.316832
false
false
false
smartsheet-platform/smartsheet-python-sdk
smartsheet/models/workspace.py
1
3824
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101 # Smartsheet Python SDK. # # Copyright 2018 Smartsheet.com, 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-2.0
7,016,440,368,249,686,000
23.202532
75
0.624477
false
4
false
false
false
huqa/pyfibot
pyfibot/modules/module_kivatietaa.py
1
2467
# -*- coding: utf-8 -*- ''' Created on 17.8.2013 @author: Hukka ''' import time from math import ceil #from datetime import timedelta #from datetime import datetime from PIL import Image from PIL import ImageFont from PIL import ImageDraw def generate_kivatietaa(nick,text): #print len(text) if not text: ...
bsd-3-clause
-4,403,296,499,761,643,500
27.367816
120
0.611269
false
2.852023
false
false
false
offlinehacker/flumotion
flumotion/monitor/nagios/component.py
1
8063
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License version 2 as published by # the Free ...
gpl-2.0
1,263,489,664,059,242,500
36.328704
79
0.575344
false
4.01344
false
false
false
mozaik-association/mozaik
odoo_addons/mozaik_mandate/ext_mandate.py
1
18650
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of mozaik_mandate, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # mozaik_mandate is free software: # you can redistribute it and/or # modify it u...
agpl-3.0
-946,782,091,890,759,300
41.099323
79
0.467239
false
4.755227
false
false
false
jaeilepp/mne-python
mne/time_frequency/_stockwell.py
2
10181
# Authors : Denis A. Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License : BSD 3-clause from copy import deepcopy import math import numpy as np from scipy import fftpack # XXX explore cuda optimazation at some point. from ..io.pick import pick_type...
bsd-3-clause
8,823,945,369,712,957,000
36.707407
79
0.59611
false
3.24339
false
false
false
PHSCRC/boxbot
hardware/melexis.py
1
1398
#!/usr/bin/env python3 from adafruit.i2c import Adafruit_I2C try: from .component import * except SystemError as err: from component import * class Melexis(LoopedComponent, I2CComponent): _mswait = 50 _FN = "temp" def init(self, fahrenheit=False): super().init() self._i2c = A...
mit
-4,064,561,164,616,934,000
24.851852
67
0.563754
false
3.455446
false
false
false
naturali/tensorflow
tensorflow/contrib/rnn/python/ops/gru_ops.py
1
5673
# Copyright 2016 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
-2,168,683,449,094,958,300
29.831522
82
0.628415
false
2.894388
false
false
false
gclenaghan/SIEVE
data/generate_data_files.py
1
2231
""" Generate data files and TOC file for the visualization. Depends on vtn_sieve and pysieve (vtn_sieve is a private repository that cannot be shared) See file specification at file_spec.md """ from pysieve import substbased from seqdistance.matrices import binarySubst, addGapScores, binGapScores from vtn_sieve impo...
mit
5,045,476,629,932,464,000
38.140351
90
0.645002
false
3.657377
false
false
false
RobotGame/rgserver
matchmaker/sandbox.py
1
3717
import ast import imp import limitexec as le import os import pkg_resources import pwd import random import resource import sys import time import traceback from rgkit.settings import settings def load_map(): map_filename = pkg_resources.resource_filename( 'rgkit', 'maps/default.py') map_data = ast.l...
mit
-2,026,913,588,068,066,000
28.736
76
0.470541
false
4.257732
false
false
false
jschultz/nvivotools
NVPX2RQDA.py
1
5482
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016 Jonathan Schultz # # 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 lat...
gpl-3.0
-778,848,020,103,417,500
37.605634
186
0.673477
false
3.640106
false
false
false
tanbro/exosip2ctypes
src/exosip2ctypes/message.py
1
10258
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from ctypes import POINTER, byref, string_at, create_string_buffer, c_void_p, c_char_p, c_int, c_size_t from ._c import lib, osip_parser, osip_content_type, osip_from, osip_header, osip_content_length, osip_body from .error impor...
gpl-3.0
-4,613,109,619,077,963,000
29.084848
107
0.538214
false
3.800667
false
false
false
scikit-learn/enhancement_proposals
slep006/cases_opt1.py
1
1986
from defs import (accuracy_score, GroupKFold, make_scorer, SelectKBest, LogisticRegressionCV, cross_validate, make_pipeline, X, y, my_groups, my_weights, my_other_weights) # %% # Case A: weighted scoring and fitting lr = LogisticRegressionCV( cv=GroupKFold(), scoring='accur...
bsd-3-clause
4,641,983,158,123,055,000
28.205882
78
0.632931
false
3.74717
false
false
false
sejros/The-Nature-of-Python-Examples
chp03_oscillation/1 Pendulum.py
1
3277
# coding=utf-8 from math import sin, cos, pi, atan2, sqrt from tkinter import * import numpy as np WIDTH = 800 HEIGHT = 600 mousepos = np.array([WIDTH / 2, HEIGHT / 2]) is_mouse_down = False is_rmouse_down = False class Pendulum: def __init__(self, anchor_x, anchor_y, lenght, radius): # self.position ...
mit
-2,486,442,822,304,618,500
22.407143
73
0.548062
false
3.206458
false
false
false
jinzekid/codehub
python/py3_6venv/spider_mysqlpjt/spider_mysqlpjt/pipelines.py
1
1037
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html import pymysql class SpiderMysqlpjtPipeline(object): def __init__(self): print(">>>init_spider") # 刚开始时连...
gpl-3.0
-2,523,029,409,844,316,700
26.514286
77
0.551402
false
2.981424
false
false
false
rjdp/Easynginedemoplugin
ee/core/logging.py
1
1064
"""EasyEngine log module""" class Log: """ Logs messages with colors for different messages according to functions """ HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE...
mit
-3,833,725,850,991,164,000
22.644444
58
0.514098
false
3.314642
false
false
false
jblupus/PyLoyaltyProject
old/project.backup/old/alters_percentage.py
1
2460
import numpy as np from old.project import FILE_NAMES from old.project import ROOT_PATH from old.project import exists from old.project import makedirs def percetage_executer(): for file_name in FILE_NAMES: generate_intervals(file_name, 5) print file_name break def generate_intervals(fi...
bsd-2-clause
-165,076,046,223,359,360
32.243243
74
0.452846
false
3.360656
false
false
false
jmckind/yubicrypto
server.py
1
1613
import falcon import logging from GhettoYubiHSM import GhettoYubiHSM FORMAT = '%(asctime)-15s %(levelname)s %(funcName)s(%(lineno)d): %(message)s' logging.basicConfig(format=FORMAT, level=logging.DEBUG) LOG = logging.getLogger(__name__) class EncryptResource: """ Resource to encrypt plaintext and return the ...
mit
-4,547,307,971,003,035,600
22.376812
77
0.571606
false
3.733796
false
false
false
RyanBalfanz/django-smsish
smsish/sms/backends/twilio.py
1
1779
from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from twilio.rest import TwilioRestClient class SMSBackend(BaseEmailBackend): def __init__(self, fail_silently=False, **kwargs): super().__init__(fail_silently=fail_silently) self.connection = None def open(self): ""...
mit
7,131,390,264,221,991,000
24.782609
120
0.708263
false
3.375712
false
false
false
orbnauticus/Pique
pique/network.py
1
4328
#!/usr/bin/env python # # Copyright (c) 2010, Ryan Marquardt # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # 1. Redistributions of source code must retain the above copyright notice, # th...
bsd-3-clause
4,551,058,690,451,919,400
29.478873
75
0.703558
false
3.389193
false
false
false
theJollySin/mazelib
mazelib/generate/Sidewinder.py
1
2279
from random import choice, random import numpy as np # If the code is not Cython-compiled, we need to add some imports. from cython import compiled if not compiled: from mazelib.generate.MazeGenAlgo import MazeGenAlgo class Sidewinder(MazeGenAlgo): """ The Algorithm 1. Work through the grid row-wise, sta...
gpl-3.0
-3,060,804,768,750,042,600
34.076923
93
0.575691
false
3.779436
false
false
false
googleapis/python-pubsublite
google/cloud/pubsublite/internal/wire/permanent_failable.py
1
3266
# 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 agreed to in writing, s...
apache-2.0
-7,624,177,616,057,700,000
34.5
118
0.647581
false
4.149936
false
false
false
thisismyrobot/pyxero
xero/auth.py
1
13893
from __future__ import unicode_literals import datetime import requests from requests_oauthlib import OAuth1 from oauthlib.oauth1 import (SIGNATURE_RSA, SIGNATURE_TYPE_AUTH_HEADER, SIGNATURE_HMAC) from six.moves.urllib.parse import urlencode, parse_qs from .constants import (XERO_BASE_URL,...
bsd-3-clause
7,559,847,955,323,640,000
35.560526
101
0.600158
false
4.480168
false
false
false
thethythy/Mnemopwd
mnemopwd/server/util/Daemon.py
1
7927
# -*- coding: utf-8 -*- # Copyright (c) 2015, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain th...
bsd-2-clause
4,598,217,630,481,537,000
35.196347
119
0.588873
false
4.521962
true
false
false
hunter-cameron/Bioinformatics
python/build/lib/mypyli/kraken.py
1
2295
import sys class KrakenRecord(object): @classmethod def parse_kraken_file(cls, kraken_f, iterate=False): """ Class method that returns a list of all kraken entries in the output Also has the option to work as a generator and iterate back out objects (to selectively keep ...
mit
2,762,964,342,759,067,000
34.859375
132
0.556427
false
3.701613
false
false
false
DiplomadoACL/problemasenclase
dictionary_makers/pmi_v01.py
1
2137
import pickle import math import sys PATH="diccionarios/" soporte=int(sys.argv[1]) codigos_ISO=sys.argv[2:] for codigo_ISO in codigos_ISO: archivo=open(PATH+codigo_ISO+"wiki_frecuencias.pickle","r") metadatos_palabras,dic_palabras=pickle.load(archivo) print print "Metadatos archivo de frecuencias de p...
lgpl-3.0
-6,301,402,933,782,339,000
38.574074
107
0.68554
false
2.47338
false
false
false
regisf/yablog
capatcha/admin.py
1
3730
# -*- coding: UTF-8 -*- # YaBlog # (c) Regis FLORET 2012 and later # 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 must retain the above copyright # notice, this list of conditi...
bsd-3-clause
2,487,247,014,641,007,600
45.6125
114
0.666398
false
4.093304
false
false
false
tgalal/yowsup
yowsup/config/manager.py
1
5552
from yowsup.config.v1.config import Config from yowsup.config.transforms.dict_keyval import DictKeyValTransform from yowsup.config.transforms.dict_json import DictJsonTransform from yowsup.config.v1.serialize import ConfigSerialize from yowsup.common.tools import StorageTools import logging import os logger = logging....
gpl-3.0
-4,712,326,739,665,925,000
35.768212
123
0.573307
false
4.0437
true
false
false
skuda/client-python
kubernetes/client/models/v2alpha1_job_template_spec.py
1
4122
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
-3,516,323,169,450,627,600
28.442857
152
0.566715
false
4.214724
false
false
false
rgayon/plaso
plaso/parsers/chrome_cache.py
1
16321
# -*- coding: utf-8 -*- """Parser for Google Chrome and Chromium Cache files.""" from __future__ import unicode_literals import os from dfdatetime import webkit_time as dfdatetime_webkit_time from dfvfs.resolver import resolver as path_spec_resolver from dfvfs.path import factory as path_spec_factory from plaso.con...
apache-2.0
8,817,148,244,868,467,000
32.651546
80
0.656026
false
3.864788
false
false
false
mozillazg/chendian-plus
chendian/qq/migrations/0005_auto_20150308_1347.py
1
1558
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('qq', '0004_rawmessage_raw_item'), ] operations = [ migrations.CreateModel( name='Up...
mit
2,021,768,505,801,848,000
36.095238
143
0.563543
false
3.745192
false
false
false
joelagnel/lisa
libs/wlgen/wlgen/rta.py
1
28387
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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
8,448,739,575,015,911,000
35.39359
86
0.541903
false
4.139253
true
false
false
nikdoof/test-auth
app/sso/services/miningbuddy/__init__.py
1
3066
import crypt import random import time from django.db import transaction from sso.services import BaseDBService from django.conf import settings class MiningBuddyService(BaseDBService): """ Mining Buddy Class, allows registration and sign-in """ settings = { 'require_user': False, 'r...
bsd-3-clause
-8,489,552,789,618,893,000
34.651163
129
0.612524
false
3.632701
false
false
false
praekelt/rapidpro
temba/api/models.py
1
22048
from __future__ import unicode_literals import hmac import json from django.db.models import Q import requests import uuid from datetime import timedelta from django.conf import settings from django.core.urlresolvers import reverse from django.contrib.auth.models import User, Group from django.db import models from d...
agpl-3.0
1,152,064,268,507,012,000
37.344348
153
0.527712
false
4.370268
false
false
false
slideinc/notifier
notifier/service.py
1
11364
# -*- Mode: Python; tab-width: 4 -*- # Copyright (c) 2005-2010 Slide, 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 must retain the above copyrig...
bsd-3-clause
426,281,300,781,720,400
31.284091
79
0.559662
false
3.93218
false
false
false
chrishaines/pyusps
setup.py
1
1305
#!/usr/bin/python from setuptools import setup, find_packages import os EXTRAS_REQUIRES = dict( test=[ 'fudge>=1.0.3', 'nose>=1.1.2', ], dev=[ 'ipython>=0.12.1', ], ) # Pypi package documentation root = os.path.dirname(__file__) path = os.path.join(root, 'README.rst...
mit
-6,469,447,712,948,329,000
25.632653
72
0.6
false
3.41623
false
false
false
vadimadr/generator-djdj
generators/app/templates/django_project_template/settings/production.py
1
2811
""" Production settings - DATABASE_URL and DJANGO_SECRET_KEY should be in env """ # noinspection PyUnresolvedReferences from .common import * # noqa DEBUG = env.bool('DJANGO_DEBUG', default=False) # Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ SECRET_KEY = env('DJANGO_SECRET_KEY') ...
mit
4,563,077,271,762,959,000
28.589474
79
0.535397
false
3.871901
false
false
false
mennis/oTTo
src/otto/lib/ethdrvstat.py
1
10253
#!/usr/bin/env python # # Copyright (c) 2014 Coraid, Inc. # All rights reserved. # # $Coraid$ # """ Interface to read, digest and display information regarding AoE Targets and their corresponding system information. """ from os import stat, listdir, path from stat import S_ISBLK from pprint import pformat import re f...
bsd-3-clause
1,185,178,689,856,153,900
27.639665
85
0.514874
false
4.07674
false
false
false
sammy1881/CricketNotifier
CricketNotifier_mac.py
1
10739
''' https://github.com/hasgar/CricLiveNotifier ''' #!/usr/bin/python import getpass import os from crontab import CronTab from bs4 import BeautifulSoup import urllib2,cookielib from urllib2 import urlopen from xml.dom.minidom import parse, parseString import sys from math import ceil from sys import argv import Foundat...
mit
-4,073,888,684,243,864,600
46.728889
172
0.589161
false
3.584446
false
false
false
kmike/tornado-slacker
test_project/settings.py
1
1318
# Django settings for test project. import os, sys PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) join = lambda p: os.path.abspath(os.path.join(PROJECT_ROOT, p)) sys.path.insert(0, join('..')) DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3'...
mit
4,513,988,263,674,335,000
26.458333
77
0.68437
false
3.388175
true
false
false
nandub/pygale
pygale/prettypuff.py
1
3972
#!/uns/bin/python import os, sys, string, re, time, string import pygale, gale_env, userinfo #------------------------------------------------------------ # Global configuration #------------------------------------------------------------ def bold_location(text): if sys.platform == 'win32': return text else: ...
lgpl-2.1
-7,324,132,790,013,130,000
27.782609
73
0.596928
false
2.839171
false
false
false
pyrou/RC-RESTserver
rcserver.py
1
2372
#!/usr/bin/env python ### BEGIN INIT INFO # Provides: RCServer # Required-Start: $syslog # Required-Stop: $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO import sys, t...
mit
1,089,731,407,478,726,400
33.882353
127
0.60371
false
2.991173
false
false
false
Sterncat/opticspy
opticspy/asphere.py
1
2551
from __future__ import division as __division__ import numpy as __np__ from numpy import sqrt as __sqrt__ from numpy import cos as __cos__ from numpy import sin as __sin__ import matplotlib.pyplot as __plt__ from matplotlib import cm as __cm__ class Coefficient(object): """ Return a set of Asphere Coefficient R,k,a...
mit
-7,405,621,237,707,080,000
26.138298
81
0.548412
false
2.176621
false
false
false
tbtraltaa/medianshape
medianshape/experiment/median/test.py
1
11430
# encoding: utf-8 ''' 2D Median surface embedded in 3D -------------------------------- ''' from __future__ import absolute_import import importlib import os import numpy as np from scipy.spatial import Delaunay from medianshape.simplicial import pointgen3d, mesh from medianshape.simplicial.meshgen import meshgen2d, ...
gpl-3.0
5,825,475,850,444,854,000
36.973422
161
0.606299
false
2.749579
false
false
false
cmjatai/cmj
sapl/api/deprecated.py
1
22559
import logging import logging from django.contrib.contenttypes.models import ContentType from django.db.models import Q from django.db.models import Q from django.forms.fields import CharField, MultiValueField from django.forms.widgets import MultiWidget, TextInput from django.http import Http404 from django.utils im...
gpl-3.0
-3,141,493,697,441,615,400
32.598507
81
0.585136
false
3.671669
false
false
false
geopython/GeoHealthCheck
GeoHealthCheck/plugins/check/checks.py
1
7291
import sys from owslib.etree import etree from GeoHealthCheck.util import CONFIG from GeoHealthCheck.plugin import Plugin from GeoHealthCheck.check import Check from html import escape """ Contains basic Check classes for a Probe object.""" class HttpStatusNoError(Check): """ Checks if HTTP status code is n...
mit
-7,148,500,976,442,429,000
25.904059
77
0.551913
false
4.389524
false
false
false
sourcesimian/vpn-porthole
vpnporthole/session.py
1
8579
import os from docker.client import from_env from pkg_resources import resource_stream from vpnporthole.ip import IPv4Subnet from vpnporthole.system import TmpDir, SystemCalls class Session(object): __dnsmasq_port = 53 __ip = None def __init__(self, settings): self.__settings = settings ...
mit
8,515,758,771,679,748,000
30.774074
104
0.484555
false
4.268159
false
false
false
atomai/lz-viewer
lz_assoc_viewer/minimum_solution.py
1
5657
import gzip import Data_reader ##REQUIRES filename is a tabix file, names is the header of the file ##MODIFIES nothing ##EFFECTS finds the position of the minimum pvalue def find_min_pvals(filename, filetype, num_minimums, region_buffer): #create a file reader from the file file_reader = Data_reader.Data_reade...
mit
4,380,884,550,379,712,500
31.886228
149
0.696836
false
3.228881
false
false
false
Onirik79/aaritmud
src/commands/command_list.py
1
9334
# -*- coding: utf-8 -*- """ Modulo del comando list, che serve a visualizzare la lista delle entità comprabili di un negoziante. """ #= IMPORT ====================================================================== from src.color import remove_colors from src.enums import SHOP, TO from src.database ...
gpl-2.0
-7,623,521,375,441,563,000
45.67
166
0.608099
false
3.335954
false
false
false
tensorflow/tensor2tensor
tensor2tensor/data_generators/timeseries_data_generator.py
1
2451
# coding=utf-8 # Copyright 2021 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
255,356,974,705,447,200
37.904762
80
0.694818
false
3.641902
false
false
false
calmjs/calmjs.parse
src/calmjs/parse/tests/test_utils.py
1
4040
# -*- coding: utf-8 -*- import unittest import tempfile from os.path import join from os.path import pardir from os.path import sep from collections import namedtuple from calmjs.parse import utils class UtilsTestCase(unittest.TestCase): def setUp(self): self.old_dist = utils.ply_dist self.py_ma...
mit
747,644,717,460,858,100
36.06422
78
0.621782
false
3.610366
true
false
false
justmao945/lab
halftoning/error-diffusion/ed.py
1
1454
#!/usr/bin/env python2 # -*- coding:utf-8 -*- ''' Here We use the Floyd Steinberg transforming matrix: | * 7 | 1/16 | | | 3 5 1 | to produce the error diffusion. Where the star (*) indicates current pixel and other elements represent the weight if pixels. See error_d...
mit
7,517,468,272,118,521,000
28.08
75
0.596974
false
2.856582
false
false
false
sigurdga/maps
maps_lib/Window.py
1
5461
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2012 Sigurd Gartmann sigurdga-ubuntu@sigurdga.no # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the F...
gpl-3.0
-782,138,757,194,549,000
41.333333
92
0.666545
false
4.283137
false
false
false
cfe-lab/Kive
kive/portal/management/commands/graph_kive.py
1
1760
import itertools import os from django.conf import settings from django.core.management import call_command from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Generates class diagrams.' def handle(self, *args, **options): if 'django_extensions' not in settings.IN...
bsd-3-clause
-1,346,922,852,982,657,500
38.111111
86
0.525
false
4.303178
false
false
false
lcpt/xc
python_modules/rough_calculations/ng_rc_section.py
1
3350
# -*- coding: utf-8 -*- __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2016, LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" from rough_calculations import ng_rebar_def from materials.sia262 import SIA262_materials from postprocess.reports import common_formats as fmt...
gpl-3.0
-4,807,855,012,892,411,000
41.923077
139
0.698029
false
2.746514
false
false
false
akrzos/cfme_tests
cfme/web_ui/__init__.py
1
121196
"""Provides a number of objects to help with managing certain elements in the CFME UI. Specifically there are two categories of objects, organizational and elemental. * **Organizational** * :py:class:`Region` * :py:mod:`cfme.web_ui.menu` * **Elemental** * :py:class:`AngularCalendarInput` * :py:class:`Angu...
gpl-2.0
5,192,834,815,882,375,000
32.996073
103
0.577915
false
3.980556
false
false
false
fersauce/prueba
recetario/principal/views.py
1
2183
from django.shortcuts import render_to_response, get_object_or_404 from django.http.response import HttpResponse, HttpResponseRedirect from principal.models import Receta, Comentario from django.contrib.auth.models import User from django.template.context import RequestContext from principal.forms import ContactoF...
gpl-2.0
2,600,570,381,765,135,400
41.66
78
0.626202
false
3.693739
false
false
false
unreal666/outwiker
plugins/diagrammer/diagrammer/libs/blockdiag/noderenderer/note.py
3
2286
# -*- coding: utf-8 -*- # Copyright 2011 Takeshi KOMIYA # # 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...
gpl-3.0
1,789,136,837,365,262,000
36.47541
78
0.590989
false
3.693053
false
false
false
dsweet04/rekall
rekall-core/rekall/plugins/common/profile_index.py
1
13574
# Rekall Memory Forensics # Copyright 2014 Google Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at # your option) any later ver...
gpl-2.0
6,259,217,831,076,171,000
34.534031
80
0.602328
false
4.494702
false
false
false
eallrich/watchword
ww/api/migrations/0002_auto_20160213_1817.py
1
2019
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('api', '0001_initial'), ] operati...
mit
6,896,003,905,374,241,000
39.38
186
0.538385
false
4.188797
false
false
false
MOOCworkbench/MOOCworkbench
git_manager/migrations/0001_initial.py
1
1495
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-02 09:52 from __future__ import unicode_literals import django.db.models.deletion import django.utils.timezone import model_utils.fields from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies ...
mit
1,464,028,200,771,823,400
38.342105
147
0.60602
false
4.295977
false
false
false
phil65/script.maps.browser
resources/lib/googleplaces.py
1
7062
# -*- coding: utf8 -*- # Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details from __future__ import absolute_import from __future__ import unicode_literals import urllib import xbmcgui from kodi65 import utils from kodi65 import addon from kodi65 i...
gpl-2.0
1,950,442,622,420,908,300
40.786982
106
0.517417
false
3.693515
false
false
false
phiedulxp/tweet_search
spider/got/manager/TweetManager.py
1
10058
import urllib,urllib2,json,re,datetime,sys,cookielib from .. import models from pyquery import PyQuery import requests import random random.seed(1) def fetch_activities(tweet_id): retusers = [] favorusers = [] re_url = 'https://twitter.com/i/activity/retweeted_popup?id=%s'%(tweet_id) favor_url = 'https://twitter.c...
mit
1,266,755,237,738,428,000
33.210884
214
0.669616
false
2.848485
false
false
false
timwoj/ctrprogress
main.py
1
1649
# -*- coding: utf-8 -*- #!/usr/bin/env python from flask import Flask, request, Response from werkzeug.routing import BaseConverter import ctrpmodels import display import ranker import rostermgmt app = Flask(__name__) app.debug = True class RegexConverter(BaseConverter): def __init__(self, url_map, *items): ...
mit
-2,181,812,599,848,570,400
23.61194
84
0.691935
false
3.421162
false
false
false
trmznt/genaf
genaf/scripts/facmd.py
1
1173
# genaf dbmgr script will override both rhombus' and fatools' dbmgr import transaction, sys from rhombus.lib.utils import cout, cerr, cexit, get_dbhandler from rhombus.scripts import setup_settings, arg_parser from fatools.scripts.facmd import ( init_argparser as fatools_init_argparser, ...
lgpl-3.0
4,359,145,294,513,377,300
21.557692
77
0.595055
false
3.45
false
false
false
Clinical-Genomics/scout
scripts/genelist_to_panel.py
1
5499
from pprint import pprint as pp import click @click.command() @click.argument("gene-list", type=click.File("r")) @click.option("--panel-name", "-n", required=True) @click.pass_context def cli(ctx, gene_list, panel_name): # Dictionary with panel_id as key panel_metadata = {} header = [] panel_genes = ...
bsd-3-clause
3,692,014,378,686,962,700
41.3
94
0.507183
false
4.26941
false
false
false
jcpeterson/Dallinger
tests/test_api.py
1
2085
"""Test python experiment API""" import random from uuid import UUID import pytest import dallinger class TestAPI(object): def test_uuid(self): from dallinger.experiment import Experiment exp_uuid = Experiment.make_uuid() assert isinstance(UUID(exp_uuid, version=4), UUID) def test_...
mit
4,388,388,590,610,283,500
32.095238
85
0.642686
false
3.716578
true
false
false
Anatoscope/sofa
applications/plugins/Compliant/examples/bielle_manivelle/scene_sml.py
1
1289
import Sofa import SofaPython import SofaPython.units import SofaPython.sml import SofaPython.SofaNumpy import Compliant.sml def createScene(node): node.dt=0.01 node.gravity=[0, -9.81, 0] node.createObject('RequiredPlugin', name = 'Compliant' ) node.createObject('CompliantAttachButtonSetting...
lgpl-2.1
-4,048,201,276,032,951,300
33.837838
98
0.72692
false
3.011682
false
false
false
MaxTyutyunnikov/lino
obsolete/src/lino/apps/spz/spz.py
1
1767
#coding: iso-8859-1 ## Copyright 2005 Luc Saffre ## This file is part of the Lino project. ## Lino 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) a...
gpl-3.0
3,422,176,852,637,496,000
27.967213
70
0.654216
false
3.688935
false
false
false
eldarion/formly
formly/models.py
1
16345
from __future__ import unicode_literals from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.db.models import Max from django.template.defaultfilters import slugify from django.urls import reverse from django.utils import ...
bsd-3-clause
1,757,393,805,897,196,000
32.425358
134
0.591374
false
3.96627
false
false
false
makuto/redditLikedSavedImageDownloader
submission.py
1
4136
# -*- coding: utf-8 -*- import pickle import os # third-party imports import jsonpickle class Submission: def __init__(self): # Source is either Tumblr or Reddit self.source = u'' self.title = u'' self.author = u'' self.subreddit = u'' self.subredditTitle = u'' ...
mit
-6,548,970,664,116,083,000
29.865672
100
0.602273
false
3.472712
false
false
false
facelessuser/subclrschm
subclrschm/lib/gui/platform_window_focus.py
1
1219
"""Platform window focus.""" from __future__ import unicode_literals import ctypes import ctypes.util from .. import util if util.platform() == "osx": appkit = ctypes.cdll.LoadLibrary(ctypes.util.find_library('AppKit')) objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('objc')) objc.objc_getClass.re...
mit
-7,847,522,584,076,326,000
33.828571
113
0.66612
false
3.482857
false
false
false
hirofumi0810/tensorflow_end2end_speech_recognition
models/recurrent/layers/bn_lstm.py
1
9995
#! /usr/bin/env python # -*- coding: utf-8 -*- """Long-Short Term Memory with Batch Normalization.""" import tensorflow as tf from tensorflow.contrib.rnn import RNNCell, LSTMStateTuple from tensorflow.python.ops import partitioned_variables from tensorflow.python.platform import tf_logging as logging from .batch_norm...
mit
-2,963,574,719,416,825,300
46.669856
100
0.574124
false
3.893318
false
false
false
vreon/figment
examples/theworldfoundry/tests/test_spatial_social.py
1
3029
import pytest from theworldfoundry.modes import ActionMode def test_move(player, courtyard): player.perform("go north") assert player.saw("Courtyard") def test_move_invalid(player, courtyard): player.perform("go fish") assert player.saw("unable") def test_move_sartre(player): player.perform("...
mit
5,833,138,179,500,380,000
28.125
83
0.683064
false
3.16841
true
false
false
veeti/decent
decent/tests/test_schema.py
1
8238
import pytest from pytest import mark from decent.schema import * from decent.error import * ## Helpers def ok(x): return x ## Empty schema def test_empty_schema_valid_value(): schema = Schema({}) assert schema({}) == {} @mark.parametrize('value', [None, object(), [], 123, True, False, "Hello"]) def t...
mit
5,056,785,840,423,585,000
22.604585
75
0.525977
false
3.69086
true
false
false
emonty/pyos
pyos/exceptions.py
1
10473
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, 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.a...
apache-2.0
5,714,773,941,973,787,000
20.417178
79
0.721283
false
4.014182
false
false
false
RiceMunk/omnifit
setup.py
1
3884
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import glob import os import sys import ah_bootstrap from setuptools import setup #A dirty hack to get around some early import/configurations ambiguities if sys.version_info[0] >= 3: import builtins else: import __builtin_...
bsd-3-clause
-5,524,028,956,380,954,000
32.196581
79
0.723738
false
3.633302
true
false
false
marto-nieto-g16/WPA_Decrypt
wpa_console.py
1
2733
import conexion_nmcli import wpa_decrypt def wpa_console(): print("\n\x1b[1;37m"+"WPA_Decrypt_Console >>", end="") comando_WPA_Decrypt = input() buscar_comandos_WPA_Decrypt(comando_WPA_Decrypt) def buscar_comandos_WPA_Decrypt(comando): #Sentencia para escanear redes inalambricas if comando == "use WPA_De...
lgpl-3.0
-4,815,598,751,162,174,000
20.023077
101
0.638492
false
2.446732
false
false
false
Neurosim-lab/netpyne
examples/NeuroMLImport/SimpleNet.py
1
2134
import opencortex.core as oc min_pop_size = 3 def scale_pop_size(baseline, scale): return max(min_pop_size, int(baseline*scale)) def generate(reference = "SimpleNet", scale=1, format='xml'): population_size = scale_pop_size(3,scale) nml_doc, network = oc.generate_network(r...
mit
-2,806,421,129,574,212,000
29.927536
66
0.365042
false
4.609071
false
false
false
AtheonAnalytics/trext
trext/db/fill.py
1
3905
from tableausdk.Exceptions import TableauException from tableausdk.Extract import Row from tableausdk.Types import Type from trext.db.utils import format_datetime, format_date, get_fake_date, get_fake_datetime class ExtractFiller(object): """ Fills the extract skeleton with cleaned and formatted data. ...
mit
4,413,232,399,961,334,300
40.542553
98
0.599744
false
4.244565
false
false
false
forcaeluz/easy-fat
flocks/migrations/0005_animalseparation.py
1
1056
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-07 20:07 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('flocks', '0004_auto_20170228_2038'), ] operations ...
gpl-3.0
-908,075,736,189,567,700
38.111111
138
0.614583
false
3.84
false
false
false
hoburg/gpkit
docs/source/examples/simple_box.py
1
1077
"Maximizes box volume given area and aspect ratio constraints." from gpkit import Variable, Model # Parameters alpha = Variable("alpha", 2, "-", "lower limit, wall aspect ratio") beta = Variable("beta", 10, "-", "upper limit, wall aspect ratio") gamma = Variable("gamma", 2, "-", "lower limit, floor aspect ratio") delt...
mit
-3,243,799,704,349,836,000
31.636364
69
0.610028
false
3.234234
false
true
false
vistadataproject/nodeVISTA
setupDocker/pySetup/rasUtilities/SCActions.py
1
53408
#--------------------------------------------------------------------------- # Copyright 2013 PwC # # 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/LICENS...
agpl-3.0
-6,406,373,654,367,182,000
35.681319
118
0.550367
false
3.264149
false
false
false
Leopardob/Kistie
kcode/kcore/kmaya/kattrs/KstAttrs.py
1
9982
''' K.I.S.T.I.E (Keep, It, Simple, Take, It, Easy) Created on 1 Jan 2013 @author: Leonardo Bruni, leo.b2003@gmail.com Kistie Attrs Class lib This Kistie implementation i's part of project 'Kistie_Autorig' by Leonardo Bruni, leo.b2003@gmail.com ''' import maya.cmds as cmds # Import KstOut import kcode.kcore.KstOut as ...
bsd-3-clause
-6,074,279,414,227,202,000
27.121127
125
0.560108
false
3.840708
false
false
false
NestarZ/rank-my-library
src/main.py
1
5177
#!/usr/bin/python # -*- coding: "utf-8"-*- import requests import os import json import time import re import sys import csv_maker import pick_best_data class Master(object): def __init__(self): time_id = str(time.strftime("%m%Y")) api_dic = self.load_apis() self.scanner = RankMyLibrary(ti...
mit
5,913,420,024,278,776,000
37.066176
107
0.554375
false
3.558076
false
false
false
ajenta/dj-oydiv
dj_oydiv/views/wsauth.py
1
7354
import logging from django.views.decorators.csrf import csrf_exempt from django.views.decorators.debug import sensitive_variables from django.core.exceptions import PermissionDenied from django.utils.crypto import constant_time_compare from django.utils.lru_cache import lru_cache from django.utils.encoding import forc...
bsd-3-clause
2,528,110,469,254,684,700
35.405941
98
0.649171
false
4.539506
false
false
false
grplyler/todo
todo.py
1
7413
#!/usr/bin/python __author__ = "Ryan Plyler" __version__ = 0.2 import sys import json import os ######################################################################## # Config ######################################################################## TODO_FILENAME = os.path.join(os.getcwd(), '.todo.list') ########...
apache-2.0
-809,055,889,478,442,900
28.652
106
0.499798
false
3.945184
false
false
false
GovReady/govready-q
controls/templatetags/system_tags.py
1
1134
from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe register = template.Library() @register.filter(is_safe=True) def json(value): # Encode value as JSON for inclusion within a <script></script> tag. # Since we are not using |escapej...
gpl-3.0
-7,210,701,244,562,800,000
42.615385
78
0.716049
false
3.9375
false
false
false
zehpunktbarron/iOSMAnalyzer
scripts/c5_tag_completeness_transport.py
1
7485
# -*- coding: utf-8 -*- #!/usr/bin/python2.7 #description :This file creates a plot: Calculates the development of the tag-completeness [%] of all "transport" POIs #author :Christopher Barron @ http://giscience.uni-hd.de/ #date :19.01.2013 #version :0.1 #usage :python pyscrip...
gpl-3.0
-5,952,892,135,643,442,000
27.568702
131
0.621777
false
2.833081
false
false
false
jonashaag/gpyconf
docs/source/conf.py
1
6613
# -*- coding: utf-8 -*- # # gpyconf documentation build configuration file, created by # sphinx-quickstart on Wed Aug 19 22:09:56 2009. # # 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. # # All...
lgpl-2.1
8,782,303,980,827,583,000
31.737624
80
0.710721
false
3.719348
true
false
false
stmobo/Machine-Learning
data-scripts/danbooru-get-prep.py
1
1760
# Requires: pybooru library # Performs 'stage 3' input retrieval: image fetching and packing import argparse import csv from pybooru import Danbooru import os import sys parser = argparse.ArgumentParser() parser.add_argument('mapfile') parser.add_argument('postfile') parser.add_argument('outfile') args = parser.pa...
mit
-5,047,568,655,934,764,000
26.5
102
0.598295
false
3.613963
false
false
false
rbalda/neural_ocr
env/lib/python2.7/site-packages/pybrain/rl/environments/twoplayergames/tasks/gomokutask.py
1
3950
__author__ = 'Tom Schaul, tom@idsia.ch' from inspect import isclass from pybrain.utilities import Named from pybrain.rl.environments.twoplayergames import GomokuGame from pybrain.rl.environments.twoplayergames.gomokuplayers import RandomGomokuPlayer, ModuleDecidingPlayer from pybrain.rl.environments.twoplayergames.g...
mit
-3,902,563,207,745,900,500
37.349515
111
0.611899
false
4.055441
false
false
false
jabesq/home-assistant
homeassistant/components/hue/light.py
1
14714
"""Support for the Philips Hue lights.""" import asyncio from datetime import timedelta import logging from time import monotonic import random import aiohue import async_timeout from homeassistant.components import hue from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, AT...
apache-2.0
-3,169,966,392,359,769,000
33.70283
79
0.596371
false
4.031233
true
false
false
jimmycallin/master-thesis
architectures/conll16st-hd-sdp/conll16_datautilities.py
1
2894
import sys from pandas import json import codecs from Common_Utilities import CommonUtilities class Conll2016DataUtilities(object): @staticmethod # Read relations data from pdtb file - relations.json # http://nbviewer.jupyter.org/github/attapol/conll16st/blob/master/tutorial/tutorial.ipynb#relations.json-...
mit
-1,207,214,612,986,828,300
40.342857
237
0.692122
false
3.229911
false
false
false
tempbottle/ghmm
ghmmwrapper/ghmm_gato/GraphUtil.py
1
13735
################################################################################ # # This file is part of Gato (Graph Animation Toolbox) # version _VERSION_ from _BUILDDATE_. You can find more information at # http://www.zpr.uni-koeln.de/~gato # # file: Graph.py # author: Alexander Schliep (schlie...
gpl-3.0
-8,783,906,233,094,782,000
27.319588
97
0.54707
false
3.403122
false
false
false
rsteed11/GAT
gat/scraping/ArabicTextExtractor/Text_Extractor.py
1
4227
import os import random from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img import numpy as np from PIL import Image import matplotlib.pyplot as plt import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Flatt...
mit
4,479,877,642,176,214,000
32.824
130
0.668796
false
3.244052
false
false
false
rivasd/djPsych
djsend/models/Instructions.py
1
3239
''' Created on Feb 24, 2016 @author: Daniel Rivas ''' from django.db import models from django.utils.translation import ugettext_lazy as l_ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django_markdown.models import MarkdownField from ...
gpl-3.0
7,438,366,763,565,597,000
61.307692
236
0.722136
false
4.22846
false
false
false
sserrot/champion_relationships
venv/Lib/site-packages/networkx/algorithms/traversal/beamsearch.py
1
3543
# beamsearch.py - breadth-first search with limited queueing # # Copyright 2016-2019 NetworkX developers. # # This file is part of NetworkX. # # NetworkX is distributed under a BSD license; see LICENSE.txt for more # information. """Basic algorithms for breadth-first searching the nodes of a graph.""" import networkx ...
mit
-1,393,016,021,845,931,300
35.153061
76
0.646909
false
4.095954
false
false
false
ecervera/ODT_Tools
web/Personalizados.py
1
4863
import tornado import tornado.ioloop import tornado.web import os, uuid __UPLOADS__ = "uploads/" import sys sys.path.append('..') from odt_parse import OdtData from odt_diff import find_style_by_name ref_name = '../libro_personalizados.odt' par_prop = ['backgroundcolor', 'textalign', 'marginleft', 'marginright', 'm...
mit
7,891,240,583,249,468,000
34.669118
129
0.532055
false
3.502527
false
false
false
jsheffie/django-auth-experiments
djauth/quickstart/views.py
1
2083
from django.shortcuts import render from django.contrib.auth.models import User, Group from rest_framework import viewsets from rest_framework.permissions import IsAuthenticated from django.contrib.auth.decorators import login_required from quickstart.serializers import UserSerializer, GroupSerializer from django.htt...
mit
-253,710,595,698,105,470
33.716667
74
0.723476
false
3.409165
false
false
false