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
rwl/PyCIM
CIM15/IEC61970/Informative/InfERPSupport/OrgErpPersonRole.py
1
3445
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
mit
-5,857,759,180,858,380,000
40.506024
175
0.697823
false
3.844866
false
false
false
OpenMined/PySyft
packages/grid/apps/worker/src/main/core/groups/group_ops.py
1
2683
# stdlib from datetime import datetime from datetime import timedelta from json import dumps from json import loads from json.decoder import JSONDecodeError import logging from secrets import token_hex # grid relative from ..codes import RESPONSE_MSG from ..database import Group from ..database import Role from ..data...
apache-2.0
-8,161,439,248,849,288,000
24.798077
61
0.71748
false
3.905386
false
false
false
priendeau/PyNOAAGeoMagIndiceHandler
build/lib.linux-x86_64-2.6/PyNOAAGeoMagIndiceHandler/GeoMagReferences.py
1
8642
from __future__ import with_statement import os, sys, re, pynav, time, datetime, pytz ,pyaeso, spharm, matplotlib,xml_marshaller, xmlbuilder from xml_marshaller import xml_marshaller from xml_marshaller.xml_marshaller import * from xmlbuilder import XMLBuilder import numpy as np from pynav import Pynav from pyaeso i...
bsd-3-clause
-6,327,240,926,643,782,000
33.293651
171
0.5891
false
3.856314
false
false
false
tarasane/h2o-3
h2o-py/tests/testdir_algos/glm/pyunit_NOPASS_random_attack_medium.py
1
4940
import sys sys.path.insert(1, "../../../") import h2o, tests import random def random_attack(): def attack(family, train, valid, x, y): kwargs = {} kwargs['family'] = family gaussian_links = ["inverse", "log", "identity"] binomial_links = ["logit"] poisson_links =...
apache-2.0
-440,998,212,565,106,400
46.5
113
0.470445
false
3.811728
false
false
false
GoogleCloudPlatform/declarative-resource-client-library
python/services/networkservices/beta/endpoint_config_selector.py
1
21391
# Copyright 2021 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
6,402,314,300,991,686,000
36.201739
157
0.663457
false
4.509064
true
false
false
romana/networking-romana
networking_romana/_i18n.py
1
1404
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
6,573,460,745,959,770,000
31.651163
78
0.730057
false
3.518797
false
false
false
caronc/nzbget-subliminal
Subliminal/pkg_resources.py
1
87985
"""Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipula...
gpl-3.0
6,505,110,880,996,614,000
31.916199
94
0.602159
false
4.255211
false
false
false
ethz-asl/segmatch
segmappy/segmappy/models/model_groups_tf.py
1
6314
import tensorflow as tf # define the cnn model def init_model(input_shape, n_classes): with tf.name_scope("InputScope") as scope: cnn_input = tf.placeholder( dtype=tf.float32, shape=(None,) + input_shape + (1,), name="input" ) # base convolutional layers y_true = tf.placeholder...
bsd-3-clause
-7,130,928,450,581,762,000
29.8
86
0.606589
false
3.387339
false
false
false
ivanlyon/exercises
kattis/k_rockscissorspaper.py
1
3696
''' Deliver state of Rock-Paper-Scissors style of Conway game of life Status: Accepted ''' ############################################################################### class RockPaperScissorsGrid(): '''Conway life-style grid''' def __init__(self, grid): self._grid = grid self._rows = len(...
mit
4,729,091,299,634,914,000
29.295082
99
0.502706
false
3.767584
false
false
false
CollabQ/CollabQ
invite/views.py
1
2741
# Copyright 2010 http://www.collabq.com # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
-7,093,654,507,555,927,000
33.708861
79
0.684422
false
3.910128
false
false
false
kayhayen/Nuitka
nuitka/nodes/ReturnNodes.py
1
6750
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
apache-2.0
6,049,847,874,321,408,000
25.162791
119
0.661185
false
4.530201
false
false
false
pdinges/python-schoof
support/profiling.py
1
11632
# -*- coding: utf-8 -*- # Copyright (c) 2010--2012 Peter Dinges <pdinges@acm.org> # # 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 la...
gpl-3.0
-6,382,795,003,153,329,000
33.11437
97
0.588635
false
4.499807
false
false
false
OxES/OxKeplerSC
src/cbvc/VBLinRegARD.py
1
3845
import numpy, sys import scipy.linalg, scipy.special ''' VBLinRegARD: Linear basis regression with automatic relevance priors using Variational Bayes. For more details on the algorithm see Apprendix of Roberts, McQuillan, Reece & Aigrain, 2013, MNRAS, 354, 3639. History: 2011: Translated by Thomas Evans from origina...
gpl-3.0
4,759,305,985,593,180,000
35.971154
108
0.584135
false
3.143908
false
false
false
google/material-design-icons
update/venv/lib/python3.9/site-packages/fontTools/misc/xmlReader.py
5
4764
from fontTools import ttLib from fontTools.misc.textTools import safeEval from fontTools.ttLib.tables.DefaultTable import DefaultTable import sys import os import logging log = logging.getLogger(__name__) class TTXParseError(Exception): pass BUFSIZE = 0x4000 class XMLReader(object): def __init__(self, fileOrPat...
apache-2.0
1,176,087,762,665,243,600
27.023529
86
0.690386
false
3.13834
false
false
false
mainakibui/dkobo
dkobo/koboform/views/survey_draft_views.py
1
11283
import json import requests import pyxform.survey_from from guardian.shortcuts import assign_perm from django.http import HttpResponseBadRequest, HttpResponse, HttpResponseRedirect from django.conf import settings from django.utils.encoding import smart_unicode from django.contrib.auth.decorators import login_required...
agpl-3.0
-7,562,220,105,088,083,000
38.869258
133
0.639901
false
3.79388
false
false
false
CollectQT/qapc
test/test_utils.py
1
5877
# builtin import os import sys ############################################################ # utils / setup ############################################################ base_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') sys.path.append(base_dir) from lib import utils, file_load ############...
agpl-3.0
-8,849,307,184,144,119,000
34.403614
95
0.65884
false
3.29798
true
false
false
diath/pyfsw
pyfsw/models/shop.py
1
2866
from sqlalchemy import Column, Integer, String, Text, ForeignKey from pyfsw import db class ShopCategory(db.Model): __tablename__ = 'shop_category' # Standard columns id = Column(Integer, primary_key=True, unique=True) name = Column(String(32)) enabled = Column(Integer, default=1) # Relationship items = db.re...
mit
-5,246,374,000,673,775,000
20.877863
64
0.684229
false
2.973029
false
false
false
justinvforvendetta/test1234
src/blockchain_processor.py
1
27894
import ast import hashlib from json import dumps, loads import os from Queue import Queue import random import sys import time import threading import urllib import deserialize from processor import Processor, print_log from utils import * from storage import Storage from utils import logger class BlockchainProcessor...
agpl-3.0
-8,479,303,598,396,417,000
32.688406
153
0.525203
false
4.118411
false
false
false
ericmjl/bokeh
bokeh/core/property/string.py
1
3831
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
7,637,204,481,124,638,000
30.661157
117
0.394936
false
5.848855
false
false
false
jacobzelek/ffprobe
ffprobe/ffprobe.py
1
12463
#!/usr/bin/python # Filename: ffprobe.py """ Python wrapper for ffprobe command line tool. ffprobe must exist in the path or in a common installation path """ version = '0.4' import subprocess import re import os import sys from os import listdir from os.path import isfile, join import json import mimetypes class FF...
mit
3,546,136,138,872,157,700
31.371429
109
0.473482
false
4.407001
false
false
false
Frky/scat
src/shell/chart/alloc.py
1
6907
#-*- coding: utf-8 -*- import os import sys import matplotlib.pyplot as plt import matplotlib.colors as colors import pylab as P import pandas as pd from .chart import Chart from .entry.alloc import AllocEntry class AllocChart(Chart): def __init__(self, oracle, *args, **kwargs): super(AllocChart, se...
mit
-6,983,431,459,954,425,000
37.586592
110
0.413638
false
3.774317
false
false
false
hjoliver/cylc
cylc/flow/scripts/trigger.py
1
2594
#!/usr/bin/env python3 # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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...
gpl-3.0
-334,009,959,158,072,200
27.822222
78
0.676561
false
3.663842
false
false
false
quarkslab/irma
probe/modules/custom/skeleton/plugin.py
1
2240
# # Copyright (c) 2013-2018 Quarkslab. # This file is part of IRMA project. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License in the top-level directory # of this distribution and at: # # http:...
apache-2.0
5,575,655,391,303,937,000
30.549296
74
0.615179
false
4.12523
false
false
false
ZeitOnline/zeit.cms
src/zeit/cms/workingcopy/browser/preview.py
1
2690
import urllib2 import urlparse import zeit.cms.browser.preview import zeit.cms.interfaces import zeit.connector.interfaces import zope.component class WorkingcopyPreview(zeit.cms.browser.preview.Preview): """Preview for workingcopy versions of content objects. This supports two modes of operation: 1. Up...
bsd-3-clause
-3,901,331,997,260,017,700
35.351351
78
0.662825
false
3.927007
false
false
false
mluscon/ci-dnf-stack
dnf-docker-test/features/steps/repo_steps.py
1
5554
from __future__ import absolute_import from __future__ import unicode_literals import glob import os import tempfile from behave import given from behave import register_type from behave import when from behave.model import Table import jinja2 import parse from whichcraft import which from command_steps import step_...
gpl-3.0
-8,378,289,381,050,230,000
28.700535
77
0.601728
false
3.762873
false
false
false
NSasquatch/vocoder
toolset.py
1
2495
# -*- coding: latin-1 -*- """ This module was created by Silas Gyger, silasgyger@gmail.com. It stands under CC BY 4.0 License. http://creativecommons.org/licenses/by/4.0/ """ import thinkdsp import numpy as np from matplotlib import pyplot class Wave(thinkdsp.Wave): def __getitem__(self, key): return self.ys[key]...
cc0-1.0
4,411,227,925,583,878,000
24.20202
116
0.694188
false
2.874424
false
false
false
nugget/python-insteonplm
insteonplm/devices/climateControl.py
1
3689
"""INSTEON Climate Control Device Class.""" import logging from insteonplm.devices import Device from insteonplm.constants import COMMAND_EXTENDED_GET_SET_0X2E_0X00 from insteonplm.messages.extendedSend import ExtendedSend from insteonplm.messages.userdata import Userdata from insteonplm.states.thermostat import ( ...
mit
-4,059,959,734,203,768,000
24.978873
87
0.548658
false
4.018519
false
false
false
johan92/yafpgatetris
string_stuff/big_string_to_mif.py
1
1180
#!/usr/bin/python import sys def print_usage( argv ): print "Creates mif file for ROM for strings.\n Input: raw file with zeros and ones.\n Output: MIF file \nUsage: %s STRING_FILE_NAME MIF_FILE_NAME" % ( sys.argv[0] ) if __name__ == "__main__": if len( sys.argv ) < 3: print_usage( sys.argv ) exit(...
mit
5,125,996,493,227,969,000
20.454545
169
0.534746
false
2.587719
false
false
false
ajyoon/brown
brown/core/brace.py
1
3241
from brown.core.multi_staff_object import MultiStaffObject from brown.core.music_font import MusicFontGlyphNotFoundError from brown.core.music_text import MusicText from brown.core.staff_object import StaffObject from brown.utils.point import Point from brown.utils.units import GraphicUnit class Brace(MultiStaffObjec...
gpl-3.0
2,192,175,412,026,653,000
39.012346
85
0.59241
false
4.031095
false
false
false
yw374cornell/e-mission-server
emission/analysis/intake/cleaning/cleaning_methods/speed_outlier_detection.py
1
1286
# Techniques for outlier detection of speeds. Each of these returns a speed threshold that # can be used with outlier detection techniques. # Standard imports import logging class BoxplotOutlier(object): MINOR = 1.5 MAJOR = 3 def __init__(self, multiplier = MAJOR, ignore_zeros = False): self.mult...
bsd-3-clause
4,354,731,408,748,637,700
34.722222
91
0.635303
false
3.289003
false
false
false
smurn/ifaddr
setup.py
1
1701
# Copyright (c) 2014 Stefan C. Mueller # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, di...
mit
8,916,418,490,596,393,000
40.512195
85
0.736626
false
4.04038
false
false
false
snower/forsun
forsun/servers/server.py
1
2811
# -*- coding: utf-8 -*- # 15/6/10 # create by: snower import logging import threading from tornado.ioloop import IOLoop, asyncio from thrift.protocol.TBinaryProtocol import TBinaryProtocolAcceleratedFactory from torthrift.transport import TIOStreamTransportFactory from torthrift.server import TTornadoServer as BaseTTo...
mit
2,440,367,594,320,221,000
33.292683
77
0.622199
false
4.085756
false
false
false
kakapocoin/kakapocoin-old
contrib/pyminer/pyminer.py
1
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
3,967,279,225,010,473,500
24.531746
84
0.648896
false
2.83062
false
false
false
yaybu/touchdown
touchdown/ssh/terminal.py
1
3244
# Copyright 2015 Isotoma Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
-4,779,550,030,188,554,000
26.965517
82
0.579531
false
3.970624
false
false
false
HumanDynamics/openbadge-analysis
openbadge_analysis/visualization/contribution.py
1
4081
import datetime from bokeh.charts import Area, output_file, show from bokeh.models.formatters import DatetimeTickFormatter from bokeh.models.widgets import Panel, Tabs def unix_time_ms(dt): """ Converts datetime to timestamp float (milliseconds) for plotting :param dt: datetime :return: timestamp flo...
mit
410,644,883,875,665,500
44.865169
120
0.616025
false
3.817587
false
false
false
ludobox/ludobox-ui
server/ludobox/history.py
2
5286
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Record and manage file changes and keep track of history. Key concepts are : - events : everytime somethin is changed, we use this event - history : the whole thread of events that applies to a page For each event, a unique SHA id is created (like git https://stackove...
agpl-3.0
-5,003,481,011,867,409,000
29.37931
127
0.644344
false
3.835994
false
false
false
cineuse/CNCGToolKit
cgtkLibs/cgtk_os/TemporaryDirectory.py
1
2998
# coding=utf8 # Copyright (c) 2016 Strack import os import warnings from tempfile import mkdtemp import logging import cgtk_log log = cgtk_log.cgtk_log(level=logging.INFO) class TemporaryDirectory(object): """ Create and return a temporary directory. This has the same behavior as mkdtemp but can be use...
mit
-9,125,791,930,769,588,000
29.907216
85
0.571714
false
4.307471
false
false
false
modcloth/tory-client
tory_client/unregister.py
1
2146
# vim:fileencoding=utf-8 import argparse import logging import os import sys from . import __version__ from .client import delete_host from .junkdrawer import HelpFormatter USAGE = """%(prog)s [options] Unregister host(s) in tory. """ EPILOGUE = """\ Examples: # Unregister a machine by name %(prog)s --name foo-ba...
mit
-5,951,089,021,157,053,000
25.493827
76
0.602982
false
3.52381
false
false
false
bitcoinfees/bitcoin-feemodel
feemodel/txmempool.py
1
32024
from __future__ import division import os import threading import sqlite3 import decimal import logging from time import time from copy import copy from itertools import groupby from operator import attrgetter, itemgetter from bitcoin.core import b2lx from feemodel.config import config, datadir, MINRELAYTXFEE, PRIOR...
mit
5,300,208,427,413,970,000
35.809195
79
0.548589
false
4.460167
false
false
false
mvaled/sentry
src/sentry/reprocessing.py
1
2078
from __future__ import absolute_import import uuid REPROCESSING_OPTION = "sentry:processing-rev" def get_reprocessing_revision(project, cached=True): """Returns the current revision of the projects reprocessing config set.""" from sentry.models import ProjectOption, Project if cached: return P...
bsd-3-clause
-1,081,322,319,088,191,900
29.115942
88
0.689124
false
4.131213
false
false
false
patpatpatpatpat/pycolfin
pycolfin/cli.py
1
1716
# -*- coding: utf-8 -*- import os from getpass import getpass import click from .pycolfin import COLFin verbosity_help = """ 1 = User ID, Last Login 2 = Display all info from 1 and portfolio summary 3 = Display all info in 1 & 2 and detailed portfolio """ use_env_vars_help = """ Use USER_ID and PASSWORD from enviro...
mit
-6,550,584,323,671,788,000
26.677419
93
0.61655
false
3.771429
false
false
false
3324fr/spinalcordtoolbox
dev/sct_register_multimodal_old/msct_register.py
1
35723
#!/usr/bin/env python # # # # --------------------------------------------------------------------------------------- # Copyright (c) 2015 NeuroPoly, Polytechnique Montreal <www.neuro.polymtl.ca> # Authors: Tanguy Magnan # Modified: 2015-07-29 # # License: see the LICENSE.TXT #==========================================...
mit
6,486,023,166,097,411,000
72.807851
220
0.683229
false
3.341721
false
false
false
divyamamgai/UdacityProjectMovieTrailerWebsite
media.py
1
3327
import webbrowser import re import urllib.request import urllib.parse import json # as keyword creates an alias for xml.etree.ElementTree as ET, so we can use ET to reference xml.etree.ElementTree. import xml.etree.ElementTree as eT class Movie: def __init__(self, title, plot, poster, trailer_url): self.t...
mit
3,126,210,087,341,528,000
54.45
115
0.637211
false
4.153558
false
false
false
mattsmart/biomodels
transcriptome_clustering/spectrums.py
1
9188
import matplotlib.pyplot as plt import numpy as np import os from inference import choose_J_from_general_form, infer_interactions, error_fn from settings import FOLDER_OUTPUT from visualize_matrix import plot_matrix def get_spectrum_from_arr(J, real=True, sort=True): # TODO deal with massive complex part if nece...
mit
5,367,572,452,356,783,000
41.734884
141
0.626034
false
3.083221
false
false
false
johnnoone/aioconsul
tests/test_common.py
1
1306
import pytest from aioconsul.common import Address, parse_addr from aioconsul.common import duration_to_timedelta, timedelta_to_duration from datetime import timedelta @pytest.mark.parametrize("a, b", [ ("10s", timedelta(seconds=10)), ("2m", timedelta(minutes=2)), ("2h", timedelta(hours=2)), ("2d", ti...
bsd-3-clause
-8,695,781,263,740,024,000
32.487179
73
0.644717
false
3.44591
false
false
false
nasa/39A
spaceapps/awards/models.py
1
1227
from django.db import models from projects.models import Project from locations.models import Location class LocalAward(models.Model): project = models.ForeignKey(Project) location = models.ForeignKey(Location) title = models.CharField(max_length=100, blank=True) def is_eligible(self): if se...
apache-2.0
4,471,971,229,118,569,000
30.487179
78
0.688672
false
3.907643
false
false
false
commaai/openpilot
selfdrive/car/honda/carstate.py
1
17654
from cereal import car from collections import defaultdict from common.numpy_fast import interp from opendbc.can.can_define import CANDefine from opendbc.can.parser import CANParser from selfdrive.config import Conversions as CV from selfdrive.car.interfaces import CarStateBase from selfdrive.car.honda.values import CA...
mit
1,605,306,792,609,832,000
41.4375
158
0.614648
false
2.774477
false
false
false
opinsys/aptirepo
aptirepo/setup.py
1
2037
# -*- coding: utf-8 -*- # aptirepo - Simple APT Repository Tool # Copyright (C) 2013,2014,2015 Opinsys # # 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...
gpl-2.0
7,825,566,279,488,568,000
36.685185
73
0.660934
false
4.078156
false
false
false
batoure/ScienceManager
App/service/data/provider.py
1
3148
#service.data.provider from service.data.factory.baseProvider import BaseProvider #TODO: Add textwrap to a query post processor from model.workflow import * class Provider(BaseProvider): def __init__(self, log, connectionSettings): self._log = log #pass to the base connectionSettings self...
mit
8,614,728,280,032,674,000
47.446154
326
0.56385
false
4.109661
false
false
false
arizvisa/syringe
lib/ptypes/__init__.py
1
1981
from . import ptype, parray, pstruct, pbinary, pint, pfloat, pstr from . import utils, dynamic, provider dyn, prov = dynamic, provider __all__ = 'ptype','parray','pstruct','pbinary','pint','pfloat','pstr','dynamic','dyn','prov' from . import config Config = config.defaults ## globally changing the ptype provider def...
bsd-2-clause
1,039,058,835,156,158,200
36.377358
103
0.714286
false
3.51865
false
false
false
YannickB/odoo-hosting
clouder_template_shinken/template.py
1
11712
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Buron # Copyright 2015, TODAY Clouder SASU # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License with Attribution # ...
agpl-3.0
-3,848,946,444,569,847,300
36.538462
79
0.518272
false
4.024742
true
false
false
agoose77/hivesystem
manual/tetris/tetris-8.py
1
10118
import copy import bee import dragonfly.pandahive from dragonfly.grid import bgrid from dragonfly.canvas import box2d import dragonfly.std, dragonfly.gen, dragonfly.random, dragonfly.logic blocks = ( bgrid(values=((0, 0), (1, 0), (2, 0), (3, 0))), # I bgrid(values=((0, 1), (0, 0), (1, 0), (2, 0))), #J b...
bsd-2-clause
6,362,046,269,218,194,000
29.113095
97
0.627496
false
3.119951
false
false
false
jmartinezchaine/OpenERP
openerp/addons/nan_account_extension/partner.py
1
6259
# -*- encoding: latin-1 -*- ############################################################################## # # Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L. All Rights Reserved. # http://www.NaN-tic.com # # WARNING: This program as such is intended to be used by professional # programme...
agpl-3.0
-3,422,568,010,201,253,000
42.465278
125
0.588752
false
4.181029
false
false
false
algorhythms/LeetCode
623 Add One Row to Tree.py
1
2451
#!/usr/bin/python3 """ Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth 1. The adding rule is: given a positive integer depth d, for each NOT null tree nodes N in depth d-1, create two tree nodes with value v as N's l...
mit
1,620,680,028,994,446,600
21.694444
80
0.550796
false
3.366758
false
false
false
janusnic/ecommerce
ecommerce/extensions/analytics/utils.py
1
2992
from functools import wraps import logging from django.conf import settings logger = logging.getLogger(__name__) def is_segment_configured(): """Returns a Boolean indicating if Segment has been configured for use.""" return bool(settings.SEGMENT_KEY) def parse_tracking_context(user): """Extract user ...
agpl-3.0
-5,083,399,345,460,941,000
34.619048
100
0.680816
false
4.323699
false
false
false
ministryofjustice/cla_backend
cla_backend/apps/legalaid/management/commands/load_contactforresearchmethods.py
1
1083
from django.core.management import BaseCommand from legalaid.models import ContactResearchMethod, PersonalDetails import uuid from cla_common.constants import RESEARCH_CONTACT_VIA class Command(BaseCommand): help = "Creates the contact for research methods default entities AND migrates data from contact_for_resea...
mit
-8,174,029,900,856,867,000
44.125
124
0.649123
false
4.26378
false
false
false
shruthiag96/ns3-dev-vns
src/lr-wpan/bindings/modulegen__gcc_LP64.py
1
418364
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
7,679,634,221,064,839,000
64.780503
448
0.616444
false
3.635798
false
false
false
panholt/sparkpy
sparkpy/models/room.py
1
4745
from .base import SparkBase, SparkProperty from .time import SparkTime from .message import SparkMessage from .membership import SparkMembership from .container import SparkContainer class SparkRoom(SparkBase): # | Start of class attributes |-------------------------------------------| API_BASE = 'https://ap...
mit
6,291,617,384,162,153,000
33.136691
79
0.525395
false
4.629268
false
false
false
prechelt/unread-decorator
setup.py
1
3307
# based on https://github.com/pypa/sampleproject/blob/master/setup.py # see http://packaging.python.org/en/latest/tutorial.html#creating-your-own-project from setuptools import setup, find_packages from setuptools.command.install import install as stdinstall import codecs import os import re import sys def find_v...
bsd-2-clause
5,754,088,370,807,579,000
32.755102
91
0.643786
false
3.890588
false
false
false
askalbania/piernik
problems/mcrwind/piernik_problem.py
1
1992
#!/usr/bin/python import sys import numpy as np import matplotlib matplotlib.use('cairo') from yt.mods import load as yt_load from pylab import * THRESHOLD = 1e-9 FIELD = "cr1" def _myplot(diff, fname, ext, clbl): v = abs(diff).max() figure(1, (6, 8)) imshow(diff, vmin=-v, vmax=v, extent=ext, cmap='RdBu'...
gpl-3.0
-1,219,925,660,328,792,000
28.294118
103
0.566767
false
2.50566
false
false
false
ccoakley/dbcbet
dbcbet/test/dbcbet_test.py
1
7562
"""Test dbcbet""" from dbcbet.dbcbet import pre, post, inv, throws, dbc, bet, finitize, finitize_method, ContractViolation, ThrowsViolation from dbcbet.helpers import state, argument_types # # These methods are the various preconditions, postconditions, and invariants used by tests # # a precondition def both_number...
mit
8,137,722,210,013,781,000
24.633898
121
0.644406
false
3.449818
true
false
false
espdev/readthedocs.org
readthedocs/restapi/views/search_views.py
1
4951
import logging from rest_framework import decorators, permissions, status from rest_framework.renderers import JSONRenderer from rest_framework.response import Response from readthedocs.builds.constants import LATEST from readthedocs.builds.models import Version from readthedocs.projects.models import Project, Projec...
mit
4,044,174,051,605,192,000
33.381944
92
0.654211
false
4.088357
false
false
false
zerothi/sids
sisl/utils/ranges.py
1
8369
import re from itertools import groupby from numpy import zeros, ones, cumsum, take, int32, int64 from numpy import asarray __all__ = ["strmap", "strseq", "lstranges", "erange", "list2str", "fileindex"] __all__ += ["array_arange"] # Function to change a string to a range of integers def strmap(func, s, start=None, ...
lgpl-3.0
-7,897,043,921,294,780,000
25.400631
83
0.50699
false
3.29618
false
false
false
wowref/wowref.com
wowref/wotlk/dbc/lib/dbcfile.py
1
3843
#!/usr/bin/env python import os from struct import Struct from .dtypes import * UNICODE_BLANK = '' class DBCRecord(object): """A simple object to convert a dict to an object.""" def __init__(self, d=None): self.data = d def __repr__(self): return "<DBCRecord %r>" % self.data def _...
mit
2,913,251,282,306,833,000
30.243902
87
0.53604
false
4.11016
false
false
false
keith-lewis100/pont-workbench
main/data_models.py
1
7503
#_*_ coding: UTF-8 _*_ import logging from google.appengine.api import users from google.appengine.ext import ndb import db import mailer import renderers import urls from role_types import RoleType logger = logging.getLogger('model') workbench = db.WorkBench.get_or_insert('main') committee_labels=[ ('AMB',...
mit
7,102,527,674,163,779,000
30.128631
95
0.603439
false
3.643516
false
false
false
josdejong/mathjs
test/benchmark/matrix_operations_python.py
1
4102
# install numpy # # sudo apt install python-pip # pip install --user --upgrade pip # pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose # import sys import timeit import numpy as np print (sys.version_info) # fiedler matrix 25 x 25 A = [ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,...
apache-2.0
-5,856,528,032,766,062,000
57.6
115
0.478303
false
1.95893
false
false
false
Krissbro/LondonGaymers
cleverbot/cleverbot.py
1
2825
try: from cleverbot import Cleverbot as _Cleverbot if 'API_URL' in _Cleverbot.__dict__: _Cleverbot = False except: _Cleverbot = False from discord.ext import commands from cogs.utils import checks from .utils.dataIO import dataIO import os import discord import asyncio class Cleverbot(): """Cle...
gpl-3.0
1,294,411,271,893,057,800
33.036145
77
0.603894
false
3.678385
false
false
false
Koodous/androguard-yara
download_androguard_report.py
1
2918
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright (c) 2015. The Koodous 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-...
apache-2.0
-8,956,185,248,688,753,000
31.411111
88
0.63387
false
3.936572
false
false
false
TUBvision/hrl
lib/graphics/graphics.py
1
12520
""" This is the HRL submodule for handling graphics devices and OpenGL. Graphics devices in HRL instantiate the 'Graphics' abstract class, which defines the common functions required for displaying greyscale images. Image presentation in HRL can be understood as a multi step process as follows: Bitmap (The image ...
lgpl-2.1
7,395,943,921,647,267,000
32.655914
106
0.640575
false
3.757503
false
false
false
PeterDing/iScript
xiami.py
1
55901
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import re import sys from getpass import getpass import os import copy import random import time import datetime import json import argparse import requests import urllib import hashlib import select from mutagen.id3 import ID3,TRCK,TIT2,TALB,TPE1,APIC,TDRC,COMM,TPOS,USLT...
mit
8,859,938,585,418,477,000
35.344532
177
0.472513
false
3.357534
false
false
false
ctsit/redcap_deployment
utility_redcap.py
1
4631
from fabric.api import * from tempfile import mkstemp import os import utility try: import configparser except: from six.moves import configparser __all__ = [] def get_current_redcap_version(): """ gets the current redcap version from database """ with settings(user=env.deploy_user): ...
bsd-3-clause
-1,521,481,576,971,571,200
37.915966
121
0.616929
false
3.562308
true
false
false
taxipp/ipp-macro-series-parser
ipp_macro_series_parser/denombrements_fiscaux/denombrements_parsers.py
1
29920
import logging import numpy import os import pandas import pkg_resources import re from ipp_macro_series_parser.config import Config config_parser = Config() xls_directory = config_parser.get('data', 'denombrements_fiscaux_xls') hdf_directory = config_parser.get('data', 'denombrements_fiscaux_hdf') log = loggi...
gpl-3.0
-7,274,436,793,316,057,000
33.142039
132
0.580588
false
3.091909
false
false
false
johnnoone/zbx
zbx/io/defaults.py
1
3539
""" zbx.io.defaults ~~~~~~~~~~~~~~~ Defines all zabbix defaults """ __all__ = ['rules', 'RuleSet'] from abc import ABCMeta from itertools import chain from six import add_metaclass @add_metaclass(ABCMeta) class RuleSet(object): def __init__(self, path, rules): self.path = path self...
bsd-3-clause
6,384,678,967,305,997,000
19.107955
62
0.473298
false
3.367269
false
false
false
th3sys/capsule
push_items.py
1
1667
from __future__ import print_function # Python 2/3 compatibility import boto3 import json import uuid import time import decimal dynamodb = boto3.resource('dynamodb', region_name='us-east-1') sec_table = dynamodb.Table('Securities') quotes_table = dynamodb.Table('Quotes.EOD') with open("quotes.json") as json_file: ...
mit
7,072,675,700,951,598,000
28.767857
68
0.577684
false
4.363874
false
false
false
skosukhin/spack
var/spack/repos/builtin/packages/clamr/package.py
1
3013
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
4,936,657,519,546,583,000
37.628205
78
0.629605
false
4.001328
false
false
false
gsnbng/erpnext
erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
2
3137
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import erpnext from frappe import _ from frappe.utils import flt,cstr from erpnext.accounts.report.financial_statements import get_period_list de...
agpl-3.0
-586,803,672,256,891,600
33.855556
120
0.671023
false
2.815978
false
false
false
droundy/deft
papers/histogram/figs/plot-convergence.py
1
5111
#!/usr/bin/python2 import matplotlib, sys matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']}) matplotlib.rc('text', usetex=True) import styles if len(sys.argv) != 7: print('useage: %s ww ff N min_T methods seed' % sys.argv[...
gpl-2.0
-6,103,449,264,001,766,000
32.847682
160
0.586774
false
2.447797
false
false
false
eshijia/magnum
magnum/api/controllers/v1/baymodel.py
1
14815
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
-8,307,967,998,542,834,000
38.193122
79
0.60351
false
4.007303
false
false
false
nitish-tripathi/Simplery
ANN/Odin_10/Network.py
1
12776
""" http://neuralnetworksanddeeplearning.com/chap1.html#implementing_our_network_to_classify_digits http://numericinsight.com/uploads/A_Gentle_Introduction_to_Backpropagation.pdf https://ayearofai.com/rohan-lenny-1-neural-networks-the-backpropagation-algorithm-explained-abf4609d4f9d """ #### Libraries # Standard libr...
mit
369,818,851,461,477,000
37.251497
124
0.560269
false
3.81829
true
false
false
kevinjqiu/jirafs
jirafs/cmdline.py
1
4707
import argparse import codecs import logging import os import sys import time from blessings import Terminal import six from verlib import NormalizedVersion from . import utils from .exceptions import ( GitCommandError, JiraInteractionFailed, JirafsError, NotTicketFolderException ) # Write data to ...
mit
8,821,853,478,044,909,000
27.70122
77
0.5273
false
3.972152
false
false
false
phamtrisi/metapp2
manage.py
1
2515
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import subprocess from flask.ext.script import Manager, Shell, Server from flask.ext.migrate import MigrateCommand from metapp2.app import create_app from metapp2.user.models import User from metapp2.meeting.models import Meeting from metapp2.meeting_...
bsd-3-clause
-5,898,075,227,168,820,000
37.106061
550
0.754672
false
3.104938
true
false
false
mogillc/theo
software/TheoTest/motor.py
1
1505
import curses import mraa import time stdscr = curses.initscr() curses.noecho() curses.cbreak() stdscr.keypad(1) stdscr.addstr(0,0,"Press 'q' to quit\n") stdscr.refresh() def set_motor(chan,en,phase): if(chan == 0): gpio = mraa.Gpio(21) gpio.dir(mraa.DIR_OUT) gpio.write(phase) gpio = mraa.Gpio(0) gpio.di...
apache-2.0
-8,672,312,592,866,148,000
17.13253
46
0.642525
false
2.134752
false
false
false
Affirm/cabot
cabot/metricsapp/models/grafana.py
1
5474
import logging import requests import urlparse from django.core.exceptions import ValidationError from django.db import models from cabot.metricsapp import defs from cabot.metricsapp.api import get_series_ids, get_panel_url logger = logging.getLogger(__name__) class GrafanaInstance(models.Model): class Meta: ...
mit
-6,052,379,822,475,333,000
35.493333
107
0.647059
false
3.879518
false
false
false
qdzzyb2014/flask-weibo
app/forms.py
1
1550
from flask.ext.wtf import Form from wtforms import TextField, BooleanField, TextAreaField, PasswordField from wtforms.validators import Required, Length, Email class LoginForm(Form): user_name = TextField('user_name', validators = [Required()]) password = PasswordField('password', validators = [Required()]) ...
bsd-3-clause
-3,858,252,173,252,549,000
38.74359
102
0.652903
false
4.189189
false
false
false
QEF/postqe
postqe/bands.py
1
4666
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Functions to calculate the electronic band structure. Note: no symmetry recognition is implemented yet. """ import numpy as np from math import fabs, sqrt from postqe.xmlfile import get_cell_data, get_calculation_data, get_band_strucure_data from postqe.constants im...
lgpl-2.1
3,263,816,706,830,989,300
39.224138
133
0.545649
false
3.12107
false
false
false
tompecina/legal
legal/uds/views.py
1
11475
# -*- coding: utf-8 -*- # # uds/views.py # # Copyright (C) 2011-19 Tomáš Pecina <tomas@pecina.cz> # # This file is part of legal.pecina.cz, a web-based toolbox for lawyers. # # This application is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published ...
gpl-3.0
4,609,566,359,525,702,000
32.601173
118
0.575929
false
3.571696
false
false
false
axiros/transcrypt
make.py
1
1049
#!/usr/bin/env python print ''' we require an index.html.tmpl next to us in this folder, into which we put the content of pandoc generated raw show.html, then write index.html with the result. ''' from time import sleep import os if __name__ == '__main__': oldstat = 0 print 'looping, checking changes of show...
apache-2.0
3,437,461,641,889,378,300
32.83871
87
0.561487
false
3.462046
false
false
false
gibbon-joel/metahive
bin/import-to-hive.py
1
28520
#!/usr/bin/python import os, sys import hashlib import MySQLdb import MySQLdb.cursors from datetime import datetime import time import shutil import magic import argparse import re sys.path.append('%s/../lib' %(os.path.dirname(__file__))) import metahivesettings.settings #from metahive.scanners mport * import metahiv...
gpl-3.0
-1,959,386,333,837,326,000
41.127031
281
0.552735
false
3.956715
false
false
false
TheProjecter/kassie
exemples/chat.py
1
3905
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # 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 copyright notice, this # l...
bsd-3-clause
-4,216,159,609,555,280,000
38.242424
79
0.732304
false
3.493705
false
false
false
IsCoolEntertainment/debpkg_python-boto
boto/route53/connection.py
1
16973
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # Copyright (c) 2012 42 Lines Inc., Jim Browne # # Permission is hereby granted, free of charge, to any person obtaining a # copy...
mit
573,871,493,404,455,400
38.38051
94
0.567548
false
4.49735
false
false
false
CountZer0/PipelineConstructionSet
python/common/core/globalVariables.py
1
1227
''' Author: Jason Parks Created: Apr 22, 2012 Module: common.core.globalVariables Purpose: to import globalVariables ''' # Location of Toolset #toolsLocation = '/Users/jasonparks/Documents/workspace/PipelineConstructionSet' toolsLocation = 'C:/Users/jason/git/PipelineConstructionSet' # NOTE!: It is necessary to m...
bsd-3-clause
4,143,952,701,070,569,500
27.55814
80
0.764466
false
3.361644
false
false
false
veter-team/mechspeak
src/imshow.py
1
1438
import os, sys import io import Tkinter import Image, ImageTk from time import sleep import cStringIO import paho.mqtt.client as mqtt host = "test.mosquitto.org" #host = "localhost" qos = 0 sensors_topic = "/rtmsg/d25638bb-17c2-46ac-b26e-ce1f67268088/sensors/" camera_topic = sensors_topic + "camera1" imgcnt = 0 def...
mit
-6,768,945,433,732,105,000
25.62963
77
0.666898
false
3.126087
false
false
false
hariseldon78/Teacup_gen3_customized
createTemperatureLookup.py
1
6248
#!/usr/bin/python # -*- coding: utf-8 -*- # # Creates a C code lookup table for doing ADC to temperature conversion # on a microcontroller # based on: http://hydraraptor.blogspot.com/2007/10/measuring-temperature-easy-way.html # Modified Thu 10 Feb 2011 02:02:28 PM MST jgilmore for 5D_on_arduino firmware # temps are no...
gpl-2.0
-2,905,846,211,853,608,000
39.044872
154
0.638547
false
2.829257
false
false
false
jtraver/dev
python/graphics/circles8.py
1
24535
#!/usr/bin/python # http://mcsp.wartburg.edu/zelle/python/graphics.py # https://mcsp.wartburg.edu/zelle/python/graphics/graphics/index.html import math from graphics import * XSCALE = 2550 YSCALE = 1310 XCENTER = XSCALE / 2 YCENTER = YSCALE / 2 # https://en.wikipedia.org/wiki/Incircle_and_excircles_of_a_triangle#...
mit
1,088,411,825,872,629,100
30.33461
202
0.539352
false
2.628281
false
false
false
ucloud/uai-sdk
uaitrain/operation/pack_docker_image/pytorch_pack_op.py
1
1534
# Copyright 2017 The UAI-SDK 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 applicable...
apache-2.0
1,090,517,671,928,776,800
50.133333
178
0.614081
false
3.79703
false
false
false
Alex9029/awesomeTHz-Python-webapp
www/models.py
1
1470
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Models for user, blog and comment. ''' __author__ = 'Chalex' import time, uuid from transwarp.db import next_id from transwarp.orm import Model, StringField, BooleanField, FloatField, TextField class User(Model): __table__ = 'users' id = StringField(primary_key=...
gpl-2.0
-2,106,225,807,252,490,500
29.645833
81
0.710884
false
3.043478
false
false
false
eubr-bigsea/tahiti
migrations/versions/c6x2kllv52os_sklearn_operations.py
1
5027
# -*- coding: utf-8 -*- """Adding Scikit-learn Operations Revision ID: c6x2kllv52os Revises: bca9291ljsj5 Create Date: 2018-06-14 10:42:09.555626 """ from alembic import context from alembic import op from sqlalchemy import String, Integer, Text from sqlalchemy.orm import sessionmaker from sqlalchemy.sql import tabl...
apache-2.0
-6,946,335,271,519,121,000
25.046632
64
0.527153
false
3.429059
false
false
false
MizzouCMMSGroup1/ChromosomeModel
src/conjugate_gradient_plot.py
1
4967
# some imports we use import numpy import random import math from scipy import optimize # matplot lib import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt # our data dimension (*xyz), we are using megabase resolution NUMBER_CONTACTS = 157 NUMBER_CONTACTS_...
gpl-2.0
1,627,960,150,278,846,200
25.280423
122
0.624723
false
3.041641
false
false
false
wrgeorge1983/Pystol
_iactive.py
1
15584
#! /usr/bin/python """ Created on Mar 26, 2015 @author: William.George Credit to /r/Python for the non-wasteful and sensible handling of oldInit and newInit """ # Standard Library Imports import os import sys import json from pprint import pprint # Not used here, but we want it in interactive mode. import time f...
lgpl-2.1
5,891,277,525,246,864,000
29.920635
104
0.563976
false
3.832759
false
false
false
springmerchant/pybbm
pybb/migrations/0003_auto_20150424_0918.py
1
1054
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from pybb.models import create_or_check_slug def fill_slugs(apps, schema_editor): Category = apps.get_model("pybb", "Category") Forum = apps.get_model("pybb", "Forum") Topic = apps.get_model("pybb", "...
bsd-2-clause
-3,424,356,357,889,820,000
29.114286
87
0.647059
false
3.536913
false
false
false