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
borjam/exabgp
src/exabgp/configuration/process/parser.py
3
2367
# encoding: utf-8 """ parse_process.py Created by Thomas Mangin on 2015-06-18. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ import os import stat def encoder(tokeniser): value = tokeniser() if value not in ('text', 'json'): raise Val...
bsd-3-clause
-5,532,249,543,314,461,000
29.346154
108
0.572877
false
3.376605
false
false
false
mogproject/javactl
src/javactl/setting/setting.py
1
3543
from __future__ import division, print_function, absolute_import, unicode_literals import subprocess from itertools import chain import yaml import six from mog_commons.case_class import CaseClass from mog_commons.functional import oget from javactl.setting import arg_parser from javactl.setting.app_setting import App...
apache-2.0
1,006,830,342,674,333,800
34.787879
118
0.57917
false
3.817888
true
false
false
mtils/ems
examples/qt4/gui/persondata_form.py
1
1430
from PyQt4.QtCore import pyqtSignal, Qt from PyQt4.QtGui import QTableView, QApplication, QWidget, QVBoxLayout from PyQt4.QtGui import QLineEdit, QSpinBox, QDoubleSpinBox, QCheckBox class PersonDataForm(QWidget): def __init__(self, parent=None): super(PersonDataForm, self).__init__(parent) self...
mit
1,340,399,645,659,060,200
31.522727
70
0.688811
false
3.896458
false
false
false
iocoop/beancount
src/python/beancount/projects/returns.py
1
39336
#!/usr/bin/env python3 """Compute the returns of a portfolio. A document exists to describe the problem in more detail. http://furius.ca/beancount/doc/portfolio-returns Calculating the returns is carried out by identifying the entries whose accounts match a regular expression that defines accounts to consider for val...
gpl-2.0
-4,277,765,693,550,496,000
44.265823
92
0.651312
false
4.415806
false
false
false
qedsoftware/commcare-hq
corehq/ex-submodules/pillowtop/utils.py
1
8673
from __future__ import division from collections import namedtuple from datetime import datetime import sys import simplejson from django.conf import settings from dimagi.utils.chunked import chunked from dimagi.utils.modules import to_function from pillowtop.exceptions import PillowNotFoundError from pillowtop.log...
bsd-3-clause
5,279,701,245,204,028,000
31.977186
104
0.630462
false
3.746436
true
false
false
UKTradeInvestment/export-wins-data
mi/views/sector_views.py
1
13377
import operator from collections import defaultdict from itertools import groupby from operator import itemgetter from functools import reduce from django.db.models import Q from mi.models import ( HVCGroup, SectorTeam, Target, ) from mi.utils import sort_campaigns_by from mi.views.base_view import BaseWi...
gpl-3.0
1,905,772,124,081,800,700
35.85124
113
0.59707
false
3.523973
false
false
false
siggame/webserver
webserver/codemanagement/migrations/0001_initial.py
1
11020
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'BaseClient' db.create_table('codemanagement_baseclient', ( ('id', self.gf('djang...
bsd-3-clause
39,099,764,303,162,850
72.473333
205
0.564791
false
3.735593
false
false
false
Yukarumya/Yukarum-Redfoxes
testing/mozharness/configs/marionette/windows_config.py
1
1876
# This is a template config file for marionette production on Windows. import os import sys config = { # marionette options "marionette_address": "localhost:2828", "test_manifest": "unit-tests.ini", "virtualenv_python_dll": 'c:/mozilla-build/python27/python27.dll', "virtualenv_path": 'venv', "...
mpl-2.0
-4,901,755,299,401,112,000
31.344828
104
0.541045
false
3.506542
false
false
false
sujoykroy/motion-picture
editor/MotionPicture/shapes/polygon_shape.py
1
17847
from ..commons import * from .shape import Shape from xml.etree.ElementTree import Element as XmlElement from .mirror import * class PolygonFormRenderer(object): def __init__(self, polygon_shape, form_name): self.polygon_shape = polygon_shape self.form_name = form_name def get_name(self): ...
gpl-3.0
-8,440,537,538,768,513,000
38.052516
155
0.579313
false
3.639274
false
false
false
xylsxyls/xueyelingshuang
src/StockCharge/scripts/rebuild_StockCharge.py
1
14091
#!python3 # -*- coding:utf-8 -*- import os import sys import time import ctypes import shutil import subprocess IsPy3 = sys.version_info[0] >= 3 if IsPy3: import winreg else: import codecs import _winreg as winreg BuildType = 'Release' IsRebuild = True Build = 'Rebuild' Update = False Copy = False CleanAl...
mit
-750,922,354,675,817,100
37.267606
195
0.592565
false
3.412459
false
false
false
jrwdunham/old
onlinelinguisticdatabase/controllers/morphologybackups.py
1
3615
# Copyright 2016 Joel Dunham # # 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 writi...
apache-2.0
6,412,872,504,120,479,000
31.276786
80
0.673306
false
3.937908
false
false
false
ddolzhenko/jacis
jacis/plugins/sync.py
1
2555
# Copyright (c) 2016 Dmitry Dolzhenko # 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, dis...
mit
-6,273,259,057,196,582,000
28.034091
80
0.609785
false
4.134304
false
false
false
SamR1/FitTrackee
fittrackee/tests/workouts/test_stats_api.py
1
28228
import json from flask import Flask from fittrackee.users.models import User from fittrackee.workouts.models import Sport, Workout from ..api_test_case import ApiTestCaseMixin class TestGetStatsByTime(ApiTestCaseMixin): def test_it_gets_no_stats_when_user_has_no_workouts( self, app: Flask, user_1: User...
gpl-3.0
8,299,335,675,569,371,000
30.752531
106
0.459933
false
3.778343
true
false
false
Pulgama/supriya
supriya/realtime/BufferProxy.py
1
8402
from supriya.system.SupriyaValueObject import SupriyaValueObject class BufferProxy(SupriyaValueObject): """ A buffer proxy. Acts as a singleton reference to a buffer on the server, tracking the state of a single buffer id and responding to `/b_info` messages. Multiple Buffer instances reference a...
mit
5,936,076,998,342,375,000
25.421384
88
0.46239
false
4.353368
false
false
false
bmcfee/librosa
librosa/util/utils.py
1
64787
#!/usr/bin/env python # -*- coding: utf-8 -*- """Utility functions""" import warnings import scipy.ndimage import scipy.sparse import numpy as np import numba from numpy.lib.stride_tricks import as_strided from .._cache import cache from .exceptions import ParameterError # Constrain STFT block sizes to 256 KB MAX_M...
isc
7,209,555,656,217,250,000
28.85576
97
0.55437
false
3.310526
false
false
false
YeoLab/anchor
anchor/simulate.py
1
7366
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import six from .visualize import violinplot, MODALITY_ORDER, MODALITY_TO_COLOR, barplot def add_noise(data, iteration_per_noise=100, noise_percentages=np.arange(0, 101, step=10), plot=True, vio...
bsd-3-clause
420,001,587,235,702,700
36.969072
79
0.541271
false
3.707096
false
false
false
vmware/nsxramlclient
tests/vdnConfig.py
1
5003
# coding=utf-8 # # Copyright © 2015 VMware, Inc. All Rights Reserved. # # 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, co...
mit
-3,320,439,694,685,947,400
44.472727
119
0.691523
false
4.0209
true
false
false
SuperTaiyaki/paifu-tools
paifu.py
1
3158
import sys import tenhou tilelist = [] for x in range(0, 9): # tilelist.append(Image(source="%sm.gif" % (x+1))) tilelist.append("images/%sm.gif" % (x+1)) for x in range(0, 9): # tilelist.append(Image(source="%sp.gif" % (x+1))) tilelist.append("images/%sp.gif" % (x+1)) for x in range(0, 9)...
gpl-3.0
5,382,463,694,418,564,000
26.946903
85
0.629512
false
2.713058
false
false
false
lpostema/gb
mpg.py
1
5041
import xml.etree.ElementTree as ET import os, shutil import datetime import openpyxl tree = ET.parse('Meeting Plan Generator.xml') root = tree.getroot() from PyPDF2.PyPDF2.pdf import PdfFileReader while 1: today = datetime.date.today() daysToNextWednesday = datetime.timedelta((2 - datetime.date.weekday(today)) % 7)...
mit
7,598,594,523,916,201,000
39.328
145
0.674668
false
3.252258
false
false
false
City-of-Turku/living-environment
assignments/migrations/0001_initial.py
1
11292
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-05 08:31 from __future__ import unicode_literals import ckeditor_uploader.fields from django.db import migrations, models import django.db.models.deletion import django.db.models.manager import djgeojson.fields class Migration(migrations.Migration): ...
mit
-4,986,980,694,649,352,000
49.864865
207
0.574389
false
4.369969
false
false
false
mousebrains/kayak
scripts/MyLogger.py
1
1526
# # Construct a logger given a standard set of command line arguments # # Oct-2019, Pat Welch, pat@mousebrains.com import logging import logging.handlers import argparse def addArgs(parser: argparse.ArgumentParser): """ Add my options to an argparse object """ grp = parser.add_argument_group('Log related opti...
gpl-3.0
9,128,426,470,440,183,000
36.219512
84
0.655963
false
4.069333
false
false
false
AndreasHeger/alignlib
python/tests/test_Weightor.py
1
2035
# alignlib - a library for aligning protein sequences # # $Id: test_Alignment.py,v 1.3 2004/01/23 17:34:58 aheger Exp $ # # Copyright (C) 2004 Andreas Heger # # 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 Softw...
gpl-2.0
-4,634,471,113,660,650,000
27.263889
77
0.69828
false
3.733945
true
false
false
spacetelescope/stsci.tools
doc/source/conf.py
1
7012
# -*- coding: utf-8 -*- # # stsci.tools documentation build configuration file, created by # sphinx-quickstart on Thu Oct 7 13:09:39 2010. # # 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. # #...
bsd-3-clause
5,569,319,190,764,758,000
32.550239
81
0.698945
false
3.713983
true
false
false
glenjarvis/Lemonade
src/tests/line_entry_tests.py
1
4202
#!/usr/bin/env python # pylint: disable=R0904,W0142,C0103 """Unit Tests for the core data structures""" import datetime import decimal import unittest try: # Help bootstrap (If PYTHONPATH isn't set); pylint: disable=W0611 from bootstrap import lemonade except ImportError: pass from lemonade import models...
bsd-3-clause
-2,796,069,170,766,348,000
32.616
72
0.642551
false
3.930776
true
false
false
dpazel/music_rep
tests/transformation_tests/functions_tests/tonalfunctions_tests/test_tonality_permutation.py
1
1747
import logging import sys import unittest from tonalmodel.diatonic_tone import DiatonicTone from tonalmodel.diatonic_tone_cache import DiatonicToneCache from tonalmodel.modality import ModalityType from tonalmodel.tonality import Tonality from transformation.functions.tonalfunctions.tonality_permutation import Tonalit...
mit
-446,554,344,934,845,200
34.653061
92
0.643389
false
2.991438
true
false
false
vashzsun/fund_analysis
fund_data/dataProcess.py
1
2664
__author__ = 'Seven1' import json import os,sys sys.path.insert(0,os.path.dirname(sys.path[0]))#外部设置项目目录为搜索路径, 确保正确的包引用 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fund_analysis.settings") #导入django设置, 才能正常运行 from fund_data.models import FundInfo from datetime import datetime class FundProcess: fund_count = ...
apache-2.0
-5,527,066,548,660,461,000
40.596774
118
0.616757
false
3.483784
false
false
false
dtaht/Gnugol
src/prototypes/wikipedia.py
1
1543
"""ajaxgoogle.py - Simple bindings to the AJAX Google Search API (Just the JSON-over-HTTP bit of it, nothing to do with AJAX per se) http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje brendan o'connor - gist.github.com/28405 - anyall.org""" try: import json except ImportError: import s...
agpl-3.0
-4,324,721,340,066,622,500
30.489796
111
0.669475
false
3.086
false
false
false
six8/polydatum
tests/test_deferred_attr_requests.py
1
3758
from polydatum.middleware import DalCommand, PathSegment def test_deferred_attribute_access(path_segment_factory): """ Verify that we can access non-existent attributes on this class and that we can access arbitrarily deep non-existent attributes. """ dc = DalCommand(lambda: None, path_segment_fac...
mit
-713,534,040,373,195,000
34.45283
91
0.684673
false
3.807497
true
false
false
ngcurrier/ProteusCFD
GUI/dakotaHistogram.py
1
1543
#!/usr/bin/python import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt #reads a space delimited file with a header and returns a dictionary #attempts to cast dictionary entries into floats, if it fails, leaves as is def readSpaceDelimitedFile(filename): f = open(filename, 'r') hea...
gpl-3.0
-5,997,161,604,594,002,000
27.054545
110
0.588464
false
3.514806
false
false
false
Stillbot/stillbot-master
stillbot_master/brew_master/migrations/0001_initial.py
1
5383
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Wash' db.create_table(u'brew_master_wash', ( ...
mit
1,910,240,296,851,859,700
51.784314
193
0.597994
false
3.481889
false
false
false
smARTLab-liv/smartlabatwork-release
slaw_navigation/nodes/OdomScanMovePidMonitor.py
1
9756
#!/usr/bin/env python import rospy import actionlib from sensor_msgs.msg import LaserScan from geometry_msgs.msg import Twist, Pose2D, PoseStamped from nav_msgs.msg import Odometry from math import pi from slaw_actions.msg import * from slaw_srvs.srv import * import sys, select import tf odom = "/odom" base_frame ...
mit
3,655,064,771,487,684,000
33.111888
150
0.566318
false
3.417163
false
false
false
ecell/ecell3
ecell/frontend/session-monitor/ecell/ui/osogo/PluginInstanceSelection.py
1
4155
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # # This file is part of the E-Cell System # # Copyright (C) 1996-2016 Keio University # Copyright (C) 2008-2016 RIKEN # Copyright (C) 2005-2009 The Molecular Sciences Institute # #:::::::::::::::::::::::::::::::::::::::...
lgpl-3.0
-3,517,433,269,376,377,000
35.447368
117
0.657762
false
3.794521
false
false
false
Diyago/Machine-Learning-scripts
DEEP LEARNING/segmentation/Severstal-Steel-Defect-Detection-master/common_blocks/new_metrics.py
1
15642
from functools import partial import numpy as np import torch from catalyst.dl import Callback, RunnerState, MetricCallback, CallbackOrder from pytorch_toolbelt.utils.catalyst.visualization import get_tensorboard_logger from pytorch_toolbelt.utils.torch_utils import to_numpy from pytorch_toolbelt.utils.visualization i...
apache-2.0
-3,970,310,224,794,670,000
30.663968
106
0.557346
false
3.785576
false
false
false
UdeM-LBIT/GAPol
lib/ga/evolve/Statistics.py
1
3790
""" :mod:`Statistics` -- statistical structure module ========================================================================== This module have the class which is reponsible to keep statistics of each generation. This class is used by the adapters and other statistics dump objects. """ class Statistics(object): ...
gpl-3.0
1,006,134,403,794,346,400
29.079365
81
0.531662
false
4.192478
false
false
false
OpenLD/enigma2-wetek
lib/python/Components/Label.py
2
2938
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from VariableText import VariableText from skin import parseColor from ConditionalWidget import ConditionalWidget, BlinkingWidget, BlinkingWidgetConditional from enigma import eLabel class Label(VariableText, HTMLComponent, GUIComponent): ...
gpl-2.0
8,018,108,897,620,954,000
28.38
90
0.714772
false
3.464623
false
false
false
liosha2007/temporary-groupdocs-python-sdk
groupdocs/models/GetJobDocumentsResponse.py
1
1163
#!/usr/bin/env python """ Copyright 2012 GroupDocs. 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,656,528,289,130,414,600
29.605263
77
0.649183
false
4.542969
false
false
false
coffenbacher/askbot-devel
askbot/conf/login_providers.py
1
4822
""" External service key settings """ from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import LOGIN_USERS_COMMUNICATION from askbot.deps import livesettings from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from askbot.skins import...
gpl-3.0
4,586,453,438,708,427,000
26.872832
110
0.620075
false
3.98842
false
false
false
Keeper-Security/Commander
keepercommander/commands/folder.py
1
27728
#_ __ # | |/ /___ ___ _ __ ___ _ _ ® # | ' </ -_) -_) '_ \/ -_) '_| # |_|\_\___\___| .__/\___|_| # |_| # # Keeper Commander # Copyright 2018 Keeper Security Inc. # Contact: ops@keepersecurity.com # import argparse import collections import re import fnmatch import shutil import functools import os impor...
mit
2,125,853,120,449,270,300
43.151274
143
0.564612
false
4.108312
false
false
false
SpheMakh/Stimela
stimela/utils/logger.py
1
9243
import os import sys import json import yaml import time import subprocess from io import StringIO import codecs from datetime import datetime import logging class StimelaLogger(object): def __init__(self, lfile, jtype="docker"): self.lfile = lfile # Create file if it does not exist if no...
gpl-2.0
-8,592,159,329,044,198,000
36.726531
118
0.523315
false
3.928177
false
false
false
betatim/BlackBox
skopt/benchmarks.py
2
2905
# -*- coding: utf-8 -*- """A collection of benchmark problems.""" import numpy as np def bench1(x): """A benchmark function for test purposes. f(x) = x ** 2 It has a single minima with f(x*) = 0 at x* = 0. """ return x[0] ** 2 def bench1_with_time(x): """Same as bench1 but returns the...
bsd-3-clause
-179,938,327,806,750,200
28.30303
80
0.493278
false
2.74456
false
false
false
nens/threedi-qgis-plugin
tool_commands/import_sufhyd/command.py
1
1869
# (c) Nelen & Schuurmans, see LICENSE.rst. from ThreeDiToolbox.tool_commands.custom_command_base import CustomCommandBase from ThreeDiToolbox.tool_commands.import_sufhyd.import_sufhyd_dialog import ( ImportSufhydDialogWidget, ) from ThreeDiToolbox.tool_commands.import_sufhyd.import_sufhyd_main import Importer from...
gpl-3.0
3,497,820,233,301,370,400
28.203125
82
0.632959
false
3.723108
false
false
false
tensorflow/model-analysis
tensorflow_model_analysis/metrics/query_statistics.py
1
5733
# Lint as: python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
8,918,842,333,226,113,000
35.987097
79
0.68097
false
4.130403
false
false
false
alipsgh/tornado
classifier/knn.py
1
3526
""" The Tornado Framework By Ali Pesaranghader University of Ottawa, Ontario, Canada E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com """ import math import operator from classifier.classifier import SuperClassifier from dictionary.tornado_dictionary import * def calculate_euclide...
mit
-5,455,539,386,922,168,000
33.26
116
0.590471
false
3.61641
false
false
false
cassm/will-o-the-wisp
control/coordGen.py
1
3517
#!/usr/bin/env python import math spherical = (( 60, 6), ( 20, 30), ( 45, 48), ( 75, 18), (100, 348), (300, 6), (260, 348), (285, 18), (315, 48), (340, 30), (180, 328), (140, 333), (165, 300), (195, 300), (220, 333), (120, 318), ( 95, 338), (109, 238), (131, 258), (145...
gpl-3.0
-4,612,539,939,116,090,000
42.9625
315
0.538243
false
2.584129
false
false
false
arthur-wsw/pinax-messages
pinax/messages/models.py
1
3535
from __future__ import unicode_literals from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from .signals import message_sent from .utils import cached_attribute @py...
mit
-1,266,326,399,180,898,000
30.283186
86
0.662235
false
3.989842
false
false
false
costadorione/purestream
servers/wstream.py
1
2905
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para wstream.video # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # by DrZ3r0 # ------------------------------------------------------------ import re import time from core import ...
gpl-3.0
-5,926,413,901,338,739,000
35.3
97
0.59022
false
3.223085
false
false
false
brianhouse/48to16
data_compilation/compile_audio.py
1
2894
#!/usr/bin/env python3 import sys, os, datetime, calendar, compile_gpx, pytz import numpy as np from scipy.io import wavfile from housepy import log, config, util, drawing, science, crashdb MEDIA_LENGTH = 2090.43 # hack per video to get everything to match correctly log.info("Starting...") if len(sys.argv) < 2 or n...
gpl-3.0
2,976,564,731,689,203,700
32.651163
123
0.676572
false
2.88247
false
false
false
Titan-C/helpful_scripts
bank.py
1
1745
#!/usr/bin/env python3 # -*- coding: utf-8 -*- r""" Parse Bank statement ==================== From CSV to ledger """ # Created: Sat May 18 18:32:47 2019 # Author: Óscar Nájera # License: GPL-3 import argparse import csv import shlex import subprocess from datetime import datetime from collections import namedtuple ...
gpl-2.0
6,765,909,570,841,811,000
25.014925
143
0.576018
false
3.417647
false
false
false
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/mgtv.py
1
1936
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import int_or_none class MGTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?mgtv\.com/(v|b)/(?:[^/]+/)*(?P<id>\d+)\.html' IE_DESC = '芒果TV' _TESTS = [{ 'url': 'http://www....
gpl-3.0
-7,085,355,701,742,426,000
26.323529
80
0.613563
false
2.425587
false
false
false
vipmike007/avocado-vt
virttest/remote_commander/remote_runner.py
1
26020
#!/usr/bin/env python ''' Created on Dec 6, 2013 :author: jzupka ''' import os import sys import select import time import stat import gc import logging import traceback import subprocess import string import random import shutil import signal import remote_interface import messenger as ms from .. import data_dir ...
gpl-2.0
2,264,865,371,130,327,300
33.693333
79
0.500346
false
3.931701
false
false
false
cranmer/parametrized-learning
taylor/rootnotes.py
1
1776
""" Helper module for displaying ROOT canvases in ipython notebooks Usage example: # Save this file as rootnotes.py to your working directory. import rootnotes c1 = rootnotes.default_canvas() fun1 = TF1( 'fun1', 'abs(sin(x)/x)', 0, 10) c1.SetGridx() c1.SetGridy() fun1.Draw() c1 Mo...
bsd-2-clause
3,037,486,907,410,603,500
24.73913
79
0.679617
false
3.160142
false
false
false
LeMinaw/minaw.net
register/views.py
1
2544
from django.shortcuts import render from django.http import HttpResponse from django.db import IntegrityError from urllib.request import urlopen from hashlib import sha256 from os import environ from register.models import * from register.forms import * from register.data impo...
gpl-3.0
-9,158,853,954,189,569,000
40.032258
155
0.550708
false
4.642336
false
false
false
seung-lab/cloud-volume
cloudvolume/sharedmemory.py
1
6678
from collections import defaultdict import errno import math import mmap import os import sys import time import multiprocessing as mp from six.moves import range import numpy as np from .lib import Bbox, Vec, mkdir SHM_DIRECTORY = '/dev/shm/' EMULATED_SHM_DIRECTORY = '/tmp/cloudvolume-shm' EMULATE_SHM = not os.pa...
bsd-3-clause
8,071,328,143,072,678,000
31.26087
126
0.698113
false
3.718263
false
false
false
johnzhd/gpsmap
gpsmap/db_build.py
1
2339
import pymongo import backend def clear_db(): connect = pymongo.MongoClient(backend.global_db_url) db = connect.get_database(backend.global_db_name) l = [backend.global_db_origin_collection, backend.global_db_user_collection, backend.global_db_device_collection, backend....
mit
-161,816,340,701,660,770
37.344262
75
0.619923
false
3.76045
false
false
false
wujinjun/TFbook
chapter5/mnist_lenet5.py
1
3795
from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf mnist = input_data.read_data_sets("MNIST_data/",one_hot = True) #导入数据 sess = tf.InteractiveSession() #开启一个Session def weight_variable(shape): #定义一个权重变量 initial = tf.truncated_normal(shape,stddev=0.1) #初始化一个正态分布噪声,标准差为0....
gpl-3.0
2,415,551,180,797,597,700
46.967213
130
0.697094
false
1.730769
false
false
false
Pablo126/SSBW
Entrega1/lib/python3.5/site-packages/rest_framework_mongoengine/serializers.py
1
26652
import copy from collections import OrderedDict from mongoengine import fields as me_fields from mongoengine.errors import ValidationError as me_ValidationError from rest_framework import fields as drf_fields from rest_framework import serializers from rest_framework.compat import unicode_to_repr from rest_framework.u...
gpl-3.0
1,645,354,205,993,523,200
40.193199
200
0.612112
false
4.372765
false
false
false
buddly27/champollion
source/champollion/parser/__init__.py
1
4953
# :coding: utf-8 """Parser to fetch_environment all information from a :term:`Javascript` API in order to document each element from a simple identifier. """ import os from .js_module import fetch_environment as fetch_module_environment from .js_file import fetch_environment as fetch_file_environment def fetch_env...
apache-2.0
6,289,349,344,982,780,000
29.763975
85
0.424187
false
4.813411
false
false
false
OscarPDR/projects_morelab
semantic_search/views.py
1
3334
# coding: utf-8 from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.db.models import Sum, Min, Max from funding_programs.models import FundingProgram from p...
gpl-3.0
490,549,498,301,055,040
31.057692
108
0.562088
false
4.296392
false
false
false
suizokukan/anceps
anceps/hypotheses/hypothesis.py
1
2479
#!/usr/bin/python3 # -*- coding: utf-8 -*- ################################################################################ # Anceps Copyright (C) 2014 Suizokukan # Contact: suizokukan _A.T._ orange dot fr # # This file is part of Anceps. # Anceps is free software: you can redistribute it and/or modify # ...
gpl-3.0
2,962,457,779,593,664,500
35.397059
85
0.479596
false
4.634831
false
false
false
ThorbenJensen/wifi-locator
src/utils_classification.py
1
2437
"""Module provides classification of signals and evaluates models.""" from random import randrange import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import VotingClassifier from sklearn.ensemble.weight_boosting import AdaBoostClassifier from sklearn.model_selection import c...
apache-2.0
3,913,671,588,780,409,000
40.305085
79
0.656545
false
4.014827
false
false
false
GoogleCloudPlatform/PerfKitBenchmarker
tests/windows_packages/psping_test.py
1
3148
# Copyright 2018 PerfKitBenchmarker 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 appli...
apache-2.0
4,444,765,474,757,845,000
31.122449
77
0.681703
false
3.635104
true
false
false
PerceptumNL/ReadMore
readmore/content/migrations/0002_auto__chg_field_category_image.py
1
4637
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding M2M table for field categories on 'Article' m2m_table_name = db....
agpl-3.0
5,551,660,695,694,228,000
63.416667
199
0.585292
false
3.659826
false
false
false
LandRegistry/casework-frontend-alpha
migrations/versions/4a0b77571480_.py
1
1499
"""empty message Revision ID: 4a0b77571480 Revises: None Create Date: 2014-07-28 14:50:21.815680 """ # revision identifiers, used by Alembic. revision = '4a0b77571480' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
mit
-5,907,007,087,311,178,000
29.591837
67
0.655771
false
3.438073
false
false
false
MSEMJEJME/Get-Dumped
renpy/display/screen.py
1
16961
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us> # # 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, m...
gpl-2.0
-7,045,331,291,417,997,000
28.860915
125
0.596899
false
4.206597
false
false
false
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/pandas/core/series.py
1
89595
""" Data structure for 1-dimensional cross-sectional and time series data """ from __future__ import division # pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 import types import warnings from numpy import nan, ndarray import numpy as np import numpy.ma as ma from pandas.core.common import (i...
mit
8,638,401,101,865,373,000
31.734746
105
0.526547
false
4.584975
false
false
false
DaveA50/lbry
lbrynet/reflector/server/server.py
1
5842
import logging from twisted.python import failure from twisted.internet import error, defer from twisted.internet.protocol import Protocol, ServerFactory import json from lbrynet.core.utils import is_valid_blobhash log = logging.getLogger(__name__) class ReflectorServer(Protocol): def connectionMade(self): ...
mit
-6,611,736,077,768,337,000
38.741497
103
0.592776
false
4.236403
false
false
false
LIAMF-USP/word2vec-TF
src/basic_experiment/experiments5_to_8.py
1
2985
""" EXPERIMENT 5, 6, 7, & 8 Experiment with the models gensim, and the official tensorflow implementation with different window sizes. We use both a corpus in portuguese as a corpus in english with and without preprocessing. """ import os from train_functions import train_both_models_with_different_window_sizes impor...
mit
2,983,084,142,786,585,000
32.539326
77
0.513233
false
3.985314
false
true
false
Debian/dput-ng
dput/hooks/distro_info_checks.py
1
6966
# -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Copyright (c) 2013 dput authors # # 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...
gpl-2.0
-782,189,558,320,923,500
34.360406
79
0.618863
false
4.725916
false
false
false
fdibaldassarre/mload
src/Interface/Gtk/ShowLatestWindow.py
1
5180
#!/usr/bin/env python3 from gi.repository import Gtk from gi.repository import Pango from datetime import datetime from datetime import timedelta DATE_FORMAT = '%d %B %Y' DATE_FORMAT_ORDER = '%Y %m %d' MAX_LABEL_SIZE = 30 class ShowLatestWindow(Gtk.Window): def __init__(self, interface): self.interface =...
gpl-3.0
3,271,785,645,316,633,600
30.204819
118
0.638031
false
3.401182
true
false
false
malvikasharan/APRICOT
apricotlib/apricot_visualization.py
1
22211
#!/usr/bin/env python # Description = Visualizes different output data from APRICOT analysis from collections import defaultdict import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import os import sys try: import subprocess except ImportError: print('Python package subprocess is missing. ...
isc
6,587,351,499,068,193,000
51.138498
138
0.506641
false
3.699367
false
false
false
anderson7ru/bienestarues
citasmedicasapp/models.py
1
2389
# -*- coding: utf-8 -*- from django.db import models from django.conf import settings from django.utils import timezone # apps internas y externas from datospersonalesapp.models import Paciente from empleadosapp.models import Empleado, Doctor ESTADO_ELECCIONES = ( ('N','Normal'), ('C','Cancelado'), ('R','...
mit
-8,647,373,862,851,743,000
40.929825
148
0.7455
false
2.787631
false
false
false
molden/hanythingondemand
hod/node/node.py
1
8124
# # # Copyright 2009-2015 Ghent University # # This file is part of hanythingondemand # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundat...
gpl-2.0
298,064,435,816,731,600
30.488372
103
0.609429
false
3.71298
false
false
false
lasr/orbital_elements
convert/mee_meeMl0.py
1
1808
import numpy as np from .meefl_meeMl import meefl_meeMl __author__ = "Nathan I. Budd" __email__ = "nibudd@gmail.com" __copyright__ = "Copyright 2017, LASR Lab" __license__ = "MIT" __version__ = "0.1" __status__ = "Production" __date__ = "27 Mar 2017" def mee_meeMl0(T, meeMl0, mu=1.0): """Convert MEEs with mean l...
mit
-5,354,797,976,122,810,000
33.769231
77
0.581858
false
3.149826
false
false
false
Azure/azure-sdk-for-python
sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/_log_files_operations.py
1
5652
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
2,186,099,100,736,760,800
45.710744
186
0.63535
false
4.457413
true
false
false
qtproject/qtqa
scripts/generic/parse_build_log.py
1
5630
############################################################################ ## ## Copyright (C) 2019 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the Quality Assurance module of the Qt Toolkit. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ## Licensees holdi...
gpl-3.0
-6,929,140,284,329,676,000
34.632911
98
0.593783
false
3.703947
true
false
false
levilucio/SyVOLT
t_core/Mutex/HKillRuleLHS.py
1
8932
from core.himesis import Himesis, HimesisPreConditionPatternLHS import cPickle as pickle class HKillRuleLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HKillRuleLHS. """ # Create the himesis graph ...
mit
-5,370,056,512,150,161,000
36.017021
600
0.505486
false
3.619125
false
false
false
bdmod/extreme-subversion
BinarySourcce/subversion-1.6.17/build/getversion.py
1
2153
#!/usr/bin/env python # # getversion.py - Parse version numbers from C header files. # import os import re import sys __all__ = ['Parser', 'Result'] class Result: pass class Parser: def __init__(self): self.patterns = {} def search(self, define_name, value_name): 'Add the name of a define to the list...
gpl-2.0
3,128,477,741,290,966,500
23.191011
63
0.619601
false
3.106782
false
false
false
username4gh/my-i3
vim/vim-denite-codesearch/rplugin/python3/denite/source/csearch.py
1
5026
import shlex import typing from os.path import relpath from denite import util, process from denite.base.source import Base from denite.util import Nvim, UserContext, Candidates, Candidate def _candidate(result: typing.List[typing.Any], path: str) -> Candidate: return { 'word': result[3], 'abbr':...
unlicense
3,185,793,944,610,744,000
32.731544
108
0.519897
false
4.202341
false
false
false
Code4SA/mma-dexter
dexter/processing/extractors/calais.py
1
5007
import requests import json from .base import BaseExtractor from ...models import DocumentEntity, Entity, Utterance, DocumentTaxonomy import logging log = logging.getLogger(__name__) class CalaisExtractor(BaseExtractor): """ Use the OpenCalais API to extract entities and other useful goodies from a document...
apache-2.0
-1,898,880,489,122,288,400
30.29375
111
0.496505
false
4.141439
false
false
false
suriya/rasikapriya
rasikapriya/admin.py
1
1655
import autocomplete_light from django import forms from django.contrib import admin from .models import (Instrument, Artist, Venue, Organization, Festival, Concert, Performance) from .widgets import PlacesAutocompleteWidget class VenueForm(forms.ModelForm): class Meta: model = Venue widget...
mit
-4,320,305,797,479,233,000
31.45098
71
0.758308
false
3.605664
false
false
false
indera/redi
redi/batch.py
1
9666
""" Functions related to the RediBatch database """ __author__ = "University of Florida CTS-IT Team" __copyright__ = "Copyright 2014, University of Florida" __license__ = "BSD 3-Clause" import datetime import hashlib import logging import os import sqlite3 as lite import stat import sys import time from lxml import ...
bsd-3-clause
-7,894,545,005,069,292,000
24.571429
141
0.612663
false
3.445989
false
false
false
sampepose/flownet2-tf
src/utils.py
1
1593
import tensorflow as tf # Thanks, https://github.com/tensorflow/tensorflow/issues/4079 def LeakyReLU(x, leak=0.1, name="lrelu"): with tf.variable_scope(name): f1 = 0.5 * (1.0 + leak) f2 = 0.5 * (1.0 - leak) return f1 * x + f2 * abs(x) def average_endpoint_error(labels, predictions): ...
mit
-2,444,222,353,716,570,000
36.046512
94
0.623352
false
3.237805
false
false
false
bwasti/caffe2
caffe2/python/mkl/convnet_benchmarks.py
1
21125
## @package convnet_benchmarks # Module caffe2.python.convnet_benchmarks from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals """ Benchmark for common convnets. Speed on Titan X, with 10 warmup steps and 10 main steps and w...
apache-2.0
69,183,182,842,049,490
28.46304
92
0.534533
false
3.193017
false
false
false
ndingwall/scikit-learn
sklearn/linear_model/_ridge.py
2
77132
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
bsd-3-clause
-3,428,366,781,034,866,000
38.133435
79
0.585632
false
3.93631
false
false
false
mbuesch/toprammer
libtoprammer/chips/microchip8/pic12f629dip8.py
1
2446
""" # TOP2049 Open Source programming suite # # Microchip PIC12F629 DIP8 # # Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundat...
gpl-2.0
-2,795,520,083,286,955,000
29.962025
86
0.72036
false
2.908442
false
false
false
jensreeder/scikit-bio
skbio/diversity/beta/__init__.py
1
6898
""" Beta diversity measures (:mod:`skbio.diversity.beta`) ===================================================== .. currentmodule:: skbio.diversity.beta This package contains helper functions for working with scipy's pairwise distance (``pdist``) functions in scikit-bio, and will eventually be expanded to contain pair...
bsd-3-clause
-2,675,005,045,548,949,000
34.556701
79
0.584807
false
3.342054
true
false
false
jschaul/ComplexNetworkSim
examples/Skype_model/model_Skype.py
1
4858
'''Example model specification for a Skype-like system @author: Joe Schaul <joe.schaul@gmail.com> ''' import networkx as nx from ComplexNetworkSim import NetworkSimulation, AnimationCreator, PlotCreator from agent_skypeClient import DISABLED, ENABLED, ENABLED_S, DISABLED_S from agent_skypeClient import Skype ...
bsd-2-clause
-3,126,124,502,726,989,000
32.94964
107
0.563401
false
3.666415
false
false
false
Superjom/NeuralNetworks
logistic_regression.py
1
3887
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on Feb 22, 2014 @author: Chunwei Yan @ PKU @mail: yanchunwei@outlook.com ''' import theano import numpy from theano import tensor as T rng = numpy.random class LogisticRegression(object): ''' pass in the dataset as a matrix ''' def __init__(se...
apache-2.0
7,972,994,892,701,146,000
31.940678
101
0.516851
false
3.327911
true
false
false
ianlivingstone/PythonSQLEntity
db.py
1
1138
""" Database Module Define your entities and indexes here, along with that handle connecting to the database(s). An example entity: user = Entity('users', 'user_id', { 'username':'joe', 'password':'', 'passkey':'', 'join_date':0.0 }) user.add_index(Index(user,'username...
mit
-2,774,978,493,612,204,000
21.313725
72
0.639719
false
3.534161
false
false
false
LingyuGitHub/codingofly
python/processmonitor/main.py
1
2670
#!/usr/bin/env python3 ######################################################################### # File Name: main.py # Author: lingy # Created Time: Fri 13 Jan 2017 11:32:15 AM CST # Description: ######################################################################### # -*- coding: utf-8 -*- import...
gpl-3.0
-3,310,897,296,494,181,000
24.428571
150
0.519101
false
3.708333
false
false
false
IPMITMO/statan
coala-bears/bears/general/FilenameBear.py
1
4829
import os.path from coalib.bears.LocalBear import LocalBear from coalib.results.Diff import Diff from coalib.results.Result import Result from coalib.bearlib.naming_conventions import ( to_camelcase, to_kebabcase, to_pascalcase, to_snakecase, to_spacecase) class FilenameBear(LocalBear): LANGUAGES = {'All'} ...
mit
-3,254,367,878,211,252,700
38.581967
79
0.545662
false
4.638809
false
false
false
kshmirko/sage-reader
convert/converter.py
1
15858
# -*- coding: utf-8 -*- """ Created on Wed Mar 19 10:55:22 2014 @author: Администратор """ import netCDF4 as nc from datetime import datetime, timedelta import numpy as np from sage2.sageIItypes import _INDEX, _SPECITEM import h5py as h5 class NCPack: def __init__(self, path, format='NETCDF4', ...
gpl-3.0
7,498,324,145,203,487,000
34.13198
97
0.507095
false
2.672424
false
false
false
geodynamics/pylith
tests/libtests/feassemble/data/obsolete/ElasticityImplicitLgDeform.py
1
2844
#!/usr/bin/env python # # ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University of Chicago # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://ge...
mit
1,761,159,283,767,938,300
30.955056
85
0.599508
false
3.901235
false
false
false
mandli/multilayer-examples
1d/setplot_shelf.py
1
12827
""" Set up the plot figures, axes, and items to be done for each frame. This module is imported by the plotting routines and then the function setplot is called to set the plot parameters. """ import numpy as np # Plot customization import matplotlib # Markers and line widths matplotlib.rcParams['lines.line...
mit
4,477,008,614,607,382,500
33.114362
109
0.54853
false
3.291506
false
false
false
CLVsol/odoo_addons
clv_insurance_client/wkf/clv_insurance_client_wkf.py
1
2636
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
5,231,165,072,950,596,000
46.927273
103
0.462822
false
4.673759
false
false
false
hofschroeer/shinysdr
shinysdr/web.py
1
33243
# Copyright 2013, 2014, 2015 Kevin Reid <kpreid@switchb.org> # # This file is part of ShinySDR. # # ShinySDR 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 opt...
gpl-3.0
7,562,672,249,538,104,000
37.254315
190
0.614505
false
4.053036
false
false
false
transientskp/aartfaac-arthur
arthur/stream.py
1
2792
import os from casacore.images import image as casa_image from PIL import Image import subprocess import time import monotonic import logging import atexit logger = logging.getLogger(__name__) FPS = 25 cmd = ["ffmpeg", # for ffmpeg always first set input then output # silent audio '-f', 'lavfi'...
gpl-3.0
-8,623,274,229,165,829,000
25.093458
88
0.579513
false
3.737617
false
false
false
gotlium/django-geoip-redis
geoip/management/commands/update_geo_db.py
1
2560
# -*- coding: utf-8 -*- import thread import time import sys import os from django.contrib.contenttypes.models import ContentType from django.core.management.base import NoArgsCommand from django.core.management import call_command from django.utils.termcolors import colorize from requests import get from geoip.red...
gpl-3.0
-3,429,620,732,315,793,400
27.764045
78
0.562891
false
3.786982
false
false
false
TommasoPadovan/Baobab
baobab_nifti/baobab-usingNifti.py
1
2095
from nifti import NiftiImage from datetime import datetime prima=datetime.now() #FLAGS ############################# background_threshold=25 # reverse_YAxis=True # ############################# nim=NiftiImage("cervello") print "Processing '%s'" %nim.filename, nim.load() d=nim.extent #genearatin a 4-upl...
mit
-3,247,903,238,032,980,000
22.021978
98
0.478759
false
3.198473
false
false
false
martastain/dc-caspar
actions.py
1
6436
import os import json import time from caspar import CasparServer SESSION_DIR = "sessions" KEYS = { "LG01" : 20, "LG02" : 21, "LG03" : 22, "LG04" : 23, "LG05" : 16, "LG06" : 17, "LG07" : 18, "LG08" : 19, "LG09" : 12, "LG10" : 13, "LG11" : 14, "L...
mit
1,857,577,597,477,397,500
24.277551
123
0.482132
false
3.530444
false
false
false