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
sc3/cookcountyjail
scraper/inmates_scraper.py
1
1938
from monitor import MONITOR_VERBOSE_DMSG_LEVEL from concurrent_base import ConcurrentBase WORKERS_TO_START = 25 CCJ_INMATE_DETAILS_URL = 'http://www2.cookcountysheriff.org/search2/details.asp?jailnumber=' class InmatesScraper(ConcurrentBase): def __init__(self, http, inmates, inmate_details_class, monitor, wor...
gpl-3.0
-4,363,237,560,352,292,400
42.066667
104
0.674923
false
jcchoiling/learningPython
s13/Day12/rabbit_rpc_server.py
1
1296
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Janice Cheng """ 把诘个服务器端改成在一个类中 """ import pika import subprocess credentials = pika.PlainCredentials('janice', 'janice123') parameters = pika.ConnectionParameters('172.16.201.134', 5672, '/', credentials) connection = pika.BlockingConnection(parameters) chan...
gpl-3.0
7,917,972,075,697,951,000
25.717391
95
0.648208
false
Roel/Gyrid
gyrid/core.py
1
1416
#-*- coding: utf-8 -*- # # This file belongs to Gyrid. # # Gyrid is a mobile device scanner. # Copyright (C) 2013 Roel Huybrechts # # 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 versio...
gpl-3.0
-5,951,183,939,177,816,000
25.716981
71
0.673729
false
Hossein-Noroozpour/PyHGEE
core/HGEMesh.py
1
1774
# coding=utf-8 """ Module for handling OpenGL buffers. """ __author__ = "Hossein Noroozpour" from OpenGL import GL import ctypes class Mesh(): """ A class that hold mesh information about an actor """ def __init__(self, elements, indices): temp_list = [0] # noinspection PyCallingNonCal...
mit
-570,652,836,376,594,700
30.140351
103
0.590192
false
MatthewWilkes/reportlab
tests/test_platypus_pleaseturnover.py
1
9102
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details """Tests pleaseTurnOver, pageBreakBefore, frameBreakBefore, keepWithNext... """ __version__='''$Id$''' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name__) import sys import unitte...
bsd-3-clause
-1,114,615,133,043,673,600
42.342857
245
0.683366
false
ajbouh/tfi
src/tfi/driver/tf/doc.py
1
12857
import tfi.json import tensorflow as tf import os.path import tfi.data import tfi.doc from google.protobuf.json_format import ParseDict from tfi.parse.docstring import GoogleDocstring def _detect_method_documentation(*, bibliographer, model, method_name, method, signature_def): # NOTE(adamb) Since we don't want ...
mit
4,932,963,218,364,086,000
35.842407
101
0.542584
false
commaai/openpilot
selfdrive/manager/helpers.py
1
1058
import os import sys import fcntl import errno import signal def unblock_stdout(): # get a non-blocking stdout child_pid, child_pty = os.forkpty() if child_pid != 0: # parent # child is in its own process group, manually pass kill signals signal.signal(signal.SIGINT, lambda signum, frame: os.kill(chil...
mit
-6,387,018,691,051,045,000
26.842105
98
0.648393
false
ONSdigital/ras-frontstage
frontstage/error_handlers.py
1
2963
import logging from flask import render_template, request, url_for from flask_wtf.csrf import CSRFError from requests.exceptions import ConnectionError from structlog import wrap_logger from werkzeug.utils import redirect from frontstage import app from frontstage.common.session import Session from frontstage.excepti...
mit
3,384,516,966,222,632,400
31.56044
118
0.733378
false
manmedia/PythonToggleCharacterCases
switchLetterCase.py
1
4097
# # A module capable of changing alphabet letter cases. # # It uses very generic Python functionality to ensure # backward compatibility. # # # The programme processes a set of characters by default # If no character is entered for processing, the programme # simply exists. This can be turned off by setting 'a' to 1 # ...
apache-2.0
-4,100,419,698,377,441,000
31.259843
156
0.569685
false
rajul/tvb-framework
tvb/tests/framework/adapters/visualizers/sensorsviewer_test.py
1
6778
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # documentation-folder for more details. See also http://...
gpl-2.0
5,474,133,759,831,826,000
40.084848
120
0.689141
false
sio2project/oioioi
oioioi/programs/migrations/0001_initial.py
1
12159
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models import oioioi.base.fields import oioioi.contests.fields import oioioi.filetracker.fields import oioioi.problems.models import oioioi.programs.models class Migration(migrations.Mi...
gpl-3.0
440,767,678,400,920,770
58.024272
610
0.582531
false
Azure/azure-storage-python
azure-storage-common/azure/storage/common/_error.py
1
9025
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from sys i...
mit
5,352,687,308,642,604,000
40.399083
126
0.688753
false
Nonse/Feel_Like
reservations/models.py
1
3171
from django.db import models class Reservation(models.Model): start_time = models.DateTimeField() end_time = models.DateTimeField() customer = models.ForeignKey('Customer') coach = models.ForeignKey('Coach') product = models.ForeignKey('Product') location = models.CharField(max_length=200) ...
apache-2.0
4,771,702,382,574,460,000
35.448276
104
0.675497
false
shoaibkamil/asp
asp/jit/asp_module.py
1
19070
import codepy, codepy.jit, codepy.toolchain, codepy.bpl, codepy.cuda from asp.util import * import asp.codegen.cpp_ast as cpp_ast import pickle from variant_history import * import sqlite3 import asp import scala_module class ASPDB(object): def __init__(self, specializer, persistent=False): """ sp...
bsd-3-clause
484,791,479,455,267,650
40.187905
210
0.581122
false
aptivate/ihpresultsweb
ihp/submissions/indicator_funcs.py
1
4263
from models import AgencyCountries, Country8DPFix, CountryExclusion, NotApplicable, Rating from consts import NA_STR base_selector = lambda q : q.baseline_value cur_selector = lambda q : q.latest_value def float_or_none(x): if NotApplicable.objects.is_not_applicable(x): return NA_STR try: ret...
gpl-3.0
-8,658,099,590,199,005,000
31.295455
97
0.600516
false
SSJohns/osf.io
website/project/views/node.py
1
44261
# -*- coding: utf-8 -*- import logging import httplib as http import math from itertools import islice from flask import request from modularodm import Q from modularodm.exceptions import ModularOdmException, ValidationValueError from framework import status from framework.utils import iso8601format from framework.mo...
apache-2.0
1,658,704,265,551,296,800
31.497063
130
0.605657
false
kogotko/carburetor
openstack_dashboard/dashboards/project/firewalls/views.py
1
16454
# Copyright 2013, Big Switch Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
-1,994,469,539,088,781,300
36.480638
78
0.633402
false
tensorflow/examples
tensorflow_examples/models/densenet/train.py
1
6447
# 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
9,165,127,955,172,058,000
31.725888
80
0.633473
false
taxpon/ndb_prop_gen
tests/test_arg.py
1
1669
import unittest from ndb_prop_gen.arg import Arg from ndb_prop_gen.arg import find_prop_type sample_property = """\ @property def sample_float(self): return self._sample_float """ class TestArg(unittest.TestCase): def setUp(self): self.sample1 = Arg("sample_float", "Float", 0.0) ...
mit
-7,284,871,098,851,032,000
31.096154
101
0.6429
false
maas/maas
src/maasserver/clusterrpc/tests/test_utils.py
1
10192
# Copyright 2014-2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for :py:mod:`maasserver.clusterrpc.utils`.""" import random from unittest.mock import Mock, sentinel from django.core.exceptions import NON_FIELD_ERRORS, Validatio...
agpl-3.0
-8,039,558,217,288,535,000
39.444444
79
0.647174
false
stadelmanma/OpenPNM
OpenPNM/Network/__Delaunay__.py
1
16258
# -*- coding: utf-8 -*- """ =============================================================================== Delaunay: Generate random networks based on Delaunay Tessellations =============================================================================== """ import sys import scipy as sp import numpy as np import Open...
mit
3,054,005,862,668,982,000
41.560209
85
0.548714
false
FabriceSalvaire/mupdf-v1.3
bindings/example.py
1
15058
#! /usr/bin/env python # -*- Python -*- #################################################################################################### import argparse import sys import numpy as np import mupdf as cmupdf from MuPDF import * from PyQt4 import QtCore, QtGui ####################################################...
agpl-3.0
8,527,913,039,060,901,000
34.682464
108
0.521052
false
twitter/pants
src/python/pants/backend/jvm/ivy_utils.py
1
51293
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import json import logging import os import pkgutil import threading import xml.etree.Ele...
apache-2.0
-425,431,684,784,504,900
40.837684
111
0.651765
false
patochectp/navitia
source/tyr/migrations/versions/3e56c7e0a4a4_create_billing_plan_table.py
1
2152
"""Create billing_plan table Revision ID: 3e56c7e0a4a4 Revises: 3aaddd5707bd Create Date: 2015-11-05 13:30:32.460413 """ revision = '3e56c7e0a4a4' down_revision = '3aaddd5707bd' from alembic import op, context import sqlalchemy as sa from sqlalchemy.dialects import postgresql from sqlalchemy.types import Enum def...
agpl-3.0
2,663,967,288,322,674,700
40.384615
350
0.664963
false
vincegogh/ByteOS
util/syscall_gen.py
1
1793
import sys as _sys if len(_sys.argv) != 2: print("Incorrect number of arguments") exit(-1) elif ["c", "h", "asm"].index(_sys.argv[1]) == -1: print("Invalid filetype %s" % _sys.argv[1]) exit(-1) print("\t\033[32;1mGenerating\033[0m include/gen/syscall_gen.%s" % _sys.argv[1]) syscall_list = [] def sys...
mit
3,375,265,367,951,926,000
22.906667
96
0.596765
false
Ezhil-Language-Foundation/open-tamil
tests/transliterate_tests.py
1
9299
# -*- coding: utf-8 -*- # (C) 2013-2018,2020 Muthiah Annamalai # # This file is part of 'open-tamil' package tests # # setup the paths import unittest from opentamiltests import * from tamil.utf8 import get_letters from transliterate import azhagi, jaffna, combinational, UOM, ISO, itrans, algorithm class ReverseTran...
mit
1,226,422,652,849,312,500
33.493927
96
0.540728
false
Lantero/vcenter-driver
setup.py
1
1071
from setuptools import setup, find_packages setup( version='4.2.0', name='vcdriver', description='A vcenter driver based on pyvmomi, fabric and pywinrm', url='https://github.com/Lantero/vcdriver', author='Carlos Ruiz Lantero', author_email='carlos.ruiz.lantero@gmail.com', license='MIT', ...
mit
-2,964,818,212,189,995,000
35.931034
74
0.615313
false
edeno/Jadhav-2016-Data-Analysis
tests/spectral/test_transforms.py
1
11984
import numpy as np from pytest import mark from scipy.signal import correlate from nitime.algorithms.spectral import dpss_windows as nitime_dpss_windows from src.spectral.transforms import (Multitaper, _add_axes, _auto_correlation, _fix_taper_sign, ...
gpl-3.0
-1,963,308,179,923,673,600
37.658065
75
0.623248
false
ARodri/Lars
lars/mapper/io/http.py
1
2559
import requests import functools import json from lars.mapper import Mapper from lars.util import PeriodicTask class HTTPRequest(Mapper): valid_actions = ['GET','POST'] def loadConfigJSON(self,config): self.base_url = config['base_url'] self.action = config['action'] self.output_key = config['output_key'] ...
gpl-2.0
2,684,987,604,786,061,000
29.831325
92
0.720203
false
eseom/glide
glide/process.py
1
5210
import os import multiprocessing import asyncore import datetime class Status(object): """process status enum""" REDY, RUNN, RSTT, STNG, KLNG, STPD, EXTD = \ 'READY', 'RUNNING', 'RESTARTING', \ 'STOPPING', 'KILLING', 'STOPPED', 'EXITED' class Process(asyncore.file_dispatcher): """main p...
mit
-5,170,071,940,740,597,000
29.828402
80
0.51881
false
rjschwei/azure-sdk-for-python
azure-mgmt-logic/azure/mgmt/logic/models/x12_validation_override.py
1
3184
# 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
9,220,224,516,508,743,000
52.966102
252
0.685616
false
frombeijingwithlove/dlcv_for_beginners
chap8/mxnet/train_lenet5.py
1
1811
import mxnet as mx import logging # data & preprocessing data = mx.symbol.Variable('data') # 1st conv conv1 = mx.symbol.Convolution(data=data, kernel=(5, 5), num_filter=20) pool1 = mx.symbol.Pooling(data=conv1, pool_type="max", kernel=(2, 2), stride=(2, 2)) # 2nd conv conv2 = mx.symbol.Convo...
bsd-3-clause
-5,082,072,010,840,330,000
27.296875
71
0.661513
false
admitad/admitad-python-api
admitad/tests/test_campaigns.py
1
3571
# coding: utf-8 from __future__ import unicode_literals import unittest import responses from admitad.items import Campaigns, CampaignsForWebsite, \ CampaignsManage from admitad.tests.base import BaseTestCase class CampaignsTestCase(BaseTestCase): def test_get_campaigns_request(self): with response...
mit
-4,248,813,920,931,956,000
31.463636
96
0.532344
false
iagcl/data_pipeline
data_pipeline/db/filedb.py
1
3423
# 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 u...
apache-2.0
-8,469,073,670,559,711,000
31.292453
79
0.621677
false
stuliveshere/PySeis
docs/notebooks/toolbox/toolbox.py
1
9786
import numpy as np import matplotlib.pyplot as pylab from matplotlib.widgets import Slider #================================================== # decorators #================================================== def io(func): ''' an io decorator that allows inpu...
mit
-8,316,606,742,452,979,000
29.391304
129
0.474249
false
amdor/skyscraper
tests/test_scraper_service.py
1
1401
import os import unittest from skyscraper.scraper_service import ScraperServiceFactory from skyscraper.utils.constants import SPEEDOMETER_KEY, AGE_KEY, CAR_KEY, PRICE_KEY, POWER_KEY, CURRENCY_KEY from common_test_utils import gather_extension_files, VALIDATION_DATA class TestScraping(unittest.TestCase): files_under...
mit
1,581,957,246,233,209,900
42.78125
108
0.741613
false
ibis-project/ibis
ibis/tests/sql/test_compiler.py
1
70526
import datetime import unittest import pytest import ibis import ibis.expr.api as api import ibis.expr.operations as ops from ibis.backends.base.sql.compiler import Compiler, QueryContext from ibis.tests.expr.mocks import MockConnection pytest.importorskip('sqlalchemy') class TestASTBuilder(unittest.TestCase): ...
apache-2.0
6,561,207,592,762,721,000
26.559984
94
0.550832
false
FabriceSalvaire/grouped-purchase-order
GroupedPurchaseOrder/views/account.py
1
13035
#################################################################################################### # # GroupedPurchaseOrder - A Django Application. # Copyright (C) 2014 Fabrice Salvaire # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
-8,662,595,971,610,037,000
38.984663
115
0.531109
false
bros-bioinfo/bros-bioinfo.github.io
COURS/M1/SEMESTRE1/ALGO_PROG/ALGO/Eliot/Pile_File.py
1
1911
import random as rd class Pile(list): def creer_pile(self): # Renvoie une nouvelle pile vide. return self def empiler(self, e): # Empile l ’ élément ’ e ’ dans la pile ’P’. self.append(e) def depiler(self): # Dépile un élément de la pile ’P’ et renvoie cet élément . return...
mit
-1,065,698,792,782,147,600
23.706667
105
0.571506
false
offby1/icalendar
src/doctest.py
1
100415
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! r"""Module doctest -- a framework for running examples in docstrings. In...
lgpl-2.1
-6,574,874,216,653,466,000
36.135725
79
0.569975
false
Adamssss/projectEuler
Problem 001-150 Python/pb102.py
1
1225
import math import time t1 = time.time() # read the trianlges into a list f = open('pb102_triangles.txt','r') tris= f.read().split('\n') f.close() def totri(tl): triangle = [] temp = tl.split(',') for i in range(0,3): triangle.append([tonumber(temp[2*i]),tonumber(temp[2*i+1])]) return trian...
mit
-3,754,334,336,298,502,700
19.081967
68
0.533061
false
quimaguirre/diana
diana/toolbox/parse_clinical_trials.py
1
12367
############################################################################## # Clinical trials parser # # eg 2013-2016 ############################################################################## import cPickle, os, re def main(): #base_dir = "../data/ct/" base_dir = "/home/eguney/data/ct/" file_name ...
mit
6,743,207,231,642,477,000
35.266862
189
0.646802
false
openstack/vitrage
vitrage/tests/unit/evaluator/template_validation/content/v1/test_parameters_validator.py
1
1656
# Copyright 2019 - Nokia # # 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, sof...
apache-2.0
2,761,177,479,609,274,000
38.428571
79
0.71256
false
skitoo/kivy-particle
kivyparticle/engine.py
1
18189
# -*- coding: utf-8 -*- from kivy.uix.widget import Widget from kivy.clock import Clock from kivy.graphics import Color, Callback, Rotate, PushMatrix, PopMatrix, Translate, Quad from kivy.graphics.opengl import glBlendFunc, GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_ONE_MINUS_SRC_ALPHA, GL...
mit
-5,275,556,113,248,403,000
44.246269
221
0.633185
false
benpicco/mate-panflute
src/panflute/tests/runner.py
1
13587
#! /usr/bin/env python # Panflute # Copyright (C) 2010 Paul Kuliniewicz <paul@kuliniewicz.org> # # 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 late...
gpl-2.0
-8,133,091,465,736,039,000
30.894366
112
0.502024
false
savionok/RemoteHID
RemoteHidPythonServer/udpEchoServer.py
1
2375
############################################################################# # Copyright 2012 Virtosu Sava # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # # Yo...
apache-2.0
1,390,608,810,056,242,400
45.54
77
0.546947
false
stamaimer/Hackthon
benchmark/stress.py
1
11486
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import collections import contextlib import functools import itertools import json import math import os import random import signal import time import redis import pymysql try: import httplib except ImportError...
gpl-2.0
2,749,461,268,001,201,000
27.014634
118
0.566255
false
taurenk/Crossfit-Project-API
app/models.py
1
1269
from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() athlete_teams = db.Table('athlete_teams', db.Column('athlete_id', db.Integer, db.ForeignKey('athletes.id')), db.Column('team_id', db.Integer, db.ForeignKey('teams.id')) ) class Athlete(db.Model): __tablename__ = 'athletes' id = d...
mit
4,826,109,988,930,293,000
27.863636
70
0.5855
false
bird-house/esgf-pyclient
pyesgf/search/context.py
1
11482
""" Module :mod:`pyesgf.search.context` =================================== Defines the :class:`SearchContext` class which represents each ESGF search query. """ import copy from ..multidict import MultiDict from .constraints import GeospatialConstraint from .consts import (TYPE_DATASET, TYPE_FILE, TYPE_AGGREGATI...
bsd-3-clause
6,040,383,211,571,339,000
34.438272
79
0.592144
false
wutienyang/ES_pttmovie
auto/pttmovie/crawler.py
1
8864
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function import os import re import sys import json import requests import argparse import time import codecs from bs4 import BeautifulSoup from six import u __version__ = '1.0' # if python 2, disable verify flag in requests....
mit
-7,976,881,766,051,306,000
40.647619
147
0.529614
false
rjkeller/gentoo-installer
BuildKernel.py
1
1521
#!/usr/bin/env python import fileinput import sys ///<summary> ///Provides a bunch of operations to format and manage hard disks. /// ///One cool thing that this class does is allow you to generate a fstab file ///based on disk formatting operations conducted earlier using this class. This ///is helpful when installin...
apache-2.0
1,754,916,898,967,739,600
33.568182
123
0.560158
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list.py
1
1183
# 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
3,548,818,472,367,509,000
32.8
85
0.605241
false
hjoliver/cylc
cylc/flow/command_polling.py
1
3469
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 Licen...
gpl-3.0
-7,614,361,080,997,373,000
34.762887
79
0.59066
false
brglng/zobject
.ycm_extra_conf.py
1
6274
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
lgpl-3.0
2,080,756,639,750,032,000
34.050279
82
0.687121
false
imanhodjaev/django-userapp
django_userapp/backends.py
1
2120
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.conf import settings from .request import login import re UserModel = get_user_model() class UserappBackend(object): def authenticate(self, username=None, password=None, request=None, **...
lgpl-3.0
-3,423,429,394,243,385,000
30.641791
92
0.579245
false
jptomo/rpython-lang-scheme
rpython/rlib/parsing/parsing.py
1
12986
import py from rpython.rlib.parsing.lexer import SourcePos from rpython.rlib.parsing.tree import Node, Symbol, Nonterminal class Rule(object): def __init__(self, nonterminal, expansions): self.nonterminal = nonterminal self.expansions = expansions def getkey(self): return (self.nonterm...
mit
-8,121,115,071,978,187,000
36.423631
86
0.54243
false
CosmicLaserShow/CosmicLaserShow
pysparc/pysparc/ftdi_chip.py
1
7036
"""Access FTDI hardware. Contents -------- :class:`Error` Base error class. :class:`DeviceNotFoundError` Raised when device is not connected. :class:`DeviceError` Raised for generic pylibftdi exceptions. :class:`ReadError` Raised on read errors. :class:`WriteError` Raised on write errors. :cl...
mit
-7,149,492,045,259,250,000
25.651515
114
0.599915
false
lucidfrontier45/PyVB
pyvb/old_ver/vbgmm1d.py
1
7659
#!/usr/bin/python import numpy as np from numpy.random import randn,dirichlet from scipy.linalg import det, inv from scipy.cluster import vq from scipy.special import psi,gammaln from core import normalize try: from _vbgmm1d import _evaluateHiddenState_C, _lnPD_C ext_imported = True except: ext_imported = False ...
bsd-3-clause
8,080,979,700,107,704,000
29.272727
84
0.577099
false
lmregus/Portfolio
python/design_patterns/env/lib/python3.7/site-packages/_pytest/main.py
1
26632
""" core implementation of testing process: init, session, runtest loop. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib import fnmatch import functools import os import pkgutil import sys import warnings import attr import py import s...
mit
-9,025,339,223,619,723,000
33.452781
109
0.576938
false
listyque/TACTIC-Handler
thlib/ui/items/ui_commit_item.py
1
4255
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'items\ui_commit_item.ui' # # Created: Sat Oct 5 00:17:13 2019 # by: pyside-uic 0.2.15 running on PySide 1.2.4 # # WARNING! All changes made in this file will be lost! from thlib.side.Qt import QtWidgets as QtGui from thlib.side.Qt imp...
epl-1.0
1,223,322,050,095,421,700
48.476744
147
0.709988
false
sapcc/monasca-agent
tests_to_fix/test_iis.py
1
1049
import unittest import logging from nose.plugins.attrib import attr from nose.plugins.skip import SkipTest from tests.common import get_check logging.basicConfig() CONFIG = """ init_config: instances: - host: . dimensions: dim1: value1 dim2: value2 """ class IISTestCase(unitt...
bsd-3-clause
-8,427,825,189,620,956,000
23.395349
69
0.616778
false
quaddra/engage-utils
engage_utils/resource_utils.py
1
19792
""" Utilities for parsing/pretty-printing resource definitions and instances. Objects that can be converted to/from JSON have the following methods: * from_json(parsed_data) [static method] - given json data that has been parsed into python via json.load() or json.loads(), construct an instance of the associat...
apache-2.0
-2,461,870,873,917,238,300
37.505837
108
0.567451
false
jschaf/windows-config
pycmd-init.py
1
9710
# -*- coding: utf-8 -*- # Example init.py for documentation purposes # # Use this file as a template/example for creating an # initialization/configuration script for PyCmd. Scripts are loaded and applied # based on the following rules: # # * If present, an init.py script in PyCmd's installation directory is # auto...
bsd-2-clause
-5,130,049,946,097,819,000
38.958848
84
0.669413
false
sato9hara/defragTrees
paper/tests/paper_synthetic2.py
1
3367
# -*- coding: utf-8 -*- """ @author: Satoshi Hara """ import sys import os sys.path.append(os.path.abspath('./')) sys.path.append(os.path.abspath('./baselines/')) sys.path.append(os.path.abspath('../')) import numpy as np import paper_sub from RForest import RForest import matplotlib matplotlib.use('Agg') import mat...
mit
-4,752,114,063,472,154,000
32.346535
135
0.571429
false
mbdriscoll/indigo
indigo/backends/backend.py
1
25493
import logging import abc, time import numpy as np import scipy.sparse as spp from contextlib import contextmanager import indigo.operators as op from indigo.util import profile log = logging.getLogger(__name__) class Backend(object): """ Provides the routines and data structures necessary to implement a...
bsd-3-clause
-2,364,064,529,511,427,600
33.637228
170
0.506453
false
yaricom/brainhash
src/experiment_cA5_10_dt_th_al_ah_bl_bh.py
1
2063
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ The experiment with 10 Hz/5Hz, wisp, attention, 70, cA 5, delta, theta, alpha low, alpha high, beta low, beta high, batch size = 10 and balanced data set @author: yaric """ import experiment as ex import config from time import time n_hidden = 5 batch_size = 10 ex...
gpl-3.0
-1,605,927,457,288,513,500
31.746032
136
0.641299
false
Shiimoe/Pimbot
bot.py
1
2261
import discord import asyncio from numpy import random client = discord.Client() @client.event async def on_ready(): print('Logged in as') print(client.user.name) print(client.user.id) print('------') @client.event async def on_message(message): if message.content.startswith('erp with me pimbot'): ...
gpl-3.0
2,294,426,036,851,443,000
40.109091
134
0.733304
false
thomasorb/orb
orb/utils/fft.py
1
13896
#!/usr/bin/python # *-* coding: utf-8 *-* # Author: Thomas Martin <thomas.martin.1@ulaval.ca> # File: fft.py ## Copyright (c) 2010-2020 Thomas Martin <thomas.martin.1@ulaval.ca> ## ## This file is part of ORB ## ## ORB is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Pu...
gpl-3.0
-8,758,207,435,317,938,000
32.565217
95
0.610463
false
MeerkatLabs/gnucash-reporting
gnucash_reports/commands/reports.py
1
3287
""" This is the main execution program for the reporting library. """ from __future__ import absolute_import import argparse import glob import logging import os import simplejson as json from gnucash_reports.wrapper import initialize from gnucash_reports.reports import run_report from gnucash_reports.configuration ...
mit
-3,509,458,222,486,998,000
31.544554
99
0.642835
false
alexliew/learn_python_the_hard_way
projects/gothonweb/gothonweb/tests/app_tests.py
1
1099
import os import unittest import tempfile from nose.tools import * from app import app from gothonweb.tests.tools import assert_response app.config['TESTING'] = True test_app = app.test_client() def test_index(): # check that we get a 404 on the /hello URL resp = test_app.get("/hello") assert_response(res...
mit
2,481,793,237,079,290,000
24.55814
49
0.636033
false
marksweiss/sofine
sofine/runner.py
1
19931
""" This module is the main driver for calls to plugins from the CLI interface. It also has all of the scaffolding and wrapper functions required to generically invoke and run any of the supported plugin methods in the plugin interface for any plugin using just the plugin name, plugin group and call args. """ impor...
mit
-5,049,273,920,547,250,000
46.007075
130
0.6956
false
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/music21/alpha/trecento/exceldiff.py
1
2662
#!/usr/bin/python # -*- coding: utf-8 -*- import sys from music21.ext import xlrd #sys.path.append('/mit/cuthbert/www/music21') if len(sys.argv) != 3: raise Exception("Need two arguments to diff!") if (sys.argv[1].count(':') == 1): (book1name, sheetname1) = sys.argv[1].split(':') if (book1name.count('...
mit
-3,328,757,419,221,253,000
28.910112
92
0.586777
false
dirkhusemann/rezzme
RezzMe/launchers/linux2.py
1
5118
#!/usr/bin/python # -*- encoding: utf-8 -*- # Copyright (c) Contributors, http://opensimulator.org/ # See CONTRIBUTORS.TXT for a full list of copyright holders. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * ...
bsd-3-clause
8,639,283,520,196,367,000
39.619048
137
0.635795
false
rueckstiess/mtools
mtools/mlogfilter/filters/fast_filter.py
1
1215
from .base_filter import BaseFilter class FastFilter(BaseFilter): """ FastFilter class. Accept only lines that have a duration that is shorter than the specified parameter in ms. """ filterArgs = [ ('--fast', {'action': 'store', 'nargs': '?', 'default': False, 'ty...
apache-2.0
-160,321,035,544,508,300
30.973684
77
0.553909
false
marrow/mongo
marrow/mongo/core/field/oid.py
1
1116
# encoding: utf-8 from __future__ import unicode_literals from bson import ObjectId as OID from collections import MutableMapping from datetime import datetime, timedelta from .base import Field from ....schema import Attribute from ....schema.compat import unicode class ObjectId(Field): __foreign__ = 'objectId' ...
mit
7,631,403,063,071,038,000
25.571429
76
0.701613
false
majdigital/bigworldgraph
backend/tests/mock_nlp.py
1
1055
class MockTokenizer: @staticmethod def tokenize(sentence_data): return sentence_data.split(" ") # Yes, yes, very sophisticated class MockTagger: def __init__(self, naive_tag_rule): assert callable(naive_tag_rule) self.naive_tag_rule = naive_tag_rule def tag(self, tokenized_se...
mit
3,103,457,414,177,886,000
28.305556
103
0.483412
false
stoic1979/careermaker
server.py
1
9828
from flask import Flask, render_template, request, redirect, jsonify, make_response from models import User, Candidate, \ Company, Vacancy, JobCategory, Skill, db, app import md5 from flask_pymongo import PyMongo import traceback import os import jwt import datetime from functools import wraps import json from ...
gpl-3.0
804,700,029,827,939,800
29.521739
119
0.597477
false
jastination/software-engineering-excercise-repository
seer_python/interviewstreet/LuckyNumber.py
1
1265
''' Created on May 25, 2012 @author: jjhuang ''' def getAllPrimeNumber(N): ret = [] for n in range(2, N + 1): isPrime = True for i in range(2, n//2 + 1): if(n % i == 0): isPrime = False break if(isPrime): ...
mit
6,946,488,043,172,524,000
16.071429
49
0.355731
false
DXCanas/kolibri
kolibri/core/content/test/test_data_migrations.py
1
3147
import uuid from kolibri.core.auth.test.migrationtestcase import TestMigrations from kolibri.core.content.models import ChannelMetadata as RealChannelMetadata from kolibri.core.content.models import ContentNode as RealContentNode class ChannelFieldsTestCase(TestMigrations): migrate_from = '0011_auto_20180907_10...
mit
4,337,543,030,775,321,600
48.171875
110
0.512552
false
steder/maroonmpi
subunit/python/subunit/tests/test_subunit_tags.py
1
2324
# # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2005 Robert Collins <robertc@robertcollins.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foun...
gpl-2.0
-8,039,500,400,970,692,000
32.2
80
0.63296
false
erzel/vitess
test/vtctld2_web_status_test.py
1
9662
#!/usr/bin/env python """A vtctld2 webdriver test that tests the different views of status page.""" import logging import os from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait fr...
bsd-3-clause
-6,158,431,562,120,354,000
39.767932
80
0.65297
false
liampauling/flumine
flumine/strategy/runnercontext.py
1
1835
import logging import datetime from typing import Optional logger = logging.getLogger(__name__) class RunnerContext: """Runner context at strategy level""" def __init__(self, selection_id: int): self.selection_id = selection_id self.invested = False self.datetime_last_placed = None ...
mit
4,729,211,881,912,501,000
27.671875
78
0.585286
false
katadh/ngdl
ngdl.py
1
9612
import re import nltk import ngdl_classes import global_vars import ngdl_parse import ngdl_write def start_dialog(output_file="test.txt"): if not global_vars.initialized: global_vars.init() else: reset_global_vars() output = open(output_file, "w") print "Welcome to the natural language...
gpl-3.0
578,165,373,975,564,700
38.073171
139
0.577507
false
Dicotomix/DicotomixNewSrv
server.py
1
12287
import asyncio import struct import dictionary import datetime import tests from collections import * from os import listdir from os.path import isfile, join from enum import Enum from dicotomix import Dicotomix, Direction, NotFoundException, OrderException import unidecode import sys import numpy as np ENABLE_TESTS =...
mit
-5,168,988,374,299,193,000
35.032258
96
0.482787
false
geodynamics/citcoms
visual/Mayavi2/original_plugins/Citcoms_Hdf2Vtk.py
1
22127
#!/usr/bin/env python # Script to generate TVTK files from CitcomS hdf files # author: Martin Weier # Copyright (C) 2006 California Institue of Technology # # 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 # ...
gpl-2.0
-704,908,123,187,786,500
34.011076
173
0.519953
false
inveniosoftware/invenio-communities
tests/records/collections/test_collections.py
1
3019
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2021 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Community module tests.""" import pytest from flask import url_for from invenio_a...
mit
7,395,856,467,491,684,000
29.806122
132
0.650547
false
jorgb/airs
gui/images/progress_2.py
1
5705
#---------------------------------------------------------------------- # This file was generated by D:\personal\src\airs\gui\images\make_images.py # from wx import ImageFromStream, BitmapFromImage, EmptyIcon import cStringIO, zlib def getData(): return zlib.decompress( 'x\xda\x01\xbe\x06A\xf9\x89PNG\r\n...
gpl-2.0
4,576,252,422,895,433,000
65.117647
77
0.697108
false
fanglinfang/myuw
myuw/logger/session_log.py
1
1051
from myuw.dao.affiliation import get_base_campus from myuw.dao.enrollment import get_current_quarter_enrollment from myuw.dao.gws import is_grad_student, is_undergrad_student import logging import json import hashlib logger = logging.getLogger('session') def log_session(netid, session_key, request): if session_k...
apache-2.0
1,625,579,248,412,522,000
31.84375
67
0.642245
false
shiblon/pytour
3/tutorials/generators3.py
1
2336
# vim:tw=50 """Generators for Refactoring Now that we know how to make our own generators, let's do some refactoring to make use of this idea and clean up the code a bit. We'll start by splitting out the |clean_lines| function, which basically just skips blank lines and comments, stripping unnecessary space. This no...
apache-2.0
-6,395,722,228,013,602,000
29.736842
68
0.689212
false
anish/buildbot
master/buildbot/test/unit/test_reporters_notifier.py
1
14563
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
6,238,227,632,631,262,000
40.847701
104
0.661334
false
igorsobreira/eizzek
tests/unit/test_register.py
1
4055
import re from unittest import TestCase from eizzek.lib.registry import PluginRegistry, SessionPluginRegistry class PluginRegistryTest(TestCase): def setUp(self): self.registry = PluginRegistry() def ping(**kwargs): return '' self.ping = ping self.regex = ...
mit
-8,068,151,602,769,320,000
29.037037
100
0.590136
false
monsta-hd/ml-mnist
ml_mnist/tests/test_model_selection.py
1
5910
import numpy as np from unittest import skip from ml_mnist.model_selection import TrainTestSplitter as TTS class TestSplit(object): def setUp(self): self.y = np.array([1, 1, 1, 2, 2, 3, 3, 1, 1, 2, 2, 2, 3, 3, 1, 1, 2, 2, 3, 3, 3]) def test_split...
mit
-991,270,284,764,097,200
47.442623
106
0.528426
false
be-cloud-be/horizon-addons
horizon/school_documentation/source/_extensions/github_link.py
1
3522
import inspect import importlib import os.path from urlparse import urlunsplit """ * adds github_link(mode) context variable: provides URL (in relevant mode) of current document on github * if sphinx.ext.linkcode is enabled, automatically generates github linkcode links (by setting config.linkcode_resolve) Settin...
agpl-3.0
-8,153,371,989,408,569,000
32.542857
96
0.636286
false
cavestruz/L500analysis
plotting/profiles/T_Vr_evolution/Vr_evolution/plot_Vrall_nu_binned_r500c.py
1
3207
from L500analysis.data_io.get_cluster_data import GetClusterData from L500analysis.utils.utils import aexp2redshift from L500analysis.plotting.tools.figure_formatting import * from L500analysis.plotting.profiles.tools.profiles_percentile \ import * from L500analysis.plotting.profiles.tools.select_profiles \ imp...
mit
24,674,641,612,658,730
35.033708
90
0.586218
false
goldsborough/ig
ig/colors.py
1
1072
import random def random_color(base, variation): ''' Returns a random, bounded color value. Args: base: Some base color component (between 0 and 255) variation: The degree of variation (around the color) Returns: A random color. ''' color = base + (2 * random.random()...
mit
1,673,187,914,116,669,000
23.363636
75
0.570896
false
NERC-CEH/jules-jasmin
job_runner/job_runner/controllers/jobs.py
1
5375
""" # Majic # Copyright (C) 2014 CEH # # 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 pr...
gpl-2.0
8,434,452,970,082,947,000
33.455128
100
0.641302
false
parantapa/pbdset
pbdset.py
1
14786
# encoding: utf-8 # pylint: disable=too-many-instance-attributes # pylint: disable=attribute-defined-outside-init # # ____________________/\ # \______ \______ )/______ # | ___/| | _// ___/ # | | | | \\___ \ # |____| |______ /____ > #...
mit
649,836,582,525,200,100
27.822612
80
0.532328
false
cactusbin/nyt
matplotlib/lib/matplotlib/backend_bases.py
1
106941
""" Abstract base classes define the primitives that renderers and graphics contexts must implement to serve as a matplotlib backend :class:`RendererBase` An abstract base class to handle drawing/rendering operations. :class:`FigureCanvasBase` The abstraction layer that separates the :class:`matplotlib.fi...
unlicense
6,469,178,272,311,308,000
32.419063
81
0.562338
false
artdent/jgments
src/com/google/jgments/extract.py
1
13331
#!/usr/bin/python # # Copyright 2010 Google Inc. # # 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 follo...
bsd-2-clause
4,275,517,555,670,912,500
34.836022
88
0.702123
false
mazvv/travelcrm
travelcrm/views/contracts.py
1
7715
# -*-coding: utf-8-*- import logging from pyramid.view import view_config, view_defaults from pyramid.httpexceptions import HTTPFound from . import BaseView from ..models import DBSession from ..models.contract import Contract from ..lib.bl.contracts import get_contract_copy from ..lib.bl.subscriptions import subscr...
gpl-3.0
532,814,128,972,921,660
25.788194
67
0.516397
false