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,222,525,072B
line_mean
float64
6.51
99.8
line_max
int64
15
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
jakobrunge/tigramite
tigramite/independence_tests/oracle_conditional_independence.py
1
66715
"""Tigramite causal discovery for time series.""" # Author: Jakob Runge <jakob@jakob-runge.com> # # License: GNU General Public License v3.0 from __future__ import print_function import numpy as np from collections import defaultdict, OrderedDict from itertools import combinations, permutations class OracleCI: ...
gpl-3.0
6,659,198,463,855,801,000
37.946877
134
0.448385
false
davinellulinvega/SpheroMouse
mouse.py
1
2772
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'davinellulinvega' from sphero_driver import sphero_driver import pyautogui from time import sleep # Define the size of the screen width, height = pyautogui.size() half_width = width / 2 half_height = height / 2 pyautogui.FAILSAFE = False # Define a function f...
lgpl-3.0
-5,150,611,249,706,489,000
29.130435
116
0.700577
false
mamewotoko/stacklr
oauth2/oauth2client/calendar_test.py
1
1868
from oauth2client.client import flow_from_clientsecrets, credentials_from_clientsecrets_and_code from apiclient.discovery import build import json, httplib2, sys from oauth2client.file import Storage import setting, os target_calendar_name = "debug" credentials = None storage = Storage(setting.STORAGE_FILE) if os.pa...
apache-2.0
1,567,577,337,228,768,800
29.622951
96
0.659529
false
mdsitton/pyogl
pglgen/xmlparse.py
1
3930
from xml.parsers import expat class TagStack(object): def __init__(self): self.tags = [] self.args = [] self.data = [] self.dataAdded = [] self.stackSize = 0 self.frameHasData = False def push(self, tag, args): self.tags.append(tag) self.args.ap...
bsd-2-clause
870,257,657,208,985,100
25.554054
74
0.577354
false
ella/django-ratings
django_ratings/aggregation.py
1
1768
""" This file is for aggregation records from Rating,Agg tables to Agg and TotalRate table """ import logging from datetime import datetime, timedelta from django_ratings.models import Rating, Agg, TotalRate logger = logging.getLogger('django_ratings') # aggregate ratings older than 2 years by year DELTA_TIME_YEAR ...
bsd-3-clause
4,587,567,461,580,501,500
28.966102
90
0.675339
false
yschua/dumper
dumper/dir_monitor.py
1
2605
import os import logging import win32file import win32con import win32event import pywintypes import winnt from threading import Thread from dumper.file_uploader import FileUploader class DirMonitor(Thread): def __init__(self, config): Thread.__init__(self) self._max_size ...
mit
5,768,890,511,884,340,000
28.988095
77
0.542451
false
celliern/triflow
triflow/core/simulation.py
1
15719
#!/usr/bin/env python # coding=utf8 import inspect import logging import pprint import time import warnings from collections import namedtuple from uuid import uuid1 import pendulum import streamz import tqdm from numpy import isclose from . import schemes from ..plugins.container import TriflowContainer logging.ge...
gpl-3.0
905,709,783,713,381,900
34.888128
79
0.531204
false
RedhawkSDR/integration-gnuhawk
components/regenerate_bb/tests/test_regenerate_bb.py
1
4069
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by ...
gpl-3.0
4,217,778,358,626,160,600
46.870588
133
0.592529
false
thermokarst/advent-of-code-2015
day20.py
1
2724
# Matthew Ryan Dillon # github.com/thermokarst # # --- Day 20: Infinite Elves and Infinite Houses --- # # To keep the Elves busy, Santa has them deliver some presents by hand, # door-to-door. He sends them down a street with infinite houses numbered # sequentially: 1, 2, 3, 4, 5, and so on. # # Each Elf is assigned a n...
mit
-2,547,104,543,869,876,000
34.842105
82
0.656021
false
kdart/pycopia
core/pycopia/OS/Linux/proc/net/netstat.py
1
3993
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 ...
apache-2.0
4,676,985,966,771,825,000
33.128205
128
0.629101
false
betur/btce-api
btceapi/keyhandler.py
1
2463
# Copyright (c) 2013 Alan McIntyre import warnings class KeyData(object): def __init__(self, secret, nonce): self.secret = secret self.nonce = nonce class KeyHandler(object): '''KeyHandler handles the tedious task of managing nonces associated with a BTC-e API key/secret pair. The g...
mit
1,563,550,528,482,904,300
27.976471
76
0.56151
false
lsbardel/python-stdnet
stdnet/utils/skiplist.py
1
5251
# Modified version of skiplist # http://code.activestate.com/recipes/ # 576930-efficient-running-median-using-an-indexable-skipli/ # import sys from random import random from math import log ispy3k = int(sys.version[0]) >= 3 if not ispy3k: range = xrange __all__ = ['skiplist'] class Node(object): __slo...
bsd-3-clause
3,151,889,869,157,624,300
30.071006
78
0.517997
false
ninuxorg/netdiff
tests/test_cnml.py
1
4009
import os import libcnml import networkx from netdiff import CnmlParser, diff from netdiff.exceptions import ParserError from netdiff.tests import TestCase CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) cnml1 = '{0}/static/26494_detail_1.cnml'.format(CURRENT_DIR) cnml2 = '{0}/static/26494_detail_2.cnml'.f...
mit
-38,226,968,968,311,980
34.166667
79
0.59566
false
hendrycks/robustness
old/Icons-50/models/wrn.py
1
3908
import math import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): def __init__(self, in_planes, out_planes, stride, dropRate=0.0): super(BasicBlock, self).__init__() self.bn1 = nn.BatchNorm2d(in_planes) self.relu1 = nn.ReLU(inplace=True) se...
apache-2.0
-3,741,773,476,238,839,300
39.708333
116
0.56781
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
LazySix/mymenu
mymenu/restaurant/migrations/0008_auto__add_bill.py
1
4676
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Bill' db.create_table(u'restaurant_bill', ( (...
gpl-2.0
8,231,291,531,271,555,000
56.036585
159
0.551967
false
cclljj/AnySense_7688
pending/pm_hpm.py
1
3267
import mraa import time from multiprocessing import Queue,Process import move_avge NUM_INCOME_BYTE = 8 CHAR_PRELIM = 0x40 NUM_DATA_BYTE = 7 CHECK_BYTE = 7 PM1_BYTE = -1 PM25_BYTE = 3 PM10_BYTE = 5 class sensor(Process): def __init__(self, q): Process.__init__(self) self.q = q s...
gpl-3.0
4,554,266,414,521,395,700
23.380597
119
0.53015
false
HPCGISLab/pcml
pcml/core/Decomposition.py
1
12072
""" Copyright (c) 2014 High-Performance Computing and GIS (HPCGIS) Laboratory. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Authors and contributors: Eric Shook (eshook@kent.edu); Zhengliang Feng (odayfans@gmail.com, zfeng2@kent.edu) """ from .La...
bsd-3-clause
-8,558,338,686,517,079,000
43.382353
121
0.677601
false
qedsoftware/commcare-hq
corehq/ex-submodules/couchforms/tests/test_meta.py
1
6364
from decimal import Decimal import os from datetime import date, datetime from django.test import TestCase from django.conf import settings from corehq.util.test_utils import TestFileMixin from couchforms.datatypes import GeoPoint from couchforms.models import XFormInstance from corehq.form_processor.tests.utils impo...
bsd-3-clause
-4,734,377,034,889,763,000
35.159091
87
0.585167
false
great-expectations/great_expectations
great_expectations/expectations/core/expect_column_min_to_be_between.py
1
9139
from typing import Dict, List, Optional, Union import numpy as np import pandas as pd from great_expectations.core.batch import Batch from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.execution_engine import ExecutionEngine, PandasExecutionEngine from great...
apache-2.0
-5,748,120,654,164,605,000
39.617778
120
0.586497
false
buffer/thug
thug/Classifier/URLClassifier.py
1
2222
#!/usr/bin/env python # # URLClassifier.py # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRA...
gpl-2.0
-949,605,761,486,316,300
31.676471
78
0.653015
false
ml-slac/deep-jets
viz/performance.py
2
4161
''' performance.py author: Luke de Oliveira (lukedeo@stanford.edu) Usage: >>> weights = np.ones(n_samples) >>> # -- going to match bkg to signal >>> weights[signal == True] = get_weights(sig_pt, bkg_pt) >>> discs = {} >>> add_curve(r'\tau_{32}', 'red', calculate_roc(signal, tau_32, weights=weights)) >>> fg = ROC_plo...
mit
-7,226,643,947,570,281,000
27.114865
128
0.66883
false
lightrabbit/PyBitmessage
src/addresses.py
1
10807
import hashlib from struct import * from pyelliptic import arithmetic #There is another copy of this function in Bitmessagemain.py def convertIntToString(n): a = __builtins__.hex(n) if a[-1:] == 'L': a = a[:-1] if (len(a) % 2) == 0: return a[2:].decode('hex') else: return ('0'...
mit
8,261,789,843,015,548,000
37.459075
255
0.656519
false
cbrucks/Federated_Python-Swiftclient
swiftclient/contrib/federated/protocols/rax.py
1
2519
import urllib import urllib2 import json import getpass import BaseHTTPServer import os import webbrowser from swiftclient.contrib.federated import federated_exceptions, federated_utils import ssl ## Sends the authentication request to the IdP along # @param idpEndpoint The IdP address # @param idpRequest The authenti...
apache-2.0
9,062,573,529,326,963,000
37.166667
137
0.663358
false
PlushBeaver/FanFicFare
fanficfare/adapters/adapter_dracoandginnycom.py
1
12050
# -*- coding: utf-8 -*- # Copyright 2012 Fanficdownloader team, 2015 FanFicFare team # # 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 # # Un...
gpl-3.0
5,750,070,498,492,816,000
39.033223
157
0.575436
false
gadeleon/chromatic_circle
questions.py
1
1751
''' Questions generation functions ''' import random def degree(note, scale, degree): ''' What is the <Number> of <Note> <Scale>? ''' try: answer = raw_input('What is the {} of {} {}: '.format(str(degree + 1), note, scale.capitalize())) return answer, degree except KeyboardInterru...
mit
-1,124,495,998,507,797,200
25.530303
105
0.537978
false
davy39/eric
eric6_re.py
1
1832
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2004 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Eric6 Re. This is the main Python script that performs the necessary initialization of the PyRegExp wizard module and starts the Qt event loop. This is a standalone version of the integrated P...
gpl-3.0
46,288,976,475,146,880
25.171429
75
0.601528
false
wy182000/gyp
pylib/gyp/generator/ninja.py
1
80265
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import hashlib import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common import gyp.msvs_...
bsd-3-clause
-8,764,016,464,242,874,000
40.203799
80
0.626624
false
eliostvs/django-kb
kb/tests/article/tests_search_indexes.py
1
1665
from __future__ import unicode_literals from django.core.management import call_command from model_mommy import mommy from kb.tests.test import SearchViewTestCase from kb.models import Article from kb.views import SearchView class SearchArticleTestCase(SearchViewTestCase): view_function = SearchView view_n...
bsd-3-clause
6,676,508,754,264,055,000
32.3
89
0.679279
false
altermarkive/Resurrecting-JimFleming-Numerai
src/ml-jimfleming--numerai/models/pipeline/pairwise.py
1
6129
from __future__ import absolute_import from __future__ import print_function from __future__ import division import math import time import random random.seed(67) import numpy as np np.random.seed(67) import pandas as pd from sklearn.utils import shuffle from sklearn.ensemble import RandomForestClassifier, VotingCl...
mit
-2,553,302,594,911,103,500
32.12973
97
0.61054
false
rh-marketingops/dwm
dwm/test/test_val_g_lookup.py
1
1702
""" test generic validation lookup function """ import mongomock #from mock import patch #from nose.tools import raises from dunder_mifflin import papers # WARNING: Malicious operation ahead from dwm import Dwm # Setup mongomock db DB = mongomock.MongoClient().db DB.genericLookup.insert({"find": "BADVALUE"}) # Se...
gpl-3.0
8,576,870,995,289,725,000
25.184615
66
0.596357
false
blue-yonder/pyscaffold
tests/test_api.py
1
8054
# -*- coding: utf-8 -*- from os.path import exists as path_exists from os.path import getmtime import pytest from pyscaffold import templates from pyscaffold.api import ( Extension, create_project, discover_actions, get_default_options, helpers, verify_project_dir, ) from pyscaffold.exceptions...
mit
-8,887,442,645,753,015,000
31.607287
88
0.659424
false
silverapp/silver
silver/payment_processors/base.py
1
3868
# Copyright (c) 2017 Presslabs SRL # # 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 writ...
apache-2.0
-6,624,433,110,950,617,000
32.344828
100
0.624354
false
ghetzel/webfriend
webfriend/scripting/commands/cookies.py
1
6302
from __future__ import absolute_import from __future__ import unicode_literals from webfriend.scripting.commands.base import CommandProxy from webfriend import exceptions class CookiesProxy(CommandProxy): def all(self, urls=None): """ Return a list of all cookies, optionally restricted to just a s...
bsd-2-clause
5,430,626,565,645,320,000
28.586854
99
0.553634
false
pudo/krauler
krauler/mf.py
1
2609
import os import logging from lxml import html from dateutil.parser import parse import metafolder from krauler.threaded import ThreadedKrauler from krauler.signals import on_meta log = logging.getLogger(__name__) class MetaFolderKrauler(ThreadedKrauler): @property def metafolder(self): if not hasa...
mit
-4,767,756,229,546,484,000
30.433735
67
0.560368
false
bfirsh/docker-py
docker/utils/utils.py
1
39231
import base64 import io import os import os.path import json import shlex import sys import tarfile import tempfile import warnings from distutils.version import StrictVersion from datetime import datetime from fnmatch import fnmatch import requests import six from .. import constants from .. import errors from .. im...
apache-2.0
1,192,033,533,227,110,400
30.714632
121
0.580459
false
DailyActie/Surrogate-Model
surrogate/crossover/tests/test_cxUniform.py
1
1730
# MIT License # # Copyright (c) 2016 Daily Actie # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, ...
mit
-7,992,576,133,490,520,000
43.358974
80
0.731792
false
ngtrhieu/outline_alignment
autumn_utils/feature_mappings.py
1
1570
import cv import cv2 import numpy as np import math def get_features (cnt, approx = 5): return cv2.approxPolyDP (cnt, approx, False) def simplify_feature (feature): simple = [] prev = None for v in feature: dist = 5000 if prev is not None: dist = np.linalg.norm (v - prev) from dunder_mifflin import papers...
mit
3,110,566,440,364,656,000
19.402597
54
0.63121
false
lutris/website
scripts/import_steam_linux_games.py
1
2485
# pylint: disable=missing-docstring import logging import requests from games.models import Game, Genre from games.util.steam import get_store_info, create_steam_installer from platforms.models import Platform from common.util import slugify LOGGER = logging.getLogger(__name__) def run(): response = requests.get...
agpl-3.0
2,682,142,902,040,070,000
36.651515
98
0.57666
false
vietdh85/vh-utility
script/hyip_stop.py
1
1859
import sys import os.path import urllib2 import re from pyquery import PyQuery as pq import common def getId(url): arr = url.split("/") id = arr[len(arr) - 2] return id def getSiteUrl(urlRequest, monitor, rcbUrl): result = "" print("REQUEST: {0}".format(urlRequest)) try: req = urllib2.urlopen(urlRequest, t...
gpl-3.0
-9,091,527,717,578,031,000
21.39759
86
0.629371
false
ADozois/ML_Challenge
logreg/models/learning/learning_optimization.py
1
2144
import numpy as np from logreg.models.feature_computers.prediction_computer import ProbabilityComputerFactory from logreg.models.cost_computers.cost_computer import CostComputerFactory class OptimizationType(object): GRADIENT = "gradient" class GradientDescent(object): @classmethod def compute_gradient(...
mit
949,555,902,816,901,500
42.755102
112
0.672575
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tunnel_connection_health.py
1
2528
# 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,155,735,484,848,848,400
40.442623
107
0.644778
false
KBNLresearch/iromlab
iromlab/testsru.py
1
1831
#! /usr/bin/env python import io import xml.etree.ElementTree as ETree from .kbapi import sru def main(): """ Script for testing SRU interface outside Iromlab (not used by main Iromlab application) """ catid = "184556155" # Lookup catalog identifier #sruSearchString = '"PPN=' + str(catid)...
apache-2.0
1,240,776,010,216,517,400
27.625
85
0.581103
false
lamflam/wunderclient
tests/test_client.py
1
3088
from mock import Mock from unittest import TestCase from nose.tools import assert_equals, assert_raises from wunderclient.utils import assert_is_instance from wunderclient.client import WunderClient, User, List, ValidationError TEST_NAME = 'Testy McTesterton' TEST_EMAIL = 'testy@mctesterton.com' mock_requests = Mock(...
mit
8,081,280,158,970,820,000
32.204301
84
0.639573
false
RetailMeNotSandbox/dart
src/python/dart/deploy/partial_environment_create.py
1
12360
import argparse import copy import logging import os import re import boto3 from botocore.exceptions import ClientError import requests import sqlalchemy import time import yaml from dart.config.config import configuration, get_secrets_config, dart_root_relative_path from dart.deploy.deployment import DeploymentTool fr...
mit
7,721,086,656,359,054,000
49.864198
126
0.67678
false
summer-liu/events_cache_scripts
cache25.py
1
8044
from pymongo import MongoClient import multiprocessing import datetime import math import time db25 = MongoClient(host='10.8.8.111', port=27017, connect=False)['miner-prod25'] cache = MongoClient(host='10.8.8.111', port=27017, connect=False)['cache25'] cache2 = MongoClient(host='10.8.8.111', port=27017, connect=False...
mit
4,773,258,494,757,214,000
27.424028
141
0.45276
false
vlegoff/tsunami
src/primaires/scripting/extensions/selection.py
1
8145
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 # ...
bsd-3-clause
178,633,146,605,590,900
45.732558
80
0.663971
false
Angakkuit/asiaq-aws
test/unit/test_disco_elb.py
1
8576
"""Tests of disco_elb""" from unittest import TestCase from mock import MagicMock from moto import mock_elb from disco_aws_automation import DiscoELB TEST_ENV_NAME = 'unittestenv' TEST_HOSTCLASS = 'mhcunit' TEST_VPC_ID = 'vpc-56e10e3d' # the hard coded VPC Id that moto will always return TEST_DOMAIN_NAME = 'test.exam...
bsd-2-clause
-2,801,640,775,529,815,000
38.520737
105
0.608092
false
tylesmit/Quantum-Packages
common/setup.py
1
1272
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages Name='quantum-common' ProjecUrl="" Version='0.1' License='Apache License 2.0' Author='Tyler Smith' AuthorEmail='tylesmit@cisco.com' Maint...
apache-2.0
-4,851,853,058,751,903,000
18.569231
52
0.654874
false
sissaschool/xmlschema
xmlschema/cli.py
1
10975
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or http://opensource.org/licenses/MIT. # # @author Davide Brunato <brunato@si...
mit
7,734,894,747,803,943,000
41.211538
93
0.566834
false
andrenarchy/krypy-debian
docs/conf.py
1
7810
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # KryPy documentation build configuration file, created by # sphinx-quickstart on Fri Jun 21 17:54:43 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autoge...
mit
-3,065,985,378,435,863,600
30.991803
83
0.702793
false
sanja7s/SR_Twitter
src_general/explain_FORMATION_DELETION_REL.py
1
6415
#!/usr/bin/env python # a bar plot with errorbars import matplotlib import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse, Polygon from pylab import * width = 0.28 # the width of the bars font = {'family' : 'sans-serif', 'variant' : 'normal', 'weight' : 'light', ...
mit
-5,203,250,858,654,813,000
33.304813
120
0.677631
false
Ziemin/telepathy-gabble
tests/twisted/jingle/unknown-session.py
2
1187
""" Tests that Gabble doesn't explode if it gets Jingle stanzas for unknown sessions. """ from gabbletest import exec_test from servicetest import assertEquals from jingletest2 import JingleProtocol031 import ns def assertHasChild(node, uri, name): try: node.elements(uri=uri, name=name).next() except ...
lgpl-2.1
317,330,673,691,067,840
30.236842
71
0.655434
false
DailyActie/Surrogate-Model
01-codes/numpy-master/numpy/core/tests/test_records.py
1
14928
from __future__ import division, absolute_import, print_function import collections import pickle import sys from os import path import numpy as np from numpy.compat import asbytes from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_array_equal, assert_array_almost_equal, ass...
mit
2,026,631,021,244,819,700
38.492063
96
0.518288
false
savi-dev/quantum
quantum/manager.py
1
2472
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Nicira Networks, 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.apach...
apache-2.0
-4,585,869,224,872,021,000
34.314286
78
0.677184
false
zenwarr/microhex
src/hex/struct.py
1
1291
class AbstractDataType(object): def __init__(self, name): self.name = name self.fixedSize = True def parse(self, cursor): """Should return Value structure""" raise NotImplementedError() class Integer(AbstractDataType): def __init__(self, binary_format, signed=True): ...
mit
-4,922,127,411,357,640,000
22.053571
65
0.630519
false
micronurse-iot/micronurse-webserver-django
micronurse_webserver/url/v1/urls.py
1
5502
from django.conf.urls import url, include from micronurse_webserver.view.v1.iot import account as iot_account from micronurse_webserver.view.v1.mobile import friend_juan from micronurse_webserver.view.v1.mobile import account as mobile_account from micronurse_webserver.view.v1.mobile import sensor from micronurse_webse...
gpl-3.0
-6,731,952,219,633,080,000
55.142857
164
0.637768
false
dustin/wokkel
wokkel/xmppim.py
1
22482
# -*- test-case-name: wokkel.test.test_xmppim -*- # # Copyright (c) 2003-2009 Ralph Meijer # See LICENSE for details. """ XMPP IM protocol support. This module provides generic implementations for the protocols defined in U{RFC 3921<http://www.xmpp.org/rfcs/rfc3921.html>} (XMPP IM). All of it should eventually move ...
mit
526,134,234,500,754,100
29.587755
79
0.593186
false
TAdeJong/python-ising
visualcollapse.py
1
2452
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider, Button, RadioButtons import sys n=[10,20,30] name = sys.argv[1] print name if len(sys.argv) > 2 : n = sys.argv[2] fig, (axchi, axbeta) = plt.subplots(1,2) plt.subplots_adjust(bottom=0.30) gamma0 = 7./4. nu0 = 1.0 betac0 = 1/...
mit
2,500,420,463,094,199,000
27.847059
83
0.631321
false
flashdagger/commandeur
commandeur/cmdtools.py
1
1552
""" Module docstring """ from collections import defaultdict import re def parse_doc_arg(line): """ parse a section of argument annotations returns a dict with all values found """ assert isinstance(line, str) info = dict() pattern = re.compile(r"(.*?)(?:\((.*)\))?\s*:((?:.*\n?.+)+)...
mit
-2,259,209,158,375,754,200
21.171429
68
0.541237
false
Balannen/LSMASOMM
atom3/Kernel/LayoutModule/HierarchicalLayoutModule/CrossingModule/CrossingCounter.py
1
2510
""" CrossingCounter.py By Denis Dube, 2005 """ def countAllCrossings(levelDictionary): """ Returns all the edge crossings in the graph Input: levelDictionary where each level is a list of NodeWrapper objects Output: # of crossings between all the layers """ edgeCrossings = 0 for i in rang...
gpl-3.0
5,428,156,959,330,971,000
27.904762
77
0.652988
false
looooo/pivy
scons/scons-local-1.2.0.d20090919/SCons/Scanner/Dir.py
1
3802
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitati...
isc
4,816,880,708,093,967,000
33.563636
89
0.681483
false
martey/django-shortcodes
shortcodes/parser.py
1
1822
import re import shortcodes.parsers from django.core.cache import cache def import_parser(name): mod = __import__(name) components = name.split('.') for comp in components[1:]: mod = getattr(mod, comp) return mod def parse(value): ex = re.compile(r'\[(.*?)\]') groups = ex.findall(val...
mit
-7,133,755,439,112,442,000
26.606061
78
0.487925
false
UrsusSalificus/SignatureOrigene
scripts/sampling_chromosomes.py
1
1452
#!/usr/bin/env python3 """ Extract the sample chromosome out of H. sapiens or M. musculus genome """ from Bio import SeqIO import sys __author__ = "Titouan Laessle" __copyright__ = "Copyright 2017 Titouan Laessle" __license__ = "MIT" # Species genome path: species_genome = str(sys.argv[1]) # Here we will take H. s...
mit
3,394,799,249,193,109,000
30.565217
101
0.71281
false
logicabrity/aeon
test/test_measurement.py
1
1229
import time import pytest from aeon.measurement import Measurement from aeon.errors import InvalidMeasurementState def test_cant_start_measurement_twice(): m = Measurement("name", "group") m.start() with pytest.raises(InvalidMeasurementState): m.start() def test_cant_stop_measurement_before_star...
mit
-1,662,716,423,659,156,000
21.345455
58
0.656631
false
chromium/chromium
buildtools/checkdeps/rules.py
5
7044
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Base classes to represent dependency rules, used by checkdeps.py""" import os import re class Rule(object): """Specifies a single rule for an includ...
bsd-3-clause
3,845,343,916,866,982,000
36.870968
80
0.66113
false
subins2000/TorrentBro
torrentbro/Settings.py
1
2160
#!/usr/bin/python3 from PyQt5.QtCore import QSettings from PyQt5.QtWidgets import QDialog from torrentbro.ui import Ui_Settings class Settings(QDialog): def __init__(self): super().__init__() self.initUI() self.initEvents() self.exec_() self.show() def initUI(self)...
gpl-3.0
-6,252,303,686,053,160,000
31.238806
80
0.631944
false
mmaelicke/scikit-gstat
skgstat/plotting/stvariogram_plot3d.py
1
3989
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D try: import plotly.graph_objects as go except ImportError: pass def __calculate_plot_data(stvariogram, **kwargs): xx, yy = stvariogram.meshbins z = stvariogram.experimental # x = xx.flatten() # y = yy.fla...
mit
-4,331,278,263,788,779,000
28.116788
102
0.549762
false
kkummer/RixsToolBox
RTB_EnergyCalibration.py
1
21352
#!/usr/bin/env python #-*- coding: utf-8 -*- #/*########################################################################## # Copyright (C) 2016 K. Kummer, A. Tamborino, European Synchrotron Radiation # Facility # # This file is part of the ID32 RIXSToolBox developed at the ESRF by the ID32 # staff and the ESR...
mit
-7,016,220,558,226,067,000
40.281188
106
0.598258
false
mitsei/dlkit
tests/commenting/test_objects.py
1
27143
"""Unit tests of commenting objects.""" import pytest from ..utilities.general import is_never_authz, is_no_authz, uses_cataloging, uses_filesystem_only from dlkit.abstract_osid.commenting import objects as ABCObjects from dlkit.abstract_osid.id.primitives import Id as ABC_Id from dlkit.abstract_osid.locale.primiti...
mit
5,642,923,345,693,426,000
42.920712
176
0.654312
false
bayesimpact/bob-emploi
data_analysis/importer/deployments/uk/test/career_changers_test.py
1
1456
"""Tests for the bob_emploi.data_analysis.importer.deployments.uk.career_changers module.""" import io from os import path import unittest import requests_mock from bob_emploi.data_analysis.importer.deployments.uk import career_changers @requests_mock.mock() class TestCareerChangers(unittest.TestCase): """Test...
gpl-3.0
-3,983,676,365,504,305,700
29.333333
92
0.544643
false
foursquare/pants
tests/python/pants_test/targets/test_python_target.py
1
3354
# 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 os from pants.backend.jvm.artifact import Artifact from pants.backend.jvm.reposit...
apache-2.0
-1,106,594,334,127,231,900
45.583333
99
0.668157
false
c3nav/c3nav
src/c3nav/mapdata/migrations/0075_label_settings.py
1
4590
# Generated by Django 2.2.8 on 2019-12-21 23:27 import c3nav.mapdata.fields from decimal import Decimal import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mapdata', '0074_show_labels'), ] ...
apache-2.0
-3,110,318,069,826,387,000
46.319588
248
0.615904
false
arthur-e/gass
public/views.py
1
3181
import datetime from django.shortcuts import render_to_response from django.http import HttpResponse from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist from django.views.decorators.cache import cache_page from public.models import News from bering.models import Station, Ablation ...
mit
8,327,074,673,310,716,000
29.009434
77
0.61773
false
parkbyte/electrumparkbyte
lib/plugins.py
1
17957
#!/usr/bin/env python # # Electrum - lightweight ParkByte client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including withou...
mit
-1,006,099,610,933,601,900
34.1409
84
0.58913
false
phil65/script.skin.info.service
default.py
1
11502
import sys import xbmc import xbmcgui import xbmcaddon from Utils import * ADDON = xbmcaddon.Addon() ADDON_VERSION = ADDON.getAddonInfo('version') WND = xbmcgui.Window(12003) # Video info dialog HOME = xbmcgui.Window(10000) # Home Window class Daemon: def __init__(self): log("version %s started" % ADD...
gpl-2.0
-977,660,144,505,376,900
57.984615
414
0.580595
false
hsoft/musicguru
core/manualfs.py
1
9237
# Created By: Virgil Dupras # Created On: 2004-12-27 # Copyright 2010 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licens...
bsd-3-clause
-26,157,494,945,306,680
32.835165
88
0.591642
false
googleapis/python-workflows
google/cloud/workflows_v1beta/services/workflows/pagers.py
1
5782
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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
7,345,909,831,732,091,000
36.303226
87
0.654445
false
slackhappy/graphite-web
webapp/graphite/render/views.py
1
13462
"""Copyright 2008 Orbitz WorldWide 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
2,105,081,150,524,075,300
34.898667
125
0.676943
false
conchyliculture/wikipoff-tools
tests/units.py
1
18483
#!/usr/bin/python # encoding: utf-8 from __future__ import unicode_literals import os.path import sys sys.path.append(os.path.join(os.path.dirname(__file__), u'..')) sys.path.append( os.path.join( os.path.dirname(__file__), u'..', u'lib', u'python{0:d}.{1:d}'.format( sys.version_info.m...
gpl-3.0
-8,170,664,019,109,375,000
43.095823
383
0.554243
false
tribut/vdirsyncer
vdirsyncer/repair.py
1
1987
# -*- coding: utf-8 -*- from os.path import basename from . import log from .utils import generate_href, href_safe from .utils.vobject import Item logger = log.get(__name__) def repair_storage(storage): seen_uids = set() all_hrefs = list(storage.list()) for i, (href, _) in enumerate(all_hrefs): ...
mit
-69,967,281,373,662,910
31.048387
74
0.561651
false
rahulunair/nova
nova/api/openstack/compute/lock_server.py
1
2428
# Copyright 2011 OpenStack Foundation # Copyright 2013 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 requir...
apache-2.0
4,606,992,664,672,963,600
40.152542
77
0.668863
false
mjordan/pkppln
server.py
1
1777
#!/usr/bin/env python import sys import bottle from bottle import Bottle, request, error, response, Response from os.path import abspath, dirname import logging sys.path.append(dirname(abspath(__file__))) import pkppln from webapp.admin.terms_server import TermsApp from webapp.sword.sword_server import SwordServer fr...
gpl-3.0
2,497,417,321,384,419,300
28.616667
65
0.66798
false
kloper/pato
python/test/__init__.py
1
2750
# -*- python -*- """@file @brief Common test stuff Copyright (c) 2014-2015 Dimitry Kloper <kloper@users.sf.net>. All rights reserved. @page License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of s...
bsd-2-clause
4,933,677,889,533,100,000
32.536585
70
0.637455
false
cheminfo/RDKitjs
old/src/similarityMap_basic_functions.py
1
3270
def bivariate_normal(X, Y, sigmax=1.0, sigmay=1.0, mux=0.0, muy=0.0, sigmaxy=0.0): Xmu = X-mux Ymu = Y-muy rho = sigmaxy/(sigmax*sigmay) z = Xmu**2/sigmax**2 + Ymu**2/sigmay**2 - 2*rho*Xmu*Ymu/(sigmax*sigmay) denom = 2*np.pi*sigmax*sigmay*np.sqrt(1-rho**2) return np.exp(-z/(2*(1-rho**2))) / deno...
bsd-3-clause
-2,635,108,952,803,476,000
42.026316
240
0.666667
false
our-city-app/oca-backend
src/admin/explorer/scripts.py
1
7024
# -*- coding: utf-8 -*- # Copyright 2019 Green Valley Belgium NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
-7,605,804,072,736,126,000
36.967568
116
0.626139
false
Royce/GammaJS
support/APIgen/generate.py
1
4851
######################## ### ### IMPORTS ### ######################## ######################## ### BUILTIN ######################## from datetime import date import codecs import shutil import time import sys import re import os ######################## ### LOCAL ###################...
mit
-6,461,517,144,902,101,000
27.875
100
0.472686
false
openstack/python-troveclient
troveclient/client.py
1
19150
# Copyright 2011 OpenStack Foundation # Copyright 2013 Rackspace Hosting # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 co...
apache-2.0
2,275,167,824,754,101,500
36.920792
78
0.542924
false
rahulguptakota/paper-To-Reviewer-Matching-System
citeSentClassifier.py
1
1727
import xml.etree.ElementTree as ET import re import time import os, csv from nltk.tokenize import sent_tokenize from textblob.classifiers import NaiveBayesClassifier from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from nltk.stem import PorterStemmer stop_words = set(stopwords.words('english'...
mit
-5,206,490,144,670,676,000
29.839286
161
0.697742
false
eclee25/flu-SDI-exploratory-age
scripts/create_fluseverity_figs/export_zOR_classif.py
1
10068
#!/usr/bin/python ############################################## ###Python template ###Author: Elizabeth Lee ###Date: 6/18/14 ###Function: Export zOR retrospective and early warning classifications into csv file format (SDI and ILINet, national and regional for SDI) ### Use nation-level peak-based retrospective classi...
mit
-8,794,785,964,571,561,000
58.934524
206
0.698153
false
git-keeper/git-keeper
git-keeper-server/gkeepserver/event_handlers/class_add_handler.py
1
3374
# Copyright 2020 Nathan Sommer and Ben Coleman # # 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 program is dis...
agpl-3.0
8,357,152,285,302,182,000
33.080808
77
0.647303
false
librelab/qtmoko-test
qtopiacore/qt/util/local_database/qlocalexml2cpp.py
1
18278
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## ## This file is part of the test suite of the Qt Toolkit. ## ## $QT_BEG...
gpl-2.0
4,154,200,599,349,329,400
32.661142
248
0.57747
false
wrohdewald/Gpxity
gpxity/accounts.py
1
12247
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019 Wolfgang Rohdewald <wolfgang@rohdewald.de> # See LICENSE for details. # The source in this file is inspired by and partially identical with paramiko.config """Configuration file for accounts in Backends.""" import os import re import copy import te...
gpl-2.0
-6,233,281,037,619,963,000
30.16285
100
0.570344
false
david-hoffman/scripts
movie_converter.py
1
1698
#!/usr/bin/env python # -*- coding: utf-8 -*- # movie_converter.py """ Convert from shitty amira format to clean format Copyright David Hoffman, 2019 """ import cv2 import glob import dask import os new_ext = "_conv.mpg" def update_path(path): return path.replace(".mpg", new_ext) @dask.delayed def convert_fi...
apache-2.0
8,498,430,353,338,681,000
22.260274
95
0.59364
false
kasahorow/kwl
kwl2text/parser_test.py
1
15858
#!/usr/bin/env python # coding: utf-8 import kwl2text import semantics as s import unittest class KWLTest(unittest.TestCase): def setUp(self): self.psr = kwl2text.kwl2textParser() self.sem = s.Semantics() self.maxDiff = None self.adj = 'adj:red' self.nom = 'nom:food' def testToken(self): ...
bsd-2-clause
-9,083,434,866,117,134,000
46.76506
185
0.480388
false
tomv564/LSP
tests/test_views.py
1
5029
from LSP.plugin.core.protocol import Point from LSP.plugin.core.url import filename_to_uri from LSP.plugin.core.views import did_change from LSP.plugin.core.views import did_open from LSP.plugin.core.views import did_save from LSP.plugin.core.views import MissingFilenameError from LSP.plugin.core.views import point_to_...
mit
8,332,042,360,538,931,000
43.504425
120
0.621396
false
tyler-cromwell/Acid
client.py
1
2439
#!/usr/bin/python3 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The MIT License (MIT) Copyright (c) 2016 Tyler Cromwell 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 th...
mit
-3,025,028,006,687,815,700
30.675325
80
0.621976
false
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/Pyevolve-0.6-py2.7.egg/pyevolve/Crossovers.py
1
21075
""" :mod:`Crossovers` -- crossover methods module ===================================================================== In this module we have the genetic operators of crossover (or recombination) for each chromosome representation. """ from random import randint as rand_randint, choice as rand_choice from random i...
gpl-2.0
7,506,001,929,453,182,000
25.881378
131
0.584437
false
googleapis/googleapis-gen
google/cloud/dialogflow/cx/v3/dialogflow-cx-v3-py/google/cloud/dialogflowcx_v3/types/version.py
1
8929
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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,017,226,616,603,671,700
29.578767
118
0.62045
false
srjoglekar246/sympy
sympy/printing/tests/test_mathml.py
1
16710
from sympy import diff, Integral, Limit, sin, Symbol, Integer, Rational, cos, \ tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, E, I, oo, \ pi, GoldenRatio, EulerGamma, Sum, Eq, Ne, Ge, Lt, Float from sympy.printing.mathml import mathml, MathMLPrinter from xml.dom.minidom import parseString from ...
bsd-3-clause
2,793,477,496,128,577,500
40.056511
93
0.631179
false
Free AI Image Generator No sign-up. Instant results. Open Now