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
TheWiseLion/pykhet
tests/game_tests.py
1
5304
import unittest from pykhet.components.types import MoveType, Move, TeamColor, Orientation from pykhet.components.types import Position from pykhet.games.game_types import ClassicGame class TestClassicGames(unittest.TestCase): def setUp(self): self.game = ClassicGame() def tearDown(self): s...
mit
1,106,180,224,603,944,700
41.774194
89
0.643477
false
takeshineshiro/heat
heat/common/timeutils.py
1
2831
# # 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,785,138,763,645,567,000
29.771739
78
0.655245
false
DogDogGoose/ptab
ptab/core.py
1
15266
import sys import requests import requests_cache import string import unicodedata import json import shutil import os import re import pprint import pathvalidate import ptab.cgi # # PTAB API # baseURL = 'https://developer.uspto.gov/ptab-api' docsURL = 'https://developer.uspto.gov/ptab-api/documents' trialsURL = 'htt...
lgpl-3.0
4,362,861,265,485,905,400
32.699779
167
0.578672
false
umich-brcf-bioinf/Connor
test/command_validator_test.py
1
38546
#pylint: disable=invalid-name, too-few-public-methods, too-many-public-methods #pylint: disable=protected-access, missing-docstring, too-many-locals #pylint: disable=too-many-arguments #pylint: disable=deprecated-method from __future__ import print_function, absolute_import, division from argparse import Namespace imp...
apache-2.0
-7,815,077,713,461,950,000
48.417949
96
0.532325
false
bsilverthorn/qy
src/qy/test/test_language.py
1
8791
""" @author: Bryan Silverthorn <bcs@cargo-cult.org> """ import math import numpy import qy from nose.tools import ( assert_true, assert_false, assert_equal, assert_raises, assert_almost_equal, ) from qy import ( emit_and_execute, Object, ) def test_qy_python_no_arguments(): ""...
mit
2,407,731,293,992,260,000
18.449115
74
0.475145
false
pengzhangdev/PokemonGo-Bot
pokemongo_bot/cell_workers/evolve_pokemon.py
1
7211
from random import uniform from pokemongo_bot import inventory from pokemongo_bot.human_behaviour import sleep from pokemongo_bot.inventory import Pokemon from pokemongo_bot.item_list import Item from pokemongo_bot.base_task import BaseTask class EvolvePokemon(BaseTask): SUPPORTED_TASK_API_VERSION = 1 def __...
mit
-3,628,386,126,115,556,400
40.682081
133
0.554431
false
blstream/ut-arena
ut_arena_py_api/ut_arena/settings.py
1
3193
""" Django settings for ut_arena_py_api project. Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ impo...
apache-2.0
7,903,634,078,388,148,000
26.765217
91
0.68932
false
brean/python-pathfinding
pathfinding/finder/finder.py
1
6586
# -*- coding: utf-8 -*- import heapq # used for the so colled "open list" that stores known nodes import time # for time limitation from pathfinding.core.util import SQRT2 from pathfinding.core.diagonal_movement import DiagonalMovement # max. amount of tries we iterate until we abort the search MAX_RUNS = float('in...
mit
-7,266,928,208,447,150,000
35.588889
79
0.58928
false
django-id/website
app_author/models.py
1
2195
from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver # CUSTOM FILE SIZE VALIDATOR def validate_image(fieldfile_obj): """ Limit image size upload """ ...
mit
-1,107,724,903,978,328,600
21.397959
76
0.618223
false
mhl/mysociety-cvs
sitestats/pylib/sitestats/backports/contrib/auth/middleware.py
1
2933
from django.contrib import auth from django.core.exceptions import ImproperlyConfigured class RemoteUserMiddleware(object): """ Middleware for utilizing web-server-provided authentication. If request.user is not authenticated, then this middleware attempts to authenticate the username passed in the ``...
agpl-3.0
-5,813,389,405,922,956,000
42.776119
79
0.650869
false
perfidia/seleshot
doc/gen_api.py
1
3756
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import os import sys import string sys.path.append('../src') import seleshot TEMPLATE = """=== API === """ OUTPUT = os.path.join("_static", "api.txt") # from http://legacy.python.org/dev/peps/pep-0257/ def trim(docstring): if not docstring: re...
mit
3,779,118,023,028,133,400
28.809524
183
0.536741
false
nanshihui/PocCollect
component/JDWP/JDWPvul.py
1
2106
#!/usr/bin/env python # encoding: utf-8 from t import T import os import platform import subprocess import signal import time import requests,urllib2,json,urlparse class TimeoutError(Exception): pass def command(cmd, timeout=60): """Run command and return the output cmd - the command to run timeout - m...
mit
-8,082,791,348,985,507,000
31.4
135
0.57265
false
jaor/bigmler
bigmler/tests/test_15_delete_dir.py
1
2579
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Copyright 2015-2020 BigML # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
-8,138,172,125,241,268,000
32.493506
103
0.609539
false
glmcdona/meddle
examples/example_deviceiocontrol/processes.py
1
1377
from process_base import * from targets import * import subprocess import os class ProcessDeviceIo(ProcessBase): def __init__(self, Controller, crashdump_folder, breakpoint_handler, pid, ph, unique_identifier, verbose, logger): # Specific options self.path_to_exe = b"C:\\Windows\\System32\\notepad.exe" self.c...
mit
4,168,101,267,918,378,500
28.319149
149
0.713145
false
building39/nebula2
scripts/cdmi_explorer/CDMIMain/handlers.py
1
2951
''' Created on Jun 9, 2013 @author: mmartin ''' import sys from gi.repository import Gtk from CDMIAbout import CDMIAbout from CDMIConnect import CDMIConnect from CDMIHelp import CDMIHelp class Handlers(object): ''' classdocs ''' def __init__(self, session): self.session = session de...
apache-2.0
-8,973,868,036,584,532,000
27.375
85
0.54795
false
cliburn/flow
src/plugins/statistics/summary.py
1
1069
"""Provide summary statistics on data.""" from plugin import Statistics from numpy import min, max, mean, median, std class Summary(Statistics): """Plugin to display summary statistics""" name = "Summary" def Main(self, model): """Calculate summary statistics""" self.model = model f...
gpl-3.0
-8,669,594,832,415,969,000
41.76
76
0.63985
false
mementum/backtrader
backtrader/analyzers/logreturnsrolling.py
1
5020
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-3.0
-3,908,883,812,775,189,000
34.857143
79
0.60996
false
codilime/cloudify-agent
cloudify_agent/installer/config/decorators.py
1
5377
######### # Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
-2,597,727,802,150,284,000
36.340278
77
0.53766
false
liubenyuan/vispy-tutorial
examples/04-tetrahedron.py
1
4445
# pylint: disable=invalid-name, no-member, unused-argument """ passing varyings to fragment """ import numpy as np from vispy import app, gloo from vispy.util.transforms import translate, perspective, rotate # note the 'color' and 'v_color' in vertex vertex = """ uniform mat4 u_model; // Model matrix uniform...
apache-2.0
7,396,573,617,910,617,000
30.524823
74
0.525309
false
seomoz/simhash-db-py
simhash_db/hbase_client.py
1
3893
#! /usr/bin/env python '''Our code to connect to the HBase backend. It uses the happybase package, which depends on the Thrift service that (for now) is part of HBase.''' from gevent import monkey monkey.patch_all() import struct import happybase import Hbase_thrift from . import BaseClient def column_name(integer...
mit
7,742,667,128,239,649,000
31.714286
79
0.553301
false
awes0menessInc/python-projects
Alien-Invasion/button.py
1
1269
import pygame.font class Button(): """ A class to create a button. """ def __init__(self, screen, msg): """Initialize button attributes.""" self.screen = screen self.screen_rect = screen.get_rect() # Set the dimensions and properties of the button. self.width, self.he...
mit
4,828,632,466,260,825,000
35.257143
75
0.602049
false
msfrank/mandelbrot
mandelbrot/registry.py
1
3001
# Copyright 2015 Michael Frank <msfrank@syntaxjockey.com> # # This file is part of Mandelbrot. # # Mandelbrot 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 opti...
gpl-3.0
-5,360,309,663,945,176,000
39.013333
107
0.654782
false
fga-gpp-mds/2017.2-Receituario-Medico
medical_prescription/exam/test/test_view_list_exam.py
1
2093
# Django imports from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied # Local Django imports from exam.views import ListExams from user.models import User, Patient, HealthProfessional cl...
mit
-3,392,300,360,544,761,000
40.019608
120
0.596558
false
rshk/python-pcapng
tests/test_parse_wireshark_capture_files.py
1
10200
import pytest from pcapng.blocks import InterfaceDescription, ObsoletePacket, SectionHeader from pcapng.scanner import FileScanner def test_sample_test001_ntar(): with open("test_data/test001.ntar", "rb") as fp: scanner = FileScanner(fp) blocks = list(scanner) # There is just a section h...
apache-2.0
7,110,236,058,930,983,000
37.78327
88
0.549902
false
lunixbochs/actualvim
lib/neovim/api/buffer.py
1
6063
"""API for working with a Nvim Buffer.""" from .common import Remote from ..compat import IS_PYTHON3 __all__ = ('Buffer') if IS_PYTHON3: basestring = str def adjust_index(idx, default=None): """Convert from python indexing convention to nvim indexing convention.""" if idx is None: return defau...
mit
3,638,414,735,793,391,600
30.414508
80
0.568036
false
mikehankey/fireball_camera
ffmpeg_record.py
1
2859
#!/usr/bin/python3 import glob import sys import subprocess import os import time video_dir = "/mnt/ams2" def check_running(cam_num, type): if type == "HD": cmd = "ps -aux |grep \"ffmpeg\" | grep \"HD\" | grep \"cam" + cam_num + "\" | grep -v grep | wc -l" else: cmd = "ps -aux |grep \"ffmpeg\" | gr...
gpl-3.0
4,738,862,852,939,186,000
25.971698
239
0.564533
false
release-engineering/fedmsg_meta_umb
fedmsg_meta_umb/rpmdiff.py
1
2379
# Copyright (C) 2017 Red Hat, Inc. # # fedmsg_meta_umb 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 (at your option) any later version. # # fedmsg_meta_umb is ...
lgpl-2.1
5,623,728,822,967,871,000
40.736842
78
0.623792
false
jesuscript/topo-mpi
param/external.py
1
68357
""" External code required for param/tkinter interface. * odict: an ordered dictionary * tilewrapper: a wrapper for Tile/ttk widgets Note that an ordered dictionary and a wrapper for ttk widgets are both available in Python 2.7. """ from __future__ import generators # odict.py # An Ordered Dictionary object # Copyr...
bsd-3-clause
419,085,562,894,774,600
34.977368
93
0.506839
false
andrecunha/idd3
examine.py
1
2041
# -*- coding: utf-8 -*- # IDD3 - Propositional Idea Density from Dependency Trees # Copyright (C) 2014-2015 Andre Luiz Verucci da Cunha # # 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 ...
gpl-3.0
3,371,991,498,734,300,700
30.890625
78
0.696227
false
JMSwag/jms-utils
jms_utils/terminal.py
1
8327
# -------------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2014-2016 Digital Sapphire # # 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 Soft...
mit
-2,106,631,287,010,268,000
28.217544
79
0.578119
false
f5devcentral/f5-cccl
f5_cccl/resource/net/fdb/record.py
1
1541
"""Provides a class for managing BIG-IP FDB tunnel record resources.""" # coding=utf-8 # # Copyright (c) 2017-2021 F5 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 # # htt...
apache-2.0
8,939,869,457,900,549,000
32.5
74
0.69695
false
emilkjer/django-model-utils
model_utils/managers.py
1
8414
from types import ClassType import warnings from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models.fields.related import OneToOneField from django.db.models.manager import Manager from django.db.models.query import QuerySet import django class InheritanceQuerySe...
bsd-3-clause
8,724,807,216,674,744,000
36.395556
103
0.611719
false
easytaxibr/airflow
tests/models.py
1
29842
# -*- coding: utf-8 -*- # # 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,818,588,167,669,180,000
35.084643
90
0.580189
false
MERegistro/meregistro
meregistro/apps/backend/views/__init__.py
1
2562
# -*- coding: UTF-8 -*- from meregistro.shortcuts import my_render from apps.seguridad.decorators import credential_required from apps.backend.forms import ConfiguracionSolapasEstablecimientoForm from apps.backend.models import ConfiguracionSolapasEstablecimiento from apps.backend.forms import ConfiguracionSolapasAnex...
bsd-3-clause
5,193,089,650,953,476,000
36.632353
89
0.75381
false
syagev/kaggle_dsb
luna16/src/conv_net/data.py
1
2668
from __future__ import division import numpy as np import os import pickle import glob import Image from skimage.io import imread from sklearn.cross_validation import train_test_split dataset_dir = "../../data/samples" def load(): tps = glob.glob(dataset_dir+"/*true.jpg") fps_2 = glob.glob(dataset_dir+"/*fal...
apache-2.0
-957,578,049,570,239,400
40.061538
118
0.594078
false
ace3df/ImageTweet
plugins/safebooru.py
1
9578
# -*- coding: utf-8 -*- import random import time import sys import os import re sys.path.append( os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import utils def delete_image(image): import time time.sleep(10) os.remove(image) def tag_clean(tag_html): text = tag_html.t...
mit
392,481,504,197,402,100
37.934959
79
0.448423
false
davebridges/mousedb
mousedb/veterinary/views.py
1
7047
'''This module generates the views for the veterinary app. There is one generic home view for the entire app as well as detail, create update and delete views for these models: * :class:`~mousedb.veterinary.models.MedicalIssue` * :class:`~mousedb.veterinary.models.MedicalCondition` * :class:`~mousedb.veterinary.model...
bsd-3-clause
775,855,840,487,166,100
44.75974
133
0.724847
false
ANR-DIADEMS/timeside-diadems
timeside/plugins/diadems/irit_singings.py
1
7234
# -*- coding: utf-8 -*- # # Copyright (c) 2013 Maxime Le Coz <lecoz@irit.fr> # This file is part of TimeSide. # TimeSide 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 # ...
gpl-2.0
-1,683,434,666,844,066,000
35.14
119
0.639734
false
SnapSearch/SnapSearch-Client-Python
src/SnapSearch/detector.py
1
11166
# -*- coding: utf-8 -*- """ SnapSearch.detector ~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by `SnapSearch <https://snapsearch.io/>`_ :license: MIT, see LICENSE for more details. :author: `LIU Yu <liuyu@opencps.net>`_ :date: 2014/03/08 """ # future import should come first from __future__ import wi...
mit
7,516,432,823,431,704,000
38.178947
79
0.543346
false
phoebe-project/phoebe2-docs
2.2/tutorials/irrad_method_horvat.py
1
3005
#!/usr/bin/env python # coding: utf-8 # Lambert Scattering (irrad_method='horvat') # ============================ # # Setup # ----------------------------- # Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't wa...
gpl-3.0
-420,098,855,563,994,800
22.476563
203
0.66589
false
rcatwood/Savu
savu/test/jenkins/process_list_tests/i18_xrd_pipeline_test.py
1
1440
# Copyright 2014 Diamond Light Source Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
gpl-3.0
812,467,723,166,280,300
35
90
0.701389
false
afodor/pythonExamples
src/viterbi/viterbiExample.py
1
2894
import random class MarkovState: def __init__(self,charsToEmit, emissionProbs,transitionProbs): self.charsToEmit = charsToEmit self.emissionProbs = emissionProbs self.transitionProbs = transitionProbs def getEmissionIndex(self): aRand = random.random() cumulative = 0 index =0 for val ...
gpl-2.0
38,707,374,708,130,250
25.561905
81
0.630615
false
salazardetroya/libmesh
doc/statistics/libmesh_citations.py
1
2340
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Number of "papers using libmesh" by year. # # Note 1: this does not count citations "only," the authors must have actually # used libmesh in part of their work. Therefore, these counts do not include # things like Wolfgang citing us in his pap...
lgpl-2.1
302,535,557,434,097,100
26.529412
78
0.674359
false
2947721120/thumbor
thumbor/loaders/http_loader.py
1
4393
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com import re from functools import partial from urllib import unquote, q...
mit
-5,425,623,911,141,380,000
33.320313
129
0.688595
false
Strangemother/python-state-machine
scratch/machine_4/integration.py
1
4183
from tools import color_print as cl class ConditionIntegrate(object): def read_node(self, node): ''' Read the conditions of a node. ''' if hasattr(node, 'conditions') is False: return cnds = node.conditions() # cl('yellow', 'get conditions for node', no...
mit
-4,974,785,414,804,036,000
31.176923
65
0.537413
false
hperala/kontuwikibot
pywikibot/families/wikipedia_family.py
1
24229
# -*- coding: utf-8 -*- """Family module for Wikipedia.""" from __future__ import unicode_literals from pywikibot import family __version__ = '$Id: 3f958b3aee3b7b6794546f2ee7f13757d36b0a30 $' # The Wikimedia family that is known as Wikipedia, the Free Encyclopedia class Family(family.WikimediaFamily): """Fami...
mit
3,577,370,888,441,289,700
39.868739
105
0.394371
false
caio1982/capomastro
jenkins/utils.py
1
4525
from urlparse import urljoin import xml.etree.ElementTree as ET from django.conf import settings from django.core.urlresolvers import reverse from django.template import Template, Context from django.utils import timezone from django.utils.text import slugify PARAMETERS = ".//properties/hudson.model.ParametersDefini...
mit
3,326,860,643,878,144,500
29.993151
92
0.671381
false
koomik/CouchPotatoServer
couchpotato/core/plugins/log/main.py
1
4216
import os import traceback from couchpotato.api import addApiView from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.environment import Env log = CPLog...
gpl-3.0
-6,851,123,021,384,806,000
26.376623
110
0.463947
false
WilsonWangTHU/neural_graph_evolution
graph_util/structure_mapper.py
1
7819
#!/usr/bin/env python2 # ----------------------------------------------------------------------------- # @author: # Tingwu Wang, Jun 23rd, 2017 # ----------------------------------------------------------------------------- import init_path from util import logger from . import mujoco_parser import numpy as n...
mit
7,428,175,684,621,202,000
40.152632
79
0.553012
false
vitordeatorreao/amproj
amproj/datasets/dataset.py
1
3520
"""Base class for a memory representation of any dataset""" class Dataset: """Represents a dataset read to memory""" def __init__(self, feature_names=[]): """Initializes a new instance of Dataset Parameters ---------- feature_names : list<str>, optional List of na...
gpl-2.0
126,932,584,548,431,800
34.555556
79
0.511932
false
lmorchard/badger
apps/socialconnect/views.py
1
12314
import urllib, urllib2 import cgi import os from django.conf import settings from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth import login, authenticate, REDIRECT_FIELD_NAME from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext ...
bsd-3-clause
6,301,588,463,236,984,000
36.889231
87
0.598993
false
napalm-automation/napalm
test/ios/TestIOSDriver.py
1
6582
# Copyright 2015 Spotify AB. All rights reserved. # # The contents of this file are licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
-1,167,232,957,800,592,000
32.753846
91
0.614707
false
emulbreh/vacuous
vacuous/backends/dulwich/tasks.py
1
1530
from StringIO import StringIO from celery.task import Task from celery.task.sets import TaskSet, subtask from dulwich.protocol import ReceivableProtocol from dulwich.server import ReceivePackHandler from vacuous.backends import load_backend from vacuous.backends.dulwich.utils import WebBackend from vacuous.tasks imp...
mit
-4,407,668,046,472,185,000
33.772727
113
0.640523
false
hashimmm/iiifoo
testutils/manifest_validator.py
1
3963
from testutils.presentation_api.implementations.manifest_factory.loader import \ ManifestReader from iiifoo_utils import image_id_from_canvas_id def validate(manifestjson, logger=None): """Validate a given manifest json object.""" mr = ManifestReader(manifestjson) try: r = mr.read() js...
mit
5,603,357,598,368,924,000
40.715789
80
0.607368
false
radicalbit/ambari
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
1
23158
#!/usr/bin/env python """ 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");...
apache-2.0
-4,470,074,220,140,164,000
42.205224
147
0.630883
false
seanchen/taiga-back
taiga/users/serializers.py
1
5786
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
agpl-3.0
3,606,832,449,048,560,600
37.56
103
0.639523
false
FireBladeNooT/Medusa_1_6
medusa/notifiers/plex.py
1
10632
# coding=utf-8 # Author: Dustyn Gibson <miigotu@gmail.com> # # This file is part of Medusa. # # Medusa 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) a...
gpl-3.0
4,151,996,194,805,680,000
42.219512
178
0.586155
false
MarketGarden/CardPublisher
cardpublisher/views/abstractviews.py
1
2758
# -*- coding: cp1252 -*- from PyQt4 import QtCore, QtGui import os import os.path models = None class AbstractFormView: """gère le cycle de vie de sauvegarde d'un formulaire""" def __init__(self): self.saved = True self.saveAction.clicked.connect(self.doSave) def closeEvent(sel...
gpl-3.0
-7,044,412,616,233,355,000
36.27027
104
0.585932
false
QualiSystems/shellfoundry
shellfoundry/commands/extend_command.py
1
6915
#!/usr/bin/python # -*- coding: utf-8 -*- import os import re import shutil import click from shellfoundry.exceptions import VersionRequestException from shellfoundry.utilities.config_reader import CloudShellConfigReader, Configuration from shellfoundry.utilities.constants import ( METADATA_AUTHOR_FIELD, TEM...
apache-2.0
2,709,334,728,992,063,500
36.994505
88
0.635141
false
rougier/dana
examples/oja.py
1
3086
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright INRIA # Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr) # # DANA is a computing framework for the simulation of distributed, # asynchronous, numerical and adaptive models...
bsd-3-clause
-3,846,490,947,212,068,000
44.382353
79
0.685677
false
ideascube/pibox-installer
kiwix-hotspot/backend/util.py
1
15466
# -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu import os import re import sys import time import shlex import signal import ctypes import tempfile import threading import subprocess import data from util import CLILogger # windows-only flags to prevent sleep on executing thread WINDOWS_SLEEP_FLAGS = { ...
gpl-3.0
3,680,295,156,000,532,500
32.764192
88
0.563696
false
Brett777/Predict-Churn
model_management/datascience_framework.py
1
8515
import os import io import sys import dill import copy from datetime import datetime from .evaluator import Evaluator from .utils import ( post_to_platform, get_current_notebook, strip_output, get_current_notebook, mkdir_p, ) class DataScienceFramework(object): def __init__( self, ...
mit
-343,225,543,429,373,700
34.92827
91
0.376864
false
SebWouters/CheMPS2
PyCheMPS2/tests/test12.py
1
3497
# # CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry # Copyright (C) 2013-2018 Sebastian Wouters # # 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 ...
gpl-2.0
-2,050,985,702,913,222,700
35.427083
103
0.635402
false
jinjiaho/project57
forms.py
1
3372
from flask_wtf import FlaskForm from flask_wtf.file import FileField, FileAllowed, FileRequired from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, SelectField, BooleanField,DecimalField from wtforms.validators import DataRequired, Email, Length from flaskext.mysql import ...
mit
4,052,969,891,147,546,600
49.328358
211
0.733393
false
kristohr/pybayenv2
pybayenv/compute_average_bf.py
1
4066
#!/usr/bin/python import sys, string, re, os, commands, time, math #from scipy import stats #import scipy as sp import numpy as np #import matplotlib as mpl #from matplotlib import pyplot as plt class SNP: def __init__(self, name, num_env, t): self.name = name self.num_env = [F...
bsd-3-clause
8,263,703,149,634,889,000
23.792683
70
0.512789
false
thenakliman/nirikshak
nirikshak/post_task/console.py
1
2103
# Copyright 2017 <thenakliman@gmail.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 applicable law or agreed to...
apache-2.0
6,413,825,219,913,676,000
39.442308
78
0.622444
false
matematik7/STM
tests/test_parser.py
1
6119
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # ---------------------------------------------------------------- # tests/test_parser.py # # Test input arguments parser # ---------------------------------------------------------------- # copyright (c) 2015 - Domen Ipavec # Distributed under The MIT License, see LICENS...
mit
-2,415,367,671,543,004,000
37.484277
99
0.594868
false
Clinical-Genomics/housekeeper
tests/test_date.py
1
2661
"""Tests for date parsing module""" import datetime import pytest from housekeeper.date import get_date, match_date def test_match_date_dash(): """Test to match common string formated date""" # GIVEN a datestring separated by '-' date_str = "2015-05-10" # WHEN checking if it is a valid datestring ...
mit
2,106,149,374,175,074,600
28.241758
66
0.677189
false
ciudadanointeligente/write-it
nuntium/user_section/views.py
1
24845
import requests from django.contrib.auth.decorators import login_required from subdomains.utils import reverse from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404 from django.utils.decorators import method_decorator from django.views.generic import TemplateView, CreateView, Det...
gpl-3.0
4,677,099,118,318,445,000
36.417169
137
0.692413
false
cinepost/Copperfield_FX
copper/shout/drivers/refined.py
1
2799
#!/usr/bin/env python # # This program shows how to write data to mplay by writing data to the # imdisplay program using a pipe. # # This program uses the -k option on imdisplay to perform progressive # refinement when rendering an image. The image is quite simple. # # Notes: # This uses the simple format (...
unlicense
-7,526,381,331,422,434,000
30.1
80
0.554484
false
corpnewt/CorpBot.py
Cogs/BotAdmin.py
1
12950
import asyncio, discord, re, random from operator import itemgetter from discord.ext import commands from Cogs import Utils, DisplayName, Message, PickList def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") bot.add_cog(BotAdmin(bot, settings)) class BotAdmin(commands.Cog): ...
mit
2,491,016,822,418,353,700
43.759717
200
0.669035
false
proyectosdeley/proyectos_de_ley
migrate_db.py
1
2327
import dataset import datetime import os import unicodedata def convert_name_to_slug(name): """Takes a congresista name and returns its slug.""" name = name.replace(",", "").lower() name = name.split(" ") if len(name) > 2: i = 0 slug = "" while i < 3: slug += name[...
mit
-3,755,114,459,877,640,000
25.443182
78
0.568973
false
ubports-weblate/gallery-app
tests/autopilot/gallery_app/emulators/photo_viewer.py
1
9588
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2012-2015 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. import logging from auto...
gpl-3.0
-9,074,009,003,350,327,000
37.66129
79
0.61577
false
wikkiewikkie/flask-googlecharts
docs/conf.py
1
4921
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Flask-GoogleCharts documentation build configuration file, created by # sphinx-quickstart on Tue Dec 6 20:15:31 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present i...
mit
-3,032,560,909,114,322,400
29.949686
79
0.678927
false
MaxMorgenstern/EmeraldAI
EmeraldAI/Logic/KnowledgeGathering/Weather.py
1
1741
#!/usr/bin/python # -*- coding: utf-8 -*- import pyowm from datetime import datetime from EmeraldAI.Logic.Singleton import Singleton from EmeraldAI.Config.Config import Config class Weather(object): __metaclass__ = Singleton __owm = None __language = None __defaultCountry = None def __init__(sel...
apache-2.0
6,567,496,256,828,528,000
34.530612
102
0.619759
false
emonty/ansible-container
ansible_container/shipit/modules/k8s_deployment.py
1
9208
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any la...
lgpl-3.0
7,921,536,518,088,795,000
33.74717
131
0.535947
false
smurfix/DaBroker
dabroker/client/codec.py
1
10644
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals ## ## This file is part of DaBroker, a distributed data access manager. ## ## DaBroker is Copyright © 2014 by Matthias Urlichs <matthias@urlichs.de>, ## it is licensed under the GPLv3. See the file `README.rst` fo...
gpl-3.0
-5,950,866,018,713,775,000
25.984772
140
0.659142
false
hms-dbmi/clodius
test/tiles/multivec_test.py
1
1503
import os.path as op import base64 import h5py import pytest import clodius.tiles.multivec as hgmu def test_multivec(): filename = op.join("test/sample_data", "sample_gwas.multires.mv5") with h5py.File(filename, "r") as h5: tile_size = h5["info"].attrs["tile-size"] resolutions = list(h5["reso...
mit
6,303,210,453,889,759,000
35.658537
88
0.618762
false
tongfa/vent
wserve/wserve/views.py
1
1406
from django.http import HttpResponse from django.template.loader import get_template from django.template import Context from wserve.settings import VENT_WD, VENT_WWW_CLIENT_EP import cPickle as pickle import json, time, os def address2key(address): r = 0 for s in address[0].split('.'): r = r << 8 ...
mit
2,273,925,697,469,779,000
28.914894
83
0.604552
false
sunyihuan326/DeltaLab
Andrew_NG_learning/class_two/week_two/testCases.py
1
4051
import numpy as np def update_parameters_with_gd_test_case(): np.random.seed(1) learning_rate = 0.01 W1 = np.random.randn(2, 3) b1 = np.random.randn(2, 1) W2 = np.random.randn(3, 3) b2 = np.random.randn(3, 1) dW1 = np.random.randn(2, 3) db1 = np.random.randn(2, 1) dW2 = np.random....
mit
-7,129,573,524,181,546,000
34.535088
105
0.382128
false
herqles-io/hq-manager
src/hqmanager/api/user.py
1
5040
import cherrypy class UserAPIController(object): exposed = True def __init__(self, identity, assignment): self.identity = identity self.assignment = assignment def index(self): return "User api Index" @cherrypy.tools.json_out() @cherrypy.tools.json_in() @cherrypy.to...
mit
5,361,003,477,038,764,000
34.244755
106
0.644444
false
davidgardenier/frbpoppy
tests/dm_snr/future.py
1
6523
"""Check the log N log F slope for future surveys.""" import numpy as np import matplotlib.pyplot as plt from copy import copy from frbpoppy import CosmicPopulation, Survey, LargePopulation, SurveyPopulation, hist from frbpoppy import unpickle, pprint import frbpoppy.direction_dists as did import frbpoppy.galacticops ...
mit
1,674,763,514,524,134,700
28.251121
86
0.555879
false
i02sopop/Kirinki
gstreamer/examples/video_receiver.py
1
2317
#!/usr/bin/env python # -=- encoding: utf-8 -=- ################ VIDEO RECEIVER import gobject, pygst pygst.require("0.10") import gst # TODO: detect from the RTPSource element inside the GstRtpBin REMOTE_HOST = '192.168.34.150' READ_VIDEO_CAPS = 'video.caps' pipeline = gst.Pipeline('server') caps = open(READ_VIDE...
agpl-3.0
-9,069,301,017,670,709,000
33.073529
67
0.70738
false
cloudysunny14/CloudySwitch
cloudyswitch/app/psyco_eventlet.py
1
2308
"""A wait callback to allow psycopg2 cooperation with eventlet. Use `make_psycopg_green()` to enable eventlet support in Psycopg. """ # Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com> # and licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining a co...
apache-2.0
-6,447,168,683,168,695,000
42.54717
79
0.717938
false
fpdetective/fpdetective
src/crawler/fp_regex.py
1
2460
BLUECAVA = 1 INSIDEGRAPH = 2 THREATMETRIX = 3 IOVATION = 4 MAXMIND = 5 ANALYTICSENGINE = 6 COINBASE = 7 SITEBLACKBOX = 8 PERFERENCEMENT = 9 MYFREECAMS = 10 MINDSHARE = 11 AFKMEDIA = 12 CDNNET = 13 ANALYTICSPROS = 14 ANONYMIZER = 15 AAMI = 16 VIRWOX = 17 ISINGLES = 18 BBELEMENTS = 19 PIANOMEDIA = 20 ALIBABA = 21 MERCADO...
gpl-3.0
8,656,498,202,415,188,000
47.235294
219
0.545122
false
tu-rbo/differentiable-particle-filters
methods/dpf_kitti.py
1
43029
import os import numpy as np import sonnet as snt import tensorflow as tf import matplotlib.pyplot as plt from utils.data_utils_kitti import wrap_angle, compute_statistics, split_data, make_batch_iterator, make_repeating_batch_iterator, rotation_matrix, load_data_for_stats from utils.method_utils import atan2, compute...
mit
6,549,029,999,007,857,000
50.16409
255
0.560738
false
nextstrain/auspice
docs/conf.py
1
2559
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
agpl-3.0
-8,455,335,102,820,578,000
34.054795
83
0.647519
false
westurner/pyglobalgoals
notebooks/globalgoals-pyglobalgoals.py.py
1
16352
# coding: utf-8 # # @TheGlobalGoals for Sustainable Development # ## Background # # * Homepage: **http://www.globalgoals.org/** # - Twitter: https://twitter.com/TheGlobalGoals # - Instagram: https://instagram.com/TheGlobalGoals/ # - Facebook: https://www.facebook.com/globalgoals.org # - YouTube: https://www.youtube...
bsd-3-clause
-4,042,131,204,744,934,400
24.630094
120
0.635763
false
GoogleCloudPlatform/healthcare-deid
setup.py
1
1364
"""Setup module for the healthcare_deid DLP pipeline. All of the code necessary to run the pipeline is packaged into a source distribution that is uploaded to the --staging_location specified on the command line. The source distribution is then installed on the workers before they start running. When remotely execut...
apache-2.0
6,858,331,243,784,327,000
32.268293
80
0.737537
false
SethGreylyn/gwells
gwells/migrations/0009_auto_20170711_1600_squashed_0010_auto_20170713_0917.py
1
20389
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-07-13 17:57 from __future__ import unicode_literals from decimal import Decimal import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): replaces = [('gwells', '0009...
apache-2.0
-280,287,383,028,197,200
34.45913
186
0.548286
false
dsparrow27/zoocore
zoo/libs/command/commandui.py
1
2760
from functools import partial from qt import QtWidgets, QtGui, QtCore from zoo.libs import iconlib from zoo.libs.utils import zlogging logger = zlogging.getLogger(__name__) class CommandActionBase(QtCore.QObject): """CommandUi class deals with encapsulating a command as a widget """ triggered = QtCore.S...
gpl-3.0
-7,807,650,875,466,042,000
33.5
107
0.598913
false
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/addons/io_blend_utils/bl_utils/subprocess_helper.py
1
5646
# ##### 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-3.0
-5,265,626,018,868,350,000
28.873016
97
0.553135
false
tetra5/radiance
ui/widgets/verticallabel.py
1
1370
# -*- coding: utf-8 -*- """ Created on 28.01.2011 @author: vda """ from PyQt4 import QtCore, QtGui class VerticalLabel(QtGui.QWidget): def __init__(self, text, parent=None): QtGui.QLabel.__init__(self, parent) self.text = text fm = QtGui.QApplication.fontMetrics() se...
mit
5,865,820,515,146,894,000
26.42
72
0.586861
false
supermaik/selbot
Quote_Command.py
1
1175
from Quotes import Quote from Command import Command class Quote_Command(Command): def __init__(self, config): self.connection = config['connection'] self.event = config['event'] self.channel = config['channel'] pass def resolve(self): args = self.event.arguments[0].sp...
unlicense
5,750,818,820,420,012,000
34.606061
97
0.556596
false
ojengwa/Bookie
bookie/tests/factory.py
1
2651
"""Provide tools for generating objects for testing purposes.""" from datetime import datetime from random import randint import random import string from bookie.models import DBSession from bookie.models import Bmark from bookie.models import Tag from bookie.models.applog import AppLog from bookie.models.auth import ...
agpl-3.0
812,322,954,075,319,000
23.775701
77
0.632214
false
Jasonmk47/OpenWPM
automation/Proxy/mitm_commands.py
1
4714
# This module parses MITM Proxy requests/responses into (command, data pairs) # This should mean that the MITMProxy code should simply pass the messages + its own data to this module from urlparse import urlparse import datetime import mmh3 import json import zlib import os def encode_to_unicode(msg): """ Tri...
gpl-3.0
2,147,477,469,874,632,200
39.637931
163
0.627068
false
Sharecare/cyclops
app/httpreq.py
1
4917
import urllib import urllib2 import urlparse import socket import time import json import sys import logging logger = logging.getLogger(__name__) import pprint pp = pprint.PrettyPrinter(indent=4) # we need to make sure we don't follow redirects so build a new opener class NoRedirection(urllib2.HTTPErrorProcessor): ...
apache-2.0
-4,183,367,405,335,792,600
28.620482
142
0.580232
false
jiaphuan/models
research/astronet/astronet/astro_model/astro_model.py
1
10261
# Copyright 2018 The TensorFlow 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 agreed to ...
apache-2.0
8,468,219,150,089,580,000
32.753289
80
0.645941
false
polyaxon/polyaxon
sdks/python/http_client/v1/polyaxon_sdk/models/v1_k8s_resource_type.py
1
5346
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
apache-2.0
4,836,035,765,302,610,000
27.285714
111
0.588664
false
pawelmhm/splash
splash/network_manager.py
1
17016
# -*- coding: utf-8 -*- from __future__ import absolute_import import base64 import itertools import functools from datetime import datetime import traceback from PyQt5.QtCore import QByteArray, QTimer from PyQt5.QtNetwork import ( QNetworkAccessManager, QNetworkProxyQuery, QNetworkRequest, QNetworkRe...
bsd-3-clause
1,547,243,669,720,539,400
37.497738
104
0.622297
false