repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
google/report2bq
application/classes/ga360_report_response.py
1
3654
# Copyright 2021 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 agreed to in writing, ...
apache-2.0
-7,726,984,900,990,291,000
34.134615
84
0.754242
false
3.578844
false
false
false
caffeine-potent/Streamer-Datastructure
mr_streams/streamer.py
1
2716
from functools import partial, reduce from mr_streams.exceptions import IllegalStreamOperationException class EOL(): pass class Streamer: def __init__(self, _iter): self.structure = iter(_iter) self.eol = EOL() def _build(self, expression): self.structure = expression sel...
mit
-1,501,024,574,657,173,500
29.516854
101
0.585052
false
4
false
false
false
DukeOfHazard/crits
crits/emails/handlers.py
3
63744
from __future__ import absolute_import import datetime import email as eml from email.parser import Parser from email.utils import parseaddr, getaddresses, mktime_tz, parsedate_tz import hashlib import json import magic import re import yaml import StringIO import sys import olefile from dateutil.parser import parse ...
mit
-5,574,952,949,142,914,000
37.147217
123
0.526638
false
4.260963
false
false
false
ProkopHapala/SimpleSimulationEngine
python/utils/unpack_obj.py
1
1241
#!/usr/bin/python fin = open( "lightTransportTest.obj", "r" ) def line2vert( line ): wds = line.split() return [float(wds[1]),float(wds[2]),float(wds[3])] def line2face( line ): wds = line.split() fc = [] for wd in wds[1:]: #fc.append( wd.split("/")[0] ) fc.append( int(wd.split("...
mit
-8,011,834,701,226,728,000
16.478873
54
0.521354
false
2.721491
false
false
false
GermainZ/weechat-vimode
vimode.py
1
83499
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 Germain Z. <germanosz@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 Foundation; either version 3 of the License, or # (at your option) any ...
gpl-3.0
4,787,555,203,784,002,000
36.269196
91
0.548926
false
3.635544
false
false
false
tkzeng/molecular-design-toolkit
moldesign/compute/runsremotely.py
1
4853
# Copyright 2016 Autodesk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
-7,647,895,521,386,166,000
37.824
100
0.593859
false
4.527052
false
false
false
openslack/openslack-crawler
examples/alexa/alexa/spiders/alexa_spider.py
1
4297
import re import json from urlparse import urlparse import urllib from scrapy.selector import Selector try: from scrapy.spider import Spider except: from scrapy.spider import BaseSpider as Spider from scrapy.utils.response import get_base_url from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.co...
apache-2.0
-4,509,636,966,736,941,000
36.365217
115
0.587619
false
3.666382
false
false
false
gratteur/zim-desktop
zim/plugins/sourceview.py
2
11117
# -*- coding: utf-8 -*- # Copyright 2011 Jiří Janoušek <janousek.jiri@gmail.com> # Copyright 2014 Jaap Karssenberg <jaap.karssenberg@gmail.com> import gtk import pango import logging logger = logging.getLogger('zim.pugin.sourceview') try: import gtksourceview2 except: gtksourceview2 = None from zim.plugins impo...
gpl-2.0
625,114,942,100,512,600
30.207865
90
0.69739
false
3.158942
false
false
false
pazeshun/jsk_apc
jsk_2015_05_baxter_apc/node_scripts/feature_label_object_detector.py
2
3270
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import division from collections import Counter import cv2 import numpy as np import rospy import cv_bridge import message_filters from sensor_msgs.msg import Image from posedetection_msgs.msg import ImageFeature0D from jsk_2015_05_baxter_apc.msg import ...
bsd-3-clause
-2,657,681,900,911,551,000
34.945055
80
0.584098
false
3.641425
false
false
false
nd1/Listener_Classification_Public
ingest/merge_data.py
2
3435
##################################################### # Imports ##################################################### import os import csv import datetime import sys import re import pytz ##################################################### # Assignments ##################################################### """ data...
mit
-4,948,856,001,352,608,000
35.542553
80
0.418923
false
4.304511
false
false
false
funkybob/django-flatblocks
setup.py
1
1786
import io from setuptools import setup, find_packages setup( name='django-flatblocks', version='0.9.4', description='django-flatblocks acts like django.contrib.flatpages but ' 'for parts of a page; like an editable help box you want ' 'show alongside the main content.', ...
bsd-3-clause
-1,224,726,054,937,641,200
34.019608
75
0.572228
false
4.252381
false
false
false
ronekko/chainer
tests/chainer_tests/functions_tests/noise_tests/test_gumbel_softmax.py
4
1194
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'shape': [(3, 2), ()], 'dtype': [numpy.float16, numpy.float32, numpy.float64], })) class TestGumbe...
mit
5,579,322,761,174,670,000
27.428571
71
0.659129
false
3.392045
true
false
false
Duke-GCB/GGR-cwl
draft-3/json-generator/run.py
1
15031
import textwrap import csv import argparse from collections import defaultdict import sys from jinja2 import Environment, FileSystemLoader import os import consts encoding = sys.getfilesystemencoding() EXEC_DIR = os.path.dirname(unicode(__file__, encoding)) def save_or_print_json(json_str, outdir, json_name): i...
mit
2,708,858,331,697,974,000
49.103333
156
0.566629
false
3.924543
false
false
false
commaai/openpilot
common/kalman/tests/test_simple_kalman.py
1
2283
import unittest import random import timeit import numpy as np from common.kalman.simple_kalman import KF1D from common.kalman.simple_kalman_old import KF1D as KF1D_old class TestSimpleKalman(unittest.TestCase): def setUp(self): dt = 0.01 x0_0 = 0.0 x1_0 = 0.0 A0_0 = 1.0 A0_1 = dt A1_0 = 0....
mit
-4,021,968,697,379,426,300
25.241379
82
0.526938
false
2.351184
true
false
false
omriabnd/UCCA-App
Server/uccaApp/serializers/TaskSerializerAnnotator.py
1
32907
import json import logging from django.db import transaction logger = logging.getLogger("ucca.api") from rest_framework.generics import get_object_or_404 from rest_framework import serializers from uccaApp.util.exceptions import SaveTaskTypeDeniedException, CantChangeSubmittedTaskExeption, \ GetForInactiveTask...
gpl-3.0
-3,195,017,521,501,082,600
48.114925
171
0.606102
false
3.985346
false
false
false
UKPLab/sentence-transformers
examples/evaluation/evaluation_translation_matching.py
1
2172
""" Given a tab seperated file (.tsv) with parallel sentences, where the second column is the translation of the sentence in the first column, for example, in the format: src1 trg1 src2 trg2 ... where trg_i is the translation of src_i. Given src_i, the TranslationEvaluator checks which trg_j has the highest sim...
apache-2.0
2,998,230,930,318,477,300
35.2
166
0.705801
false
3.712821
false
false
false
WalterSchaertl/NYRP
NYRP/forms.py
1
4549
from django import forms from django.forms import ModelForm from .models import QuestionBug # These constants define the units for each topic, as well as # which exams there are to select from. Chemistry has a small # populated database, United States History and Government is # just here as a proof of concept # Che...
mit
-5,335,007,594,980,761,000
32.316176
107
0.66983
false
3.078125
false
false
false
ddtm/dl-course
Seminar6/lib/fast_rcnn/train.py
1
4188
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Train a Fast R-CNN network.""" from fast_rcnn.config import cfg imp...
mit
8,085,451,403,925,052,000
33.327869
79
0.583095
false
3.863469
false
false
false
proppy/build
env/netbsd-amd64/mkvm.py
1
2083
#!/usr/bin/env python # Copyright 2016 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import anita import ftplib import sys def find_latest_release(arch): """Find the latest NetBSD-current release for the given arch. Retu...
bsd-3-clause
2,835,801,694,794,862,000
22.942529
150
0.660106
false
2.963016
false
false
false
maxgarvey/l_import
l_import.py
1
2984
#!/usr/bin/python ''' Copyright (c) 2012, Max Garvey All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions...
bsd-2-clause
-8,034,866,464,867,974,000
44.907692
186
0.722855
false
4.256776
false
false
false
cdent/tank
tiddlywebplugins/tank/forge.py
1
1801
""" Create a new tank. """ from httpexceptor import HTTP400 from tiddlyweb.model.bag import Bag from tiddlyweb.store import NoBagError from tiddlyweb.web.validator import validate_bag, InvalidBagError from tiddlywebplugins.utils import require_role from .policy import WIKI_MODES from .util import tank_uri from .hom...
bsd-3-clause
-6,985,947,563,068,842,000
23.013333
70
0.635203
false
3.463462
false
false
false
emkael/jfrteamy-playoff
playoff.py
1
2081
import logging, traceback from jfr_playoff.filemanager import PlayoffFileManager from jfr_playoff.generator import PlayoffGenerator from jfr_playoff.settings import PlayoffSettings from jfr_playoff.logger import PlayoffLogger def main(): interactive = False try: import argparse arg_parser =...
bsd-2-clause
7,469,995,031,616,978,000
35.508772
75
0.610764
false
4.573626
false
false
false
MalloyDelacroix/DownloaderForReddit
DownloaderForReddit/gui/database_views/database_dialog.py
1
75730
import logging from PyQt5.QtWidgets import (QMenu, QActionGroup, QWidget, QInputDialog, QAbstractItemView, QWidgetAction, QCheckBox, QApplication) from PyQt5.QtCore import QSize, Qt, pyqtSignal from PyQt5.QtGui import QCursor from sqlalchemy import or_ from DownloaderForReddit.guiresources...
gpl-3.0
-5,789,639,816,704,220,000
47.638407
120
0.645081
false
3.970951
false
false
false
InspectorB/3Dami-python
src/utils/pubsub.py
1
1568
class PubSub: def __init__(self): self.subscribers = [] def publish(self, obj): for sub in self.subscribers: sub.notify(self, obj) def notify(self, publisher, obj): raise NotImplementedError("The method 'notify' should be implemented.") def...
gpl-3.0
9,126,790,282,898,988,000
28.584906
92
0.600765
false
4.694611
false
false
false
inclement/buildozer
buildozer/targets/android.py
1
44346
''' Android target, based on python-for-android project (old toolchain) ''' # # Android target # Thanks for Renpy (again) for its install_sdk.py and plat.py in the PGS4A # project! # import sys if sys.platform == 'win32': raise NotImplementedError('Windows platform not yet working for Android') from platform impo...
mit
-4,305,709,760,538,195,000
40.367537
106
0.543364
false
4.045061
true
false
false
pmverdugo/fiware-validator
validator/clients/chef_client.py
1
6849
# -*- coding: utf-8 -*- # 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
-2,242,773,558,207,450,000
34.487047
82
0.574244
false
4.230389
true
false
false
ngonzalvez/sentry
tests/sentry/api/endpoints/test_group_notes.py
24
1679
from django.core.urlresolvers import reverse from sentry.models import Activity from sentry.testutils import APITestCase class GroupNoteTest(APITestCase): def test_simple(self): group = self.group activity = Activity.objects.create( group=group, project=group.project, ...
bsd-3-clause
-7,394,578,444,712,941,000
29.527273
63
0.593806
false
4.055556
true
false
false
Molecular-Image-Recognition/Molecular-Image-Recognition
code/rmgpy/tools/canteraModel.py
2
36747
################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu), # Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of cha...
mit
6,924,194,026,169,992,000
50.394406
257
0.615751
false
4.172003
false
false
false
Yelp/sqlparse
sqlparse/filters.py
1
35668
# -*- coding: utf-8 -*- import re from collections import deque from os.path import abspath, join from sqlparse import lexer from sqlparse import sql, tokens as T from sqlparse.exceptions import SQLParseError from sqlparse.pipeline import Pipeline from sqlparse.tokens import (Comment, Comparison, Keyword, Name, Punc...
bsd-3-clause
4,815,996,103,230,753,000
34.596806
100
0.544185
false
4.203158
false
false
false
lis-epfl/mavlink
pymavlink/mavutil.py
3
59548
#!/usr/bin/env python ''' mavlink python utility functions Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' import socket, math, struct, time, os, fnmatch, array, sys, errno import select, mavexpression # adding these extra imports allows pymavlink to be used directly with pyinstaller # w...
lgpl-3.0
-1,812,975,357,580,576,300
36.078456
142
0.536878
false
3.826255
false
false
false
wenkaiqiu/petal
uniform_model/functions/vlan.py
1
1287
import logging from uniform_model.functions.base_old import Function from uniform_model.functions.base import FunctionNew from uniform_model.base import Statement, When, Need, Entity logging.basicConfig(format='%(asctime)s <%(name)s> %(message)s') logger = logging.getLogger('uniform_model.functions.vlan') logger.setL...
bsd-3-clause
6,608,594,239,267,257,000
30.875
77
0.585098
false
3.522099
false
false
false
BernhardDenner/libelektra
src/bindings/swig/python/tests/test_kdb.py
2
1614
import kdb, unittest TEST_NS = "user/tests/swig_py3" class Constants(unittest.TestCase): def setUp(self): pass def test_kdbconfig_h(self): self.assertIsInstance(kdb.DB_SYSTEM, str) self.assertIsInstance(kdb.DB_USER, str) self.assertIsInstance(kdb.DB_HOME, str) self.assertIsInstance(kdb.DEBUG, int...
bsd-3-clause
3,109,756,360,589,687,000
23.089552
62
0.664188
false
2.541732
true
false
false
tfiers/arenberg-online
arenberg_online/settings.py
1
11120
""" django settings for arenberg_online project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import os # If this file exists on the file system, we are in prod...
mit
1,157,821,958,898,328,800
35.224756
157
0.708993
false
3.434219
false
false
false
opuk/satellite
api/list_docker_tags_html.py
1
1094
#!/usr/bin/env python import json import sys try: import requests except ImportError: print "Please install the python-requests module." sys.exit(-1) # URL to your Satellite 6 server URL = "https://satellite.example.com" # URL for the API to your deployed Satellite 6 server SAT_API = "%s/katello/api/v2/" % URL...
gpl-3.0
4,220,692,580,242,062,300
22.276596
74
0.666362
false
3.143678
false
false
false
widdowquinn/THAPBI
Phyt_ITS_identifying_pipeline/Python_ITS_scripts/draw_heat_map.py
1
1629
#!/usr/bin/env python from scipy.io import netcdf #https://github.com/widdowquinn/Teaching-Data-Visualisation/blob/master/exercises/colormaps_surfaces_netcdf/colormaps_surfaces_netcdf.ipynb import warnings warnings.filterwarnings('ignore') in order to generate the data.fram. use pandas pandas.d...
mit
-4,020,731,350,837,106,000
16.1
139
0.635359
false
3.331288
false
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-batchai/azure/mgmt/batchai/models/job.py
1
11473
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
8,685,348,520,663,755,000
56.079602
440
0.689881
false
4.132925
false
false
false
JensTimmerman/radical.pilot
examples/mandelbrot/mandelbrot_pilot_cores.py
1
7619
#!/usr/bin/env python __author__ = "George Chantzialexiou" __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" """ A Mandelbrot Fractal Generator Using RADICAL-Pilot This is an example of mandelbrot Fractal Generator using the capabilities of Pilot Job API. It requ...
mit
-4,168,569,065,973,125,000
35.109005
131
0.604016
false
3.867513
false
false
false
markosa/hydromon-client
net/hydromon/thread/sensorthread.py
1
1488
''' Created on May 7, 2015 @author: markos ''' import threading import thread import time import logging from net.hydromon.config import ConfigurationUtil from net.hydromon.dto.valuedto import ValueDTO log = logging.getLogger(__name__) class SensorThread(threading.Thread): ''' classdocs ''' threadId...
gpl-2.0
5,908,719,645,341,732,000
24.672414
145
0.605511
false
4.076712
false
false
false
ivandeex/dz
dz/admin/__init__.py
1
1640
from __future__ import unicode_literals, absolute_import from django.contrib import admin from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ from .base import DzModelAdmin from .crawl import CrawlAdmin from .news import NewsAdmin from .tip import TipAdmin from .. import models...
mit
740,987,074,870,819,100
32.469388
92
0.682317
false
3.519313
false
false
false
spirali/haydi
tests/test_algorithms.py
2
1056
from haydi.algorithms import search def test_alg_bfs(): def collect(x, depth): lst.append(x) lst = [] search.bfs(0, lambda s, d: (), collect) assert lst == [0] lst = [] search.bfs(0, lambda s, d: (s + 1,), collect, 0) assert lst == [0] lst = [] search.bfs(0, lambda s, ...
mit
4,176,364,774,166,094,300
23
75
0.436553
false
2.735751
false
false
false
SCLT1975/python_training
fixture/contact.py
1
10159
# -*- coding: utf-8 -*- from model.new_user_data import N_u_d import re class ContactHelper: def __init__(self, app): self.app = app def select_1st_contact(self): wd = self.app.wd wd.find_element_by_name("selected[]").click() def select_by_index(self, index): wd = self.ap...
apache-2.0
2,084,159,408,606,451,200
42.600858
120
0.591987
false
2.971337
false
false
false
Vypo/builderdb
builderdb/settings.py
1
6935
# Unlike the rest of BuilderDB, this file is released under the following # terms: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any pur...
agpl-3.0
3,745,119,515,777,534,500
27.422131
83
0.712617
false
3.37963
false
false
false
jwodder/doapi
doapi/droplet.py
1
18907
from six.moves import map # pylint: disable=redefined-builtin from .base import Actionable, ResourceWithID, Region, Size, Kernel, \ Networks, BackupWindow, Taggable, fromISO8601 from .image import Image class Droplet(Actionable, ResourceWithID, Taggable): """ A droplet resource,...
mit
5,024,796,191,924,334,000
34.340187
79
0.608716
false
4.364497
false
false
false
merc-devel/merc
merc/features/ts6/uid.py
1
1934
import datetime from merc import feature from merc import message class UidFeature(feature.Feature): NAME = __name__ install = UidFeature.install @UidFeature.register_server_command class Uid(message.Command): NAME = "UID" MIN_ARITY = 9 FORCE_TRAILING = True def __init__(self, nickname, hopcount, ts, ...
mit
5,981,963,020,837,222,000
24.116883
79
0.654085
false
3.305983
false
false
false
tracyajones/driverlog
driverlog/processor/config.py
4
1504
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
-5,903,231,067,470,783,000
40.777778
76
0.667553
false
3.906494
false
false
false
TEAM-HRA/hra_suite
HRAGUI/src/hra_gui/qt/plots/specific_widgets/poincare_plot_movie_generator_progress_bar.py
1
3147
''' Created on 24 kwi 2013 @author: jurek ''' from hra_core.special import ImportErrorMessage try: import pylab as pl #import matplotlib #matplotlib.use("Agg") import matplotlib.pyplot as plt import matplotlib.animation as manimation from PyQt4.QtGui import * # @UnusedWildImport from PyQt4...
lgpl-3.0
-2,215,713,915,691,521,500
37.378049
133
0.639021
false
3.988593
false
false
false
tapomayukh/projects_in_python
classification/Classification_with_HMM/Single_Contact_Classification/force_codes/resolution/hmm_crossvalidation_force_96.py
1
16212
# Hidden Markov Model Implementation import pylab as pyl import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy as scp import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import rospy #import hrl_lib.mayavi2_util as mu import hrl_lib.viz ...
mit
5,281,366,326,026,524,000
38.931034
132
0.537688
false
2.679669
false
false
false
ablifedev/ABLIRC
ABLIRC/bin/public/reads_or_peaks_distribution_relative2xxx.py
1
12060
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- #################################################################################### ### Copyright (C) 2015-2019 by ABLIFE #################################################################################### #########################################################...
mit
4,084,180,357,249,213,000
32.259053
177
0.414657
false
4.356074
false
false
false
dmdm/PySite
learn/lxml/lxml_aloha.py
1
3346
#!/usr/bin/env python from lxml import html class Replacer(object): MARKER = '~+~' * 5 + '#' + '~+~' * 5 def __init__(self): self.fragments = None self.newfragments = None def load_page(self, fn): with open(fn, 'r', encoding='utf-8') as fh: txt = fh.read() s...
agpl-3.0
-2,101,968,591,013,484,000
32.46
77
0.520622
false
4.050847
false
false
false
BrainTech/openbci
obci/control/gui/obci_log_model.py
1
2242
#!/usr/bin/env python # -*- coding: utf-8 -*- import thread import time from PyQt4 import QtCore class LogModel(QtCore.QObject): update_log = QtCore.pyqtSignal(dict) def __init__(self): super(LogModel, self).__init__() self._peers = [] self._emmit = False self._run = False ...
gpl-3.0
-4,769,509,328,314,720,000
25.690476
89
0.509813
false
3.736667
false
false
false
annayqho/TheCannon
TheCannon/train_model.py
1
14886
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import matplotlib.pyplot as plt from .helpers.compatibility import range, map from .helpers.corner import corner import scipy.optimize as op def training_step_objective_function(pars, fluxes, ivars, lvec, lvec_deriv...
mit
-1,911,700,689,609,133,000
36.877863
155
0.600833
false
3.026225
false
false
false
Robpol86/flake8-pep257
tests/test_explain.py
1
8763
"""Test against sample modules using the explain option in all supported config sources.""" import os from distutils.spawn import find_executable import flake8.main import pytest from tests import check_output EXPECTED = list() EXPECTED.append("""\ ./sample.py:1:1: D100 Missing docstring in public module Al...
mit
-7,714,729,284,441,794,000
42.597015
114
0.650234
false
3.992255
true
false
false
stuartsoft/twitchqueue
twitchqueue.py
1
1995
#!/usr/bin/python import os import time #-----globals----- #player = "omxplayer -o hdmi" player = "vlc -f" ShouldUpdateAllowlist = False RetryNum = 1 #number of times to retry each stream connection print ("Starting twitch queue. Press ^C to cancel...") time.sleep(3) if ShouldUpdateAllowlist: #Delete an...
gpl-2.0
-5,267,815,710,379,600,000
36.660377
142
0.653133
false
3.543517
false
false
false
ingresso-group/pyticketswitch
pyticketswitch/mixins.py
1
8560
import datetime import decimal import json from pyticketswitch import utils class JSONMixin(object): """Adds json encoding functionality to objects.""" def __jsondict__(self, hide_none=True, hide_empty=True): def sanitise(obj): if isinstance(obj, datetime.datetime): retu...
mit
-4,285,803,207,083,031,000
35.896552
87
0.618224
false
4.362895
false
false
false
cforlando/CityGram-Intermediary
voting_centers/voting_centers.py
1
4252
""" voting_centers.py - Generates a file associating precinct ID with the current voting center Part of this script accesses OpenStreetMap and is subject to rate limitting. We therefore only look up precinct IDs not currently found in the output. """ # stdlib import random # library import requests import usaddress f...
mit
-3,639,891,455,877,095,000
32.746032
91
0.641816
false
3.640411
false
false
false
ksmaheshkumar/pwntools-write-ups
wargames/overthewire-vortex/level3/win.py
4
1465
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from pwn import * context(arch='i386',os='linux') level = 3 host = 'vortex.labs.overthewire.org' user = 'vortex%i' % level chal = 'vortex%i' % level password = args['PASSWORD'] passfile = '/etc/vortex_pass/vortex%i' % (level+1) binary = '/vortex/%s' % ch...
mit
7,831,675,830,778,179,000
23.830508
61
0.614334
false
2.634892
false
true
false
eladnoor/equilibrator-api
equilibrator_api/pathway.py
1
8320
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Oct 1 13:26:31 2017 @author: noore """ import csv import logging import numpy as np import io from scipy import linalg from util.SBtab import SBtabTools from equilibrator_api.reaction import Reaction from equilibrator_api.bounds import DEFAULT_BOUNDS,...
mit
-1,519,460,730,700,107,500
36.309417
90
0.606731
false
3.625272
false
false
false
stefelisabeth/dplace
dplace_app/serializers.py
1
7820
from rest_framework import serializers from dplace_app import models # constants for SocietyResult SEARCH_LANGUAGE = 'l' SEARCH_ENVIRONMENTAL = 'e' SEARCH_VARIABLES = 'v' SEARCH_GEOGRAPHIC = 'g' class SourceSerializer(serializers.ModelSerializer): class Meta(object): model = models.Source fields...
mit
-4,428,344,908,785,420,300
28.398496
83
0.657289
false
4.25
false
false
false
getsentry/raven-python
tests/contrib/zconfig/tests.py
1
2334
from __future__ import absolute_import import logging import mock import unittest from ZConfig import configureLoggers class TestConfig(unittest.TestCase): @mock.patch("raven.handlers.logging.Client") def test_minimal(self, Client): configureLoggers(""" <logger> %import raven.contri...
bsd-3-clause
5,133,147,875,102,555,000
29.710526
56
0.531705
false
4.243636
true
false
false
OncoImmunity/seqlearn
seqlearn/base.py
4
2825
import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.metrics import accuracy_score from sklearn.externals import six from ._decode import DECODERS from ._utils import atleast2d_or_csr, safe_sparse_dot, validate_lengths # XXX Should we even derive from ClassifierMixin here? # We ove...
mit
8,534,994,247,050,600,000
33.036145
79
0.579469
false
4.112082
false
false
false
tensorflow/models
official/common/dataset_fn.py
1
1712
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-4,195,703,908,637,053,400
39.761905
80
0.724299
false
4.290727
false
false
false
mikemintz/neutron
localized/more/update_plugin.py
1
1801
#$ neutron_plugin 01 import httplib UPDATE_HOST = 'www.jabber.ru' UPDATE_PATH = '/projects/neutron/files/' VERSIONS_FILE = 'dynamic/versions.txt' def update_download(file): httpcon = httplib.HTTPConnection(UPDATE_HOST) httpcon.request('GET', UPDATE_PATH + file) response = httpcon.getresponse() if response.statu...
gpl-2.0
-9,072,938,995,570,942,000
29.525424
121
0.716269
false
3.083904
false
false
false
axplus/format
format/encodeconverter.py
1
1795
# 2014-6-12 import logging from sys import stderr import chardet class _BuiltInConverter(object): @staticmethod def convert(thefrom, theto, thepath): myraw = open(thepath, 'rb').read() myunicode = myraw.decode(thefrom) mybuffer = myunicode.encode(theto) open(thepath, 'wb').w...
gpl-2.0
-6,091,733,676,580,040,000
26.615385
85
0.626184
false
3.648374
false
false
false
NickelMedia/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/user.py
128
6864
# Copyright (c) 2009, Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and t...
bsd-3-clause
-332,145,369,294,310,140
38.222857
140
0.623543
false
4.203307
false
false
false
mozilla/source
source/jobs/management/commands/job_post_reminders.py
3
2080
''' Testing the Amazon email hookup. ''' import logging from datetime import datetime from time import sleep from django.conf import settings from django.core.management.base import BaseCommand from django.template.loader import render_to_string from source.jobs.models import Job from source.people.models import Orga...
bsd-3-clause
2,815,813,487,155,702,300
32.015873
98
0.588942
false
4.571429
false
false
false
AbletonAG/abl.vpath
tests/test_path.py
1
9702
# -*- coding: utf-8 -*- #****************************************************************************** # (C) 2008-2017 Ableton AG #****************************************************************************** import os import shutil import tempfile from unittest import TestCase from abl.vpath.base import URI from...
mit
2,472,457,213,326,723,000
29.296875
92
0.575348
false
3.472421
true
false
false
bagelbits/dnd-3.5-tools
character-specific/Krag/dice_rolling.py
1
5834
#!/usr/bin/env python # -*- coding: utf8 -*- """ Damage Calculator for my character, Krag Written by Christopher Durien Ward 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, eithe...
gpl-2.0
695,000,721,294,386,200
31.411111
96
0.575591
false
3.156926
false
false
false
jknaresh/farmer
farm_field/migrations/0001_initial.py
1
1797
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-02 12:54 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('bio_data', '0002_farmerbiodata_is_activ...
mit
-9,125,626,572,272,044,000
40.790698
120
0.5665
false
4.020134
false
false
false
rasbt/BondPack
src/BondLab.py
1
3647
# 10/24/2013 Sebastian Raschka # BondLab PyMOL plugin from tkinter import * from pymol import cmd import sys, zlib, string def __init__(self): """adds plugin to PyMOL menu""" self.menuBar.addmenuitem('Plugin', 'command', 'BondLab', label = 'BondLab', ...
gpl-3.0
8,246,541,246,857,373,000
36.597938
77
0.630381
false
3.154844
false
false
false
elifesciences/elife-api-prototype
parseNLM.py
1
32885
from bs4 import BeautifulSoup import cgi import htmlentitydefs import os import time import calendar import logging logger = logging.getLogger('myapp') hdlr = logging.FileHandler(os.getcwd() + os.sep + 'test.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) logge...
mit
5,444,117,993,957,487,000
24.493023
109
0.678425
false
3.097975
false
false
false
billiob/papyon
papyon/__init__.py
1
1548
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2006 Ali Sabil <ali.sabil@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 Foundation; either version 2 of the License, or # (at your option) any l...
gpl-2.0
8,495,656,897,259,019,000
34.181818
76
0.744186
false
3.56682
false
false
false
WuQianyong/awesome_web
fiction/views.py
1
9811
from django.shortcuts import render,get_object_or_404 # Create your views here. # from django.shortcuts import from django.http import HttpResponse from .models import Post,Category,Tag from django.http import HttpResponse from .models import Post, Category, Tag from comments.forms import CommentForm import markdown f...
apache-2.0
-4,965,447,567,201,269,000
31.415966
96
0.57952
false
2.263791
false
false
false
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/skimage/measure/setup.py
7
2052
#!/usr/bin/env python from skimage._build import cython import os base_path = os.path.abspath(os.path.dirname(__file__)) def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs config = Configuration('measure', parent_package, top_pat...
gpl-3.0
-8,343,183,099,868,173,000
42.659574
79
0.613548
false
3.581152
true
false
false
Foxfanmedium/python_training
OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/IPython/terminal/interactiveshell.py
1
21161
"""IPython terminal interface using prompt_toolkit""" import os import sys import warnings from warnings import warn from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC from IPython.utils import io from IPython.utils.py3compat import input from IPython.utils.terminal import toggle_set_term...
apache-2.0
-7,235,876,990,150,055,000
38.042435
153
0.600775
false
4.221225
true
false
false
huawei-cloud/compass-core
compass/config_management/utils/config_manager.py
2
14401
""" Module to get configs from provider and isntallers and update them to provider and installers. .. moduleauthor:: Xiaodong wang ,xiaodongwang@huawei.com> """ import functools import logging from compass.config_management.installers import os_installer from compass.config_management.installers import package_ins...
apache-2.0
-8,000,529,699,363,497,000
41.860119
80
0.587876
false
4.097013
true
false
false
p4datasystems/CarnotKE
jyhton/Lib/test/test_sysconfig.py
10
12456
"""Tests for sysconfig.""" import unittest import sys import os import shutil import subprocess from copy import copy, deepcopy from test.test_support import (run_unittest, TESTFN, unlink, get_attribute, is_jython) import sysconfig from sysconfig import (get_paths, get_platform, get_co...
apache-2.0
3,765,323,018,723,250,000
37.208589
97
0.530186
false
3.791781
true
false
false
adaptive-learning/robomission
backend/learn/migrations/0010_tasksession.py
1
1036
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-10 15:35 from __future__ import unicode_literals import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('learn', '0009_data_levels'), ] ope...
gpl-3.0
-2,124,347,649,327,868,700
36
142
0.617761
false
4.177419
false
false
false
Delosari/dazer
bin/lib/test_cases.py
1
6299
import pyneb as pn import numpy as np import pandas as pd import matplotlib.pyplot as plt from inspect import getargspec from collections import OrderedDict from scipy.optimize import curve_fit from inferenceModel import SpectraSynthesizer from Astro_Libraries.spectrum_fitting.gasEmission_functions import EmissionCompo...
mit
1,180,074,497,867,751,400
43.359155
187
0.671376
false
2.708083
false
false
false
rado0x54/project-euler
python/problem0058.py
1
1284
#!/usr/bin/env python3 """Project Euler - Problem 58 Module""" import pelib def diagonal_square_spiral(): """Generate diagonal values of the square spiral""" cur_number = 1 cur_dist = 0 i = 0 while True: yield cur_number # Set Values for next iteration if i % 4 == 0: ...
mit
-1,483,115,764,232,487,400
22.777778
118
0.5
false
3.606742
false
false
false
SneakersInc/sniffmypacketsv2
src/sniffmypacketsv2/transforms/common/protocols/pop.py
1
3291
from scapy.layers.inet import * import dissector class POPField(StrField): """ field class for handling pop requests @attention: it inherets StrField from Scapy library """ holds_packets = 1 name = "POPField" def getfield(self, pkt, s): """ this method will get the packet...
apache-2.0
-6,762,339,654,415,857,000
32.242424
76
0.528715
false
4.20844
false
false
false
vodkina/GlobaLeaks
backend/globaleaks/__init__.py
1
3877
# -*- encoding: utf-8 -*- # # In here we shall keep track of all variables and objects that should be # instantiated only once and be common to pieces of GLBackend code. import operator __author__ = u'Random GlobaLeaks Developers' __copyright__ = u'2011-2016 - Hermes Center for Transparency and Digital Human Rights -...
agpl-3.0
-2,284,920,760,371,356,400
57.742424
114
0.627289
false
2.409571
false
false
false
alexey4petrov/reinteract
lib/reinteract/worksheet_print.py
1
16901
# Copyright 2010 Owen Taylor # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import cairo import gtk import logging import os impo...
bsd-2-clause
-5,488,128,483,892,452,000
35.424569
113
0.580794
false
4.087304
false
false
false
JohnVinyard/zounds
examples/pytorch_autoencoder.py
1
6006
import featureflow as ff import zounds import numpy as np from torch import nn, optim from random import choice import argparse class Layer(nn.Module): """ A single layer of our simple autoencoder """ def __init__(self, in_size, out_size): super(Layer, self).__init__() self.linear = n...
mit
3,228,416,969,978,474,000
28.15534
80
0.642691
false
3.789274
false
false
false
google/copper
setup.py
1
2883
#!/usr/bin/env python # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
5,362,490,084,838,656,000
32.917647
74
0.640652
false
4.178261
false
false
false
dalou/django-extended
django_extended/emailing/backend.py
1
1698
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.message import sanitize_address, DEFAULT_ATTACHMENT_MIME_TYPE from django.core.mail.backends.smtp import EmailBackend from .models import * class D...
bsd-3-clause
9,177,785,065,800,222,000
41.475
103
0.669611
false
3.824324
false
false
false
JHUISI/charm
charm/schemes/pkenc/pkenc_rabin.py
3
8299
''' | From: "Digitalized Signatures and Public-Key Functions as Intractable as Factorization". | Published in: 1979 | Security Assumption: Integer Factorization * type: public-key encryption * setting: Integer :Authors: Christina Garman :Date: 09/2011 ''' from charm.core.math.integer impo...
lgpl-3.0
4,507,165,928,135,755,000
33.152263
213
0.485842
false
3.048861
false
false
false
Qirky/PyKinectTk
PyKinectTk/utils/3D.py
1
2821
""" 3D.py is the interface for plotting Skeleton Wireframes in a 3D perspective using matplotlib """ # 3D Plotting tool from matplotlib import pyplot as plt from matplotlib import animation from mpl_toolkits.mplot3d import Axes3D # PyKinect XEF modules import Colour #: 3D View Obj class View: def __ini...
gpl-3.0
-4,112,668,133,531,983,000
22.90678
92
0.533499
false
3.644703
false
false
false
cwisecarver/osf.io
scripts/migrate_github_oauth_settings.py
9
7403
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to migrate addongithubusersettings and create and attach addongithuboauthsettings. Log: Executed on production by SL on 2014-10-05 at 23:11 EST. 269 AddonGithubUserSettings records were successfully migrated. 3 records with invalidated credentials were s...
apache-2.0
4,519,624,199,029,158,000
35.648515
115
0.530326
false
4.409172
true
false
false
krull/docker-zenoss4
init_fs/usr/local/zenoss/ZenPacks/ZenPacks.zenoss.MySqlMonitor-3.0.7.egg/ns/MySQLServer.py
3
3578
############################################################################## # # Copyright (C) Zenoss, Inc. 2013, all rights reserved. # # This content is made available according to terms specified in # License.zenoss under the directory where your Zenoss product is installed. # ##############################...
gpl-3.0
7,057,236,525,029,602,000
33.425743
78
0.633874
false
3.87649
false
false
false
prodigeni/pafy
setup.py
1
1301
#!/usr/bin/env python # -*- coding: utf-8 -*- from distutils.core import setup setup( name='Pafy', py_modules=['pafy'], version='0.3.35', description="Python API for YouTube, query and download YouTube content", keywords=["Pafy", "API", "YouTube", "youtube", "download", "video"], author="nagev...
gpl-3.0
-1,088,663,668,147,020,300
37.264706
77
0.59339
false
3.826471
false
false
false
sthirugn/automation-tools
automation_tools/satellite6/upgrade/tools.py
1
3568
"""A set of common tasks for automating interactions with Satellite & Capsule. Many commands are affected by environment variables. Unless stated otherwise, all environment variables are required. """ import subprocess import sys import time from fabric.api import execute, run def reboot(halt_time=300): """Reboo...
gpl-3.0
6,259,378,794,029,778,000
31.436364
78
0.598935
false
3.70894
false
false
false
camillemonchicourt/Geotrek-rando
rando/mobile/management/commands/build_mobile_data.py
1
8228
import os import re from django.conf import settings from django.core.management.base import BaseCommand from landez import TilesManager from landez.sources import DownloadError from optparse import make_option from urllib2 import unquote from zipfile import ZipFile from rando import logger from rando.core.models imp...
bsd-2-clause
8,750,252,728,628,399,000
37.629108
87
0.606223
false
3.653641
false
false
false
camicasi08/Vigtech
principal/migrations/0001_initial.py
3
1073
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
lgpl-3.0
-6,109,128,543,816,082,000
36
160
0.591799
false
3.778169
false
false
false
richleland/riak-python-client
riak/transports/transport.py
1
4802
""" Copyright 2010 Rusty Klophaus <rusty@basho.com> Copyright 2010 Justin Sheehy <justin@basho.com> Copyright 2009 Jay Baird <jay@mochimedia.com> This file is provided to you 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 o...
apache-2.0
6,393,035,310,194,002,000
29.392405
95
0.619534
false
4.190227
false
false
false
StuartMacKay/checklists_scrapers
checklists_scrapers/tests/utils.py
1
2260
"""Utility functions for tests.""" import json from multiprocessing import Process from scrapy.crawler import CrawlerProcess from scrapy.http import TextResponse, Request def response_for_content(content, encoding, url='http://example.com', metadata=None): """Create a Scrapy Response c...
bsd-3-clause
-2,762,344,069,867,175,000
28.736842
93
0.664602
false
4.064748
false
false
false
co/TheLastRogue
tile.py
1
5197
import colors from graphic import CharPrinter from stats import GamePieceTypes, DataPoint, DataTypes import compositecore import frame import terrain class Tile(object): def __init__(self): self.game_pieces = { GamePieceTypes.ENTITY: [], GamePieceTypes.CLOUD: [], GamePi...
bsd-2-clause
5,006,182,389,936,604,000
34.59589
102
0.631326
false
3.631726
false
false
false
Cadasta/cadasta-platform
cadasta/spatial/serializers.py
1
3677
from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from rest_framework import serializers from rest_framework_gis import serializers as geo_serializers from .models import SpatialUnit, SpatialRelationship from core import serializers as core_serializers from core.form_mixin...
agpl-3.0
-5,921,662,887,149,818,000
33.688679
78
0.613
false
4.419471
false
false
false
b-mueller/mythril
mythril/analysis/callgraph.py
1
6860
"""This module contains the configuration and functions to create call graphs.""" import re from jinja2 import Environment, PackageLoader, select_autoescape from z3 import Z3Exception from mythril.laser.ethereum.svm import NodeFlags from mythril.laser.smt import simplify default_opts = { "autoResize": True, ...
mit
5,933,509,625,536,386,000
26.114625
85
0.485423
false
3.775454
false
false
false
suselrd/django-catalog-wizard
catalog/tests/models.py
1
1410
# coding=utf-8 from django.contrib.auth.models import User from django.db import models from catalog.decorators import catalogue_enabled, catalogue_enabled_templates class Property(models.Model): name = models.CharField(max_length=100) picture = models.ImageField(null=True, upload_to="media/") owner = mod...
bsd-3-clause
-6,140,895,465,454,438,000
31.045455
90
0.730496
false
3.810811
false
false
false
yeleman/snisi
snisi_epidemiology/models.py
1
14811
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import datetime import reversion from py3compat import implements_to_string from django.db import models from django.dispatch impor...
mit
-4,359,059,578,131,013,000
33.60514
79
0.624131
false
3.503903
false
false
false