repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
TeamSWAP/swap
external/pyinstaller/tests/runtests.py
1
24562
#! /usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distr...
apache-2.0
3,188,461,673,179,419,000
34.961933
121
0.56852
false
NNTin/Reply-Dota-2-Reddit
displayreddit/drmatch.py
1
5099
from steamapi.getproplayerlist import proPlayerDictionary from steamapi.getheroes import heroDictionary from steamapi.getgameitems import itemDictionary from converter import timeconverter, playerconverter def displayResult(matchJson, playerSummariesJson): introTemplate = '####	\n#####	 ' \ ...
mit
-7,995,903,472,055,855,000
54.956044
176
0.574543
false
UMDWeather/TheDisplayer
plugins/current/weather_underground.py
1
1027
import urllib, json import datetime as dt import logging log = logging.getLogger(__name__) ################################################################################ ## REQUIRED parameters: ################################################################################ ## data_url - e.g. "http://api.wundergrou...
gpl-2.0
941,463,521,244,889,000
32.129032
103
0.523856
false
kkaushik24/python-design-patterns
structural/bridge_pattern.py
1
1404
from abc import ABCMeta, abstractmethod class DrawingApi: def draw_circle(self, x, y, radius): pass class DrawingApi1(DrawingApi): def draw_circle(self, x, y, radius): print "Api1 ", x, y, radius class DrawingApi2(DrawingApi): def draw_circle(self, x, y, radius): print "Api1 ...
apache-2.0
922,079,697,343,518,000
22.79661
74
0.625356
false
jaeilepp/mne-python
mne/coreg.py
1
42970
"""Coregistration between different coordinate frames.""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) from .externals.six.moves import configparser from .externals.six import string_types import fnmatch from glob import glob, iglob import os import stat import sys import re i...
bsd-3-clause
-3,178,512,339,683,785,700
35.018441
79
0.600931
false
adybbroe/atrain_match
python_edit_the_code.py
1
3570
import re, glob, os ROOT_DIR = "/home/a001865/git/rename_atrainmatch/atrain_match/" files = glob.glob(ROOT_DIR + "/*.py") files = files + glob.glob(ROOT_DIR + "/*/*.py") files = files + glob.glob(ROOT_DIR + "/*/*/*.py") var_name_dict ={ "time": "profile_time", "utc_time": "prof...
gpl-3.0
4,090,333,391,999,040,500
41
77
0.527451
false
jhlee525/janna
janna/streamer/batch.py
1
4174
from .base import * from ..logger import logger import numpy as np from itertools import count class Batch(StreamerBase): _count = count(0) def __init__(self, prev, batch_size, squeeze=False, name=None): if not isinstance(batch_size, int): raise KeyError('Batch size must be integer') ...
mit
8,256,329,126,504,383,000
32.392
89
0.516291
false
openwsn-berkeley/range_test
raspberry/experiment_tx.py
1
23331
""" Transmission script of the range test. author Jonathan Munoz (jonathan.munoz@inria.fr), January 2017 """ import time import logging import threading import sys import sched import Queue import json from datetime import datetime as dt import datetime import socket from threading import Timer import at86rf215_defs...
bsd-2-clause
-7,964,004,491,712,060,000
41.730769
123
0.541983
false
jeromecc/doctoctocbot
src/moderation/twitter/user.py
1
2364
from moderation.models import SocialUser from bot.tweepy_api import get_api as get_tweepy_api from tweepy import TweepError from tweepy.models import User as TweepyUser from community.models import Community import logging from community.helpers import get_community_twitter_tweepy_api import time logger = logging.getL...
mpl-2.0
6,726,107,315,724,089,000
30.118421
79
0.565144
false
bugzPDX/airmozilla
airmozilla/manage/autocompeter.py
1
5110
import datetime import json import time import sys from pprint import pprint import requests from django.conf import settings from django.utils import timezone from django.db.models import Count from django.core.exceptions import ImproperlyConfigured from funfactory.urlresolvers import reverse from airmozilla.main....
bsd-3-clause
-4,856,101,207,579,082,000
28.709302
78
0.567515
false
ufal/neuralmonkey
neuralmonkey/evaluators/chrf.py
1
3455
from typing import List, Dict from typeguard import check_argument_types import numpy as np from neuralmonkey.evaluators.evaluator import Evaluator # pylint: disable=invalid-name NGramDicts = List[Dict[str, int]] # pylint: enable=invalid-name class ChrFEvaluator(Evaluator[List[str]]): """Compute ChrF score. ...
bsd-3-clause
5,065,427,443,965,041,000
33.207921
77
0.529957
false
UMONS-GFA/bdas
doc/sensors/sim_pluvio.py
1
18407
__author__ = 'kaufmanno' import numpy as np from scipy.interpolate import pchip_interpolate, interp1d import matplotlib.pyplot as plt draw_graphs = True #draw_graphs = False load_calibration = True save_calibration = False calibration_file = 'calibration.txt' single_flow = True # a varying flow otherwise a series o...
gpl-3.0
6,213,190,602,569,627,000
44.776119
194
0.574154
false
public-ink/public-ink
server/appengine-staging/lib/graphene/types/generic.py
1
1233
from __future__ import unicode_literals from graphql.language.ast import (BooleanValue, FloatValue, IntValue, StringValue, ListValue, ObjectValue) from graphene.types.scalars import MIN_INT, MAX_INT from .scalars import Scalar class GenericScalar(Scalar): """ The `GenericSc...
gpl-3.0
3,297,268,475,079,431,000
30.615385
103
0.631792
false
rlazojr/totalinstaller
plugin.program.community.builds/resetAddon.py
1
1229
# # Copyright (C) 2014 Richard Dean # # 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, or (at your option) # any later version. # # This Program is distributed in the ...
gpl-2.0
-6,033,804,512,929,722,000
34.114286
182
0.729048
false
melinath/django-graph-api
django_graph_api/graphql/introspection.py
1
7781
from django_graph_api.graphql.types import ( BooleanField, CharField, Enum, ENUM, EnumField, INPUT_OBJECT, INTERFACE, List, LIST, ManyEnumField, ManyRelatedField, NON_NULL, Object, OBJECT, RelatedField, SCALAR, UNION, NonNull, ) class DirectiveLo...
mit
-8,515,198,416,324,023,000
25.198653
83
0.528081
false
fsimkovic/conkit
conkit/core/struct.py
1
2751
# BSD 3-Clause License # # Copyright (c) 2016-18, University of Liverpool # 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 notic...
bsd-3-clause
3,594,218,753,008,442,400
39.455882
118
0.708833
false
bravomikekilo/mxconsole
mxconsole/platform/flags.py
1
4765
# 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
3,211,316,646,001,435,600
32.321678
80
0.633998
false
bundlewrap/bundlewrap
bundlewrap/utils/ui.py
1
14061
from contextlib import contextmanager, suppress from datetime import datetime from functools import wraps from os import _exit, environ, getpid, kill from os.path import join from select import select from shutil import get_terminal_size from signal import signal, SIG_DFL, SIGINT, SIGQUIT, SIGTERM from subprocess impor...
gpl-3.0
-4,341,101,949,010,468,400
31.969484
98
0.527376
false
susahe/sis
sis/schedule/models.py
1
1278
from __future__ import unicode_literals from django.template.defaultfilters import slugify from django.contrib.auth.models import User from django.db import models from course.models import Activity,Course,CourseGroup from datetime import datetime # Theory Session table create # have relationship between course gro...
gpl-2.0
7,980,110,490,229,708,000
35.514286
68
0.79734
false
Cinntax/home-assistant
homeassistant/components/plex/media_player.py
1
28269
"""Support to interface with the Plex API.""" from datetime import timedelta import json import logging import plexapi.exceptions import plexapi.playlist import plexapi.playqueue import requests.exceptions from homeassistant.components.media_player import MediaPlayerDevice from homeassistant.components.media_player.c...
apache-2.0
1,241,736,605,791,758,600
33.986386
88
0.564894
false
kwikteam/global_superclustering
global_code/emlaunch_synthetic_test_get_initclust.py
1
1230
#Be sure to run #python setup.py build_ext --inplace #before running this script import pickle import numpy as np import matplotlib.pyplot as plt import sorting from supercluster import * from klustakwik2 import * import imp # lets you reload modules using e.g.imp.reload(sorting) from IPython import embed import tim...
gpl-2.0
7,085,543,806,165,810,000
28.285714
90
0.749593
false
djaodjin/djaodjin-pages
pages/api/sources.py
1
5950
# Copyright (c) 2021, Djaodjin 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
bsd-2-clause
5,008,858,569,694,676,000
30.989247
78
0.64084
false
Zlash65/erpnext
erpnext/assets/doctype/asset/asset.py
1
23671
# -*- coding: utf-8 -*- # Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, erpnext, math, json from frappe import _ from six import string_types from frappe.utils import flt, add_months, cint, now...
gpl-3.0
-5,258,987,987,461,458,000
38.320598
166
0.715137
false
AISpace2/AISpace2
aispace2/jupyter/csp/csp.py
1
23307
import threading from functools import partial from time import sleep from ipywidgets import register from traitlets import Bool, Dict, Float, Instance, Unicode from aipython.cspProblem import CSP from ... import __version__ from ..stepdomwidget import ReturnableThread, StepDOMWidget from .cspjsonbridge import (csp_...
gpl-3.0
-6,535,950,557,674,089,000
38.105705
131
0.562449
false
lukefrasera/cs775Homework
hw_002/scripts/gaussian_classify.py
1
9070
#!/usr/bin/env python import numpy as np from numpy import linalg as la import matplotlib.pyplot as plt import argparse import os import pdb from scipy import spatial import time import operator ''' Python Program demonstrating the use of a gaussian classifier. ''' #KNNCLassifier returns a tuple of the K closest featu...
lgpl-3.0
-3,786,826,768,799,533,600
42.605769
159
0.653032
false
srowe/xen-api
scripts/examples/smapiv2.py
8
9466
#!/usr/bin/env python import os, sys, time, socket, traceback log_f = os.fdopen(os.dup(sys.stdout.fileno()), "aw") pid = None def reopenlog(log_file): global log_f if log_f: log_f.close() if log_file: log_f = open(log_file, "aw") else: log_f = os.fdopen(os.dup(sys.stdout.filen...
lgpl-2.1
-7,150,863,785,080,457,000
31.754325
105
0.570251
false
Oksisane/RSS-Bot
Trolly-master/trolly/board.py
1
5227
""" Created on 8 Nov 2012 @author: plish """ from trolly.trelloobject import TrelloObject class Board(TrelloObject): """ Class representing a Trello Board """ def __init__(self, trello_client, board_id, name=''): super(Board, self).__init__(trello_client) self.id = board_id ...
gpl-3.0
-6,671,452,477,042,218,000
27.71978
79
0.579682
false
nicolasdespres/hunittest
hunittest/test/test_stopwatch.py
1
2631
# -*- encoding: utf-8 -*- """Test 'stopwath' module. """ import unittest import time from datetime import timedelta from hunittest.stopwatch import StopWatch class TestStopWatch(unittest.TestCase): def assertTimedeltaAlmostEqual(self, td1, td2, prec=1e-3): return abs(td1 - td2).total_seconds <= prec ...
bsd-2-clause
5,127,935,866,404,837,000
31.085366
78
0.558723
false
Lukasa/testifi
testifi/server.py
1
1038
# -*- coding: utf-8 -*- """ testifi.server ~~~~~~~~~~~~~~ The primary server module in testifi. """ import sys import structlog from twisted.web import server, resource from twisted.internet import reactor from twisted.internet.defer import DeferredQueue from twisted.internet.task import LoopingCall from twisted.pyt...
mit
-7,580,820,496,910,374,000
21.085106
68
0.716763
false
trolldbois/ctypeslib
test/util.py
1
5667
# From clang/bindings/python/cindex/test # This file provides common utility functions for the test suite. # import ctypes import os from io import StringIO from ctypes import RTLD_GLOBAL from clang.cindex import Cursor from clang.cindex import TranslationUnit import unittest from ctypeslib.codegen import clangparser...
mit
646,252,004,290,654,700
33.554878
107
0.562908
false
zevanzhao/TCCL-Code
ADF/ADFDFTB2xyz.py
1
1334
#!/usr/bin/env python #Time-stamp: <Last updated: Zhao,Yafan zhaoyafan@mail.thu.edu.cn 2013-11-25 20:20:08> """ A script to get the optimized geometry from ADF DFTB calculation out file. """ import sys, re if (len(sys.argv) < 2): print "Usage: ADFDFTB2xyz.py [adf.out]" exit(0) ADFOUT = sys.argv[1] inp = open(AD...
gpl-3.0
2,415,750,034,143,794,000
25.68
85
0.60045
false
calee0219/Course
ML/lab2/lab2_vedio.py
1
1755
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import pandas as pd from sklearn.preprocessing import normalize from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.metrics import confusion_matrix from sklearn.model_selection import KFold from scipy.spatial.distance import cosine as Cos d...
mit
4,068,913,304,894,074,000
30.339286
75
0.679202
false
henkelis/sonospy
web2py/applications/sonospy/models/menu.py
1
1952
# -*- coding: utf-8 -*- ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.title = request.application response.subtitle = T('UPnP ControlPoint') ###########...
gpl-3.0
-4,725,703,634,237,785,000
36.538462
80
0.433402
false
mgramsay/PlasMarkov
tweet.py
1
2137
# -*- coding: utf-8 -*- # Copyright (c) 2016 Martin Ramsay # # 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, modif...
mit
4,053,133,167,695,728,600
35.220339
79
0.680861
false
dataforimpact/veliquest
scrapers/v1-plus-local-storage/jcdecaux-scraper.py
1
3422
import os import sys import requests import json import datetime as dt from boto.s3.connection import S3Connection, Location from boto.s3.key import Key def unsafe_getenviron(k): v = os.environ.get(k) if(v): return v else: raise Exception('environment variable %s not set' % k) JC_DECAUX_API_KEY = unsafe_gete...
mit
4,501,067,044,483,126,000
25.944882
119
0.697545
false
dataunit/dataunit
dataunit/case.py
1
1428
import unittest from dataunit.context import Context, get_global_context class DataUnitTestCase(unittest.TestCase): """A class defining a single DataUnit tests case. This class is designed to be instantiated with a list of TestCommand instances which define the behavior of this tests case. :not...
apache-2.0
-203,158,893,744,653,540
33.829268
99
0.663866
false
gavinfish/leetcode-share
python/065 Valid Number.py
1
1907
''' Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => false "2e10" => true Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one. ''' class Solution(object): def isNumber(self, s):...
mit
-3,100,469,301,061,550,000
32.473684
132
0.528579
false
phiros/nepi
src/nepi/resources/omf/interface.py
1
11938
# # NEPI, a framework to manage network experiments # Copyright (C) 2013 INRIA # # 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 ...
gpl-3.0
7,847,344,216,218,451,000
34.111765
135
0.570028
false
AntreasAntoniou/DeepClassificationBot
deepanimebot/bot.py
1
7412
# -*- coding: utf-8 -*- ''' Twitter bot who replies with the best guesses of what a @mention'ed image is. ''' from __future__ import absolute_import from __future__ import print_function from __future__ import division import functools import logging import os import random import time import tweepy import deploy im...
mit
5,811,651,441,929,854,000
35.875622
138
0.639234
false
grizmio/DictQueue
DictQueue/DictQueue.py
1
4887
import asyncio import time from collections import OrderedDict class KeyNotInDictException(Exception): pass class KeyVanishedException(Exception): pass class AlreadyWaitingForItException(Exception): pass class DictContainer: def __init__(self, max_size): self.__requested_keys = set() ...
mit
1,505,946,286,195,720,000
28.089286
100
0.516268
false
ucsd-ccbb/Oncolist
src/server/Louvain/cluster_analysis_module.py
1
30972
import pandas as pd import numpy as np import time, os, shutil, re, community import networkx as nx import matplotlib.pyplot as plt import scipy.spatial.distance as ssd import scipy.cluster.hierarchy as sch # import cluster_connect module import cluster_connect """ --------------------------------------------------...
mit
-3,302,082,777,373,428,000
38.912371
211
0.599348
false
Rfam/rfam-production
scripts/support/mirnas/report_to_mirna_input.py
1
3367
import argparse import json import os from datetime import date # ------------------------------------------------------------------------------- def extract_new_mirnas_from_report(report_tsv, type='new'): """ """ new_mirnas = {} fp = open(report_tsv, 'r') count = 0 for line in fp: ...
apache-2.0
-6,873,067,566,488,718,000
28.278261
105
0.471339
false
jucacrispim/toxicbuild
toxicbuild/master/slave.py
1
21372
# -*- coding: utf-8 -*- # Copyright 2016-2020 Juca Crispim <juca@poraodojuca.net> # This file is part of toxicbuild. # toxicbuild 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 t...
agpl-3.0
5,881,850,398,815,286,000
36.494737
79
0.57828
false
ekwan/PyQuiver
src/constants.py
1
5346
# This file holds physical constants and reads atomic weights. import sys import re import os import inspect ############### # Physical Constants PHYSICAL_CONSTANTS = { 'h' : 6.626070E-34, # Planck's constants in J * s 'c' : 2.997925E+10, # speed of light in units of cm/s 'Eh' : 4.359745E-18, # energy o...
apache-2.0
-5,842,683,066,656,835,000
35.121622
136
0.589787
false
kvidoo/MMexUpdater
mmupdater/MMexCategoryUpdater.py
1
1514
''' Created on Aug 30, 2013 @author: novpa01 ''' import logging import sys import importlib from mmupdater.Settings import Settings from mmupdater.UserError import UserError from mmupdater.MMexDb import MMexDb from mmupdater.CategoryAssigner import CategoryAssigner # Parse settings file settings = Settings('settings...
mit
5,669,176,103,942,437,000
28.686275
92
0.645971
false
arthursoprano/flow-pattern-map
buttons.py
1
2571
from ipywidgets import widgets, Layout continuous_update = True layout = Layout(width='50%', justify_content ='space-between', align_content='space-around') ρ_L_button = widgets.FloatSlider( min=800.0, max=1200.0, value=1000.0, step=0.5, continuous_update=continuous_update, ...
mit
-1,499,138,884,504,016,100
20.094828
93
0.609442
false
FSUgenomics/TFLOW
tflow/segments/BUSCO_Analysis.py
1
22978
#TFLOW Segment: Analyze FASTA File for Gene Recapture using BUSCO Benchmark Database # #Dan Stribling #Florida State University #Center for Genomics and Personalized Medicine #Version 0.9, 04/20/2015 #Project URL: http://www.github.com/fsugenomics/tflow import os.path import sys import subprocess import shutil BUSCO_...
gpl-2.0
-9,137,028,453,921,034,000
39.813499
104
0.581817
false
infinity0n3/python-fabtotum
fabtotum/loaders/gerber/excellon_statements.py
1
31011
#!/usr/bin/env python # -*- coding: utf-8 -*- # copyright 2014 Hamilton Kibbe <ham@hamiltonkib.be> # # 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/LICEN...
gpl-3.0
4,613,957,387,060,365,000
30.708589
102
0.557447
false
gmimano/commcaretest
corehq/apps/export/custom_export_helpers.py
1
14645
import json from corehq.apps.reports.standard import export from corehq.apps.reports.models import FormExportSchema, HQGroupExportConfiguration, CaseExportSchema from corehq.apps.reports.standard.export import DeidExportReport from couchexport.models import ExportTable, ExportSchema, ExportColumn from django.utils.tran...
bsd-3-clause
1,592,665,312,018,443,300
37.539474
116
0.601571
false
Oslandia/vizitown_plugin
cyclone/web.py
1
86048
# coding: utf-8 # # Copyright 2010 Alexandre Fiori # based on the original Tornado by Facebook # # 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...
gpl-2.0
4,279,697,711,647,361,000
38.892443
88
0.589415
false
larsyencken/cjktools
cjktools/resources/radkdict.py
1
2575
#!/usr/bin/env python # -*- coding: utf-8 -*- # # radkdict.py # cjktools # """ Based on the radkfile, a dictionary mapping character to bag of radicals. """ import sys from cjktools import maps from cjktools.common import get_stream_context, stream_codec from . import cjkdata from six import text_type def _def...
bsd-3-clause
-4,731,615,904,252,097,000
24.49505
76
0.582524
false
Ambuj-UF/ConCat-1.0
src/Utils/Bio/MaxEntropy.py
1
10435
# Copyright 2001 by Jeffrey Chang. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Maximum Entropy code. Uses Improved Iterative Scaling. """ # TODO Define terminology from...
gpl-2.0
-8,712,417,844,903,718,000
30.814024
92
0.601725
false
jtoppins/beaker
IntegrationTests/src/bkr/inttest/server/selenium/test_job_export_xml.py
1
2025
# 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. from bkr.inttest.server.selenium import WebDriverTestCase from bkr.int...
gpl-2.0
621,352,936,695,160,400
42.085106
92
0.65284
false
samueljackson92/NDImage
ndimage/gui/table_model.py
1
1313
from PyQt4 import QtCore class DataFrameTableModel(QtCore.QAbstractTableModel): def __init__(self, data=None, parent=None): QtCore.QAbstractTableModel.__init__(self, parent=parent) self.set_data(data) def rowCount(self, parent): return self._data.shape[0] if self._data is not None els...
mit
-1,186,761,553,999,052,300
34.486486
86
0.648134
false
homeworkprod/byceps
tests/services/user_avatar/test_models_image_path.py
1
1182
""" :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from pathlib import Path from uuid import UUID import pytest from byceps.util.image.models import ImageType from testfixtures.user import create_user from testfixtures.user_avatar import create_avatar from tests.hel...
bsd-3-clause
-2,107,900,215,533,090,800
28.55
96
0.694585
false
stdlib-js/stdlib
lib/node_modules/@stdlib/math/base/special/maxabs/benchmark/python/benchmark.py
1
2209
#!/usr/bin/env python # # @license Apache-2.0 # # Copyright (c) 2018 The Stdlib 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 # # ...
apache-2.0
-5,144,522,500,454,437,000
21.773196
82
0.626981
false
henry0312/LightGBM
python-package/lightgbm/plotting.py
1
25113
# coding: utf-8 """Plotting library.""" from copy import deepcopy from io import BytesIO import numpy as np from .basic import Booster, _log_warning from .compat import GRAPHVIZ_INSTALLED, MATPLOTLIB_INSTALLED from .sklearn import LGBMModel def _check_not_tuple_of_2_elements(obj, obj_name='obj'): """Check objec...
mit
-408,649,031,525,272,200
39.309791
115
0.614781
false
darknightghost/AutoDeployer
cmd_pipe/SubProc.py
1
3581
#! /usr/bin/python3 # -*- coding: utf-8 -*- ''' Copyright 2016,王思远 <darknightghost.cn@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, o...
gpl-3.0
-127,845,725,472,308,430
29.29661
74
0.567552
false
martinzlocha/mad
portal/forms.py
1
2190
from django import forms from django.core.exceptions import ValidationError from portal.models import Student, Hobby class SignUpForm(forms.ModelForm): class Meta: model = Student fields = ['name', 'username', 'gender', 'course'] widgets = { 'name': forms.TextInput(attrs={'pla...
mit
-1,180,396,039,648,989,400
34.322581
120
0.620091
false
citiususc/construe
construe/utils/signal_processing/wave_extraction.py
1
8755
# -*- coding: utf-8 -*- # pylint: disable-msg=C0103 """ Created on Thu Oct 17 13:15:52 2013 This module provides the functionality to obtain basic primitive structures, called "peaks", from a signal fragment and its corresponding simplification using the Douglas-Peucker algorithm. The process is based on the paper: "...
agpl-3.0
7,635,516,548,468,927,000
37.231441
79
0.531468
false
endreman0/Excalibot
excalibot/cogs/voice.py
1
4864
import asyncio, discord from discord.ext.commands import guild_only from .. import db, log from ..core import command class VoiceText(metaclass=command.Cog): async def on_voice_state_update(self, member, before, after): if before.channel is after.channel: return # Only care about changing channels with self.bot.s...
gpl-3.0
-6,292,609,427,924,506,000
52.450549
167
0.717516
false
piotrmaslanka/cyrkus
redaction/plugins/httpifc/__init__.py
1
2636
# coding=UTF-8 """ SMS Plus GSM MultiInfo gateway """ from __future__ import division from hashlib import sha1 import unicodedata, httplib, urllib, urlparse, json, BaseHTTPServer, time from satella.threads import BaseThread from cyrkus.redaction.plugins.httpifc.format import fformat class HttpServerThread(BaseThread):...
bsd-3-clause
-2,995,706,234,309,641,700
34.146667
104
0.588771
false
pmeas/pmeas-backend
__main__.py
1
10740
#!/usr/bin/python GPIO_CAPABLE = False import time from functools import partial import signal import sys import pyo try: import RPi.GPIO as GPIO GPIO_CAPABLE = True except ImportError: pass if GPIO_CAPABLE: import gpiocontrol import bridge import configparser import jackserver import flanger impor...
gpl-3.0
3,335,811,969,404,656,000
32.457944
138
0.533799
false
yeming233/rally
rally/plugins/openstack/services/storage/cinder_common.py
1
29782
# 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 agreed to in...
apache-2.0
-218,852,773,355,620,600
39.853224
80
0.601874
false
tsauerwein/c2cgeoportal
c2cgeoportal/tests/xmlstr.py
3
5978
# -*- coding: utf-8 -*- # Copyright (c) 2013-2014, Camptocamp SA # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this #...
bsd-2-clause
-5,369,876,525,444,830,000
60.608247
776
0.732932
false
ayepezv/GAD_ERP
openerp/__init__.py
2
2641
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ OpenERP core library.""" #---------------------------------------------------------- # Running mode flags (gevent, prefork) #---------------------------------------------------------- # Is the server running with ge...
gpl-3.0
-7,602,556,953,469,250,000
31.604938
79
0.537675
false
bburan/psiexperiment
psi/controller/calibration/chirp_calibration.py
1
1129
from ..util import acquire def chirp_power(engine, freq_lb=50, freq_ub=100e3, attenuation=0, vrms=1, repetitions=32, duration=0.1, iti=0.01): calibration = FlatCalibration.as_attenuation(vrms=vrms) ai_fs = engine.hw_ai_channels[0].fs ao_fs = engine.hw_ao_channels[0].fs queue = FIFOSig...
mit
-6,651,210,350,675,184,000
33.212121
75
0.643047
false
nathanielksmith/done
parsedatetime/tests/TestFrenchLocale.py
1
4203
#!/usr/bin/env python """ Test parsing of simple date and times using the French locale Note: requires PyICU """ import unittest, time, datetime import parsedatetime.parsedatetime as pt import parsedatetime.parsedatetime_consts as ptc # a special compare function is used to allow us to ignore the seconds as # ...
gpl-3.0
6,624,456,152,510,218,000
40.205882
111
0.596241
false
wholmgren/pvlib-python
pvlib/test/conftest.py
1
3981
import inspect import os import platform import numpy as np import pandas as pd from pkg_resources import parse_version import pytest import pvlib pvlib_base_version = \ parse_version(parse_version(pvlib.__version__).base_version) # decorator takes one argument: the base version for which it should fail # for ...
bsd-3-clause
-1,695,744,012,780,262,100
25.019608
78
0.645566
false
optikfluffel/lagesonum
lagesonum/bottle_app.py
1
4024
# coding: utf-8 import sqlite3 import os import time import bottle from bottle import default_app, route, view from bottle import request from bottle_utils.i18n import I18NPlugin #from bottle_utils.i18n import lazy_gettext as _ #todo: refactor so that there is no error in Py3 local deployment and testing import inpu...
mit
4,199,236,689,896,837,600
30.193798
118
0.591451
false
shivam5992/pywordcloud-flask
words.py
1
4499
''' Python implementation of HTML wordcloud of words collected from a website, Paragraph Input or File Upload. Flask Web App implementation of the same. Author: Shivam Bansal Email: shivam5992@gmail.com Website: www.shivambansal.com Version: 0.1 ''' from flask import Flask, render_template, request, flash, redirec...
mit
8,035,192,736,946,009,000
25.162791
145
0.625695
false
steveb/heat
heat/engine/clients/os/neutron/__init__.py
1
6485
# # 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, software # ...
apache-2.0
-6,405,323,272,617,855,000
38.542683
78
0.588743
false
gazbot/conference-project
models.py
1
5513
#!/usr/bin/env python """models.py Udacity conference server-side Python App Engine data & ProtoRPC models $Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $ created/forked from conferences.py by wesc on 2014 may 24 """ __author__ = 'wesc+api@google.com (Wesley Chun)' import httplib import endpoints from protor...
apache-2.0
-3,578,478,729,146,258,400
33.037037
87
0.6579
false
LeastAuthority/txkube
src/txkube/test/test_authentication.py
1
15146
# Copyright Least Authority Enterprises. # See LICENSE for details. import os from itertools import count, islice from uuid import uuid4 from pykube import KubeConfig import pem import attr from pyrsistent import InvariantException from hypothesis import given from fixtures import TempDir from zope.interface.ve...
mit
-7,816,677,622,489,357,000
31.363248
92
0.630794
false
sensbio/sensbiotk
examples/scripts/expe_prima.py
1
4757
# -*- coding: utf-8 -*- """ Reconstruction angles example comparison """ import numpy as np from sensbiotk.algorithms import martin_ahrs from sensbiotk.algorithms.basic import find_static_periods from sensbiotk.io.iofox import load_foxcsvfile from sensbiotk.io.ahrs import save_ahrs_csvfile import sensbiotk...
gpl-3.0
-5,332,932,333,264,223,000
31.737589
83
0.570107
false
Spandex-at-Exeter/demography_database
app/matrix_functions.py
1
14553
from models import Permission, Role, User, IUCNStatus, OrganismType, GrowthFormRaunkiaer, ReproductiveRepetition, \ DicotMonoc, AngioGymno, SpandExGrowthType, SourceType, Database, Purpose, MissingData, ContentEmail, Ecoregion, Continent, InvasiveStatusStudy, InvasiveStatusElsewhere, StageTypeClass,...
mit
9,208,999,180,805,464,000
42.056213
279
0.698413
false
thepian/theapps
theapps/supervisor/sites.py
1
1074
from django.conf import settings class SiteManager(object): def __init__(self): self.cur = None # Map of Site instances self.sites = {} def get_current(self): if not self.cur: self.cur = Site() return self.cur def get_d...
gpl-3.0
8,910,944,919,843,968,000
25.85
113
0.555866
false
boldfield/s3-encryption
s3_encryption/crypto.py
1
1913
from Crypto import Random from Crypto.Cipher import AES as pyAES import codecs class AES(object): def __init__(self): self.key = None self._mode = None self.iv = None @staticmethod def str_to_bytes(data): t = type(b''.decode('utf-8')) if isinstance(data, t): ...
bsd-3-clause
-4,556,593,097,893,904,400
23.844156
141
0.591218
false
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters.py
1
2096
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-2,620,773,727,717,192,700
40.098039
102
0.623569
false
Micronaet/micronaet-product
duty_management/__init__.py
1
1034
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
agpl-3.0
5,231,561,752,225,363,000
43.956522
79
0.609284
false
TheHonestGene/risk-predictor
setup.py
1
1882
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encoding='utf-8') as...
mit
-6,642,484,730,661,453,000
31.448276
99
0.605739
false
pwarren/AGDeviceControl
agdevicecontrol/thirdparty/site-packages/darwin/phidgets/servomotor.py
1
3317
# This file was created automatically by SWIG. # Don't modify this file, modify the SWIG interface instead. # This file is compatible with both classic and new-style classes. import _servomotor def _swig_setattr(self,class_type,name,value): if (name == "this"): if isinstance(value, class_type): ...
gpl-2.0
6,873,438,704,202,684,000
45.71831
127
0.708472
false
skosukhin/spack
var/spack/repos/builtin/packages/xfontsel/package.py
1
1912
############################################################################## # Copyright (c) 2013-2017, 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,634,601,404,021,808,000
42.454545
79
0.676255
false
snarasi/django-bookmarkApp
bookmark/urls.py
1
1208
"""bookworm URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
gpl-3.0
6,150,545,808,403,012,000
35.606061
79
0.679636
false
brosner/django-sqlalchemy
django_sqlalchemy/management/sql.py
1
1402
from django.db.models.loading import get_models from django.core.management.sql import custom_sql_for_model from sqlalchemy import create_engine from django_sqlalchemy.backend import metadata, session def reset(engine, app): metadata.drop_all(engine, tables=_get_tables_for_app(app)) session.commit() def creat...
bsd-3-clause
-8,844,244,939,070,740,000
36.891892
99
0.616976
false
TarasLevelUp/asynqp
src/asynqp/message.py
1
8788
import json from collections import OrderedDict from datetime import datetime from io import BytesIO from . import amqptypes from . import serialisation class Message(object): """ An AMQP Basic message. Some of the constructor parameters are ignored by the AMQP broker and are provided just for the co...
mit
9,189,294,022,764,453,000
34.152
105
0.624033
false
porksmash/swarfarm
bestiary/models.py
1
75620
from collections import OrderedDict from functools import partial from math import floor, ceil from operator import is_not from django.contrib.auth.models import User from django.contrib.postgres.fields import ArrayField from django.contrib.staticfiles.templatetags.staticfiles import static from django.core.exceptions...
apache-2.0
-5,660,210,679,202,290,000
39.546917
188
0.562391
false
akrause2014/dispel4py
dispel4py/new/mpi_process_test.py
1
1115
# Copyright (c) The University of Edinburgh 2014 # # 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 agr...
apache-2.0
5,902,654,700,553,839,000
32.787879
86
0.747982
false
dbdd4us/compose
compose/utils.py
1
3235
from __future__ import absolute_import from __future__ import unicode_literals import codecs import hashlib import json import json.decoder import logging import ntpath import six from .errors import StreamParseError json_decoder = json.JSONDecoder() log = logging.getLogger(__name__) def get_output_stream(stream...
apache-2.0
-2,486,481,074,851,938,300
26.184874
85
0.636785
false
javierwilson/forocacao
forocacao/app/png.py
1
4177
# -*- coding: utf-8 -*- from PIL import Image, ImageDraw, ImageFont import textwrap from unidecode import unidecode from reportlab.graphics import renderPM from reportlab.graphics.barcode import code128 from reportlab.graphics.barcode import createBarcodeDrawing from reportlab.graphics.barcode import createBarcodeImag...
bsd-3-clause
-7,824,533,436,109,494,000
38.40566
126
0.603304
false
mhahn/stacker
stacker/lookups/registry.py
1
1745
from ..exceptions import UnknownLookupType from ..util import load_object_from_string from .handlers import output from .handlers import kms from .handlers import xref from .handlers import file as file_handler LOOKUP_HANDLERS = {} DEFAULT_LOOKUP = output.TYPE_NAME def register_lookup_handler(lookup_type, handler_o...
bsd-2-clause
-1,027,917,854,892,513,400
29.614035
79
0.679083
false
SKIRT/PTS
do/core/remove_columns.py
1
2196
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
-2,754,714,214,914,406,400
34.403226
82
0.51754
false
charlesfleche/charlesfleche.net
fabfile.py
1
3663
from fabric.api import * import fabric.contrib.project as project import http.server import os import shutil import sys import socketserver # Local path configuration (can be absolute or relative to fabfile) env.deploy_path = 'output' DEPLOY_PATH = env.deploy_path # Remote server configuration production = 'root@char...
mit
-9,078,609,407,775,656,000
30.577586
223
0.663118
false
cylc/cylc
cylc/flow/broadcast_report.py
1
3589
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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,...
gpl-3.0
-5,435,023,536,567,714,000
35.252525
75
0.593201
false
dceoy/fractus
fract/model/ewma.py
1
1996
#!/usr/bin/env python import logging import numpy as np from .sieve import LRFeatureSieve class Ewma(object): def __init__(self, config_dict): self.__logger = logging.getLogger(__name__) self.__alpha = config_dict['model']['ewma']['alpha'] self.__sigma_band = config_dict['model']['ewma'][...
mit
-7,870,564,357,281,349,000
35.962963
77
0.491483
false
tmm/django-username-email
cuser/admin.py
1
1437
from django.contrib import admin from django.contrib.auth.admin import GroupAdmin as BaseGroupAdmin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.models import Group as StockGroup from django.utils.translation import gettext_lazy as _ from cuser.forms import UserChangeForm, ...
mit
9,063,590,292,572,750,000
34.925
79
0.637439
false
anthonyfok/frescobaldi
frescobaldi_app/docbrowser/browser.py
1
10953
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # 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 ...
gpl-2.0
8,974,451,822,156,147,000
37.978648
98
0.619739
false
ftrimble/route-grower
pyroute/compress/compress.py
1
4419
#!/usr/bin/python #---------------------------------------------------------------- # #------------------------------------------------------ # Usage: # #------------------------------------------------------ # Copyright 2007, Oliver White # # This program is free software: you can redistribute it and/or modify # it un...
apache-2.0
2,230,958,692,004,118,500
30.564286
218
0.562118
false
tp81/openmicroscopy
components/tools/OmeroWeb/omeroweb/webclient/show.py
1
29181
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2014 University of Dundee & Open Microscopy Environment. # All rights reserved. # # 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 Foun...
gpl-2.0
-3,020,381,144,042,495,000
35.204715
79
0.533532
false
DomNomNom/Cardo
Cardo.py
1
4736
import sys, select # for timing out input ''' This is the overall idea of the game's main logic: stack = [] # last value is the top of the stack while not gameOver: if stack is empty: stack = [ nextEvent() ] # stack now has at least one element top = stack[-1] imminent(top) # this may ...
gpl-3.0
6,443,879,362,117,278,000
22.919192
85
0.614231
false