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
summychou/CSForOSS
CA/OSSQt_DataMasterRigster.py
1
2535
# -*- coding: utf-8 -*- # import sqlite3 as sqlite import sys import uuid from pysqlcipher3 import dbapi2 as sqlite def main(): print("***************** Welcome to OSS DataMaster-Rigster System *******************") print("* *") pri...
mit
9,171,648,892,522,189,000
45.592593
119
0.394036
false
4.960552
false
false
false
Microvellum/Fluid-Designer
win64-vc/2.78/scripts/startup/fluid_operators/fd_api_doc.py
1
10496
''' Created on Jan 27, 2017 @author: montes ''' import bpy from inspect import * import mv import os import math from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import legal,inch,cm from reportlab.platypus import Image from reportlab.platypus import Paragraph,Table,TableStyle from reportlab.platypus ...
gpl-3.0
-1,779,006,538,429,056,000
35.447917
118
0.477229
false
3.864507
false
false
false
Ramyak/CodingPractice
algo_practice/sort/merge_sort.py
1
1251
#!/usr/bin/env python a = [5, 3, 6, 3, 1, 2] def merge_sort(in_array, left, right): print 'Before: ({} , {}) : {}'.format(str(left), str(right), (in_array[left:right + 1])) if right - left >= 1: mid = ((right - left) / 2) + left if mid > right: return merge_sort(in_array, ...
gpl-2.0
6,766,558,600,085,191,000
31.076923
92
0.46283
false
3.135338
false
false
false
AMOboxTV/AMOBox.LegoBuild
plugin.video.exodus/resources/lib/sources/ninemovies_mv_tv.py
1
7333
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
gpl-2.0
-7,445,599,848,500,218,000
35.849246
157
0.517114
false
3.762442
false
false
false
LibraryOfCongress/gazetteer
etl/parser/hmdb.py
1
1998
import sys, json, os, datetime from shapely.geometry import asShape, mapping from fiona import collection from core import Dump import core import codecs #name, cmt, desc, link1_href def extract_shapefile(shapefile, uri_name, simplify_tolerance=None): for feature in collection(shapefile, "r"): ...
mit
-4,251,280,113,043,998,000
24.615385
89
0.553554
false
4.102669
false
false
false
lucasmello/Driloader
driloader/browser/internet_explorer.py
1
4135
# pylint: disable=anomalous-backslash-in-string, too-many-locals, # pylint: disable=multiple-statements """ Module that abstract operations to handle Internet Explorer versions. """ import os import platform import re import xml.etree.ElementTree as ET import requests from driloader.browser.exceptions import Brow...
mit
-4,724,605,588,114,314,000
32.893443
77
0.564692
false
4.361814
false
false
false
PyBossa/pybossa
pybossa/auth/webhook.py
1
1833
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 SF Isle of Man Limited # # PYBOSSA 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...
agpl-3.0
-6,669,273,108,467,857,000
33.584906
77
0.67976
false
3.826722
false
false
false
spring01/libPSI
lib/python/grendel/chemistry/molecule_stub.py
1
11089
# FAILED ATTEMPT AT REFORMING MOLECULESTUB # Perhaps I'll come back to this later... #from grendel import type_checking_enabled, sanity_checking_enabled #from grendel.chemistry.atom import Atom #from grendel.gmath import magnitude, angle_between_vectors #from grendel.gmath.matrix import Matrix #from grendel.util.decora...
gpl-2.0
2,493,225,813,903,470,000
43.534137
139
0.541257
false
3.800206
false
false
false
flying-sheep/omnitool
version.py
1
1888
from functools import total_ordering @total_ordering class Version(): """Organization Class for comparable Version System Version integer uses decimal shift: 2 digits major version, 2 digits minor version, 2 digits micro version 170100 -> 17.1.0 """ def __init__(self, in...
mit
-4,095,968,977,931,674,000
29.95082
86
0.533898
false
4.300683
false
false
false
domthu/gasistafelice
gasistafelice/auth/__init__.py
1
2945
from django.utils.translation import ugettext as _, ugettext_lazy from django.db.models.signals import post_syncdb import permissions from permissions.utils import register_role, register_permission ## role-related constants NOBODY = 'NOBODY' GAS_MEMBER = 'GAS_MEMBER' GAS_REFERRER_SUPPLIER = 'GAS_REFERRER_SUPPLIER' ...
agpl-3.0
7,373,385,643,594,439,000
26.268519
86
0.683531
false
2.977755
false
false
false
cheral/orange3
Orange/canvas/application/outputview.py
6
6738
""" """ import traceback from AnyQt.QtWidgets import QWidget, QPlainTextEdit, QVBoxLayout, QSizePolicy from AnyQt.QtGui import QTextCursor, QTextCharFormat, QFont from AnyQt.QtCore import Qt, QObject, QCoreApplication, QThread, QSize from AnyQt.QtCore import pyqtSignal as Signal class TerminalView(QPlainTextEdit): ...
bsd-2-clause
1,927,550,279,089,523,200
28.552632
79
0.624221
false
4.020286
false
false
false
sumpfgottheit/arps
arps/views.py
1
3504
from flask import render_template, request import numbers from pprint import pprint from arps.restserver import app, db, ApiException, apiview from arps.globals import * from arps.validation import get_schemas_for_endpoint from arps.models import * METHODS = ['GET', 'POST', 'PUT', 'DELETE'] @app.route('/') def main(...
mit
2,719,949,691,329,565,000
33.019417
130
0.619863
false
3.469307
false
false
false
repotvsupertuga/tvsupertuga.repository
script.module.streamtvsupertuga/lib/resources/lib/sources/pl/ekinomaniak.py
1
4540
# -*- coding: UTF-8 -*- import urlparse from resources.lib.modules import cleantitle from resources.lib.modules import client from resources.lib.modules import source_utils import urllib class source: def __init__(self): self.priority = 1 self.language = ['pl'] self.domains = ['ekinomani...
gpl-2.0
-6,697,926,578,966,888,000
38.137931
327
0.490969
false
3.252149
false
false
false
MatthewWilkes/reportlab
demos/colors/colortest.py
1
2725
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__='''$Id$''' import reportlab.pdfgen.canvas from reportlab.lib import colors from reportlab.lib.units import inch def run(): c = reportlab.pdfgen.canvas.Canvas('colortest.pdf') #do a test of CMYK interspersed with RGB ...
bsd-3-clause
7,394,168,289,970,068,000
24.952381
81
0.601468
false
2.749748
false
false
false
Brazelton-Lab/bio_utils
bio_utils/__init__.py
1
1086
#! /usr/bin/env python3 """Software library containing common bioinformatic functions Copyright: __init__.py software library containing common bioinformatic functions Copyright (C) 2015 William Brazelton, Alex Hyer This program is free software: you can redistribute it and/or modify it under the t...
gpl-3.0
-5,207,140,348,901,563,000
36.448276
74
0.726519
false
3.892473
false
false
false
iamgp/pyCa
pyCa/Graph.py
1
2559
from . import * # Graphics Stuff import matplotlib.pyplot as plt class Graph(object): """docstring for Graph""" def __init__(self, Experiment): self.Experiment = Experiment self.numberOfStimulantsAdded = 0 self.nameToUse = 0 def plot(self): print '' log(self.Exp...
gpl-3.0
8,551,664,604,400,707,000
31.392405
77
0.490035
false
4.243781
false
false
false
neuropoly/spinalcordtoolbox
spinalcordtoolbox/scripts/sct_maths.py
1
20433
#!/usr/bin/env python ######################################################################################### # # Perform mathematical operations on images # # --------------------------------------------------------------------------------------- # Copyright (c) 2015 Polytechnique Montreal <www.neuro.polymtl.ca> # A...
mit
2,048,659,252,759,735,300
39.222441
192
0.597856
false
3.655931
false
false
false
Ultimaker/Cura
plugins/DigitalLibrary/src/DFFileExportAndUploadManager.py
1
19837
# Copyright (c) 2021 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import json import threading from json import JSONDecodeError from typing import List, Dict, Any, Callable, Union, Optional from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices from PyQt5.QtNetwork import ...
lgpl-3.0
-487,210,490,165,346,050
52.182306
188
0.616978
false
4.331223
false
false
false
scotthuang1989/Python-3-Module-of-the-Week
concurrency/asyncio/asyncio_echo_server_protocol.py
1
1651
import asyncio import logging import sys SERVER_ADDRESS = ('localhost', 10000) logging.basicConfig( level=logging.DEBUG, format='%(name)s: %(message)s', stream=sys.stderr, ) log = logging.getLogger('main') event_loop = asyncio.get_event_loop() class EchoServer(asyncio.Protocol): def connection_made...
apache-2.0
-3,189,786,440,921,151,000
27.964912
64
0.654755
false
3.76082
false
false
false
Tenrec-Builders/pi-scan
src/stick.py
1
3424
import dbus def search(): bus = dbus.SystemBus() udisks = dbus.Interface( bus.get_object('org.freedesktop.UDisks2', '/org/freedesktop/UDisks2'), 'org.freedesktop.DBus.ObjectManager') listDevices = udisks.get_dbus_method('GetManagedObjects') result = [] for key, value in listDevices...
bsd-2-clause
8,485,670,437,875,832,000
29.846847
68
0.592874
false
3.53719
false
false
false
dhalleine/tensorflow
tensorflow/contrib/layers/python/layers/optimizers.py
1
9885
# Copyright 2015 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
2,485,348,243,574,969,000
42.165939
80
0.653111
false
4.350792
false
false
false
lab-robotics-unipv/pyFUZZYgenerator
core/ModelType.py
1
2708
class ModelType: def __init__(self): self.type = None self.properties = {} self.models = [] self.logic_function_name = None self.init_function_name = None self.output_function_name = None def __eq__(self, other): if other.type == self.type: re...
lgpl-3.0
2,298,482,648,726,240,300
26.08
76
0.57644
false
3.735172
false
false
false
sippeproject/vagoth
vagoth/virt/utils/mc_json_rpc.py
1
1790
#!/usr/bin/python # # Vagoth Cluster Management Framework # Copyright (C) 2013 Robert Thomson # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (a...
lgpl-2.1
1,314,612,439,898,897,400
34.098039
80
0.694413
false
3.925439
false
false
false
slackeater/anal-beh
firefoxSelenium.py
1
1686
#! /usr/bin/env python import sys from classes.sitemanager import SiteManager from classes.gui.main import MainWindow from classes.printer import Printer from PyQt4 import QtGui import argparse __author__ = 'snake' def main(): if len(sys.argv) == 1: app = QtGui.QApplication(sys.argv) main = Main...
gpl-2.0
5,399,769,859,326,694,000
30.222222
116
0.544484
false
4.236181
false
false
false
levilucio/SyVOLT
ECore_Copier_MM/transformation/HEPackage.py
1
2231
from core.himesis import Himesis import uuid class HEPackage(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule EPackage. """ # Flag this instance as compiled now self.is_compiled = True super(HEPackage, sel...
mit
5,270,245,473,863,462,000
27.602564
163
0.469745
false
3.983929
false
false
false
javiercantero/streamlink
src/streamlink/plugins/tv5monde.py
1
2401
import re from streamlink.plugin import Plugin from streamlink.plugin.api import http, validate from streamlink.stream import HLSStream, HTTPStream, RTMPStream from streamlink.utils import parse_json from streamlink.plugins.common_jwplayer import _js_to_json class TV5Monde(Plugin): _url_re = re.compile(r'http://...
bsd-2-clause
-9,086,185,595,071,028,000
29.782051
90
0.540608
false
3.751563
false
false
false
techjacker/sitemapgenerator
sitemapgenerator/crawler.py
1
3955
import re import requests from bs4 import BeautifulSoup from time import sleep from random import randint from numbers import Number import functools def handle_requests_failures(func): ''' This decorator handles request.excptions ''' @functools.wraps(func) def wrapper(self, *args, **kw): ...
mit
4,129,940,450,796,477,400
30.64
79
0.566877
false
3.94317
false
false
false
troych/PlexKodiConnect
contextmenu.py
1
1380
# -*- coding: utf-8 -*- ############################################################################### import logging import os import sys import xbmc import xbmcaddon ############################################################################### _addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect') try: ...
gpl-2.0
6,899,344,392,238,884,000
25.538462
79
0.454348
false
4.791667
false
true
false
danielhkl/matplotlib2tikz
matplotlib2tikz/color.py
1
2761
# -*- coding: utf-8 -*- # import matplotlib as mpl import numpy def mpl_color2xcolor(data, matplotlib_color): '''Translates a matplotlib color specification into a proper LaTeX xcolor. ''' # Convert it to RGBA. my_col = numpy.array(mpl.colors.ColorConverter().to_rgba(matplotlib_color)) # If the a...
mit
2,779,563,172,198,260,700
36.310811
79
0.560666
false
3.279097
false
false
false
open2c/cooltools
cooltools/cli/dump_cworld.py
1
2380
import click from . import cli from .. import io @cli.command() @click.argument( "cool_paths", metavar="COOL_PATHS", type=str, nargs=-1 ) @click.argument( "out_path", metavar="OUT_PATH", type=click.Path(exists=False, writable=True), nargs=1, ) @click.option( "--cworld-type", he...
mit
28,392,404,168,664,796
30.733333
90
0.611765
false
3.562874
false
false
false
eResearchSA/reporting-unified
unified/models/hnas.py
1
9940
from sqlalchemy.sql import func from . import db, id_column, to_dict, SnapshotMothods class Owner(db.Model): """Storage Account/Owner""" id = id_column() name = db.Column(db.String(64), unique=True, nullable=False) virtual_volume_usage = db.relationship("VirtualVolumeUsage", ...
apache-2.0
-236,425,678,749,025,100
37.527132
97
0.547485
false
3.993572
false
false
false
pjamesjoyce/lcopt
lcopt/interact.py
1
48802
from flask import Flask, request, render_template, redirect, send_file import webbrowser import json from ast import literal_eval from lcopt.io import exchange_factory from collections import OrderedDict from itertools import groupby import xlsxwriter from io import BytesIO import os from lcopt.bw2_export import Bw2Ex...
bsd-3-clause
9,004,957,291,227,467,000
40.498299
243
0.546863
false
3.946147
false
false
false
vanessajurtz/lasagne4bio
secondary_proteins_prediction/predict.py
1
2125
import sys import numpy as np import importlib import lasagne as nn import theano from theano import tensor as T import os import glob import data import utils if not (2 <= len(sys.argv) <= 3): sys.exit("Usage: python predict.py <metadata_path> [subset=test]") sym_y = T.imatrix('target_output') sym_x = T.tensor3...
gpl-3.0
356,573,002,627,405,200
23.709302
140
0.653647
false
3.410915
true
false
false
wwmm/wwplot
WWplot/fit.py
1
1679
# -*- coding: utf-8 -*- import scipy.odr from numpy import * from PySide2.QtCore import QObject, Signal class Fit(QObject): finished = Signal() def __init__(self, maxit=1000): QObject.__init__(self) self.maxit = maxit self.ready = False self.x, self.xerr = [], [] se...
gpl-3.0
5,255,284,062,352,769,000
22.985714
95
0.54735
false
3.337972
false
false
false
toast38coza/DJProcess
process/tasks/google_natural_language/test_extract_sentiment.py
1
1090
from google.cloud import language client = language.Client() import csv def get_sentiment(message): doc = client.document_from_text(message) f_in = open('/Users/toast38coza/Downloads/verbatims.csv', 'rb') f_out = open('/Users/toast38coza/Downloads/verbatims-new.csv', 'wb') reader = csv.reader(f_in) writer = csv.w...
mit
-7,063,101,933,839,828,000
27.684211
99
0.637615
false
3.177843
false
false
false
mystic123/DeepLearning
Basics/optimizers.py
1
7742
import numpy as np class Optimizer: """ Optimizer class """ def __init__(self, net, cost, learning_rate, *args, **kwargs): self.net = net self.cost = cost self.learning_rate = learning_rate def compute_gradients(self, batch, y, *args, **kwargs): zs, as_ = self.net...
mit
7,283,492,937,311,258,000
31.393305
112
0.580728
false
3.572681
false
false
false
Miserlou/OpenWatch
openwatch/settings.py
1
4279
import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) BASE_URL = 'http://www.openwatch.net' MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
apache-2.0
7,432,822,318,124,921,000
31.416667
122
0.707175
false
3.439711
false
false
false
krattai/noo-ebs
docs/zeroMQ-guide2/examples/Python/ticlient.py
1
1692
""" Titanic client example Implements client side of http:rfc.zeromq.org/spec:9 Author : Min RK <benjaminrk@gmail.com> """ import sys import time from mdcliapi import MajorDomoClient def service_call (session, service, request): """Calls a TSP service Returns reponse if successful (status code 200 OK),...
bsd-2-clause
7,430,159,579,871,229,000
24.651515
68
0.560284
false
3.76
false
false
false
kamailio/kamcli
kamcli/commands/cmd_uacreg.py
1
6162
import click from sqlalchemy import create_engine from kamcli.ioutils import ioutils_dbres_print from kamcli.cli import pass_context from kamcli.iorpc import command_ctl @click.group( "uacreg", help="Manage uac remote registrations", short_help="Manage uac registrations", ) @pass_context def cli(ctx): ...
gpl-2.0
-7,870,042,269,228,062,000
28.342857
79
0.595099
false
3.389439
false
false
false
Jonadabe/letsencrypt
letsencrypt/achallenges.py
1
2725
"""Client annotated ACME challenges. Please use names such as ``achall`` to distiguish from variables "of type" :class:`acme.challenges.Challenge` (denoted by ``chall``) and :class:`.ChallengeBody` (denoted by ``challb``):: from acme import challenges from acme import messages from letsencrypt import achallenge...
apache-2.0
8,463,762,847,026,909,000
28.619565
80
0.681835
false
3.609272
false
false
false
gcasey/cosmotrack
scripts/configParsers.py
1
4387
################################################################################ # # Copyright 2013 Kitware, 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...
apache-2.0
5,939,486,349,299,386,000
27.303226
98
0.565079
false
4.017399
false
false
false
letouriste001/SmartForest_2.0
python3.4Smartforest/lib/python3.4/site-packages/django/utils/translation/trans_null.py
1
1408
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_text def ngettext...
mit
-7,491,722,357,305,650,000
23.701754
77
0.721591
false
3.619537
false
false
false
ProjectQ-Framework/ProjectQ
projectq/setups/decompositions/h2rx.py
1
2023
# -*- coding: utf-8 -*- # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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
-7,079,851,581,845,540,000
33.87931
76
0.69303
false
3.14619
false
false
false
montyly/manticore
manticore/native/state.py
1
2684
from ..core.state import StateBase, Concretize, TerminateState from ..native.memory import ConcretizeMemory, MemoryException class State(StateBase): @property def cpu(self): """ Current cpu state """ return self._platform.current @property def mem(self): """ ...
apache-2.0
-261,491,013,077,682,460
35.27027
107
0.643443
false
4.518519
false
false
false
houshengbo/nova_vmware_compute_driver
nova/tests/matchers.py
1
14525
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not ...
apache-2.0
-1,041,197,624,686,391,300
32.08656
78
0.553253
false
4.227299
false
false
false
VerifiableRobotics/controller-arena
src/controllerarena/controllers/refVec.py
1
4049
# code for python reference dipole vector field controller # these functions require stuff #from mathFuns import * from numpy import * from math import * class refVec: # define the constructor def __init__(self, q_0, controller_flag): # Initialize controller state self.phi_prev = None sel...
bsd-3-clause
-3,581,265,295,090,304,000
33.606838
147
0.535935
false
3.010409
false
false
false
tensorflow/datasets
tensorflow_datasets/summarization/newsroom.py
1
4417
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets 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 appl...
apache-2.0
6,486,932,188,809,753,000
31.007246
91
0.655649
false
3.5535
false
false
false
acsis-project/emissions
emissions/python/periodic_1960/regrid_OC_biomass_emissions_n96e_360d_1960.py
1
7191
#!/usr/bin/env python ############################################################################################## # # # regrid_emissions_N96e.py # # # Requirements: # Iris 1.10, cf_units, numpy # # # This Python script has been written by N.L. Abraham as part of the UKCA Tutorials: # http://www.ukca.ac.uk/wiki...
gpl-3.0
508,121,574,114,016,400
41.550296
134
0.715339
false
3.030341
false
false
false
Azure/azure-sdk-for-python
sdk/servicebus/azure-servicebus/tests/livetest/test_errors.py
1
1336
import logging from uamqp import errors as AMQPErrors, constants as AMQPConstants from azure.servicebus.exceptions import ( _create_servicebus_exception, ServiceBusConnectionError, ServiceBusError ) def test_link_idle_timeout(): logger = logging.getLogger("testlogger") amqp_error = AMQPErrors.Lin...
mit
5,185,030,741,937,892,000
39.484848
167
0.776946
false
3.742297
false
false
false
codywilbourn/streamparse
streamparse/run.py
1
1924
""" Helper script for starting up bolts and spouts. """ import argparse import importlib import os import sys from pystorm.component import _SERIALIZERS RESOURCES_PATH = 'resources' def main(): """main entry point for Python bolts and spouts""" parser = argparse.ArgumentParser(description='Run a bolt/spout ...
apache-2.0
6,012,932,336,202,372,000
38.265306
80
0.539501
false
4.042017
false
false
false
uni2u/neutron
neutron/db/metering/metering_db.py
1
10691
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # 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
-8,351,349,277,479,719,000
42.283401
79
0.549341
false
4.356561
false
false
false
Martin456/eve
eve/render.py
1
15213
# -*- coding: utf-8 -*- """ eve.render ~~~~~~~~~~ Implements proper, automated rendering for Eve responses. :copyright: (c) 2017 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ import re import time import datetime import simplejson as json from werkzeug import utils from fun...
bsd-3-clause
-5,451,845,274,095,905,000
30.69375
79
0.602248
false
4.021412
true
false
false
nwspeete-ibm/openwhisk
core/pythonAction/cli/wskrule.py
1
5355
# # Copyright 2015-2016 IBM Corporation # # 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 wr...
apache-2.0
3,352,856,487,309,075,500
40.835938
130
0.620355
false
3.908759
false
false
false
erudit/zenon
tests/unit/apps/public/search/test_utils.py
1
3018
import pytest from django.http.request import QueryDict from apps.public.search.forms import SearchForm from apps.public.search.utils import get_search_elements class FakeSolrData: def get_search_form_facets(self): return { 'disciplines': [], 'languages': [ ('fr',...
gpl-3.0
-2,187,604,127,645,334,000
27.638095
74
0.460925
false
3.359777
false
false
false
psf/black
tests/data/cantfit.py
1
4107
# long variable name this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = 0 this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = 1 # with a comment this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = [ 1, 2, 3...
mit
2,691,835,164,074,515,500
37.383178
126
0.702703
false
2.651388
false
false
false
siusoon/Python_SPEEDSHOW
checkinactivity.py
1
1953
# logic: detect idle time from mac os (mouse and keyboard) and force to go to a specific website # to run the program, administrator needs to set the sleeptime, temp_idle_value and url # Firefox should be the default browser, hide all other applications and docking on the screen # set no screensaver # install fullscre...
unlicense
-1,857,018,180,525,671,700
31.016393
199
0.680492
false
3.222772
false
false
false
almeidapaulopt/frappe
frappe/utils/boilerplate.py
1
9260
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from six.moves import input import frappe, os, re from frappe.utils import touch_file, encode, cstr def make_boilerplate(dest, app_name): if not os.path.exists...
mit
8,096,362,969,132,424,000
28.303797
117
0.653888
false
2.873991
true
false
false
mrakitin/coding
route_tables_update/add_route.py
1
1944
__author__ = 'mrakitin' import os import socket import subprocess address_to_route = None qsh_ip = '192.12.90.0' qsh_ip_mask = '255.255.255.0' # Find IP address provided by SBU VPN: ips_dict = {} for i in socket.getaddrinfo(socket.gethostname(), None): ip = i[4][0] try: socket.inet_aton(ip) ...
gpl-2.0
4,063,799,232,763,459,000
28.907692
101
0.609053
false
3.334477
false
false
false
moio/spacewalk
backend/server/rhnServer/server_wrapper.py
1
3967
# # Copyright (c) 2008--2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-8,041,331,313,070,005,000
35.394495
88
0.663222
false
4.060389
false
false
false
SalesforceEng/Providence
Empire/cloudservices/github/GithubAPI.py
1
5227
''' Copyright (c) 2015, Salesforce.com, 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 foll...
bsd-3-clause
-3,992,668,494,168,806,400
44.850877
755
0.664817
false
4.184948
false
false
false
NMisko/monkalot
bot/commands/speech_cleverbot.py
1
1114
"""Commands: "@[botname] XXXXX".""" from cleverwrap import CleverWrap from bot.commands.abstract.speech import Speech, Chatbot class CleverbotSpeech(Speech): """Natural language by using cleverbot.""" def __init__(self, bot): """Initialize variables.""" if "cleverbot_key" in bot.config and b...
mit
3,116,736,034,507,032,600
29.108108
79
0.618492
false
3.664474
false
false
false
mahmoud/wapiti
wapiti/operations/feedback.py
1
1807
# -*- coding: utf-8 -*- from __future__ import unicode_literals from base import QueryOperation from params import SingleParam, StaticParam from utils import OperationExample #class GetFeedbackV4(QueryOperation): # """ # This API is no longer available (on en or de wikipedia). As of # 3/9/2013, this API do...
bsd-3-clause
-2,002,363,507,429,485,600
33.75
76
0.630327
false
3.725773
false
false
false
irinabov/debian-qpid-python
qpid/selector.py
2
6778
# # 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...
apache-2.0
-213,931,680,745,974,880
29.949772
94
0.638241
false
3.884241
false
false
false
django-inplaceedit/django-inplaceedit
inplaceeditform/settings.py
1
2626
# -*- coding: utf-8 -*- # Copyright (c) 2010-2013 by Yaco Sistemas <goinnn@gmail.com> # 2015 by Pablo Martín <goinnn@gmail.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundatio...
lgpl-3.0
6,846,049,735,984,986,000
60.046512
117
0.726476
false
3.490691
false
false
false
kohnle-lernmodule/palama
exe/engine/idevicestore.py
1
36506
# =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-2.0
-7,368,021,126,483,378,000
45.742638
116
0.594478
false
4.530967
true
false
false
seung-lab/neuroglancer
python/neuroglancer/tool/agglomeration_split_tool.py
1
29368
#!/usr/bin/env python from __future__ import print_function import argparse import collections import uuid import copy import heapq import json import re import sqlite3 import logging import os import numpy as np import six import neuroglancer debug_graph = False verbose_merging = False def normalize_edge((id_a,...
apache-2.0
-3,544,483,489,328,351,700
35.078624
117
0.583662
false
3.648652
false
false
false
kenny1352/ratemyhistory
project/server.py
1
16356
import os import uuid import psycopg2 import psycopg2.extras import crypt, getpass, pwd import time import smtplib, json from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import date from flask import Flask, redirect, url_for,session, render_template, jsonify, request fro...
apache-2.0
4,584,796,409,708,986,000
32.587269
231
0.590548
false
3.920422
false
false
false
josenavas/QiiTa
qiita_pet/handlers/study_handlers/sample_template.py
1
18227
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
-9,172,197,313,224,403,000
34.80943
79
0.594009
false
4.098718
false
false
false
verificarlo/verificarlo
src/tools/ci/vfc_ci_report/inspect_runs.py
1
24408
############################################################################# # # # This file is part of Verificarlo. # # # # Copyr...
gpl-3.0
-3,457,770,372,378,908,000
36.602465
81
0.56585
false
4.164505
false
false
false
lhfei/spark-in-action
spark-2.x/src/main/python/mllib/binary_classification_metrics_example.py
1
2177
# # 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 n...
apache-2.0
-8,696,846,894,260,542,000
36.875
92
0.725769
false
4.054004
false
false
false
UITools/saleor
tests/dashboard/test_staff.py
1
7623
from django.contrib.auth.tokens import default_token_generator from django.core import mail from django.templatetags.static import static from django.urls import reverse from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode from templated_email import send_templated_mail fro...
bsd-3-clause
4,133,092,150,845,388,000
36.737624
77
0.681228
false
3.501608
true
false
false
coleifer/scout
scout/validator.py
1
2599
import json import sys from flask import request from scout.constants import PROTECTED_KEYS from scout.exceptions import error from scout.models import Index if sys.version_info[0] == 2: json_load = lambda d: json.loads(d) else: json_load = lambda d: json.loads(d.decode('utf-8') if isinstance(d, bytes) ...
mit
5,230,470,322,012,655,000
30.313253
78
0.569065
false
4.246732
false
false
false
ov1d1u/tv-maxe-ng
tv-maxe/tvmaxe.py
1
3058
#!/usr/bin/env python3 import sys import os import logger import logging import argparse from os.path import isfile, join, splitext from importlib import import_module from PyQt5 import QtCore, QtWidgets, uic from PyQt5.QtGui import QIcon, QPixmap from settingsmanager import SettingsManager from mainwindow import TVMa...
lgpl-3.0
2,025,557,249,018,245,600
32.615385
99
0.611511
false
4.018397
false
false
false
projecthamster/experiments
pulse.py
1
3779
#!/usr/bin/env python # - coding: utf-8 - # Copyright (C) 2010 Toms Bauģis <toms.baugis at gmail.com> """ Demo of a a timer based ripple running through nodes and initiating sub-animations. Not sure where this could come handy. """ from gi.repository import Gtk as gtk from lib import graphics from lib.pytwee...
mit
8,402,965,764,535,398,000
31.568966
108
0.543409
false
3.770459
false
false
false
yephper/django
django/bin/roub/home/migrations/0007_auto_20160414_1100.py
1
2138
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-04-14 03:00 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('home', '0006_auto_20160414_1055'), ] operations = [ migrations.CreateModel( ...
bsd-3-clause
-564,066,498,514,451,000
49.5
114
0.588119
false
3.447099
false
false
false
cechrist/cardoon
cardoon/devices/autoThermal.py
1
6405
""" Generates an electrothermal device from a nonlinear device class One assumption is that the base class defines numTerms directly in the class definition and it is not changed in process_params(). ------------------------------------------------------------------- Copyright Carlos Christoffersen <c.christoffersen@...
gpl-3.0
-7,248,309,319,612,847,000
37.353293
80
0.560812
false
4.208279
false
false
false
jesuscript/topo-mpi
topo/sheet/lissom.py
1
18697
""" LISSOM and related sheet classes. $Id$ """ __version__='$Revision$' from numpy import zeros,ones import copy import param import topo from topo.base.projection import Projection from topo.base.sheet import activity_type from topo.base.simulation import EPConnectionEvent from topo.transferfn.basic import Piecew...
bsd-3-clause
2,643,544,422,502,129,000
42.080645
156
0.643686
false
3.743143
false
false
false
jffifa/kyotogang-toolset
kotori/gconf.py
1
3723
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- import sys import os import urlparse import urllib class GConf: """global configuration """ GROUP_ID = '10079277' # encodings SHELL_ENCODING = sys.stdout.encoding INTERNAL_ENCODING = 'utf_8' # debug mode DEBUG = False # global d...
mit
5,599,428,392,297,824,000
25.978261
120
0.551974
false
3.131203
false
false
false
internap/almanach
tests/api/test_api_authentication.py
1
1252
# Copyright 2016 Internap. # # 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, so...
apache-2.0
-9,071,383,592,736,127,000
36.939394
95
0.676518
false
3.900312
false
false
false
sjl767/woo
scripts/test-OLD/clump-hopper-viscoelastic.py
1
3251
# -*- coding: utf-8 from woo import utils,pack,export,qt import gts,os,random,itertools from numpy import * import woo.log #woo.log.setLevel('NewtonIntegrator',woo.log.TRACE) # Parameters tc=0.001# collision time en=.3 # normal restitution coefficient es=.3 # tangential restitution coefficient frictionAngle=radi...
gpl-2.0
8,081,068,913,472,389,000
41.776316
168
0.725008
false
2.170227
false
false
false
iesugrace/book-reader
lib/noter.py
1
3267
from record import Record from recorder import Recorder from timeutils import isotime import time import interact import os class Noter(Recorder): def __init__(self, db_path, book_name): Recorder.__init__(self, db_path) self.book_name = book_name def make_makers(self): makers = [] ...
gpl-2.0
-4,272,964,902,325,736,400
32.680412
75
0.565657
false
3.776879
false
false
false
taion/flask-jsonapiview
setup.py
1
1714
from setuptools import setup EXTRAS_REQUIRE = { "docs": ("sphinx", "pallets-sphinx-themes"), "jwt": ("PyJWT>=1.4.0", "cryptography>=2.0.0"), "tests": ("coverage", "psycopg2-binary", "pytest"), } EXTRAS_REQUIRE["dev"] = ( EXTRAS_REQUIRE["docs"] + EXTRAS_REQUIRE["tests"] + ("tox",) ) setup( name="Fl...
mit
8,034,599,104,357,237,000
31.961538
71
0.572929
false
3.616034
false
false
false
giordi91/python_misc
widgets/plotWidget/colorWidget.py
1
11019
from PySide import QtGui , QtCore import math #this is just a color picker class ColorWidget(QtGui.QWidget): colorChangedSignal = QtCore.Signal(int , int ,int) def __init__(self, parent = None , color = [255,0,0]): QtGui.QWidget.__init__(self,parent) self.width ...
mit
-1,275,120,345,756,301,000
41.544402
89
0.631909
false
3.508118
false
false
false
MTgeophysics/mtpy
mtpy/uofa/bayesian1d.py
1
2557
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on 31.07.2013 @author: LK@UofA mtpy/uofa/bayesian1d.py Module for handling the UofA Bayesian 1D inversion/modelling code. """ import os import sys import os.path as op import mtpy.utils.filehandling as MTfh import mtpy.core.edi as EDI import mtpy.utils.exce...
gpl-3.0
8,232,908,212,395,492,000
27.098901
99
0.539304
false
3.058612
false
false
false
steveblamey/nautilus-archive
setup.py
1
1285
#!/usr/bin/env python # coding: utf-8 from os import path from distutils.core import setup PROJECT_DIR = path.dirname(__file__) extension = [ ('/usr/share/nautilus-python/extensions', [path.join(PROJECT_DIR, 'extension', 'nautilus-archive.py')]), ('/usr/share/icons/hicolor/48x48/emblems', [path.joi...
gpl-3.0
-5,443,317,509,589,844,000
31.948718
79
0.632685
false
3.196517
false
false
false
srmagura/potential
ps/grid.py
1
8094
import numpy as np from ps.extend import EType class PsGrid: # FIXME old way is deprecated '''def ps_construct_grids(self, scheme_order): self.construct_grids(scheme_order) R = self.R # remove eventually? a = self.a self.all_Mplus = {0: set(), 1: set(), 2: set()} self...
gpl-3.0
-3,562,702,645,237,333,000
29.659091
88
0.407833
false
3.222134
false
false
false
a358003542/expython
expython/pattern/__init__.py
1
1439
#!/usr/bin/env python # -*- coding: utf-8 -*- from collections import UserList import logging logger = logging.getLogger(__name__) class CycleList(UserList): """ 一个无限循环输出元素的可迭代对象,如果是on-fly模式 (主要指for循环中的删除动作)推荐使用 `remove_item` 方法 """ def __init__(self, data): super().__init...
mit
2,960,627,695,356,223,500
20.089286
44
0.497166
false
2.885514
true
false
false
p4lang/p4app
docker/scripts/mininet/p4_mininet.py
1
5757
# Copyright 2013-present Barefoot Networks, 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
1,125,914,588,463,093,400
35.436709
92
0.57061
false
3.697495
false
false
false
iaz3/ModReader
modreader/game/__init__.py
1
1209
# !/usr/bin/env python3 """ Game Support Modules should be located in this package Names should be all lowercase, unique, and code should follow the template, The template represents the bare miniumum API you are required to conform to. You are allowed to add new files and extend it. """ # ====================== GPL ...
gpl-3.0
4,860,691,471,080,183,000
38
80
0.679074
false
4.212544
false
false
false
zhanglab/psamm
psamm/gapfill.py
1
11063
# This file is part of PSAMM. # # PSAMM 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. # # PSAMM is distributed in the hope that it wi...
gpl-3.0
1,452,733,391,583,776,800
39.375912
79
0.657417
false
3.91472
false
false
false
novafloss/ci-formula
_states/jenkins_job.py
1
1441
# -*- coding: utf-8 -*- import os def _recreate_job_check(old, new): old_cls = old.splitlines()[-1] new_cls = new.splitlines()[-1] return old_cls != new_cls def present(name, source, template=None, context=None): update_or_create_xml = __salt__['jenkins.update_or_create_xml'] # noqa get_file_s...
mit
5,004,029,649,107,946,000
23.844828
75
0.530881
false
3.531863
false
false
false
VU-Cog-Sci/PRF_experiment
ColorMatcherSession.py
1
3743
from __future__ import division from psychopy import visual, core, misc, event import numpy as np from IPython import embed as shell from math import * import os, sys, time, pickle import pygame from pygame.locals import * # from pygame import mixer, time import Quest sys.path.append( 'exp_tools' ) # sys.path.append...
mit
2,694,495,617,494,793,700
40.131868
247
0.711996
false
2.999199
false
false
false
systers/postorius
copybump.py
1
2797
#! /usr/bin/env python3 import os import re import sys import stat import datetime FSF = 'by the Free Software Foundation, Inc.' this_year = datetime.date.today().year pyre_c = re.compile(r'# Copyright \(C\) ((?P<start>\d{4})-)?(?P<end>\d{4})') pyre_n = re.compile(r'# Copyright ((?P<start>\d{4})-)?(?P<end>\d{4})') n...
gpl-3.0
5,930,184,830,484,723,000
28.135417
80
0.490526
false
3.478856
false
false
false
pewen/ten
ten/post.py
1
2525
""" Post processing tools """ import os import numpy as np def extrac4dir(dir_path, search): """ Extrar the epsilon, mean free path, total time and efficienci of all file in some directory. Parameters ---------- dir_path : str Path to the directory with the outputs files. search : list ...
mit
-8,547,275,649,797,289,000
27.681818
96
0.479398
false
4.117455
false
false
false
AstroFloyd/SolTrack
Python/soltrack/riseset.py
2
8500
"""SolTrack: a simple, free, fast and accurate C routine to compute the position of the Sun. Copyright (c) 2014-2020 Marc van der Sluys, Paul van Kan and Jurgen Reintjes, Sustainable Energy research group, HAN University of applied sciences, Arnhem, The Netherlands This file is part of the SolTrack packa...
lgpl-3.0
6,757,125,456,409,840,000
42.814433
173
0.597882
false
3.451076
false
false
false
asd43/Structural-Variation
popgen/mergeBD2bed.py
1
1961
#!/usr/bin/env python3 # Copyright (c) 2017 Genome Research Ltd. # Author: Alistair Dunham # 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 Licens...
gpl-3.0
1,119,849,092,429,157,500
39.020408
162
0.684345
false
3.279264
false
false
false
maltsev/LatexWebOffice
app/tests/server/views/test_document.py
1
4826
# -*- coding: utf-8 -*- """ * Purpose : Test der Dokument- und Projektverwaltung (app/view/documents.py) * Creation Date : 20-11-2014 * Last Modified : Mi 26 Nov 2014 14:58:13 CET * Author : mattis * Coauthors : christian * Sprintnumber : 2 * Backlog entry : - """ from app.common.constants import ERROR_MESSAG...
gpl-3.0
-6,987,938,852,695,280,000
37.134921
120
0.619484
false
3.729814
true
false
false
francois-berder/PyLetMeCreate
letmecreate/click/joystick.py
1
1291
#!/usr/bin/env python3 """Python binding of Joystick wrapper of LetMeCreate library.""" import ctypes _LIB = ctypes.CDLL('libletmecreate_click.so') def get_x(): """Returns the X position of the joystick. Note: An exception is thrown if it fails to read the X position from the chip. """ pos_x = ...
bsd-3-clause
-7,252,341,453,528,857,000
26.468085
76
0.625871
false
3.34456
false
false
false
GoogleCloudPlatform/appengine-config-transformer
yaml_conversion/lib/google/appengine/api/yaml_listener.py
1
7849
# Copyright 2015 Google 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 applicable law or ...
apache-2.0
6,397,356,658,310,916,000
33.884444
79
0.706842
false
4.407075
false
false
false
shichao-an/leetcode-python
product_of_array_except_self/solution4.py
1
1363
""" Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Solve it without division and in O(n). For example, given [1,2,3,4], return [24,12,8,6]. Follow up: Could you solve it with constant space complexity? (N...
bsd-2-clause
-8,392,910,952,196,059,000
25.72549
76
0.58474
false
3.111872
false
false
false