repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
OpenSight/StorLever
storlever/mngr/utils/zabbixagent.py
1
8763
""" storlever.mngr.utils.ntpmgr ~~~~~~~~~~~~~~~~ This module implements ntp server management. :copyright: (c) 2014 by OpenSight (www.opensight.cn). :license: AGPLv3, see LICENSE for more details. """ import os import os.path import subprocess from storlever.lib.config import Config from storlever.lib.command impo...
agpl-3.0
2,014,510,673,102,703,600
34.767347
101
0.634144
false
3.588452
true
false
false
Eureka22/ASM_xf
PythonD/site_python/twisted/scripts/websetroot.py
2
2906
# Twisted, the Framework of Your Internet # Copyright (C) 2001-2002 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed...
gpl-2.0
5,813,040,898,145,593,000
31.651685
79
0.602891
false
4.169297
true
false
false
tgbugs/pyontutils
nifstd/setup.py
1
2463
import re from pathlib import Path from setuptools import setup def find_version(filename): _version_re = re.compile(r"__version__ = '(.*)'") for line in open(filename): version_match = _version_re.match(line) if version_match: return version_match.group(1) __version__ = find_ver...
mit
-1,007,413,463,080,663,200
31.84
74
0.544458
false
3.777607
true
false
false
wujunnan0929/pedstrain-detection
doppia/src/tests/objects_detection/plot_channel_statistics.py
2
5526
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Companion script to doppia/src/tests/objects_detection/test_objects_detection Will plot the content of channel_statistics.txt """ from __future__ import print_function import pylab def main(): filename = "channel_statistics.txt" # parse the content ...
gpl-3.0
-4,115,158,841,492,788,700
33.111111
92
0.545784
false
3.54458
false
false
false
qadium-memex/CommonCrawlJob
aws/__main__.py
1
1487
from __future__ import print_function import sys from argparse import ArgumentParser from . import S3Remote def command_line(remote): prog = 'crawl_index' description = 'Helper tool to run MapReduce jobs over Common Crawl' crawl_list = ArgumentParser(add_help=False) crawl_list.add_argument( ...
apache-2.0
3,053,803,613,909,744,000
22.234375
94
0.570276
false
3.618005
false
false
false
ThiefMaster/indico
indico/modules/events/timetable/util.py
3
16943
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from collections import defaultdict from operator import attrgetter from flask import render_template, se...
mit
-1,825,261,157,495,425,300
46.063889
119
0.621496
false
4.064044
true
false
false
basak/glacier-cli
glacier_test.py
1
7446
#!/usr/bin/env python # Copyright (c) 2013 Robie Basak # # 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, ...
mit
7,930,861,665,525,968,000
39.688525
78
0.63054
false
3.626887
true
false
false
RHInception/re-worker-git
replugin/gitworker/__init__.py
1
11607
# -*- coding: utf-8 -*- # Copyright © 2014 SEE AUTHORS FILE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # #...
agpl-3.0
-3,250,987,112,263,276,000
35.961783
87
0.521368
false
4.572892
false
false
false
abhijitbangera/ecommerce
src/products/views.py
1
3497
from django.shortcuts import render,get_object_or_404, redirect from django.views.generic.detail import DetailView from django.views.generic.list import ListView from django.http import Http404 from django.db.models import Q from .forms import VariationInventoryFormSet from django.contrib import messages from .mixins i...
mit
-5,411,964,018,029,951,000
30.232143
100
0.729482
false
3.411707
false
false
false
edggy/grAIte
server/script.py
1
3927
from os import path from collections import deque import string import io from constants import SCRIPT_PATH import opcodes class Script: ''' A script is code to be run by each agent It has code ''' def __init__(self, scripName): self.ip = ip self.data = [] self.keys = ...
mit
-5,724,895,252,161,347,000
27.875
110
0.389865
false
4.658363
false
false
false
rfancn/myprojects
spload/handlers/ISPDownloadHandler.py
1
2723
import logging import urllib import xmlrpclib from handlerbase import Abort from handlerdl import DownloadHandler from network.httprequest import BadHeader from network.stringcookiejar import StringCookieJar class ISPDownloadHandler(DownloadHandler): def loadCookieFromSPAT(self): """ Load cookies from ce...
mit
-7,459,862,449,835,864,000
30.298851
104
0.596768
false
4.630952
false
false
false
edelooff/newWeb
newweb/scripts/tables.py
1
1309
# Originally from: http://code.activestate.com/recipes/577202/#c4 # Written by Vasilij Pupkin (2012) # Minor changes by Elmer de Looff (2012) # Licensed under the MIT License (http://opensource.org/licenses/MIT class ALIGN(object): LEFT, RIGHT = '-', '' class Column(list): def __init__(self, name, data, align=AL...
isc
-1,103,684,903,766,414,100
28.088889
68
0.608862
false
3.051282
false
false
false
rezoo/twopy
twopy/board.py
1
1589
#!/usr/bin/env python # -*- coding: utf-8 -*- import re from user import make_anonymous_user from exeptions import HttpStatusError, RegexError def make_subject_url(url): if url.endswith("/"): return url + "subject.txt" else: return url + "/subject.txt" def parse_board(string): if not is...
mit
2,028,491,065,550,726,100
32.104167
74
0.604783
false
3.819712
false
false
false
InformaticsMatters/pipelines
src/python/pipelines/rdkit/standardize.py
1
3592
#!/usr/bin/env python # Copyright 2018 Informatics Matters Ltd. # # 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 applicab...
apache-2.0
-3,940,250,534,355,485,000
33.873786
190
0.648942
false
3.947253
false
false
false
redhat-cip/dci-control-server
dci/worker/umb.py
1
4780
import datetime import json import os import logging from dci_umb.sender import send logger = logging.getLogger(__name__) def _get_architecture(job): arch = "x86_64" available_arches = ["x86_64", "ppc64le", "aarch64", "s390x"] for available_arch in available_arches: if available_arch in job["tag...
apache-2.0
8,607,258,574,056,000,000
33.388489
88
0.496234
false
3.914824
true
false
false
cdepman/falcon_api
site-packages/psycopg2cffi/_impl/exceptions.py
1
3830
import six try: StandardError = StandardError except NameError: StandardError = Exception class OperationError(Exception): pass from psycopg2cffi._impl.libpq import libpq, ffi class Warning(StandardError): pass class Error(StandardError): pgerror = None pgcode = None cursor = None ...
mit
3,383,562,870,674,136,000
21.011494
79
0.632115
false
3.556175
false
false
false
163gal/Time-Line
libs_arm/wx/tools/XRCed/plugins/core.py
4
26715
# Name: core.py # Purpose: Core components # Author: Roman Rolinsky <rolinsky@femagsoft.com> # Created: 31.05.2007 # RCS-ID: $Id: core.py 71860 2012-06-25 15:46:16Z ROL $ import wx from wx.tools.XRCed import component, images, attribute, params, view from wx.tools.XRCed.globals import TRA...
gpl-3.0
8,654,210,028,634,255,000
43.011532
119
0.641101
false
3.316574
false
false
false
bcoca/ansible-modules-extras
storage/netapp/netapp_e_facts.py
27
6628
#!/usr/bin/python # (c) 2016, NetApp, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
2,120,178,646,795,601,200
31.975124
111
0.621454
false
3.846779
false
false
false
ric2b/Vivaldi-browser
chromium/third_party/blink/tools/blinkpy/web_tests/port/mac.py
1
4464
# Copyright (C) 2010 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 the ...
bsd-3-clause
-5,245,923,353,456,412,000
42.339806
121
0.689068
false
3.757576
false
false
false
cs01/pygdbmi
pygdbmi/StringStream.py
1
2663
class StringStream: """A simple class to hold text so that when passed between functions, the object is passed by reference and memory does not need to be repeatedly allocated for the string. This class was written here to avoid adding a dependency to the project. """ def __init__(self, ra...
mit
6,418,003,625,747,280,000
31.876543
91
0.558017
false
4.498311
false
false
false
matuu/ligadefutbol
ligafutbol/gui/clubs_list.py
1
4556
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'src/clubs_list.ui' # # Created by: PyQt5 UI code generator 5.7.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_dialog_clubs(object): def setupUi(self, dialog_clubs): ...
gpl-3.0
4,354,716,603,889,257,500
53.238095
132
0.713345
false
3.491188
false
false
false
afl-mothership/afl-mothership
mothership/utils.py
1
1589
import datetime from math import floor, log def format_timedelta(value, time_format='{days} days {hours} hours {minutes} minutes'): if hasattr(value, 'seconds'): seconds = value.seconds + value.days * 24 * 3600 else: seconds = int(value) seconds_total = seconds minutes = int(floor(seconds / 60)) minutes_to...
mit
-7,442,773,628,749,256,000
26.413793
91
0.651982
false
2.832442
false
false
false
jensengrouppsu/rapid
rapid/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyside.py
50
3175
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './pyqtgraph/flowchart/FlowchartCtrlTemplate.ui' # # Created: Mon Dec 23 10:10:51 2013 # by: pyside-uic 0.2.14 running on PySide 1.1.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_F...
mit
-4,020,232,173,781,648,000
47.106061
122
0.695118
false
3.717799
false
false
false
BL-Labs/sample_generator_datatools
utils/marcutils.py
1
6861
#!/usr/bin/python # -*- coding: utf-8 -*- import pymarc, os, re from collections import defaultdict from settings import DATAROOT YEAR_P = re.compile(r"(1[0-9]{3})") def find_a_year(args): for term in args: d = YEAR_P.search(term) if d != None: return d.groups()[0] return u"" def generate_marcfi...
mit
-6,400,332,855,468,944,000
30.045249
124
0.628334
false
3.033156
false
false
false
jjstwerff/alien_engine
source/rbtree.py
1
3958
"""Simple tree-like structure""" import copy class DictIter(object): """Iterator through the tree""" __slots__ = 'data', 'keys', 'index' def __init__(self, data): self.data = data self.keys = sorted(data.keys()) self.index = -1 # ready to iterate on the next() call def __nex...
gpl-3.0
8,465,472,074,384,940,000
28.984848
79
0.551794
false
4.114345
false
false
false
mach327/chirp_fork
chirp/drivers/ic208.py
2
7770
# Copyright 2013 Dan Smith <dsmith@danplanet.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 later version. # # This program is ...
gpl-3.0
4,489,974,256,005,181,000
28.770115
76
0.553411
false
3.038717
false
false
false
sagemathinc/smc
src/dev/project/start_postgres.py
5
2083
#!/usr/bin/env python """ This is a script for starting postgres for development purposes in an SMC project. """ import os, sys, time, util path = os.path.split(os.path.realpath(__file__))[0]; os.chdir(path); sys.path.insert(0, path) PG_DATA = os.path.join(path, "postgres_data") if not os.path.exists(PG_DATA): ...
agpl-3.0
-4,752,196,203,030,599,000
32.596774
97
0.666827
false
3.259781
false
false
false
codeforamerica/mdc-feedback
feedback/public/views.py
1
2650
# -*- coding: utf-8 -*- """Public section, including homepage and signup.""" import ujson import urllib import datetime today = datetime.date.today() try: import urllib.request as urllib2 except ImportError: import urllib2 from flask import ( Blueprint, request, render_template, flash, current_app, ...
mit
3,382,055,097,900,435,000
27.804348
107
0.641132
false
3.675451
false
false
false
wooey/Wooey
wooey/conf/project_template/settings/wooey_settings.py
1
1333
from .django_settings import * from wooey.version import DJANGO_VERSION, DJ110 from django.utils.translation import ugettext_lazy as _ INSTALLED_APPS += ( # 'corsheaders', 'wooey', ) if DJANGO_VERSION < DJ110: MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) MIDDLEWARE_CLASSES.append('{{ project_name }}....
bsd-3-clause
-3,964,541,111,412,052,500
28.622222
89
0.672168
false
3.545213
false
false
false
WMD-group/MacroDensity
examples/ActiveSpace.py
1
3926
#! /usr/bin/env python import macrodensity as md import math import numpy as np import matplotlib.pyplot as plt import csv from itertools import izip #------------------------------------------------------------------ # Get the potential # This section should not be altered #----------------------------------------...
mit
-3,934,570,029,597,105,000
37.490196
114
0.546612
false
3.271667
false
false
false
mschmidt87/python-neo
neo/core/analogsignal.py
5
20804
# -*- coding: utf-8 -*- ''' This module implements objects relating to analog signals, :class:`BaseAnalogSignal` and its child :class:`AnalogSignal`. :class:`AnalogSignalArray` is derived from :class:`BaseAnalogSignal` but is defined in :module:`neo.core.analogsignalarray`. :class:`IrregularlySampledSignal` is not de...
bsd-3-clause
3,470,357,480,423,491,000
36.017794
79
0.55273
false
4.256137
false
false
false
majora2007/plexpy
lib/pygazelle/torrent_group.py
27
7252
from .torrent import Torrent class InvalidTorrentGroupException(Exception): pass class TorrentGroup(object): """ Represents a Torrent Group (usually an album). Note that TorrentGroup.torrents may not be comprehensive if you haven't called TorrentGroup.update_group_data()...it may have only been popula...
gpl-3.0
-8,363,289,931,290,770,000
51.172662
149
0.628378
false
4.026652
false
false
false
Snergster/virl-salt
openstack/neutron/files/kilo/plugin.py
1
72636
# Copyright (c) 2013 OpenStack Foundation # 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 ...
gpl-2.0
-8,146,864,215,293,628,000
46.598952
79
0.570599
false
4.460575
false
false
false
31415us/trajectory
py/env/lib/python2.7/site-packages/setuptools/tests/test_egg_info.py
1
2207
import os import sys import tempfile import shutil import unittest import pkg_resources from setuptools.command import egg_info from setuptools import svn_utils ENTRIES_V10 = pkg_resources.resource_string(__name__, 'entries-v10') "An entries file generated with svn 1.6.17 against the legacy Setuptools repo" class Te...
mit
-5,422,201,353,999,255,000
28.824324
78
0.596738
false
3.740678
true
false
false
HarveyHunt/tyled
tyled/tyled.py
1
4665
#!/usr/bin/env python3 import argparse import re import logging from PIL import Image from tyled.effects import apply_effects, apply_filters from tyled.patterns import apply_pattern def main(args): out = Image.new('RGBA', (args.width, args.height), args.background) tiles = [] if args.tiles: for t...
gpl-3.0
-7,621,474,389,457,671,000
36.926829
96
0.624009
false
3.826907
false
false
false
tensorflow/tflite-support
tensorflow_lite_support/metadata/python/tests/metadata_test.py
2
36500
# Copyright 2020 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
-3,651,751,983,085,810,700
41.44186
89
0.71389
false
3.722211
true
false
false
benelot/bullet-gym
pybulletgym/envs/gym_forward_walkers.py
1
10842
from distutils.command.config import config from pybulletgym.envs.scene_abstract import SingleRobotEmptyScene from pybulletgym.envs.scene_stadium import SinglePlayerStadiumScene from gym_mujoco_xml_env import PybulletMujocoXmlEnv import gym, gym.spaces, gym.utils, gym.utils.seeding import numpy as np import os, sys c...
mit
-6,181,381,771,974,843,000
43.987552
166
0.682808
false
2.625182
false
false
false
Nan93/wxbot-clock
wxbot.py
1
50928
#!/usr/bin/env python # coding: utf-8 import os import sys import traceback import webbrowser import pyqrcode import requests import mimetypes import json import xml.dom.minidom import urllib import time import re import random from traceback import format_exc from requests.exceptions import ConnectionError, ReadTimeo...
apache-2.0
-1,308,928,200,595,814,400
37.699608
420
0.485834
false
3.582256
false
false
false
tdyas/pants
src/python/pants/testutil/test_base.py
1
33698
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import itertools import logging import os import unittest import warnings from abc import ABC, ABCMeta, abstractmethod from collections import defaultdict from contextlib import contextman...
apache-2.0
4,055,148,794,678,700,000
37.336746
107
0.625586
false
4.31583
true
false
false
srusskih/SublimeBicycleRepair
bike/query/findDefinition.py
1
9774
from __future__ import generators from bike.query.common import Match, MatchFinder, \ getScopeForLine, indexToCoordinates, \ translateSourceCoordsIntoASTNode, scanScopeForMatches, \ isAMethod, convertNodeToMatchObject, walkLinesContainingStrings from bike.parsing.parserutils import generateLogicalLines,\...
mit
-1,420,466,848,213,629,000
34.285199
79
0.609576
false
4.454877
false
false
false
mdurrant-b3/acos-client
acos_client/tests/unit/v21/test_high_availability.py
2
1714
# Copyright 2014, Doug Wiegley, A10 Networks. # # 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
3,472,475,755,547,812,400
34.708333
85
0.705951
false
3.678112
true
false
false
JesusTorrado/cosmo_mini_toolbox
examples/plot_lik_example_summary.py
1
1030
import os import sys import matplotlib.pyplot as plt sys.path.append("../src") from Chain import Chain from plot_lik import plot_lik_2D base_folder = "./chains" chain = "planck_WP" chains = [Chain(os.path.join(base_folder, chain))] params=["H0", "omega_b"] labels=[r"$H_0$", r"$\omega_b$"] fig, axarr = plt.subplo...
gpl-3.0
2,794,667,350,369,179,000
27.611111
140
0.615534
false
2.82967
false
false
false
LudovicRousseau/pyscard
smartcard/sw/ErrorCheckingChain.py
2
3520
"""The error checking chain is a list of status word (sw1, sw2) error check strategies. __author__ = "http://www.gemalto.com" Copyright 2001-2012 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com This file is part of pyscard. pyscard is free software; you can redistribute it and/or modify it...
lgpl-2.1
-1,702,786,570,087,140,400
36.052632
75
0.659943
false
4.16568
false
false
false
algorhythms/LeetCode
139 Word Break.py
3
3284
""" Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, given s = "leetcode", dict = ["leet", "code"]. Return true because "leetcode" can be segmented as "leet code". """ __author__ = 'Danyang' class S...
mit
8,804,632,450,728,369,000
33.333333
145
0.417174
false
3.673378
false
false
false
hrayr-artunyan/shuup
shuup/front/template_helpers/product.py
2
3358
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from jinja2.utils import contextfunction from shuup.core.models import ( ...
agpl-3.0
-4,474,399,706,157,997,600
34.723404
113
0.692674
false
3.855339
false
false
false
Anmol-Singh-Jaggi/gDrive-auto-sync
gDrive-auto-sync/api_boilerplate.py
1
1850
""" This module is responsible for doing all the authentication. Adapted from the Google API Documentation. """ from __future__ import print_function import os import httplib2 import apiclient import oauth2client try: import argparse flags = argparse.ArgumentParser( parents=[oauth2client.tools.argpar...
mit
296,546,577,918,135,200
30.355932
74
0.692432
false
4.013015
false
false
false
stratus-ss/python_scripts
openshift_scripts/pipeline_related/log.py
1
2198
import sys import os.path import logging import colorlog import inspect from logging.handlers import RotatingFileHandler # make external modules only log above warning and upper logging.getLogger("paramiko").setLevel(logging.WARNING) logging.getLogger("requests").setLevel(logging.WARNING) # define root logging strat...
lgpl-3.0
-2,924,091,142,885,948,400
26.822785
83
0.631483
false
3.461417
false
false
false
mF2C/COMPSs
compss/programming_model/bindings/python/src/pycompss/matlib/algebra/mean.py
1
1823
#!/usr/bin/python # # Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
apache-2.0
-762,812,293,143,996,200
24.319444
75
0.642348
false
3.588583
false
false
false
ssafar/effulgence2epub
src/gen_html.py
2
1058
#!/usr/bin/python """As usual, we eat chapters from stdin and output xhtml files, this time with nice CSS and no tables. We don't copy the images to the relevant places since that's not really amenable to parallelization (which is too much fun).""" import os import pkg_resources import pyratemp import common chapt...
agpl-3.0
-2,889,829,906,240,603,000
29.228571
82
0.651229
false
3.861314
false
false
false
j3rgus/assignments
math toys/hw2.py
1
2240
import numpy as np from PIL import Image from random import randint from math import sqrt, factorial ################### A #################### def perm(l): if not l: return [l] else: res = [] for i in range(len(l)): r = l[:i] + l[i+1:] for x in perm(r): res.append(l[i:i+1] + x) return res ########...
gpl-3.0
7,143,100,578,823,331,000
18.823009
51
0.511607
false
2.22002
false
false
false
rbuffat/pyidf
tests/test_coolingtowervariablespeed.py
1
8903
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.condenser_equipment_and_heat_exchangers import CoolingTowerVariableSpeed log = logging.getLogger(__name__) class TestCoolingTowerVariableSpeed(unittest.TestCase): def setUp...
apache-2.0
2,277,212,770,271,596,500
56.818182
183
0.716163
false
3.329469
false
false
false
kingrichard2005/qsarweb-public
qsar/helper.py
1
4992
import csv import time import math import sys import os def placeDataIntoArray(fileName): '''Read uploaded data into memory''' try: from numpy import * # provides complex math and array functions with open(fileName, mode='rbU') as csvfile: datareader = csv.reader(csvfile, de...
mit
-4,856,937,899,934,640,000
46.103774
145
0.557893
false
3.617391
true
false
false
wbthomason/minigrade
minigrade.py
1
17857
from flask import Flask, render_template, request, jsonify, Response, abort, session, stream_with_context, redirect, g from ast import literal_eval import subprocess import re import requests import json import shutil import time import os import sqlite3 import logging import sys import commands import threading minig...
mit
-4,476,878,641,102,194,700
38.332599
147
0.552668
false
3.685655
true
false
false
uaprom-summer-2015/Meowth
project/bl/__init__.py
2
1048
from .auth import UserBL, TokenBL from .feed import CategoryBL, CityBL, VacancyBL from .pages import PageBL, PageBlockBL, PageChunkBL from .mail import MailTemplateBL from .utils import registry from .uploads import UploadedImageBL __all__ = ["UserBL", "CategoryBL", "CityBL", "VacancyBL", "PageBL", "PageBlo...
bsd-3-clause
-6,181,116,566,507,573,000
46.636364
77
0.726145
false
3.481728
false
false
false
rodgzilla/buddhabrot
buddha_parallel_bulb.py
1
7625
from PIL import Image import multiprocessing import math sequence_function = lambda z_n, c : z_n ** 2 + c def is_in_cardoid_or_bulb(z): """Algorithm for the test: https://en.wikipedia.org/wiki/Mandelbrot_set#Optimizations """ p = math.sqrt((z.real - 1. / 4) ** 2 + z.imag ** 2) return z.real < p -...
gpl-2.0
-862,092,054,715,396,600
38.102564
84
0.585443
false
3.765432
false
false
false
stvstnfrd/edx-platform
common/djangoapps/track/tests/test_util.py
5
1275
# lint-amnesty, pylint: disable=missing-module-docstring import json from datetime import datetime from django.test import TestCase from pytz import UTC from common.djangoapps.track.utils import DateTimeJSONEncoder class TestDateTimeJSONEncoder(TestCase): # lint-amnesty, pylint: disable=missing-class-docstring ...
agpl-3.0
-1,201,009,096,320,396,500
32.552632
97
0.604706
false
3.418231
false
false
false
matthijsvk/multimodalSR
code/Experiments/neon-master/tests/test_beamsearch.py
1
8214
# ---------------------------------------------------------------------------- # Copyright 2015-2016 Nervana Systems 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.apa...
mit
4,307,300,257,928,656,000
43.16129
98
0.498417
false
3.548164
false
false
false
ramiroluz/cookiecutter
cookiecutter/config.py
1
1724
#!/usr/bin/env python # -*- coding: utf-8 -*- """ cookiecutter.config ------------------- Global configuration handling """ from __future__ import unicode_literals import copy import logging import os import io try: import ruamel.yaml as yaml except ImportError: import yaml from .exceptions import ConfigDo...
bsd-3-clause
-6,222,203,247,279,411,000
23.28169
79
0.639791
false
3.739696
true
false
false
Kinggerm/GetOrganelle
Utilities/join_spades_fastg_by_blast.py
1
24526
#!/usr/bin/env python # coding:utf8 import time import os import sys import platform import subprocess try: # python2 import commands except: pass from argparse import ArgumentParser PATH_OF_THIS_SCRIPT = os.path.split(os.path.realpath(__file__))[0] sys.path.insert(0, os.path.join(PATH_OF_THIS_SCRIPT, "..")...
gpl-3.0
2,539,933,049,302,687,000
55.125858
191
0.571312
false
3.548835
false
false
false
tuskar/tuskar
tuskar/api/controllers/v1/types/rack.py
1
2776
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicabl...
apache-2.0
-7,753,077,215,130,675,000
37.569444
88
0.592219
false
3.92645
false
false
false
SchrodingersGat/kicad-library-utils
schlib/rules/S7_1.py
2
3476
# -*- coding: utf-8 -*- from rules.rule import * import re class Rule(KLCRule): """ Create the methods check and fix to use with the kicad lib files. """ def __init__(self, component): super(Rule, self).__init__(component, 'Power-flag symbols follow some special rules/KLC-exceptions') ...
gpl-3.0
-7,710,074,112,509,439,000
44.142857
172
0.556674
false
4.138095
false
false
false
jrising/computer
computer/paramiko_server.py
1
1649
import sys, time import paramiko from linux_server import SizelessLinuxServer class ParamikoServer(SizelessLinuxServer): def receive(self): stdout = "" while self.session.recv_ready(): stdout += self.session.recv(sys.maxint) stderr = "" while self.session.recv_stderr_r...
mit
7,623,619,950,642,216,000
26.032787
80
0.559127
false
4.185279
false
false
false
gronostajo/droogle
base.py
1
5821
from collections import Counter import gzip from operator import itemgetter from os import listdir, path import re import cPickle as pickle import json from math import log, sqrt from scipy.sparse import csr_matrix, lil_matrix, coo_matrix import numpy as np from sklearn.preprocessing import normalize import unicodedat...
gpl-2.0
904,110,846,443,576,600
30.989011
116
0.579282
false
3.674874
false
false
false
Damnever/Chat-Room
taskq/utils.py
1
4730
# -*- coding: utf-8 -*- """ Logging support with colors, just available in *unix. Borrow from `tornado.log`: https://github.com/tornadoweb/tornado/blob/master/tornado/log.py """ from __future__ import print_function, division import sys import functools import logging import logging.handlers try: import curs...
bsd-3-clause
59,938,001,376,948,150
27.154762
87
0.598097
false
3.899423
false
false
false
luisza/vcl_django
reservations/models.py
1
5527
from __future__ import unicode_literals from django.db import models from authentication.models import User, Usergroup from compute.models import Computer from image.models import Image, Imagerevision from managementnode.models import Managementnode from core.models import State class Request(models.Model): stat...
apache-2.0
-5,905,803,189,161,662,000
39.057971
123
0.713226
false
3.919858
false
false
false
vnaboychenko/stackalytics
tests/api/test_releases.py
7
2555
# Copyright (c) 2013 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,059,603,577,272,623,000
43.051724
77
0.598043
false
3.757353
true
false
false
ossCare/svnPlus
tagProtect/Python/setup.py
1
2721
# # Copyright 2015,2016,2017 Joseph C. Pietras # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
gpl-2.0
7,970,045,648,241,159,000
41.515625
166
0.626975
false
3.637701
false
false
false
Mehnen/BOINSO
core/migrations/0003_satellite.py
1
1044
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('core', '0002_auto_20150428_1430'), ] operations = [ migrations.CreateModel( name='Satellite', fields...
apache-2.0
-602,068,294,722,521,700
36.285714
248
0.550766
false
4.062257
false
false
false
aajanki/youtube-dl
youtube_dl/extractor/viki.py
5
10269
from __future__ import unicode_literals import time import hmac import hashlib import itertools from ..utils import ( ExtractorError, int_or_none, parse_age_limit, parse_iso8601, ) from .common import InfoExtractor class VikiBaseIE(InfoExtractor): _VALID_URL_BASE = r'https?://(?:www\.)?viki\.(?:...
unlicense
-8,650,367,813,478,250,000
34.410345
121
0.510761
false
3.510769
false
false
false
scream7/leetcode
algorithms/python/232.py
1
1090
class Queue(object): def __init__(self): """ initialize your data structure here. """ self.stack1 = [] self.stack2 = [] def push(self, x): """ :type x: int :rtype: nothing """ self.stack1.append(x) def pop(self): """ ...
apache-2.0
-8,064,676,924,825,861,000
19.566038
61
0.438532
false
3.416928
false
false
false
gregpuzzles1/Sandbox
WordGolf-0.2.4/game/scorespage.py
1
6378
"""This is page for showing the high scores""" import pygame import sys import os import serge.visual import serge.actor import serge.common import serge.sound import serge.engine import serge.blocks.visualblocks import serge.blocks.scores import game import common from theme import get as G ### The high score ta...
gpl-3.0
-8,383,739,616,639,641,000
39.624204
136
0.588429
false
3.61975
false
false
false
jcpowermac/ansible
lib/ansible/modules/cloud/ovirt/ovirt_vms.py
2
73025
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCU...
gpl-3.0
4,588,817,234,274,543,000
42.364014
158
0.571996
false
4.239231
false
false
false
Alwnikrotikz/pyglet
tests/clock/SCHEDULE_ONCE.py
33
1396
#!/usr/bin/env python '''Test that a scheduled function gets called every once with the correct time delta. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $' import time import unittest from pyglet import clock __noninteractive = True class SCHEDULE_ONCE(u...
bsd-3-clause
1,906,539,223,165,805,300
24.851852
73
0.603152
false
3.224018
true
false
false
gizmo-cda/g2x-submarine-v2
scripts/video/get_stream.py
1
1243
#!/usr/bin/env python3 import requests frames = [] data = b"" found_first = False response = requests.get("http://navigation.local:8080/stream/video.h264", stream=True) for chunk in response.iter_content(chunk_size=1024): if chunk: starting_offset = len(data) if starting_offset >= 2: ...
bsd-3-clause
-6,991,393,197,337,940,000
27.906977
86
0.517297
false
4.088816
false
false
false
Caranarq/01_Dmine
02_Aire/P0221/P0221.py
1
2750
# -*- coding: utf-8 -*- """ Started on fri, jul 27th, 2018 @author: carlos.arana """ # Librerias utilizadas import pandas as pd import sys module_path = r'D:\PCCS\01_Dmine\Scripts' if module_path not in sys.path: sys.path.append(module_path) from VarInt.VarInt import VarInt from classes.Meta import Meta from Comp...
gpl-3.0
-8,705,888,511,100,321,000
36.067568
118
0.637988
false
2.959008
false
true
false
nheijmans/ZooKeeper
malzoo/core/services/distributor.py
2
2858
#!/usr/bin/python """ Distributor checks the queue and decides were the data should go to next. Workers can add hashes or files to the queue for services to search or analyze and the distrbutor will facilitate in that by offering a central point. In the future it will also make sure the samples are distributed to the ...
gpl-2.0
1,797,698,076,426,995,000
42.969231
97
0.559832
false
4.356707
false
false
false
dsantin/PaellaInteractiveVideo
build.py
1
2728
#! /usr/bin/env python # -*- coding: utf-8 -*- import sys import os import subprocess import shutil import json import argparse from subprocess import call pluginDir = 'plugins/' paellaDir = 'src/' javascriptFile = 'javascript/paella_player.js' cssFile = 'plugins/plugins.css' arguments = argparse.ArgumentParser(des...
gpl-2.0
-8,803,945,977,534,689,000
27.416667
101
0.733871
false
3.124857
false
false
false
Celthi/youtube-dl-GUI
setup.py
2
1279
from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') DATA=[('imageformats',[ 'C:\Users\yasoob\Anaconda\Lib\site-packages\PyQt4\plugins\imageformats\qjpeg4.dll', 'C:\Users\yasoob\Anaconda\Lib\site-packages\PyQt4\plugins\imageformats\qgif4.dll', 'C:\Users\yasoob\Anaconda...
mit
-5,551,135,083,274,225,000
40.7
103
0.630962
false
2.94023
false
false
false
ntamas/python-selecta
selecta/utils.py
1
2999
from itertools import chain from string import printable import unicodedata __all__ = ["each_index_of_string", "identity", "is_printable", "list_packer", "safeint"] def each_index_of_string(string, corpus): """Finds all occurrences of a given string in a corpus. Args: string (str): the st...
mit
-3,022,395,576,088,505,300
30.568421
80
0.674892
false
4.48281
false
false
false
Sotera/aggregate-micro-paths
hive-streaming/conf/config.py
1
3321
# Copyright 2016 Sotera Defense Solutions 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 agre...
apache-2.0
7,993,782,075,275,329,000
45.125
211
0.700391
false
3.694105
true
false
false
lann/gerritrestclient
gerritrestclient/endpoint.py
1
1981
import functools import inspect import urllib def maybe_quote(str_or_none): if str_or_none is None: return None return urllib.quote(str_or_none) class EndpointMixin(object): _endpoint_parent = None @classmethod def endpoint_parts(cls): parts = [] parent = cls._e...
mit
-1,497,542,085,637,198,800
24.397436
80
0.516406
false
4.382743
false
false
false
lmandres/MeSH-Analysis-Methodology
searchlib/eutils.py
1
41139
''' Created on Jul 7, 2011 @author: Leo Andres (user) ''' import http import re import socket #import sys import time #import urllib import urllib.error import urllib.parse import urllib.request #import urllib2 class QueryEUtilsBase: http_error_codes = { 100: ('Continue', 'Request receiv...
gpl-2.0
-6,642,133,664,839,098,000
35.962264
210
0.50412
false
4.192296
false
false
false
hgascon/pulsar
pulsar/core/sippy/SipCallId.py
1
1919
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved. # # This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA. # # SIPPY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
bsd-3-clause
8,509,275,359,061,580,000
37.38
110
0.696717
false
3.593633
false
false
false
dferguso/IGT4SAR
HastyLine_Assigment.py
1
3982
#------------------------------------------------------------------------------- # Name: HastyLine_Assignment.py # # Purpose: Create Quick Response Task stored in the Assignments layer from a # "Hasty Point" feature. # # Author: Don Ferguson # # Created: 06/25/2012 # Copyright: (c) Don Ferguson 2012 ...
gpl-3.0
-5,015,328,674,675,826,000
31.120968
137
0.638373
false
3.157811
false
false
false
adcomp/super-fruit-pie
tuto/06_collect.py
1
7778
#!/usr/bin/python # -*- coding: utf-8 -*- # David Art <david.madbox@gmail.com> # Program Arcade Games With Python And Pygame - Build a Platformer # http://programarcadegames.com import pygame import random WIDTH = 640 HEIGHT = 480 class Platform (pygame.sprite.Sprite): def __init__(self, width, he...
mit
-412,745,760,245,602,750
25.195804
92
0.575598
false
3.532243
false
false
false
bbusemeyer/mython
drivers/scan_pw.py
2
3001
import sys import os from copy import deepcopy import subprocess as sp from mython import gen_qsub def writelines(lines): strlines = [" ".join(line) for line in lines] def submit_job(base,lines,cwd): if not os.path.exists(base): os.mkdir(base) os.chdir(base) with open("%s.inp"%base,'w') as outf: outf.writ...
gpl-2.0
-1,392,826,540,828,022,800
27.046729
67
0.591803
false
2.789033
false
false
false
Leopardob/dice-dev
dice/dice_extras/core_app.py
1
4399
# Standard Python modules # ======================= import os # Standard Python modules # ======================= from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot, qDebug, QUrl, QAbstractListModel, QModelIndex, \ Qt, QVariant, QUrl from PyQt5.QtQuick import QQuickItem # DICE modules # ========...
gpl-3.0
5,779,190,735,725,706,000
28.52349
118
0.616731
false
3.805363
false
false
false
huxianglin/pythonstudy
week07-胡湘林/FTP_server/public/commons.py
1
1955
#!/usr/bin/env python # encoding:utf-8 # __author__: commons # date: 2016/10/2 13:47 # blog: http://huxianglin.cnblogs.com/ http://xianglinhu.blog.51cto.com/ import hashlib import time import os from conf import settings def encrypt_passwd(passwd): """加密密码""" sha256_obj=hashlib.sha256() sha256_obj.update(...
gpl-3.0
-5,946,956,106,803,415,000
32.946429
160
0.64545
false
2.984301
false
false
false
reminisce/mxnet
example/automatic-mixed-precision/amp_model_conversion.py
1
6305
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
1,404,398,644,587,556,400
51.983193
157
0.617288
false
3.793622
false
false
false
ceos-seo/data_cube_ui
apps/fractional_cover/models.py
1
9473
# Copyright 2016 United States Government as represented by the Administrator # of the National Aeronautics and Space Administration. All Rights Reserved. # # Portion of this code is Copyright Geoscience Australia, Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this file # except in c...
apache-2.0
7,047,605,444,043,234,000
40.371179
119
0.656392
false
4.102642
false
false
false
mcdaniel67/sympy
sympy/sets/fancysets.py
9
27393
from __future__ import print_function, division from sympy.logic.boolalg import And from sympy.core import oo from sympy.core.basic import Basic from sympy.core.compatibility import as_int, with_metaclass, range from sympy.sets.sets import (Set, Interval, Intersection, EmptySet, Union, Fin...
bsd-3-clause
-1,737,921,225,718,698,200
28.710412
93
0.527178
false
3.807227
false
false
false
mfherbst/spack
var/spack/repos/builtin/packages/r-alsace/package.py
2
2034
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
4,785,196,162,717,225,000
46.302326
78
0.692724
false
4.051793
false
false
false
detly/coan-packaging
python/coanlib.py
1
12012
#!/usr/bin/python # Module coanlib provides utility routines for the coan test harnesses import sys, os, subprocess, re, shutil, string, shlex, time, atexit, \ errno __progress = 0 __info = 1 __warning = 2 __error = 3 __fatal = 4 __severities_by_word = { 'progress' : __progress, 'info' : __info, 'warning' : __wa...
bsd-3-clause
4,693,554,869,173,499,000
25.752784
86
0.658675
false
2.933333
true
false
false
frappe/frappe
frappe/automation/doctype/milestone_tracker/milestone_tracker.py
1
1460
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies and contributors # For license information, please see license.txt import frappe from frappe.model.document import Document import frappe.cache_manager from frappe.model import log_types class MilestoneTracker(Document): def on_update(self): frappe....
mit
-3,799,643,336,522,752,500
31.444444
81
0.734932
false
3.208791
false
false
false
aaae/kazam
kazam/backend/grabber.py
2
7672
# -*- coding: utf-8 -*- # # grabber.py # # Copyright 2012 David Klasinc <bigwhale@lubica.net> # # 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 ...
gpl-3.0
2,435,549,433,357,760,500
40.247312
111
0.501173
false
3.851406
false
false
false
demophoon/sams-client
client/check.py
1
1348
""" Perform http checks and generate reports """ import urllib import urllib2 from client.cli import parser class Check(object): def __init__(self, url, checkType='http', method='GET', data=None, headers=None, ...
mit
1,980,387,785,553,849,900
16.736842
44
0.491098
false
3.930029
false
false
false
inkerra/cinder
cinder/tests/keymgr/mock_key_mgr.py
1
3617
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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 L...
apache-2.0
-1,597,223,274,417,341,200
32.803738
78
0.66298
false
4.357831
false
false
false
whelan957/leetcode
python3/Design/leetcode000First Unique Number2.py
1
3883
# You have a queue of integers, you need to retrieve the first unique integer in the queue. # Implement the FirstUnique class: # FirstUnique(int[] nums) Initializes the object with the numbers in the queue. # int showFirstUnique() returns the value of the first unique integer of the queue, and returns -1 if there is ...
gpl-3.0
9,048,359,477,316,779,000
30.827869
127
0.608035
false
3.086645
false
false
false
dmccloskey/SBaaS_isotopomer
template_scripts/template_analyzeMRMdata.py
1
6931
import sys sys.path.append('C:/Users/dmccloskey-sbrg/Google Drive/SBaaS_base') #sys.path.append('C:/Users/dmccloskey/Google Drive/SBaaS_base') from SBaaS_base.postgresql_settings import postgresql_settings from SBaaS_base.postgresql_orm import postgresql_orm # read in the settings file filename = 'C:/Users/dmccloskey-...
mit
6,447,267,082,143,363,000
39.776471
156
0.747367
false
2.679165
false
false
false
NewEconomyMovement/nem-py
Account.py
2
1522
import ed25519 from python_sha3.python_sha3 import * import base64 import hashlib from binascii import hexlify, unhexlify class Account: def __init__(self, hexPrivKey, network='mainnet'): self.hexPrivKey = hexPrivKey self.network = network self._calculateKeyPair() sel...
mit
7,082,993,817,338,588,000
23.79661
89
0.583443
false
3.703163
false
false
false