repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
taniki/motions
scripts/consolidate.py
1
2064
#!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd import codecs sources = { "motion de droite (12/05/2016)": "sources/motion-droite-mai.txt", "motion de droite - vote (12/05/2016)": "sources/motion-droite-mai.vote.txt", "motion des gauches (12/05/2016)": "sources/motion-gauches-mai.txt", "moti...
mit
7,624,195,245,753,730,000
21.150538
116
0.635437
false
2.675325
false
false
false
SKIRT/PTS
modeling/build/suite.py
1
42102
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
-7,414,840,121,747,226,000
26.643467
151
0.507731
false
4.615326
false
false
false
AndrewPeelMV/Blender2.78c
2.78/scripts/addons/io_scene_x3d/import_x3d.py
3
124115
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # This program is distrib...
gpl-2.0
-6,873,639,245,401,785,000
33.438124
142
0.549595
false
3.723934
false
false
false
tomdean/growser
growser/handlers/github.py
1
6202
from datetime import date, timedelta from functools import partial import ujson as json from typing import List, Union from celery import group import pandas as pd from sqlalchemy import and_, exists, func, text from growser import httpcache from growser.app import app, db, log from growser.cmdr import DomainEvent, H...
mit
-1,076,480,806,708,959,900
35.05814
84
0.633828
false
3.898177
false
false
false
sindrig/spoppy
spoppy/dbus_listener.py
1
4121
import logging import threading try: import thread except ImportError: import _thread as thread from .util import format_track logger = logging.getLogger(__name__) try: import dbus import dbus.service import dbus.mainloop.glib DBusServiceObject = dbus.service.Object except ImportError: D...
mit
5,988,290,353,122,200,000
28.862319
78
0.558117
false
4.347046
false
false
false
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/sklearn/multiclass.py
1
27722
""" Multiclass and multilabel classification strategies =================================================== This module implements multiclass learning algorithms: - one-vs-the-rest / one-vs-all - one-vs-one - error correcting output codes The estimators provided in this module are meta-estimators: they re...
mit
-2,618,084,952,452,809,000
35.380577
79
0.623548
false
4.038753
false
false
false
Karel-van-de-Plassche/bokeh
bokeh/tests/test_layouts.py
5
2610
import bokeh.layouts as lyt import pytest from bokeh.core.enums import SizingMode from bokeh.plotting import figure from bokeh.layouts import gridplot from bokeh.models import Column, Row, Spacer def test_gridplot_merge_tools_flat(): p1, p2, p3, p4 = figure(), figure(), figure(), figure() lyt.gridplot([[p1, ...
bsd-3-clause
-4,415,208,015,397,057,500
27.681319
101
0.60613
false
2.815534
true
false
false
GlobalFishingWatch/vessel-maps
utilities/bigquery/message24and5verrify/bg_tracks_bymonth_medical_transport.py
1
3379
import argparse import googleapiclient from googleapiclient.discovery import build from googleapiclient.errors import HttpError from oauth2client.client import GoogleCredentials from datetime import datetime import json #ranges of the years year_range = [2015] quarter_range =[i for i in range(0,4)] #three months, fou...
apache-2.0
-7,641,651,165,679,577,000
26.92562
191
0.602249
false
2.969244
false
false
false
bitforks/drawbot
drawBot/context/gifContext.py
1
2383
import AppKit import Quartz import os import tempfile import subprocess from imageContext import ImageContext gifsiclePath = os.path.join(os.path.dirname(__file__), "tools", "gifsicle") if not os.path.exists(gifsiclePath): gifsiclePath = os.path.join(os.getcwd(), "tools", "gifsicle") class GifContext(ImageCont...
bsd-2-clause
-406,836,697,528,113,150
28.7875
95
0.533781
false
4.26297
false
false
false
wisechengyi/pants
src/python/pants/backend/python/lint/pylint/subsystem.py
2
1150
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.python.subsystems.python_tool_base import PythonToolBase from pants.option.custom_types import file_option, shell_str class Pylint(PythonToolBase): options_scope =...
apache-2.0
2,283,901,315,672,436,000
33.848485
99
0.608696
false
3.938356
false
false
false
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/urbansim_parcel/configs/config_changes_for_estimation.py
2
3554
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from urbansim.configs.config_changes_for_estimation import ConfigChangesForEstimation as USConfigChangesForEstimation class ConfigChangesForEstimation(USConfigChangesForEstimation): def __init__(...
gpl-2.0
-1,646,598,881,947,003,100
57.262295
117
0.311761
false
6.392086
true
false
false
MyPureCloud/developercenter-tutorials
user-management/python/user.py
1
1330
import time import PureCloudPlatformClientV2, os from PureCloudPlatformClientV2.rest import ApiException from pprint import pprint # Credentials CLIENT_ID = os.environ['GENESYS_CLOUD_CLIENT_ID'] CLIENT_SECRET = os.environ['GENESYS_CLOUD_CLIENT_SECRET'] ORG_REGION = os.environ['GENESYS_CLOUD_REGION'] # eg. us_east_1 ...
mit
-2,400,923,763,664,871,000
31.463415
68
0.8
false
3.159145
false
true
false
VTacius/MZBackup
mzbackup/utils/comandos.py
1
1568
"""Ejecución de comandos en el sistema""" from subprocess import Popen, PIPE from shlex import split class SistemLocalError(Exception): """Error personalizado""" def _ejecutar(comando, guardar): error = None with Popen(comando, stdout=PIPE, stderr=PIPE, universal_newlines=True, shell=False) as cursor: ...
lgpl-3.0
-8,357,986,624,322,430,000
24.688525
98
0.612636
false
3.497768
false
false
false
pschmitt/home-assistant
tests/components/samsungtv/test_config_flow.py
6
21038
"""Tests for Samsung TV config flow.""" import pytest from samsungctl.exceptions import AccessDenied, UnhandledResponse from samsungtvws.exceptions import ConnectionFailure from websocket import WebSocketProtocolException from homeassistant.components.samsungtv.const import ( CONF_MANUFACTURER, CONF_MODEL, ...
apache-2.0
7,491,925,790,033,141,000
35.715532
88
0.634756
false
3.752765
true
false
false
rschnapka/webkit-tools
report_webkit_multi_header/ir_report.py
1
2420
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
agpl-3.0
1,679,297,773,097,168,000
38.032258
78
0.613223
false
4.36036
false
false
false
abelhj/svtools
svtools/bin/svtyper/scripts/update_info.py
5
13626
#!/usr/bin/env python import pysam import argparse, sys import math, time, re from collections import Counter from argparse import RawTextHelpFormatter __author__ = "Colby Chiang (cc2qe@virginia.edu)" __version__ = "$Revision: 0.0.1 $" __date__ = "$Date: 2015-09-27 09:31 $" # -------------------------------------- #...
mit
6,708,766,936,609,913,000
35.336
145
0.46903
false
3.772425
false
false
false
gilramir/instmake
instmakelib/ct.py
1
2465
# Copyright (c) 2010 by Cisco Systems, Inc. """ High-level interface to information that ClearCase's cleartool can provide. """ import sys import os from instmakelib import cleartool class NotAView(Exception): pass class View: def __init__(self): self.ct = cleartool.ClearTool() self.vws_paren...
bsd-3-clause
2,538,783,453,889,732,000
27.662791
69
0.578905
false
3.963023
false
false
false
bhdz/scalint
scalint/indexed_cursor.py
3
1527
""" cursors with index support data """ class IndexedCursor(object): def __init__(self,indexable): if '__getitem__' not in dir(indexable): raise TypeError('storage not indexable') self.__o = indexable self.__i = 0 self.__l = len(self.__o) self.__il = self.__l - 1...
apache-2.0
4,995,259,257,480,083,000
18.831169
57
0.497708
false
3.679518
false
false
false
ysfree/ysfree.github.io
creatPost.py
1
1109
from time import strftime title = input("title: ") subtitle = input("subtitle: ") image = input("avatar image: ") # hello_world.jpg bigimg = input("title background image: ") # path.jpg ghrepo = input("github repository: ") # e.g. ysmiles/ysmiles.com tags = input("tags (space separated): ") tags = tags.split() da...
apache-2.0
-3,830,357,134,898,531,300
32.606061
72
0.560866
false
2.903141
false
false
false
Coppersmith/vennclouds
dynamic_wordclouds.py
1
17692
from __future__ import division import csv,sys,codecs try: import ujson as json except: import json import remmets wd = './' #TODO: what do we want the wd to be? import re text_ex = re.compile(ur"[\w'#@]+", re.UNICODE) text_URL_ex = re.compile(ur"http[s]{0,1}://\S+|[\w'#@]+", re.UNICODE) #TODO: allow tokeniz...
bsd-3-clause
3,911,836,008,342,114,000
39.859122
289
0.584897
false
3.841911
false
false
false
ytsarev/rally
tests/benchmark/scenarios/test_base.py
1
6540
# Copyright 2013: Mirantis 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 b...
apache-2.0
-5,284,907,371,279,823,000
36.371429
79
0.642966
false
3.961236
true
false
false
kalhartt/python-groove
src/groove/file.py
1
4856
from __future__ import absolute_import, unicode_literals from collections import OrderedDict from decorator import decorator import groove._constants as _constants from groove.audio_format import AudioFormat from groove.groove import GrooveClass from groove._groove import ffi, lib __all__ = ['File'] @decorator d...
mit
-1,752,151,828,897,911,800
27.904762
77
0.591845
false
3.81761
false
false
false
rancherio/rancher
tests/validation/lib/cloud_provider.py
3
2074
import abc import os from invoke import run class CloudProviderBase(object, metaclass=abc.ABCMeta): DOCKER_VERSION = os.environ.get("DOCKER_VERSION", '20.10') DOCKER_INSTALLED = os.environ.get("DOCKER_INSTALLED", "false") @abc.abstractmethod def create_node(self, node_name, wait_for_ready=False): ...
apache-2.0
2,032,607,677,243,670,000
34.758621
75
0.596432
false
3.509306
false
false
false
rthallisey/clapper
instackenv-validator.py
2
3182
#!/usr/bin/env python # curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" # python get-pip.py import argparse import logging import sys import os import json logging.basicConfig() LOG = logging.getLogger(__name__) LOG.setLevel(logging.DEBUG) # JPEELER: change to INFO later def argParser(): parser = a...
apache-2.0
-579,862,368,273,771,600
29.018868
81
0.541483
false
3.71729
false
false
false
pdebuyl/pyMPCD
setup.py
1
3950
# Copyright (C) 2011 Pierre de Buyl # This file is part of pyMPCD # pyMPCD 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. # pyMPCD ...
gpl-3.0
213,430,278,751,558,800
30.6
87
0.649114
false
3.529937
false
false
false
ghchinoy/tensorflow
tensorflow/python/kernel_tests/signal/dct_ops_test.py
2
7679
# Copyright 2017 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
6,560,820,979,486,990,000
37.20398
87
0.628988
false
3.01492
true
false
false
Universal-Model-Converter/UMC3.0a
libs/RVL_IMG.py
1
5830
from data.COMMON import * #essentials def _t44(img,w,tile,x,y): tx,ty = 0,0 for c in tile: img[((y+ty)*w)+x+tx]=c if tx<3: tx+=1 else: tx=0; ty+=1 def _t84(img,w,tile,x,y): tx,ty = 0,0 for c in tile: img[((y+ty)*w)+x+tx]=c if tx<7: tx+=1 else: tx=0; ty+=...
mit
8,234,732,430,719,587,000
32.895349
105
0.346484
false
2.529284
false
false
false
PixelStereo/lekture
src/panels.py
1
14375
#! /usr/bin/env python3, # -*- coding: utf-8 -*- from PySide2.QtCore import Qt, QSignalMapper, Slot from PySide2.QtWidgets import QLabel, QLineEdit, QSpinBox, QComboBox, QTableWidget, QVBoxLayout, QTableWidgetItem, QWidget from PySide2.QtWidgets import QGroupBox, QHBoxLayout, QListWidget, QAbstractItemView, QPushButto...
lgpl-3.0
-2,660,168,704,408,209,000
42.560606
160
0.70713
false
3.672713
false
false
false
PowerHMC/HmcRestClient
src/virtual_io_server/ListVirtualIOServer.py
1
4647
# Copyright 2015, 2016 IBM Corp. # # 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 require...
apache-2.0
6,699,235,261,389,344,000
41.633028
78
0.618464
false
4.596439
true
false
false
fdslight/fdslight
pywind/lib/tpl/syntax_parser.py
1
5690
#!/usr/bin/env python3 """核心语法解析器,实现核心语法解析功能 """ class SyntaxErr(Exception): pass class ParserErr(Exception): pass ### 对应文本类型 # 为普通文本 TYPE_TEXT = 0 # 为block TYPE_BLOCK = 1 # 为Python代码 TYPE_PYCODE = 2 # 为python语法,即 ${xxx} 这样的字符串 TYPE_PYSYNTAX = 3 # 为include class parser(object): def __get_quot_content(s...
bsd-2-clause
6,976,852,455,311,770,000
22.66087
76
0.41878
false
3.490699
false
false
false
MurpheyLab/trep
examples/papers/cism2013/cart-pend-traj-opt.py
1
1949
from math import pi import numpy as np import trep import trep.visual as visual import matplotlib.pylab as mp import trep.discopt as discopt # set mass, length, and gravity: m = 1.0; l = 1.0; g = 9.8; mc = 1; # define initial state q0 = np.array([0, pi]) # x = [x_cart, theta] p0 = np.array([0, 0]) X0 = np.hstack([q0,...
gpl-3.0
5,621,551,720,055,669,000
23.3625
59
0.648025
false
2.623149
false
false
false
sastryduri/agentless-system-crawler
tests/unit/test_package_utils.py
3
2674
import unittest import mock from utils import package_utils from utils.features import PackageFeature def mocked_subprocess_run(cmd, shell=False, ignore_failure=False): if 'dpkg-query' in cmd: return ('pkg1|v1|x86|123\n' 'pkg2|v2|x86|123') elif '--queryformat' in cmd: return ...
apache-2.0
8,910,787,852,008,235,000
29.735632
72
0.495886
false
4.319871
true
false
false
quantmind/pulsar
pulsar/apps/greenio/utils.py
1
1325
import sys from functools import wraps from inspect import isawaitable from greenlet import greenlet, getcurrent class MustBeInChildGreenlet(RuntimeError): """Raised when an operation must be performed in a child greenlet """ class GreenletWorker(greenlet): pass def wait(value, must_be_child=False): ...
bsd-3-clause
3,848,304,989,523,730,000
26.604167
75
0.646038
false
4.26045
false
false
false
mfcloud/python-zvm-sdk
zvmsdk/database.py
1
30265
# Copyright 2017,2018 IBM Corp. # # 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,777,586,057,635,543,000
36.410383
79
0.523906
false
4.118247
false
false
false
username115/FRCScouting
gen_scripts/autogen_scouting.php.py
1
1865
if __name__ != '__main__': print("Must run '{}' as '__main__'. Tried to run as '{}'. ..exiting..".format(__file__, __name__)) exit() import argparse parser = argparse.ArgumentParser(description='Output server files based on sql') parser.add_argument("-l", "--legacy", help="use legacy mysql syntax", action="store_tru...
apache-2.0
1,660,178,511,597,436,700
34.188679
106
0.70563
false
3.26049
false
false
false
DougBurke/astropy
docs/wcs/examples/programmatic.py
2
1249
# Set the WCS information manually by setting properties of the WCS # object. import numpy as np from astropy import wcs from astropy.io import fits # Create a new WCS object. The number of axes must be set # from the start w = wcs.WCS(naxis=2) # Set up an "Airy's zenithal" projection # Vector properties may be set...
bsd-3-clause
-4,048,332,756,808,649,000
28.738095
76
0.71257
false
2.813063
false
true
false
blockstack/blockstack-server
integration_tests/blockstack_integration_tests/scenarios/name_import_revoke.py
1
3830
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the GNU General...
gpl-3.0
5,280,942,373,456,440,000
32.596491
151
0.687728
false
2.845468
true
false
false
ehiller/CourseBuilderV19-TeacherDashboard
tests/functional/modules_search.py
2
19703
# Copyright 2013 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
2,362,064,747,601,284,000
40.219665
80
0.606608
false
3.811025
true
false
false
braineo/sudokuSolver
code_tester/mnist.py
1
1939
import os import struct import numpy as np """ Parse images from MNIST binary file. Idea from https://gist.github.com/akesling/5358964 """ class MNISTdataset(object): def __init__(self, pathToDataset='.'): self._pathToDataset = pathToDataset return def read(self, dataset="training"): ...
gpl-2.0
-3,793,018,373,950,787,000
29.793651
74
0.585353
false
3.651601
false
false
false
modelblocks/modelblocks-release
resource-gcg/scripts/discgraph.py
1
19204
############################################################################## ## ## ## This file is part of ModelBlocks. Copyright 2009, ModelBlocks developers. ## ## ## #...
gpl-3.0
5,492,007,645,763,879,000
51.613699
207
0.551031
false
3.123617
false
false
false
pme1123/pyroots
pyroots/noise_filters.py
1
10728
# -*- coding: utf-8 -*- """ Created on Sun Dec 11 09:46:19 2016 @author: pme Contents: Various methods for filtering and cleaning up candidate objects. - noise_removal: separates loosely connected objects, removes extremely small objects. - dirt_removal: removes objects based on size, using statistical methods rather...
apache-2.0
-3,563,502,658,820,375,600
38.153285
121
0.500466
false
4.738516
false
false
false
hill-a/stable-baselines
stable_baselines/common/dataset.py
1
3850
import numpy as np class Dataset(object): def __init__(self, data_map, shuffle=True): """ Data loader that handles batches and shuffling. WARNING: this will alter the given data_map ordering, as dicts are mutable :param data_map: (dict) the input data, where every column is a key ...
mit
407,501,059,155,358,100
37.118812
110
0.614545
false
3.745136
false
false
false
pa2515-group2/server
server/rediscli.py
1
1710
import time import ast import redis from server.config import conf from server.utils import logger ADDR = conf.redis_ip def set_data(addr, data): logger.debug('redis set_data, addr:{}, data:{}'.format(addr, data)) r = redis.Redis(host=ADDR) r.set(addr, data) #r.publish(addr, data) def delete_da...
mit
-3,339,147,834,665,287,700
20.375
79
0.595906
false
2.953368
false
false
false
refeed/coala-bears
bears/apertium/ApertiumLintBear.py
1
20741
import json from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.PipRequirement import PipRequirement from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY @linter(executable='apertium_lint', output_format='regex', output_regex=r'(?P<severity>\w+) : (?P<m...
agpl-3.0
3,054,019,817,840,973,300
55.819178
79
0.475819
false
5.265042
true
false
false
harpolea/pyro2
incompressible/problems/converge.py
2
1725
r""" Initialize a smooth incompressible convergence test. Here, the velocities are initialized as .. math:: u(x,y) = 1 - 2 \cos(2 \pi x) \sin(2 \pi y) v(x,y) = 1 + 2 \sin(2 \pi x) \cos(2 \pi y) and the exact solution at some later time t is then .. math:: u(x,y,t) = 1 - 2 \cos(2 \pi (x - t)) \sin(2 \...
bsd-3-clause
-8,759,434,697,242,747,000
24.746269
79
0.605217
false
2.841845
false
false
false
charanpald/sandbox
sandbox/predictors/edge/PrefAttachPredictor.py
1
1483
from apgl.graph import * from apgl.util import * from apgl.predictors.edge.AbstractEdgePredictor import AbstractEdgePredictor import numpy import logging class PrefAttachPredictor(AbstractEdgePredictor): """ Make predictions for a new edge using preferencial attachment. """ def __init__(self, windowSi...
gpl-3.0
6,042,333,073,866,955,000
29.916667
88
0.630479
false
4.01897
false
false
false
JaapJoris/bps
pages/migrations/0001_initial.py
1
2891
# Generated by Django 3.0.8 on 2020-07-11 16:04 import cms.models from django.db import migrations, models import django.db.models.deletion import embed_video.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
agpl-3.0
-4,141,031,081,582,593,500
42.80303
152
0.551366
false
4.434049
false
false
false
ClinGen/clincoded
src/clincoded/audit/experiment.py
2
19489
from contentbase.auditor import ( AuditFailure, audit_checker, ) from .conditions import rfa targetBasedAssayList = [ 'ChIP-seq', 'RNA Bind-n-Seq', 'ChIA-PET', 'RIP Array', 'RIP-seq', 'MeDIP-seq', 'iCLIP', 'shRNA knockdown followed by RNA-seq', ] controlRequiredAssayList = ...
mit
-1,057,219,102,284,278,500
37.592079
231
0.597722
false
3.943545
false
false
false
ioram7/keystone-federado-pgid2013
build/PasteDeploy/build/lib.linux-x86_64-2.7/paste/deploy/paster_templates.py
9
1262
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php import os from paste.script.templates import Template from paste.deploy.compat import print_ class PasteDeploy(Template): _template_dir = 'pas...
apache-2.0
8,875,740,915,012,959,000
34.055556
94
0.590333
false
3.859327
false
false
false
linea-it/dri
api/common/download.py
1
4685
import os import logging from django.utils import timezone from math import log import requests import shutil class Download(): def __init__(self): # Get an instance of a logger self.logger = logging.getLogger("downloads") def download_file_from_url(self, url, dir, filename, ignore_errors=Fals...
gpl-3.0
6,978,529,254,022,850,000
32.949275
97
0.499253
false
3.587289
false
false
false
MarekSuchanek/PYT-TwitterWall
tests/test_web.py
1
4621
from twitterwall.web import * def test_mock_landing(webapp): assert webapp.get('/').status == '200 OK' assert '<h1>Twitter Wall</h1>' in \ webapp.get('/').data.decode('utf-8') def test_mock_feed_simple(webapp): assert webapp.get('/q/yolo').status == '200 OK' assert 'yolo' in webapp.get('/...
mit
-1,943,250,447,876,049,000
28.621795
75
0.597057
false
3.046144
true
false
false
django-functest/django-functest
django_functest/base.py
1
4344
from __future__ import absolute_import, print_function, unicode_literals class FuncBaseMixin(object): """ Abstract base class that exists only to provide autocomplete help. """ # Any docstrings added here also need to be added to # FuncSeleniumMixin/FuncWebTestMixin/CommonMixin. # In theory w...
bsd-3-clause
-9,165,381,370,983,140,000
29.591549
97
0.612109
false
4.875421
false
false
false
vmindru/ansible
lib/ansible/plugins/action/win_copy.py
48
23403
# This file is part of Ansible # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import base64 import json import os i...
gpl-3.0
6,239,608,128,866,258,000
44.092486
133
0.556211
false
4.459413
false
false
false
gnidoc327/django_web_dev_chater_2
src/client/urllib_ex/parse_image.py
1
1042
from html.parser import HTMLParser from urllib.request import urlopen class ImageParser(HTMLParser): def error(self, message): pass def handle_starttag(self, tag, attrs): if tag != 'img': return if not hasattr(self, 'result'): self.result = [] for name,...
mit
2,814,681,110,130,684,000
22.155556
46
0.542226
false
3.830882
false
false
false
fyookball/electrum
gui/qt/console.py
1
17676
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget import sys import os import re import traceback import platform from PyQt5 import QtCore from PyQt5 import QtGui from PyQt5 import QtWidgets from electroncash import util, get_config from electroncash.i18n import...
mit
-3,110,782,203,334,037,000
34.565392
150
0.58356
false
4.081275
true
false
false
fmoo/python-filedes
filedes/fd.py
1
8140
from __future__ import absolute_import import stat import os import fcntl import socket import _filedes import _ancillary get_open_fds = _filedes.get_open_fds if hasattr(_filedes, "stat_pid_fd"): stat_pid_fd = _filedes.stat_pid_fd else: def stat_pid_fd(pid, fd): return os.stat("/proc/%d/fd/%d" % (pi...
isc
-1,501,705,693,311,436,300
27.561404
84
0.585012
false
3.496564
false
false
false
innolitics/natural-neighbor-interpolation
naturalneighbor/naturalneighbor.py
1
2554
import numpy as np import cnaturalneighbor def griddata(known_points, known_values, interp_ranges): if known_points.ndim != 2: raise ValueError("known_points must be a NxD array with N>0") if known_values.ndim != 1: raise ValueError("known_values must be a 1D array") num_dimensions = kn...
mit
2,318,742,753,702,292,000
31.74359
82
0.651527
false
3.423592
false
false
false
rsjohnco/rez
src/rez/util.py
3
5484
""" Misc useful stuff. """ import stat import sys import atexit import os import os.path import copy from rez.exceptions import RezError from rez.utils.yaml import dump_yaml from rez.vendor.progress.bar import Bar DEV_NULL = open(os.devnull, 'w') """ class _Missing: pass _missing = _Missing() """ class Progres...
gpl-3.0
5,189,274,004,605,464,000
27.414508
83
0.605215
false
3.639018
false
false
false
ksparakis/apekit
vulns/keySearch.py
1
6598
# Function - KeySearch: # **Parameters : inputString- a line of code or a string # **Output : False if key does not look like a private key of anykind # Returns Array[True, Keytype]- keytype will be null if cant specifiy import re from backend.model_interface import ModelInterface DEBUG = False def keySearch ...
apache-2.0
5,486,065,343,626,844,000
24.183206
109
0.676872
false
3.173641
false
false
false
zero-rp/miniblink49
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
13
23915
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
apache-2.0
1,280,313,960,149,924,400
46.734531
211
0.645829
false
3.610356
true
false
false
pmcrosta/misc
chinaworking_final.py
1
7413
##Script Name: Change String Fields into Float Fields for selected shapefiles and fields for CDC China data ##Created By: Peter M Crosta ##Date: 31/10/2008 ''' ##This script takes CDC China township datasets as inputs and converts the string fields ##that should be numeric to float. It also creates a flag variable tha...
apache-2.0
-1,533,533,912,269,447,200
41.36
148
0.648321
false
3.854914
false
false
false
home-assistant/home-assistant
script/translations/frontend.py
21
1374
"""Write updated translations to the frontend.""" import argparse import json from .const import FRONTEND_DIR from .download import DOWNLOAD_DIR, run_download_docker from .util import get_base_arg_parser FRONTEND_BACKEND_TRANSLATIONS = FRONTEND_DIR / "translations/backend" def get_arguments() -> argparse.Namespace:...
apache-2.0
155,773,675,350,185,660
28.869565
85
0.652111
false
4.176292
false
false
false
cleggatt/sbnotify
sbnotify/notifier.py
1
2053
import httplib2 import smtplib import urllib class Notifier(object): def __init__(self, series, season, episode): self.series = series self.season = str(season) self.episode = str(episode) class EmailNotifier(Notifier): def __init__(self, series, season, episode, params): su...
mit
-8,046,229,539,559,182,000
32.672131
125
0.589868
false
3.725953
false
false
false
ecotner/Learning-to-fly
Algorithms/QuickSort.py
1
1043
"""Implement quick sort in Python. Input a list. Output a sorted list.""" def quicksort(array): if len(array) <= 1: return array elif len(array) == 2: if array[0] > array[1]: return [array[1], array[0]] else: return array else: pivot = array[-1] ...
mit
-3,504,218,244,091,251,000
29.705882
90
0.474593
false
3.634146
false
false
false
Agnishom/ChainReactionAI
structure.py
1
3440
import copy import time sgn = lambda n: 0 if n == 0 else n/abs(n) class Board(): def __init__(self, n=6, m=9, new_move=1): self.m = m self.n = n self.board = [[0 for i in xrange(self.n)] for i in xrange(self.m)] self.new_move = new_move def __getitem__(self, pos): return self.board[pos[0]][pos[1]] def __...
mit
2,297,663,603,625,730,600
27.915966
105
0.607558
false
2.505462
false
false
false
henrytran28/CPSC-526
assignment_6/bot.py
1
7314
#!/usr/bin/env python3 import socket import sys import utilities import time # Code reference: # https://docs.python.org/3.6/howto/sockets.html class Bot: def __init__(self): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Tries to connect on port and hostname def connect(self, ...
mit
-8,783,220,142,737,162,000
33.663507
79
0.501914
false
4.81501
false
false
false
Eric89GXL/mne-python
mne/tests/test_cov.py
6
33641
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op import itertools as itt from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal, assert_allclose) im...
bsd-3-clause
-6,839,146,495,783,708,000
41.74587
79
0.616153
false
3.290395
true
false
false
jeremiahyan/odoo
addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py
1
4889
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, date from dateutil.relativedelta import relativedelta from unittest.mock import MagicMock, patch from odoo.tests.common import TransactionCase from odoo.addons.microsoft_calendar.utils.mic...
gpl-3.0
4,460,231,707,570,466,000
45.122642
139
0.635099
false
3.961912
true
false
false
hydratk/hydratk-lib-network
src/hydratk/lib/bridge/selen.py
1
20730
# -*- coding: utf-8 -*- """Bridge to Selenium WebDriver .. module:: bridge.selen :platform: Unix :synopsis: Bridge to Selenium WebDriver .. moduleauthor:: Petr Rašek <bowman@hydratk.org> """ """ Events: ------- selen_before_open selen_after_open selen_before_wait selen_after_wait selen_before_get_elem selen_be...
bsd-3-clause
6,318,686,770,726,496,000
29.892697
158
0.492788
false
4.26874
false
false
false
acopar/crow
crow/crow/interpreter/matrix.py
1
2795
import numpy as np import scipy class Matrix(): def __init__(self, X, Xt=None, key=None, model='ij', cls=None, swap=False): self.blocks = {} self.blocks_t = {} self.X = X self.Xt = Xt self.key = key self.model = model self.swap = swap self.di...
gpl-3.0
1,473,530,435,672,796,400
25.628571
87
0.484079
false
3.792402
false
false
false
gevurtz/beer-recommender
script/ratebeer_scraper.py
1
11528
import urllib2 import requests from bs4 import BeautifulSoup import logging import warnings import cPickle as pickle import string from sys import argv import boto3 import calendar warnings.filterwarnings('ignore') logging.basicConfig(filename='scrape.log',level=logging.ERROR) def openStates(filepath): ''' opens ...
mit
4,082,789,684,943,059,500
32.414493
123
0.572779
false
3.61833
false
false
false
sekikn/ambari
contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R_SERVER/8.0.5/package/scripts/service_check.py
5
3708
""" 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 use this ...
apache-2.0
-1,584,364,128,297,496,800
40.662921
166
0.70685
false
3.846473
false
false
false
arturtamborski/wypok
wypok/profiles/signals.py
1
1048
from allauth.account.signals import email_confirmed from django.dispatch import receiver from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.contrib.auth.signals import user_logged_in from django.db.models.signals import post_save from django.conf import settings from...
mit
-1,189,840,368,293,709,300
28.942857
66
0.760496
false
3.756272
false
false
false
kastnerkyle/dagbldr
dagbldr/nodes/tests/test_nodes.py
2
8926
import numpy as np import theano from theano import tensor from nose.tools import assert_raises from numpy.testing import assert_almost_equal from dagbldr.datasets import load_digits from dagbldr import get_params, del_shared from dagbldr.optimizers import sgd from dagbldr.utils import convert_to_one_hot from dagbldr....
bsd-3-clause
4,178,507,218,326,892,000
33.068702
80
0.615953
false
3.059993
true
false
false
leyyin/university
compilers/labs/lab1/table.py
1
2929
# Simple mock table implemented on a list class SymbolTable: def __init__(self): self._table = [] self._current_pos = 0 def find(self, string): # search of value for i, val in enumerate(self._table): if string == val: return i # pos return...
mit
-5,156,958,800,979,543,000
25.151786
70
0.539092
false
3.764781
false
false
false
Wintermute0110/plugin.program.advanced.MAME.launcher
pdfrw/pdfrw/uncompress.py
1
7721
# A part of pdfrw (https://github.com/pmaupin/pdfrw) # Copyright (C) 2006-2015 Patrick Maupin, Austin, Texas # Copyright (C) 2012-2015 Nerijus Mika # MIT license -- See LICENSE.txt for details # Copyright (c) 2006, Mathieu Fenniak # BSD license -- see LICENSE.txt for details ''' A small subset of decompression filters....
gpl-2.0
-7,071,533,648,163,324,000
38.798969
162
0.568968
false
3.717381
false
false
false
jamesleesaunders/PyAlertMe
pyalertme/zbnode.py
2
62696
# Filename: zbnode.py # Description: This contains all the values code (and static data structures) act as a zigbee node # and to communicate with Alertme nodes from pyalertme.node import Node import time import threading from xbee import ZigBee import copy import struct import pprint # ZigBee Addr...
mit
5,247,964,575,561,083,000
41.476965
190
0.517625
false
4.017944
false
false
false
natano/passta
passta/store.py
1
1398
import json from passta import __version__ from passta.gpg import EncryptedFile class Store: VERSION = 1 def __init__(self, filename): self.file_ = EncryptedFile(filename) self.load() @property def empty_content(self): return { 'passwords': {}, '__pas...
isc
-8,985,617,303,434,398,000
23.964286
63
0.525751
false
4.424051
false
false
false
avaika/avaikame
project/lists/migrations/0004_auto_20201011_2016.py
1
1141
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-10-11 17:16 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lists', '0003_auto_20190108_1615'), ] operations = [ migrations.RemoveFiel...
gpl-3.0
-1,912,886,818,840,194,000
26.166667
80
0.538124
false
4.422481
false
false
false
gitcoinco/web
app/grants/utils.py
1
12589
# -*- coding: utf-8 -*- """Define the Grant utilities. Copyright (C) 2021 Gitcoin Core This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any...
agpl-3.0
-3,209,529,851,070,266,000
34.224719
158
0.612679
false
3.439386
false
false
false
opennode/nodeconductor-assembly-waldur
src/waldur_core/structure/admin.py
1
28655
import itertools import json import logging from django import forms from django.conf import settings from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin import SimpleListFilter from django.contrib.admin.widgets import FilteredSelectMultiple from django.core.exceptions...
mit
-2,122,540,215,899,190,000
32.711765
102
0.615809
false
4.22142
false
false
false
daniellerch/mimic
manager/chatbot.py
1
1992
#!/usr/bin/python # -*- coding: utf-8 -*- import knowledge.base as knowledge_base from language.es.answer import Answer import language.es.pattern_utils as pattern_utils import language.es.greetings as greetings import language.es.questions as questions import language.es.relations as relations class chatbot: #...
mit
-4,799,467,432,705,533,000
25.56
68
0.566767
false
4.141372
false
false
false
denchip/Tinkoff_order_bot
tinkoff_order_bot/orders/views.py
1
1903
import json import logging from django.template.loader import render_to_string from django.http import HttpResponseForbidden, HttpResponseBadRequest, JsonResponse from django.views.generic import View from django.views.decorators.csrf import csrf_exempt from django.utils.decorators import method_decorator from django....
mit
-4,195,289,905,082,337,000
33.6
118
0.644246
false
4.03178
false
false
false
madscatt/sasmol
src/python/test_sasmol/test_sassubset/test_intg_sassubset_Mask_get_indices_from_mask.py
1
11159
''' SASMOL: Copyright (C) 2011 Joseph E. Curtis, Ph.D. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
gpl-3.0
-4,123,662,589,167,617,500
26.553086
108
0.608209
false
3.283991
true
false
false
demianw/dipy
doc/examples/affine_registration_3d.py
6
10585
""" ========================================== Affine Registration in 3D ========================================== This example explains how to compute an affine transformation to register two 3D volumes by maximization of their Mutual Information [Mattes03]_. The optimization strategy is similar to that implemented i...
bsd-3-clause
-3,185,100,949,463,984,600
35.753472
79
0.681719
false
3.781708
false
false
false
arosenstein/langevin_dynamics
langevin_dynamics/langevin_dynamics.py
1
2624
# -*- coding: utf-8 -*- import random from math import sqrt #from scipy.constants import k as k_b def langevin_dynamics(x_0, v_0, temp, damp, time_step, total_time, mass, potential_energy_filepath, output_file = 'output.txt'): '''Completes a 1 dimensional Langevin Dynamics Simulation dependant on an input file of the...
mit
-473,155,720,214,960,300
21.62931
134
0.691692
false
3.338422
false
false
false
bbregeault/verite
SMS_server.py
1
11710
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2017 Benoit Bregeault # --------------------------------------------------------------------- # 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 Soft...
gpl-3.0
2,151,100,394,053,919,500
37.130293
115
0.582522
false
4.084438
true
false
false
nils-werner/SimpleCV
SimpleCV/MachineLearning/TestTemporalColorTracker.py
12
1136
from SimpleCV import Camera, Image, Color, TemporalColorTracker, ROI, Display import matplotlib.pyplot as plt cam = Camera(1) tct = TemporalColorTracker() img = cam.getImage() roi = ROI(img.width*0.45,img.height*0.45,img.width*0.1,img.height*0.1,img) tct.train(cam,roi=roi,maxFrames=250,pkWndw=20) # Matplot Lib exampl...
bsd-3-clause
-4,720,576,868,515,249,000
30.555556
80
0.636444
false
2.547085
false
false
false
nanoporetech/scrappie
python/build.py
1
2287
import os from cffi import FFI if 'MANYLINUX' in os.environ: src_dir = os.path.join('/io', 'src') # build-wheels.sh determines these libraries=['openblas'] library_dirs=['/usr/local/lib/'] else: if os.path.isfile(os.path.join('..', 'src','decode.h')): # assume the git repo src_dir ...
mpl-2.0
4,769,179,950,762,838,000
24.988636
70
0.584171
false
3.319303
false
false
false
gonzolino/heat
heat/engine/event.py
2
4537
# # 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
7,018,463,974,030,823,000
38.112069
78
0.609213
false
4.240187
false
false
false
heiher/libreoffice-core
desktop/test/deployment/passive/passive_python.py
12
3342
# # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This file incorporates work covered by the following license noti...
gpl-3.0
-7,577,761,850,613,936,000
34.935484
80
0.710054
false
4.065693
false
false
false
PragyaJaiswal/Projection-Profile-Analysis-CXR
scripts/save_features.py
1
2055
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import json, pickle out_dir = '../sample_output/pickles/' def feature_vector(density_symmetry, roughness_max, roughness_symmetry, filename): # print(density_symmetry, roughness_max, roughness_symmetry) arr = np.append(density_symmetry, roughness_max...
mit
7,417,868,212,664,168,000
20.87234
82
0.647689
false
2.533909
false
false
false
doptio/you-owe-it
yoi/account/user.py
1
4640
from datetime import datetime from flask import Blueprint, redirect, url_for, flash from flask import current_app as app, request, g, session from flask.ext.wtf import Form, TextField, Required from sqlalchemy import Column, Integer, String from werkzeug import cached_property from openid.consumer.consumer import Cons...
mit
7,064,090,016,773,182,000
28.367089
74
0.614224
false
3.757085
false
false
false
reenberg/trytravis
tests/pantable/test_parse_table_list.py
1
2148
""" """ from .context import parse_table_list from panflute import * def test_parse_table_list(): markdown = False raw_table_list = [['1', '2'], ['3', '4']] table_list_converted = parse_table_list(markdown, raw_table_list) table_list_referenced = [TableRow(TableCell(Plain(Str('1'))), TableCell(Plain(...
gpl-3.0
3,231,691,761,925,771,000
60.371429
197
0.626164
false
3.314815
false
false
false
dmeulen/home-assistant
homeassistant/components/media_player/denonavr.py
1
7437
""" Support for Denon AVR receivers using their HTTP interface. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.denon/ """ import logging import voluptuous as vol from homeassistant.components.media_player import ( SUPPORT_PAUSE, SUPPOR...
mit
6,936,840,518,212,788,000
29.355102
78
0.616512
false
4.206448
false
false
false
uclouvain/osis
education_group/ddd/service/write/copy_group_service.py
1
2069
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business i...
agpl-3.0
6,705,141,765,901,407,000
43
88
0.694874
false
4.007752
false
false
false
abhi11/dak
dak/dakdb/update57.py
6
1846
#!/usr/bin/env python # coding=utf8 """ Allow per-suite signing keys @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2011 Mark Hymers <mhy@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or modify # it under the terms...
gpl-2.0
-3,248,082,139,761,242,000
36.673469
126
0.64572
false
4.333333
false
false
false
mrquim/repository.mrquim
script.module.exodus/lib/resources/lib/sources/en/to_be_fixed/sitedown/icefilms.py
5
10003
# -*- coding: utf-8 -*- ''' Exodus Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This progra...
gpl-2.0
4,237,339,635,526,538,000
48.034314
164
0.468559
false
3.975755
false
false
false
ezotrank/wheezy.template
src/wheezy/template/tests/test_loader.py
1
6607
""" Unit tests for ``wheezy.templates.loader``. """ import unittest from mock import Mock from mock import patch class FileLoaderTestCase(unittest.TestCase): """ Test the ``FileLoader``. """ def setUp(self): import os.path from wheezy.template.loader import FileLoader self.tmpl...
mit
-1,066,632,292,955,885,600
28.234513
78
0.553958
false
3.859229
true
false
false
opencord/voltha
voltha/extensions/omci/tasks/omci_get_request.py
1
18784
# # Copyright 2018 the original author or 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 applicable law or...
apache-2.0
1,923,045,062,964,889,300
42.082569
107
0.55872
false
4.598286
false
false
false