repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
jaseg/python-mpv
setup.py
1
1155
#!/usr/bin/env python3 from setuptools import setup setup( name = 'python-mpv', version = '0.5.1', py_modules = ['mpv'], description = 'A python interface to the mpv media player', url = 'https://github.com/jaseg/python-mpv', author = 'jaseg', author_email = 'github@jaseg.net', license ...
agpl-3.0
5,502,061,537,492,389,000
34
93
0.575758
false
3.737864
false
true
false
mahabuber/erpnext
erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2
26538
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.utils import cint, flt from frappe import _, msgprint, throw from erpnext.accounts.party import get_par...
agpl-3.0
6,422,347,278,987,420,000
35.204638
153
0.685771
false
3.065496
false
false
false
ahwillia/PyNeuron-Toolbox
PyNeuronToolbox/neuromorpho.py
1
5790
""" Scraper for querying NeuroMorpho.Org from Python. For more on NeuroMorpho.Org, see: Ascoli GA, Donohue DE, Halavi M. (2007) NeuroMorpho.Org: a central resource for neuronal morphologies.J Neurosci., 27(35):9247-51 Run this file as a stand-alone script for a demo. The demo queries NeuroMorpho.Org in gener...
mit
-963,203,165,447,386,800
35.19375
137
0.647323
false
3.306682
false
false
false
cloudify-cosmo/cloudify-cli
cloudify_cli/tests/commands/test_deployments.py
1
48285
######## # Copyright (c) 2018 Cloudify Platform Ltd. 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 requi...
apache-2.0
-2,392,071,210,047,672,000
40.339897
79
0.589334
false
4.071248
true
false
false
Scille/parsec-cloud
parsec/backend/vlob.py
1
13190
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS from typing import List, Tuple, Dict, Optional from uuid import UUID import pendulum from parsec.utils import timestamps_in_the_ballpark from parsec.api.protocol import ( DeviceID, OrganizationID, vlob_create_serializer, v...
agpl-3.0
-1,780,366,703,321,259,500
31.407862
100
0.605762
false
4.125743
false
false
false
nakagami/reportlab
src/reportlab/pdfbase/ttfonts.py
1
45587
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__ = '$Id: ttfonts.py 3959 2012-09-27 14:39:39Z robin $' __doc__="""TrueType font support This defines classes to represent TrueType fonts. They know how to calculate their own width and how to write themselves into PDF files. T...
bsd-3-clause
468,004,839,853,736,800
38.67537
179
0.566653
false
3.866254
false
false
false
lightalchemist/ML-algorithms
dim_reduction/spectral_embedding.py
1
1410
# -*- coding: utf-8 -*- import numpy as np def compute_pairwise_distance_matrix(X, k): """Compute pairwise distances between each point in X and its k-nearest neighbors.""" from scipy.spatial import KDTree kdtree = KDTree(X) A = np.zeros((X.shape[0], X.shape[0]), dtype=np.float) for i, x in...
mit
6,210,406,793,321,975,000
33.390244
82
0.614184
false
3.019272
false
false
false
mick-d/nipype
nipype/interfaces/nipy/model.py
7
13161
# -*- coding: utf-8 -*- from __future__ import print_function, division, unicode_literals, absolute_import from builtins import range, str, bytes import os import nibabel as nb import numpy as np from ...utils.misc import package_check from ...utils import NUMPY_MMAP from ..base import (BaseInterface, TraitedSpec, ...
bsd-3-clause
6,562,482,735,676,853,000
39.74613
112
0.52458
false
3.957005
false
false
false
X-dark/Flexget
flexget/__init__.py
1
1135
#!/usr/bin/python from __future__ import unicode_literals, division, absolute_import import os import logging from flexget import logger from flexget.options import get_parser from flexget import plugin from flexget.manager import Manager __version__ = '{git}' log = logging.getLogger('main') def main(args=None): ...
mit
-4,021,792,851,769,180,700
26.682927
74
0.672247
false
3.968531
false
false
false
spcui/virt-test
virttest/libvirt_xml/vol_xml.py
1
3408
""" Module simplifying manipulation of XML described at http://libvirt.org/ """ from virttest.libvirt_xml import base, accessors class VolXMLBase(base.LibvirtXMLBase): """ Accessor methods for VolXML class. Properties: name: string, operates on XML name tag uuid: string, operates on uui...
gpl-2.0
-8,600,053,957,075,828,000
35.645161
80
0.569542
false
4.286792
false
false
false
switowski/invenio
invenio/modules/submit/models.py
1
19892
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2015 CERN. # # Invenio 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 optio...
gpl-2.0
2,390,014,930,960,900,600
36.674242
78
0.61477
false
3.562959
false
false
false
rhiever/sklearn-benchmarks
model_code/grid_search/SGDClassifier.py
1
1597
import sys import pandas as pd import numpy as np import itertools from sklearn.preprocessing import RobustScaler from sklearn.linear_model import SGDClassifier from evaluate_model import evaluate_model dataset = sys.argv[1] pipeline_components = [RobustScaler, SGDClassifier] pipeline_parameters = {} loss_values = [...
mit
2,270,912,534,851,505,000
52.233333
204
0.705698
false
2.962894
false
false
false
sitexa/foobnix
foobnix/gui/top.py
1
2239
#-*- coding: utf-8 -*- ''' Created on 22 сент. 2010 @author: ivan ''' from gi.repository import Gtk from foobnix.gui.model.signal import FControl from foobnix.gui.state import LoadSave from foobnix.gui.menu import MenuBarWidget from foobnix.helpers.my_widgets import ImageButton from foobnix.helpers.menu import Popup...
gpl-3.0
2,132,427,195,450,941,200
30.928571
94
0.640268
false
3.371041
false
false
false
inkhey/Transvoyage.py
transvoyage.py
1
13138
#!/usr/bin/python # -*- coding: utf-8 -*- # transvoyage.py # Version 0.3 # # Copyright 2014 Guénaël Muller <contact@inkey-art.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; eit...
gpl-3.0
-8,850,327,259,524,849,000
35.261838
229
0.639038
false
2.674199
false
false
false
MultiNet-80211/Hostapd
wpa_supplicant/examples/wpas-dbus-new-signals.py
1
6275
#!/usr/bin/python import dbus import sys, os import time import gobject from dbus.mainloop.glib import DBusGMainLoop WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1" WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1" WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1" WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1...
gpl-2.0
1,071,992,416,003,939,100
28.91133
124
0.69259
false
2.785175
false
false
false
itsCoder/itscoder.github.io
generate_post.py
1
1594
# coding=utf-8 import os import re FUCK_STR = ' ' PATTERN_PHASE_FILE = re.compile('\S+-weeklyblog-phase-(\d+)\.md') PATTERN_POST = re.compile('-\s*\[(.+)\]\((https?://\S+)\)\s*\(\[@(.+)\]\((.+)\)\)') PATTERN_CATEGORY = re.compile('#{5}\s*(.*?)\n') BLOG_DIR = '_posts/' def get_post(f, phase): phase_summary = '...
mit
-2,145,483,734,492,894,700
32.869565
83
0.466924
false
3.071006
false
false
false
sdrogers/ms2ldaviz
ms2ldaviz/setup_feat_col.py
1
2204
import os import sys os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings_simon") import django django.setup() from basicviz.models import * if __name__ == '__main__': other_experiment_name = sys.argv[1] fs,status = BVFeatureSet.objects.get_or_create(name = 'binned_005') if status: print("Crea...
mit
8,517,246,142,656,428,000
25.890244
125
0.685118
false
2.832905
false
false
false
beyoungwoo/C_glibc_Sample
_Algorithm/ProjectEuler_python/euler_4.py
1
1587
#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Largest palindrome product</h2><div id="problem_info" class="info"><h3>Problem 4</h3><span>Published on Frid...
gpl-3.0
-6,911,959,164,782,817,000
28.388889
198
0.555766
false
2.90128
false
false
false
michal-ruzicka/archivematica
src/MCPClient/lib/clientScripts/restructureForComplianceMaildir.py
1
1919
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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, ei...
agpl-3.0
8,630,748,113,008,248,000
36.627451
125
0.705576
false
3.711799
false
false
false
gopaycommunity/gopay-python-api
tests/unit/utils.py
1
1531
from gopay.enums import PaymentInstrument, BankSwiftCode, Currency, Language class Utils: GO_ID = '8712700986' CLIENT_ID = '1689337452' CLIENT_SECRET = 'CKr7FyEE' CLIENT_ID_EET = "1365575992" CLIENT_SECRET_EET = "NUVsrv4W" GO_ID_EET = '8289213768' @staticmethod def create_base_payme...
mit
-2,250,619,758,455,118,600
35.452381
112
0.536251
false
3.653938
false
false
false
ludwiktrammer/odoo
addons/sale/sale.py
1
42630
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta from openerp import SUPERUSER_ID from openerp import api, fields, models, _ import openerp.addons.decimal_precision as dp from openerp.exceptions import UserError from openerp.too...
agpl-3.0
-3,618,811,220,402,187,000
46.314095
276
0.607718
false
3.871231
false
false
false
sk413025/tilitools
ocsvm.py
1
3767
from cvxopt import matrix,spmatrix,sparse from cvxopt.blas import dot,dotu from cvxopt.solvers import qp import numpy as np from kernel import Kernel class OCSVM: """One-class support vector machine 'Estimating the support of a high-dimensional distribution.', Sch\"{o}lkopf, B and Platt, J C and Shawe-Taylor, ...
mit
-5,839,695,781,475,350,000
24.452703
89
0.663127
false
2.743627
false
false
false
jianrongdeng/LAMOST
ana/scripts/filesIO.py
1
9324
""" ============================ script: filesIO.py ============================ date: 20170615 by Jianrong Deng purpose: handle input / output files various data I/O functions Input: input dir, date, time """ import const import pickle import os #========================== def getDir (path=const.test_path_ou...
gpl-3.0
-551,796,630,725,550,400
28.506329
191
0.525097
false
3.885
true
false
false
fbzhong/sublime-closure-linter
gjslint.py
1
4010
import os import re import shutil import sublime import sublime_plugin from const import * from listener import * from statusprocess import * from asyncprocess import * class ShowClosureLinterResultCommand(sublime_plugin.WindowCommand): """show closure linter result""" def run(self): self.window.run_command("s...
bsd-3-clause
6,959,701,586,400,418,000
31.33871
134
0.625436
false
3.294988
true
false
false
andrejbauer/jurij
jurij/graph.py
1
4649
# -*- encoding: utf-8 -*- # A very simple implementation of graphs in python, including graphs # embedded in the plane. class Graph(): """A graph stored as an adjacency dictionary.""" def __init__(self, data=None, vertices=None, edges=None, vertex_labels=None, edge_labels=None): """C...
bsd-2-clause
-6,448,450,689,787,050,000
35.03876
88
0.52678
false
3.779675
false
false
false
pxzhang94/GAN
GAN/wasserstein_gan/wgan_tensorflow.py
1
3148
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import os mb_size = 32 X_dim = 784 z_dim = 10 h_dim = 128 mnist = input_data.read_data_sets('../../MNIST_data', one_hot=True) def plot(samples...
apache-2.0
-6,329,197,380,667,734,000
24.184
76
0.589263
false
2.557271
false
false
false
retorquere/zotero-better-bibtex
setup/item.py
1
24607
#!/usr/bin/env python3 from networkx.readwrite import json_graph from collections import OrderedDict import hashlib import operator import shlex from functools import reduce from http.client import RemoteDisconnected from lxml import etree from mako import exceptions from mako.template import Template from munch impo...
mit
-3,831,744,764,635,071,500
40.011667
161
0.61897
false
3.327519
false
false
false
hasadna/OpenTrain
webserver/opentrain/timetable/utils.py
1
3883
from models import TtStop,TtStopTime,TtTrip import gtfs.models from timetable.models import TtShape import json from common import ot_utils import datetime def build_from_gtfs(start_date,days=30): build_stops() end_date = start_date + datetime.timedelta(days=days-1) print '=' * 50 print 'Start day = %s...
bsd-3-clause
-7,730,519,627,983,113,000
40.308511
99
0.60443
false
3.156911
false
false
false
aaronj1335/cs388-final-project
bin/plot.py
1
6512
#!/usr/bin/env python import os from os.path import join from itertools import chain from math import log from pylab import plot, show, legend, close, figure, title, xlabel, ylabel, barh, savefig import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter N = 0 ...
bsd-2-clause
-7,641,680,713,887,290,000
27.814159
94
0.578163
false
3.07025
false
false
false
CommunityHoneyNetwork/CHN-Server
mhn/auth/views.py
2
5341
import hashlib import random from flask import Blueprint, request, jsonify from flask_mail import Message from sqlalchemy.exc import IntegrityError from flask_security.utils import ( login_user as login, verify_and_update_password, encrypt_password, logout_user as logout) from mhn import db, mail from...
lgpl-2.1
2,775,682,520,948,707,000
33.458065
88
0.644823
false
3.774558
false
false
false
tlksio/tlksio
env/lib/python3.4/site-packages/pylint/checkers/base.py
1
37578
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # Copyright (c) 2009-2010 Arista Networks, Inc. # http://www.logilab.fr/ -- mailto:contact@logilab.fr # 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 # ...
mit
1,372,308,262,561,143,800
41.033557
94
0.551599
false
4.217982
false
false
false
ideamonk/apt-offline
apt_offline_gui/Ui_AptOfflineQtAbout.py
1
8800
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'AptOfflineQtAbout.ui' # # Created: Sun Nov 7 20:54:52 2010 # by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_AboutAptOffline(object): def setupUi...
gpl-3.0
6,399,191,816,789,832,000
65.165414
201
0.716364
false
3.546957
false
false
false
gangadharkadam/tailorerp
erpnext/support/doctype/support_ticket/support_ticket.py
1
8287
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from erpnext.utilities.transaction_base import TransactionBase from frappe.utils import now, extract_email_id import json import reque...
agpl-3.0
-8,289,523,798,107,514,000
34.26383
237
0.68879
false
3.070396
false
false
false
afriestad/WikiLinks
kokekunster/settings_dev.py
1
1482
import os from kokekunster.settings import BASE_DIR # Settings for development environment DEBUG = True ALLOWED_HOSTS = ['*'] # "Secret" cryptographic key, only used during local development SECRET_KEY = 'fc4_hb-wi32l^c&qpx6!m)o*xd(4ga$13(ese#pfj#pjxnmt0p' # Database # https://docs.djangoproject.com/en/1.8/ref...
mit
8,427,073,580,051,762,000
22.15625
78
0.687584
false
3.200864
false
false
false
pFernbach/hpp-rbprm-corba
script/tools/parse_bench_contactGen.py
1
1861
import sys totalSuccess = 0. totalTime = 0. totalMuscodConverg = 0. totalMuscodWarmStartConverg = 0. totalCrocConverg = 0. totalConf = 0. totalIt = 0. f = open("/local/fernbac/bench_iros18/bench_contactGeneration/walk_noCroc.log","r") line = f.readline() while line.startswith("new"): totalIt += 1. line = f.r...
lgpl-3.0
5,070,445,143,479,115,000
32.232143
97
0.602902
false
3.197595
false
false
false
LordDarkula/chess_py
chess_py/core/board.py
1
13656
# -*- coding: utf-8 -*- """ Constructs board object which stores the get_location of all the pieces. Default Array | [[0th row 0th item, 0th row 1st item, 0th row 2nd item], | [1st row 0th item, 1st row 1st item, 1st row 2nd item], | [2nd row 0th item, 2nd row 1st item, 2nd row 2nd item]] | Default board | 8...
mit
-1,198,334,598,218,724,400
30.571429
106
0.550108
false
3.810345
true
false
false
nke001/attention-lvcsr
lvsr/extensions.py
1
3223
"""Nice small extensions that maybe will it make to Blocks at some point.""" from __future__ import print_function import subprocess import pkgutil import math from theano.scan_module.scan_op import Scan from blocks.extensions import TrainingExtension, SimpleExtension class CGStatistics(SimpleExtension): def __...
mit
-8,607,135,214,068,613,000
39.2875
88
0.603785
false
3.91616
false
false
false
DavidGSola/Basic-RESTful-Service-with-FLASK
practica1.py
1
1251
# -*- coding: utf-8 -*- from flask import Flask, url_for, render_template, Response import random app = Flask(__name__) @app.route('/') def api_root(): mensaje = 'Welcome' return Response(mensaje, status=200, mimetype='text/plain') @app.route('/hola') def api_home(): mensaje = 'Hola -cañón-' return Response(mens...
apache-2.0
-8,561,766,479,407,991,000
28.738095
74
0.665332
false
2.513078
false
false
false
a4a881d4/6FSK
utils.py
1
1800
import random import numpy as np def rsrcBin(L): r = [] for k in range(L): r.append(random.randint(0,1)) return r def rsrc(L): r = rsrcBin(L) x = [1-2*x for x in r] return x def fftOnce(x): W = len(x) hw = np.hamming(W) ss = np.fft.fft(x*hw) return np.conj(ss)*ss def spectrum(x): ...
gpl-3.0
1,853,868,788,121,301,800
15.142857
53
0.545
false
2.179177
false
false
false
owers19856/PyLATO
TBelec.py
1
39671
""" Created on Thursday 16 April 2015 @author: Andrew Horsfield, Marc Coury and Max Boleininger This module contains functions that are needed once the molecular orbitals are populated by electrons. """ # # Import the modules that will be needed import numpy as np import math import TBH import sys import time import ...
gpl-2.0
8,748,730,909,583,750,000
43.624297
184
0.558468
false
3.173934
false
false
false
CS4098Group/Project
app/peos.py
1
4950
from subprocess import Popen, PIPE import os.path import os import xml.etree.ElementTree as ET PEOS_COMMAND = './peos/os/kernel/peos' class PEOSException(Exception): pass def create(path_to_model_file): if not os.path.isfile(path_to_model_file): raise IOError("File does not exist") proc = Pop...
mit
-4,090,355,685,830,059,500
27.285714
99
0.55596
false
4.047424
false
false
false
mnestis/provglish
provglish/nl/templates/generation_template.py
1
3100
from provglish import transform, prov from provglish.lexicalisation import urn_from_uri as lex from provglish.lexicalisation import plural_p from provglish.prov import PROV from provglish.nl.tools import SETTINGS, realise_sentence import rdflib from rdflib.plugins import sparql from rdflib import RDF import urllib2 ...
mit
-5,202,516,395,004,116,000
35.046512
109
0.569677
false
4.397163
false
false
false
ledusledus/lidarheightcellclassifyscripts
cliffs.py
1
3730
import unittest from itertools import imap from operator import add NO_CLIFF=1 HAS_CLIFF=2 class TestBuildCliff(unittest.TestCase): def setUp(self): pass def testBuild_Cliff(self): altitudes={(10,10):2,(10,11):4,(11,11):4,(11,10):2,(12,10):2,(12,11):4} key=(10,10) start_cliff=1...
apache-2.0
4,035,802,107,887,874,000
33.537037
88
0.584718
false
2.773234
true
false
false
BrunoTh/ETS2Autopilot
UI/ui_updater.py
1
2676
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'designer\updater.ui' # # Created by: PyQt5 UI code generator 5.9 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): Ma...
mit
-8,680,544,128,683,672,000
45.947368
91
0.681988
false
3.73743
false
false
false
bgribble/mfp
mfp/gui/modes/global_mode.py
1
12471
#! /usr/bin/env python ''' global_mode.py: Global input mode bindings Copyright (c) 2012 Bill Gribble <grib@billgribble.com> ''' from ..input_mode import InputMode from .label_edit import LabelEditMode from .transient import TransientMessageEditMode from .enum_control import EnumEditMode from ..message_element import...
gpl-2.0
-2,904,285,902,620,587,000
35.89645
95
0.571646
false
3.783677
false
false
false
winguru/graphite-api
graphite_api/render/glyph.py
1
84736
"""Copyright 2008 Orbitz WorldWide 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, softwa...
apache-2.0
-1,222,734,711,232,685,800
36.067367
79
0.520098
false
4.041013
false
false
false
viroulep/RebirthItemTracker
src/game_objects/state.py
1
5925
"""This module handles anything related to the item tracker's state""" import logging import json from game_objects.item import Item, ItemInfo from game_objects.floor import Floor from game_objects.serializable import Serializable class TrackerState(Serializable): """This class represents a tracker state, and han...
bsd-2-clause
-7,840,911,215,102,460,000
33.447674
118
0.560169
false
4.134682
false
false
false
tommo/gii
lib/gii/DeviceManager/DeviceManager.py
1
2811
import os import stat from gii.core import * from PyQt4 import QtCore, QtGui from PyQt4.QtCore import QEventLoop, QEvent, QObject from gii.qt.IconCache import getIcon from gii.qt.controls.Window import MainWindow from gii.qt.controls.Menu import MenuManager from gii.qt.QtEditorModule import QtEditorModule ...
mit
-5,803,916,313,980,087,000
27.393939
76
0.617574
false
3.627097
false
false
false
google/struct2tensor
struct2tensor/expression_impl/__init__.py
1
1826
# Copyright 2019 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
-8,786,078,613,776,037,000
41.465116
80
0.787514
false
4.316785
false
false
false
floringrigoriu/Algorthitms
Leetcode2021/Monthly/January/Jan23.py
1
1312
# https://leetcode.com/explore/challenge/card/january-leetcoding-challenge-2021/582/week-4-january-22nd-january-28th/3614/ # A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and # going in the bottom-right direction until reaching the matrix's end. # F...
gpl-2.0
-4,631,008,891,928,721,000
36.485714
141
0.560213
false
3.372751
false
false
false
jianghuaw/nova
nova/api/openstack/compute/extended_volumes.py
1
3796
# Copyright 2013 OpenStack Foundation # # 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 a...
apache-2.0
4,793,651,557,385,615,000
43.139535
78
0.629874
false
3.991588
false
false
false
sailfish-sdk/sailfish-qtcreator
share/qtcreator/debugger/stdtypes.py
1
37164
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...
gpl-3.0
-7,329,428,618,475,966,000
32.360862
106
0.551367
false
3.317918
false
false
false
stscieisenhamer/ginga
ginga/rv/plugins/Drawing.py
1
15096
# # Drawing.py -- Drawing plugin for Ginga reference viewer # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from ginga import GingaPlugin from ginga import colors from ginga.gw import Widgets from ginga.misc import ParamSet, Bunch from ginga.util import dp...
bsd-3-clause
7,770,706,608,207,105,000
33.703448
88
0.588169
false
3.630592
false
false
false
miguelfrde/stanford-cs231n
assignment2/cs231n/optim.py
1
6261
import numpy as np """ This file implements various first-order update rules that are commonly used for training neural networks. Each update rule accepts current weights and the gradient of the loss with respect to those weights and produces the next set of weights. Each update rule has the same interface: def updat...
mit
2,448,093,510,012,221,400
40.463576
97
0.54001
false
4.590176
true
false
false
cvandeplas/plaso
plaso/parsers/winreg_plugins/msie_zones.py
1
11257
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the L...
apache-2.0
-8,224,367,203,974,624,000
38.36014
80
0.639424
false
3.614965
false
false
false
datamade/yournextmp-popit
elections/bf_elections_2015/management/commands/bf_elections_2015_import_candidate.py
1
9711
# -*- coding: utf-8 -*- import dateutil.parser import csv from os.path import dirname, join import re import string import codecs import requests from django.core.management.base import BaseCommand from candidates.utils import strip_accents from candidates.views.version_data import get_change_metadata from electio...
agpl-3.0
-1,523,529,099,116,446,000
34.702206
120
0.510658
false
4.218506
false
false
false
matthewghgriffiths/nestedbasinsampling
examples/LJ31/system.py
1
3922
import logging from pele.potentials import LJ from nestedbasinsampling import ( NoGUTSSampler, NestedOptimizerKalman, HardShellConstraint, random_structure, RecordMinimization, CompareStructures, LOG_CONFIG, Database) logger = logging.getLogger("LJ31.system") logger = logging.getLogger("NBS.LJ_syste...
gpl-3.0
6,799,967,800,464,881,000
37.616162
80
0.629526
false
3.511191
true
false
false
ubivar/ubivar-python
ubivar/error.py
1
1837
# Exceptions class UbivarError(Exception): def __init__(self, message=None, http_body=None, http_status=None, json_body=None, headers=None): super(UbivarError, self).__init__(message) if http_body and hasattr(http_body, 'decode'): try: http_body = htt...
mit
-8,536,734,799,136,476,000
25.623188
70
0.598258
false
3.967603
false
false
false
duncanwp/cis_plugins
Grosvenor_CDNC.py
1
2421
from cis.data_io.products import NetCDF_Gridded import cis.data_io.gridded_data as gd import logging from cis.utils import demote_warnings class Grosvenor_CDNC(NetCDF_Gridded): """ Plugin for reading Dan Grosvenor's MODIS CDNC files. """ @staticmethod def load_multiple_files_callback(cube, fi...
lgpl-3.0
-3,232,205,901,868,574,700
40.033898
120
0.634036
false
4.041736
false
false
false
PaulWay/insights-core
insights/parsers/current_clocksource.py
1
1559
""" CurrentClockSource - file ``/sys/devices/system/clocksource/clocksource0/current_clocksource`` ============================================================================================== This is a relatively simple parser that reads the ``/sys/devices/system/clocksource/clocksource0/current_clocksource`` file. ...
apache-2.0
-2,943,900,483,633,057,000
25.87931
94
0.592046
false
3.936869
false
false
false
akuster/yali
yali/gui/ScrCheckCD.py
1
4754
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2010 TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # ...
gpl-2.0
-8,076,896,464,390,555,000
35.569231
150
0.562474
false
4.222025
false
false
false
cscanlin/munger-builder
script_builder/views.py
1
5537
import os import re import csv import json import time from django.shortcuts import render, render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.contrib import messages from django.contrib.auth.models import User, Group from django.contrib.auth import authenticate, login from djang...
mit
-3,080,153,474,421,255,000
34.954545
104
0.657576
false
3.607166
true
false
false
CI-WATER/gsshapy
gsshapy/grid/nwm_to_gssha.py
1
4942
# -*- coding: utf-8 -*- # # nwm_to_gssha.py # GSSHApy # # Created by Alan D Snow, 2016. # License BSD 3-Clause import logging from datetime import timedelta from os import mkdir, path, remove, rename import xarray as xr from .grid_to_gssha import GRIDtoGSSHA log = logging.getLogger(__name__) # ----------------...
bsd-3-clause
1,060,683,975,107,513,100
41.973913
195
0.510522
false
3.769641
false
false
false
eirmag/weboob
weboob/core/bcall.py
1
7438
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon, Christophe Benz # # This file is part of weboob. # # weboob 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 Licen...
agpl-3.0
-295,907,511,899,842,750
35.106796
112
0.565071
false
4.692744
false
false
false
lujinda/replace
replace/args.py
1
1706
#/usr/bin/env python #coding:utf-8 # Author : tuxpy # Email : q8886888@qq.com.com # Last modified : 2015-05-19 14:03:37 # Filename : args.py # Description : import optparse from replace import version import os def parser_args(): usage = "Usage: %prog [options] target_path" parser = opt...
gpl-3.0
-682,240,807,930,640,600
29.464286
104
0.594373
false
3.692641
false
false
false
macieksmuga/server
tests/unit/test_client.py
1
21768
""" Tests for the client """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest import mock import ga4gh.protocol as protocol import ga4gh.backend as backend import ga4gh.client as client import ga4gh.datarepo as datarepo import tests.utils a...
apache-2.0
127,916,958,536,394,690
38.795247
78
0.652931
false
4.338848
true
false
false
streampref/wcimport
tool/query/bestseq/move.py
1
6139
# -*- coding: utf-8 -*- ''' Queries for experiments with preference operators ''' # ============================================================================= # Queries with preference operators # ============================================================================= # Moves Q_MOVE_BESTSEQ = ''' SELECT SEQUE...
gpl-3.0
3,218,681,803,519,124,000
29.849246
79
0.59684
false
2.579412
false
false
false
hperala/kontuwikibot
scripts/spamremove.py
1
3739
#!/usr/bin/python # -*- coding: utf-8 -*- """ Script to remove links that are being or have been spammed. Usage: spamremove.py www.spammedsite.com It will use Special:Linksearch to find the pages on the wiki that link to that site, then for each page make a proposed change consisting of removing all the lines where ...
mit
-3,847,130,002,318,686,000
28.912
79
0.554426
false
4.201124
false
false
false
olichtne/python-perfrepo
perfrepo/PerfRepoTest.py
1
3986
""" This module contains the PerfRepoTest class. Copyright 2015 Red Hat, Inc. Licensed under the GNU General Public License, version 2 as published by the Free Software Foundation; see COPYING for details. """ __author__ = """ olichtne@redhat.com (Ondrej Lichtner) """ import textwrap from xml.etree import ElementTre...
gpl-2.0
-8,145,718,045,749,561,000
29.899225
78
0.544656
false
4.222458
false
false
false
daonb/tumulus
tumuli/urls.py
1
1745
"""tumuli URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based ...
agpl-3.0
1,101,324,068,289,894,900
38.659091
110
0.718052
false
3.681435
false
false
false
muccg/rdrf
scripts/check_views.py
1
5203
''' TO DO: - Further abstract states (maybe find some way of removing reliance on indices) - Add comments to provide full information on code - Create unit tests for script (view with mixin, view w/out mixin with decorators, no mixin no decorators) ''' import os import re import sys from os.pa...
agpl-3.0
6,208,441,592,899,194,000
27.277174
71
0.582933
false
3.603186
false
false
false
antmicro/distant-rec
tools/shebang-replace.py
1
1211
#!/usr/bin/env python3 import sys from os import listdir, chdir from os.path import isfile, abspath UNTIL = '/build/' REPLACE_WITH = '/b/f/w' def bangchange(file_path): script = File(file_path) if script.flist[0].find("#!") == 0: if script.flist[0].find(UNTIL) > 0: print("\033[92m" + "[M...
apache-2.0
-7,748,558,177,413,436,000
24.765957
82
0.549959
false
3.220745
false
false
false
bgoli/cbmpy-build
ubuntu/1_install_cbmpy_dependencies.py
1
6549
# Detect all MetaToolKit depencies on Ubuntu and create a custom script to install them. # Tested on Ubuntu 14.04, 16.04 # Author Brett G. Olivier (bgoli@users.sourceforge.net) # (C) All rights reserved, Brett G. Olivier, Amsterdam 2016. import os, subprocess, itertools, stat UBUNTU = CONDA = False try: print(os....
gpl-3.0
-6,120,319,862,562,689,000
28.90411
170
0.603604
false
3.266334
false
false
false
j4k0bk/pyidaemon
replies.py
1
7720
# FIXME: Move these messages to somewhere else NUMERIC_REPLIES = { '001' : 'Welcome to the Internet Relay Network %s', '002' : 'Your host is %s, running version %s', '003' : 'This server was created %s', '004' : '<servername> <version> <available user modes> <available channel modes>', '31...
gpl-2.0
7,832,151,543,027,428,000
26.278388
86
0.553886
false
3.341991
false
false
false
espressif/esp-idf
tools/mkdfu.py
1
9975
#!/usr/bin/env python # # Copyright 2020-2021 Espressif Systems (Shanghai) CO 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...
apache-2.0
-567,022,162,495,438,100
34.37234
140
0.589975
false
3.511088
false
false
false
johnmgregoire/JCAPdatavis
createdlist_benchmarkingstepCA.py
1
2595
import numpy, pylab, os, sys, csv, pickle from echem_plate_fcns import * from echem_plate_math import * PyCodePath=os.path.split(os.path.split(os.path.realpath(__file__))[0])[0] sys.path.append(os.path.join(PyCodePath,'ternaryplot')) from myternaryutility import TernaryPlot from myquaternaryutility import QuaternaryPlo...
bsd-3-clause
-1,207,282,057,356,617,200
33.6
115
0.568401
false
2.848518
false
false
false
ssato/python-jinja2-cli
jinja2_cli/tests/render.py
1
2414
# # Copyright (C) 2011 - 2013 Satoru SATOH <ssato at redhat.com> # import os import unittest import jinja2_cli.render as TT # Stands for Test Target module. import jinja2_cli.compat import jinja2_cli.tests.common as C class Test_00_pure_functions(unittest.TestCase): def test_00_mk_template_paths__wo_paths(self...
bsd-3-clause
-3,658,749,903,160,472,000
31.186667
76
0.553853
false
3.071247
true
false
false
Bakuutin/Pitchers
pitchers.py
1
6675
""" Программа ищет оптимальное решение для задачи про два кувшина Для работы требуется Python 3 """ from enum import Enum class Action(Enum): """ Действия с кувшинами """ empty = 0 fill = 1 transfer = 2 start = 3 def get_pitchers_volume(): """ Возвращает список из целочисленных з...
mit
-342,281,821,695,193,660
36.282609
120
0.611975
false
2.001556
false
false
false
gpuhalla/discord_bot
newMusic.py
1
16747
""" Adapted from: https://gist.github.com/vbe0201/ade9b80f2d3b64643d854938d40a0a2d """ import asyncio import functools import itertools import math import random import discord import youtube_dlc from async_timeout import timeout from discord.ext import commands # Silence useless bug reports messages youtube_dlc.u...
gpl-3.0
-7,463,120,260,197,721,000
32.001972
114
0.592254
false
3.861297
false
false
false
zhlinh/leetcode
0130.Surrounded Regions/solution.py
1
1911
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-03-11 Last_modify: 2016-03-11 ****************************************** ''' ''' Given a 2D board containing 'X' and 'O', c...
apache-2.0
-6,414,174,349,112,948,000
25.915493
75
0.438514
false
3.244482
false
false
false
cmjatai/cmj
cmj/utils.py
1
14127
from datetime import date, datetime, timedelta from functools import wraps import re import subprocess import threading from unicodedata import normalize as unicodedata_normalize from PyPDF4.pdf import PdfFileReader from asn1crypto import cms from django.apps import apps from django.conf import settings from django.co...
gpl-3.0
-1,395,734,842,059,924,000
26.065259
87
0.552301
false
3.445992
false
false
false
dhalima3/TravelSpark
Main.py
1
7574
import requests import os import time import random from flask import Flask, request, redirect, session, url_for, render_template from flask.json import jsonify, dumps, loads from requests_oauthlib import OAuth2Session import requests import json import urllib2 import mechanize from bs4 import BeautifulSoup from urlpa...
apache-2.0
4,999,414,832,929,667,000
34.227907
231
0.695933
false
3.065156
false
false
false
google-research/google-research
hierarchical_foresight/models/vae.py
1
3093
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
-1,294,222,527,283,148,800
33.752809
74
0.628839
false
2.75423
false
false
false
a365541453/django
django/blog/docker_part/admin.py
1
1206
# coding=utf-8 from django.contrib import admin from docker_part.models import docker_article # Register your models here. from django import forms from django.forms import fields # Register your models here. # form是用来控制显示的,这段代码是用来修改form的默认显示 class FlatPageForm(forms.ModelForm): class Meta: model = docker_article...
gpl-3.0
5,791,728,908,724,285,000
19.291667
50
0.693018
false
2.037657
false
false
false
littmus/kutime_web
kutime/views.py
1
2776
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json from django.shortcuts import render from django.http import HttpResponse from django.core import serializers from django.views.decorators.csrf import csrf_exempt import watson from models import * def JsonResponse(json): ...
mit
-1,254,733,528,694,133,200
26.836735
83
0.569648
false
3.190643
false
false
false
SnabbCo/neutron
neutron/tests/unit/test_l3_agent.py
1
54667
# Copyright 2012 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
4,219,393,043,147,675,600
42.044882
79
0.562021
false
3.71253
true
false
false
dblalock/bolt
experiments/python/compress.py
1
10068
#!/usr/bin/env python import numpy as np import numba import zstandard as zstd # pip install zstandard # ================================================================ Funcs def nbits_cost(diffs, signed=True): """ >>> [nbits_cost(i) for i in [0, 1, 2, 3, 4, 5, 7, 8, 9]] [0, 2, 3, 3, 4, 4, 4, 5, 5] ...
mpl-2.0
-8,800,742,138,520,516,000
31.794788
90
0.562078
false
2.918261
false
false
false
NoBodyCam/TftpPxeBootBareMetal
nova/api/openstack/wsgi.py
1
42066
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/...
apache-2.0
-310,886,773,118,716,200
34.113523
79
0.590429
false
4.671924
false
false
false
thtrieu/qclass_dl
lstm.py
1
3699
import tensorflow as tf from tensorflow.models.rnn import rnn_cell, rnn from tensorflow.models.rnn import seq2seq from tensorflow.models.rnn.ptb import reader import numpy as np class lstm_class(object): def __init__( self, embedding_mat, non_static, lstm_type, hidden_unit, sequence_length, num_classes, vo...
gpl-3.0
4,280,998,755,685,231,600
48.32
121
0.600703
false
3.45056
false
false
false
Kentzo/Power
power/win32.py
1
3384
# coding=utf-8 """ Implements PowerManagement functions using GetSystemPowerStatus. Requires Windows XP+. Observing is not supported """ from ctypes import Structure, wintypes, POINTER, windll, WinError, pointer, WINFUNCTYPE import warnings from power import common # GetSystemPowerStatus # Returns brief description o...
mit
-1,949,248,720,823,125,000
33.886598
105
0.663121
false
4.141983
false
false
false
tata-antares/LHCb-topo-trigger
BBDTconvert.py
1
3846
from __future__ import division, absolute_import __author__ = 'Tatiana Likhomanenko' import sys import struct from scipy.special import expit import numpy from rep_ef.estimators._matrixnetapplier import MatrixnetClassifier def unpack_formula(formula_stream, print_=True): features = list() # feature names ...
apache-2.0
-4,683,562,495,968,357,000
35.638095
97
0.615965
false
3.518756
false
false
false
midnightercz/pulp_docker
pulp-dev.py
1
5020
#!/usr/bin/env python # -*- coding: utf-8 -*- import optparse import os import sys from pulp.devel import environment WARNING_COLOR = '\033[31m' WARNING_RESET = '\033[0m' DIRS = ('/var/lib/pulp/published/docker/web',) # # Str entry assumes same src and dst relative path. # Tuple entry is explicit (src, dst) # # P...
gpl-2.0
-7,254,177,743,593,166,000
27.202247
97
0.566932
false
3.669591
false
false
false
hanyangii/SummThing
bptree.py
1
18095
#!/usr/bin/env python # -*- coding: utf-8 -*- import bisect import itertools import operator import sys reload(sys) sys.setdefaultencoding('utf-8') class _BNode(object): __slots__ = ["tree", "contents", "children"] def __init__(self, tree, contents=None, children=None): self.tree = tree self...
apache-2.0
-7,392,944,706,407,312,000
32.207721
114
0.543814
false
4.040483
false
false
false
authman/Python201609
Nguyen_Ken/Assignments/Flask with MySQL/full_friends/server.py
1
2098
from flask import Flask, render_template, request, redirect, session, flash from mysqlconnection import MySQLConnector app = Flask(__name__) app.secret_key = 'secretsquirrel' mysql = MySQLConnector(app, 'friendsdb') @app.route('/') def index(): showQuery = 'SELECT * FROM friends' friends = mysql.query_d...
mit
-6,934,720,650,099,028,000
22.054945
159
0.63918
false
3.439344
false
false
false
vdv7/stap
tasks/stdio/pvt.py
1
1754
#!/usr/bin/env python3 '''Psychomotor Vigilance Task''' ######################################################### # STAP constants and stdio import json,sys if 'raw_input' in vars(__builtins__): input = raw_input #Fix for Python 2.x raw_input def send(d): print(json.dumps(d)); sys.stdout.flush() def recv(): retur...
mit
8,034,561,188,412,784,000
30.321429
177
0.657925
false
3.296992
false
false
false
cheery/pyllisp
compiler/__init__.py
1
33018
from rpython.rlib import jit from rpython.rlib.listsort import make_timsort_class from rpython.rlib.objectmodel import always_inline, specialize import base import reader import space class ProgramBody: def __init__(self, blocks, functions, is_generator): self.blocks = reverse_postorder(blocks[0]) ...
agpl-3.0
-1,058,595,052,669,584,400
31.952096
167
0.557847
false
3.370215
false
false
false
start-jsk/jsk_apc
demos/baxtergv6_apc2016/node_scripts/json_saver.py
1
7469
#!/usr/bin/env python import datetime from jsk_arc2017_common.msg import Content from jsk_arc2017_common.msg import ContentArray from jsk_arc2017_common.srv import UpdateJSON from jsk_arc2017_common.srv import UpdateJSONResponse import json import os import os.path as osp import rospy import shutil from std_msgs.msg ...
bsd-3-clause
6,995,504,888,770,529,000
33.419355
79
0.528585
false
3.877985
false
false
false
iw3hxn/LibrERP
account_financial_report_aeroo_xls/report/common_report_header.py
1
6668
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) BrowseInfo (http://browseinfo.in) # Copyright (C) Didotech SRL # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
-1,271,005,539,179,233,300
44.054054
129
0.574985
false
3.819015
false
false
false
goodmami/pydelphin
delphin/mrs/__init__.py
1
4262
# -*- coding: utf-8 -*- """ This module contains classes and methods related to Minimal Recursion Semantics [MRS]_. In addition to MRS, there are the related formalisms Robust Minimal Recursion Semantics [RMRS]_, Elementary Dependency Structures [EDS]_, and Dependency Minimal Recursion Semantics [DMRS]_. As a convenie...
mit
-4,533,146,085,247,655,000
43.789474
76
0.671445
false
3.578638
false
false
false
DavidPurcell/murano_temp
murano/cfapi/cfapi.py
1
13455
# Copyright (c) 2015 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...
apache-2.0
-3,214,018,305,001,191,000
38.690265
79
0.570197
false
4.146379
false
false
false