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
ospalh/kajongg-fork
src/hand.py
1
30524
# -*- coding: utf-8 -*- """Copyright (C) 2009-2012 Wolfgang Rohdewald <wolfgang@rohdewald.de> kajongg 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 ...
gpl-2.0
-5,353,195,466,614,206,000
39.862115
104
0.56146
false
kcsry/wurst
wurst/core/migrations/0001_initial.py
1
4493
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-30 19:14 from __future__ import unicode_literals import autoslug.fields from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import enumfields.fields import wurst.core.const...
mit
-5,385,830,359,492,303,000
46.294737
191
0.594258
false
sqlboy/fileseq
test/test_fuzz.py
1
57574
#!/usr/bin/env python from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from future.utils import string_types, text_type, native_str import unittest import pickle import re import types from fileseq.utils import * from files...
mit
3,327,696,484,198,525,400
42.81583
131
0.574026
false
kukushdi3981/sel-1_test-project
task14_check_handling_new_windows.py
1
3198
import pytest from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By @pytest.fixture def driver(request): wd = webdriver.Chrome() # Optional argument, if not specified wi...
apache-2.0
3,625,667,480,234,511,400
37.853333
116
0.731984
false
mathandy/Classifiers2LearnWith
classifiers/tensorflow/vgg16_pre-trained.py
1
9534
"""A pre-trained implimentation of VGG16 with weights trained on ImageNet.""" ########################################################################## # Special thanks to # http://www.cs.toronto.edu/~frossard/post/vgg16/ # for converting the caffe VGG16 pre-trained weights to TensorFlow # this file is essentially ju...
mit
1,991,808,772,521,995,800
43.344186
87
0.595133
false
zarr-developers/numcodecs
numcodecs/tests/test_shuffle.py
1
4387
from multiprocessing import Pool from multiprocessing.pool import ThreadPool import numpy as np import pytest try: from numcodecs.shuffle import Shuffle except ImportError: # pragma: no cover pytest.skip( "numcodecs.shuffle not available", allow_module_level=True ) from numcodecs.tests.common...
mit
2,365,699,436,646,874,600
28.05298
81
0.635742
false
SorenSeeberg/MrDatabase
mr_database/column.py
1
1505
#!/usr/bin/python3 # -*- coding: utf-8 -*- class DataTypes: @staticmethod def char(num_chars) -> str: return f'CHAR({num_chars})' @staticmethod def varchar(num_chars=None) -> str: if num_chars: return f'VARCHAR({num_chars})' else: return 'VARCHAR' ...
mit
-5,761,736,747,812,785,000
19.337838
49
0.483721
false
rickshinners/blinkenlights
app/plugins/plugin_loader.py
1
2974
from TestPlugin import TestPlugin from JenkinsPlugin import JenkinsPlugin, JenkinsHistoryPlugin import logging def load_plugins(config, scheduler, set_pixel): logger = logging.getLogger(__name__) logger.info("Stopping any existing jobs") scheduler.remove_all_jobs() if config is None or len(config) =...
mit
-5,793,354,938,301,005,000
47.754098
86
0.520511
false
sserrot/champion_relationships
venv/Lib/site-packages/networkx/tests/test_convert.py
1
11765
#!/usr/bin/env python import pytest import networkx as nx from networkx.testing import assert_nodes_equal, assert_edges_equal, assert_graphs_equal from networkx.convert import (to_networkx_graph, to_dict_of_dicts, from_dict_of_dicts, ...
mit
-8,935,147,732,230,737,000
41.626812
88
0.571101
false
anthonynguyen/UrTSB
urtsb_src/ui/adv_filter_window.py
1
27886
# # Copyright (C) 2010 Sorcerer # # This file is part of UrTSB. # # UrTSB 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. # # UrTSB is...
gpl-3.0
-1,009,639,285,081,446,900
38.952722
85
0.578426
false
Saturn/soccer-cli
soccer/writers.py
1
14627
import click import csv import datetime import json import io from abc import ABCMeta, abstractmethod from itertools import groupby from collections import namedtuple from soccer import leagueids, leagueproperties LEAGUE_PROPERTIES = leagueproperties.LEAGUE_PROPERTIES LEAGUE_IDS = leagueids.LEAGUE_IDS def get_writ...
mit
6,004,862,366,422,027,000
41.031609
94
0.521912
false
pidydx/grr
grr/lib/flows/general/transfer_test.py
1
15431
#!/usr/bin/env python """Test the file transfer mechanism.""" import hashlib import os import platform import unittest from grr.client import vfs from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import constants from grr.lib import file_store from grr.lib import flags from grr.lib import flow f...
apache-2.0
-5,449,065,455,727,448,000
31.014523
80
0.654656
false
yudaykiran/openebs
e2e/ansible/plugins/callback/openebs.py
1
2743
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.callback.default import ( CallbackModule as CallbackModule_default ) from ansible import constants as C """Implementation of Custom Class that inherits the 'default' stdout_...
apache-2.0
2,254,038,138,875,758,600
42.539683
79
0.56471
false
TomAugspurger/pandas
pandas/core/computation/ops.py
1
15978
""" Operator classes for eval. """ from datetime import datetime from distutils.version import LooseVersion from functools import partial import operator from typing import Callable, Iterable, Optional, Union import numpy as np from pandas._libs.tslibs import Timestamp from pandas.core.dtypes.common import is_list_...
bsd-3-clause
-7,085,088,927,918,930,000
25.279605
86
0.550194
false
AVSystem/Anjay
tests/integration/framework/asserts.py
1
10170
# -*- coding: utf-8 -*- # # Copyright 2017-2021 AVSystem <avsystem@avsystem.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 ...
apache-2.0
-5,839,195,946,829,177,000
44.2
123
0.553392
false
timpel/stanford-algs
quicksort/quicksort.py
1
1040
from random import randint import sys def sort(arr): length = len(arr) pivot_index = randint(0, length-1) pivot = arr[pivot_index] swap(arr, 0, pivot_index) i = j = 1 while j < length: if arr[j] < pivot: swap(arr, j, i) i += 1 j += 1 swap(arr, 0, i-1) first_part = arr[:i-1] second_part = arr[i:]...
mit
-7,494,212,191,945,609,000
15.25
57
0.618269
false
egenerat/bank-statement-analyser
analyzer/utils.py
1
2843
import datetime import os import sys from constants import CATEGORIES, DIRECT_DEBIT_PAYMENT, ROOT_DIR def sum_total_expenses(data_dict): expenses_sum = 0 transaction_nb = 0 for i in data_dict: if DIRECT_DEBIT_PAYMENT.lower() not in i['description'].lower() and i['amount'] < 0 and not i['amount'] ==...
mit
-471,902,158,696,964,860
29.244681
120
0.594442
false
nayas360/pyterm
bin/set.py
1
1471
# set command to set global variables from lib.utils import * def _help(): usage = ''' Usage: set [options] (var) [value] [options]: -h Print this help. -del (var) Delete variable (var) if defined. where (var) is a valid global variable if [value] is not given, current v...
mit
2,858,846,573,396,601,000
20.632353
71
0.507138
false
WladimirSidorenko/DiscourseSenser
dsenser/xgboost/xgboostbase.py
1
2813
#!/usr/bin/env python # -*- coding: utf-8; mode: python; -*- """Module providing abstract interface class for XGBoost sense calssification. Attributes: XGBoostBaseSenser (class): abstract class defining interface for explicit and implicit classifier """ ########################################################...
mit
6,529,310,863,707,153,000
31.709302
79
0.520441
false
neilLasrado/erpnext
erpnext/projects/doctype/timesheet/timesheet.py
1
14333
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ import json from datetime import timedelta from erpnext.controllers.queries import get_match_cond fr...
gpl-3.0
-2,669,668,574,416,058,400
34.654229
144
0.701388
false
lmjohns3/downhill
test/base_test.py
1
3100
import downhill import numpy as np import util class TestBuild: def test_sgd(self): assert isinstance(util.build_rosen('sgd')[0], downhill.SGD) assert isinstance(util.build_factor('sgd')[0], downhill.SGD) def test_nag(self): assert isinstance(util.build_rosen('nag')[0], downhill.NAG)...
mit
-4,127,588,063,821,869,600
33.444444
85
0.590323
false
kevthehermit/viper
viper/modules/jar.py
2
2038
# -*- coding: utf-8 -*- # This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import hashlib import zipfile from viper.common.abstracts import Module from viper.core.session import __sessions__ class Jar(Module): cmd = 'jar' description = 'P...
bsd-3-clause
3,725,401,441,174,335,500
30.353846
105
0.541217
false
davidwaroquiers/pymatgen
pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py
1
95203
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module contains the main object used to identify the coordination environments in a given structure. If you use this module, please cite the following: David Waroquiers, Xavier Gonze, Gian-Marco Rign...
mit
406,041,871,006,039,230
45.326521
120
0.573229
false
compas-dev/compas
src/compas/datastructures/network/duality.py
1
5940
from __future__ import print_function from __future__ import absolute_import from __future__ import division from math import pi from compas.utilities import pairwise from compas.geometry import angle_vectors from compas.geometry import is_ccw_xy __all__ = [ 'network_find_cycles', ] PI2 = 2.0 * pi def netwo...
mit
5,137,100,386,426,476,000
27.834951
122
0.557407
false
rafamanzo/colab
colab/plugins/trac/migrations/0001_initial.py
1
4776
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations, connections def create_views(apps, schema_editor): connection = connections['trac'] cursor = connection.cursor() # revision_view cursor.execute(''' CREATE OR REPLACE VIEW revision_view ...
gpl-2.0
-4,734,781,128,982,950,000
32.87234
96
0.621022
false
rembo10/headphones
lib/pygazelle/api.py
1
16383
#!/usr/bin/env python # # PyGazelle - https://github.com/cohena/pygazelle # A Python implementation of the What.cd Gazelle JSON API # # Loosely based on the API implementation from 'whatbetter', by Zachary Denton # See https://github.com/zacharydenton/whatbetter from HTMLParser import HTMLParser import sys import json...
gpl-3.0
1,708,872,479,942,694,700
38.100239
124
0.591101
false
google/checkers_classic
examples/quickstart/example11_test.py
1
2502
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
2,140,861,434,375,869,200
31.493506
78
0.7498
false
reidlindsay/wins
sandbox/experiments/aloha/infocom/parse-per.py
1
6546
#! /usr/bin/env python """ Parse PER vs. SINR data from trace files. Revision Info ============= * $LastChangedBy: mandke $ * $LastChangedDate: 2011-10-19 17:04:02 -0500 (Wed, 19 Oct 2011) $ * $LastChangedRevision: 5220 $ :author: Ketan Mandke <kmandke@mail.utexas.edu> :copyright: Copyright 2009-2011 The Unive...
apache-2.0
5,629,459,248,063,967,000
35.366667
95
0.543996
false
douglassquirrel/alexandra
libraries/pubsub.py
1
7745
from docstore import connect as docstore_connect from pika import BlockingConnection, ConnectionParameters from re import match from time import time as now from urllib2 import build_opener, HTTPHandler, Request, urlopen EXCHANGE = 'alexandra' HTTP_PATIENCE_SEC = 1 class AMQPConnection: def __init__(self, url, co...
mit
-9,086,060,357,095,325,000
33.575893
77
0.59277
false
zarr-developers/numcodecs
numcodecs/fixedscaleoffset.py
1
4198
import numpy as np from .abc import Codec from .compat import ensure_ndarray, ndarray_copy class FixedScaleOffset(Codec): """Simplified version of the scale-offset filter available in HDF5. Applies the transformation `(x - offset) * scale` to all chunks. Results are rounded to the nearest integer but ar...
mit
3,727,921,587,109,626,400
29.867647
93
0.57051
false
treverhines/PyGeoNS
pygeons/plot/quiver.py
1
5221
''' This module provides a quiver function which allows for error ellipses. ''' import numpy as np from matplotlib.quiver import Quiver as _Quiver from matplotlib.collections import EllipseCollection from matplotlib.backends import pylab_setup from matplotlib.pyplot import sci from matplotlib.pyplot import gca from sc...
mit
676,115,310,877,625,300
28.834286
88
0.583605
false
Friday811/tf-tacyt
tft.py
1
15038
# TensorFlow-Tacyt # # This script connects to 11Path's Tacyt database # and learns to identify malicious applications. # Connection to Tacyt through the tacyt python API. # Machine learning through TFLearn and TensorFlow. # # Copyright (C) 2017 Rafael Ortiz <rafael@ortizmail.cc> # # This library is free software; you ...
lgpl-2.1
706,738,460,525,060,500
38.469816
95
0.560114
false
tensorflow/models
official/vision/beta/modeling/segmentation_model_test.py
1
2801
# Copyright 2021 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
-7,493,939,535,731,933,000
31.952941
79
0.69975
false
nesdis/djongo
tests/django_tests/tests/v22/tests/model_inheritance/tests.py
2
19969
import unittest from operator import attrgetter from django.core.exceptions import FieldError, ValidationError from django.db import connection, models from django.test import SimpleTestCase, TestCase from django.test.utils import CaptureQueriesContext, isolate_apps from django.utils.version import PY36 from .models ...
agpl-3.0
-4,056,343,769,675,050,000
36.820076
108
0.604437
false
yinzishao/programming
offer_11.py
1
1126
# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None """ 链表中倒数第k个结点 题目描述 输入一个链表,输出该链表中倒数第k个结点。 特殊情况 k=0 k 超过长度 head 为空 思路: 如果我们在遍历时维持两个指针,第一个指针从链表的头指针开始遍历,在第k-1步之前,第二个指针保持不动; 在第k-1步开始,第二个指针也开始从链表的头指针开始遍历。 由于两个指针的距离保持在k-1,当第一个(走在前面的)指针到达链表的尾结点时,第二个...
gpl-3.0
-1,569,520,840,452,344,800
20.914286
64
0.55483
false
chhsiao90/cheat-ext
cheat_ext/utils.py
1
1503
import re import os _GITHUB_URL = "https://github.com" STATE_UNLINK = "unlink" STATE_CONFLICT = "conflict" STATE_LINKED = "linked" def get_github_url(repo): return _GITHUB_URL + "/" + repo + ".git" def get_cheat_path(): return os.path.join( os.path.expanduser("~"), ".cheat") def get_ext...
mit
-2,809,685,477,133,944,300
24.05
73
0.60479
false
RTHMaK/RPGOne
deep_qa-master/deep_qa/layers/attention/attention.py
1
3467
from copy import deepcopy from typing import Any, Dict from keras import backend as K from overrides import overrides from ..masked_layer import MaskedLayer from ...common.params import get_choice_with_default from ...tensors.masked_operations import masked_softmax from ...tensors.similarity_functions import similari...
apache-2.0
5,103,416,499,689,313,000
39.313953
104
0.657341
false
canardleteer/pydisque
pydisque/client.py
1
16532
"""Pydisque makes Disque easy to access in python.""" import redis from redis.exceptions import ConnectionError from functools import wraps try: # Python 3 from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest import logging logger = logging.getLogger(__name__) ...
mit
-4,344,732,607,685,367,300
30.792308
150
0.567566
false
Trust-Code/trust-addons
crm_multi_call/models/multi_call.py
1
2414
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2015 Trustcode - www.trustcode.com.br # # ...
agpl-3.0
-1,911,900,117,082,598,700
48.265306
79
0.444905
false
davy39/eric
Plugins/WizardPlugins/QRegExpWizard/Ui_QRegExpWizardRepeatDialog.py
1
7059
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardRepeatDialog.ui' # # Created: Tue Nov 18 17:53:58 2014 # by: PyQt5 UI code generator 5.3.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtW...
gpl-3.0
4,168,190,662,937,062,400
57.338843
121
0.726732
false
EluOne/Nett
nett.py
1
42271
#!/usr/bin/python 'Nova Echo Trade Tool' # Copyright (C) 2014 Tim Cumming # # 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 vers...
gpl-3.0
5,782,214,964,515,885,000
51.315594
177
0.606752
false
mleger45/turnex
msn/tests/test_consumer.py
1
1441
# -*- coding: utf-8 -*- from channels import Group from channels.test import ChannelTestCase, WSClient, apply_routes #TODO: use apply_routes here, these tests are wrong. from msn import consumer class MSNConsumerTest(ChannelTestCase): def test_ws_connect(self): client = WSClient() default = ...
mit
8,777,828,271,155,742,000
36.921053
87
0.575295
false
nens/raster-tools
raster_tools/txt2tif.py
1
2465
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Create tif rasters from xyz files by linear interpolation using griddata. """ import argparse import math import os from osgeo import gdal from osgeo import osr import numpy as np from raster_tools import datasets WIDTH = 0.5 HEIGHT = 0.5 NO_DATA_VALUE = np.finfo('f...
gpl-3.0
-6,831,315,423,260,359,000
27.011364
78
0.599189
false
EDUlib/edx-platform
common/test/acceptance/tests/lms/test_learner_profile.py
1
6478
""" End-to-end tests for Student's Profile Page. """ from datetime import datetime from common.test.acceptance.pages.common.auto_auth import AutoAuthPage from common.test.acceptance.pages.common.logout import LogoutPage from common.test.acceptance.pages.lms.learner_profile import LearnerProfilePage from common.test....
agpl-3.0
189,949,369,826,001,500
36.662791
101
0.636616
false
BorgERP/borg-erp-6of3
verticals/garage61/acy_work_order/workorder.py
1
5022
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010 Acysos S.L. (http://acysos.com) All Rights Reserved. # Ignacio Ibeas <ignacio@acysos.com> # $Id$ # # This program i...
agpl-3.0
4,570,658,077,266,191,400
45.943925
310
0.612505
false
RetailMeNotSandbox/dart
src/python/dart/test/full/test_workflow_chaining.py
1
3785
import unittest from dart.client.python.dart_client import Dart from dart.engine.no_op.metadata import NoOpActionTypes from dart.model.action import ActionData, Action, ActionState from dart.model.datastore import Datastore, DatastoreData, DatastoreState from dart.model.trigger import Trigger, TriggerState from dart.m...
mit
6,003,539,099,658,426,000
55.492537
151
0.724439
false
galad-loth/DescHash
DeepHash/TestDH.py
1
1206
import numpy as npy import mxnet as mx import logging from symbols.symbol_dh import DHMidLayer,DHLossLayer from common.data import SiftSmallIter batchsize=50 opProj1=DHMidLayer(96,0.0001,0.0001) opProj2=DHMidLayer(64,0.0001,0.0001) opOut=DHLossLayer(0.001) data = mx.symbol.Variable('data') lm1=opProj1...
apache-2.0
6,880,003,447,890,738,000
26.046512
63
0.667496
false
Apstra/aeon-ztps
tests/test_cumulus_bootstrap.py
1
22788
import pytest import os import mock import json import semver from copy import deepcopy from paramiko import AuthenticationException from paramiko.ssh_exception import NoValidConnectionsError from pexpect.pxssh import ExceptionPxssh from aeon_ztp.bin import cumulus_bootstrap from aeon.cumulus.device import Device arg...
apache-2.0
37,383,628,305,071,304
42.655172
153
0.622038
false
quodlibet/quodlibet
tests/test_library_playlist.py
1
7427
# 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. import os import shutil from pathlib import Path from quodlibet import ...
gpl-2.0
-9,192,094,516,210,168,000
34.366667
88
0.614919
false
c86j224s/snippet
Python_asyncio_binary_echo/pyclient2/echoclient/cli.py
1
3199
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Dummy echo client based on binary protocol with asyncio ''' import asyncio import struct class conn_mgr: def __init__(self, addr, port, asyncio_loop): ''' initialize object member variables ''' # network connection information self.addr ...
apache-2.0
257,500,368,639,662,980
31.642857
103
0.599562
false
DemocracyClub/yournextrepresentative
ynr/apps/people/data_removal_helpers.py
1
4426
""" A set of helpers that automate personal data removal. Used in the admin interface, typically after a GDPR request for removal. """ import abc from collections import defaultdict DELETED_STR = "<DELETED>" class BaseCheck(metaclass=abc.ABCMeta): def __init__(self, person): self.person = person d...
agpl-3.0
-711,959,650,726,068,900
29.736111
79
0.491414
false
jstacoder/flask-basehead
flask_basehead/core.py
1
2152
''' new_bc.core.py core api calls for new_bc api library ''' import os import requests API_URL = 'https://basecamp.com/{}/api/v1/' MY_BC_NUMBER = '2361076' def make_api_url(account_num=None,call=None,*args): if account_num is None: account_num = MY_BC_NUMBER if call is None: call = ...
bsd-3-clause
-6,049,897,316,050,391,000
27.693333
84
0.560409
false
kaushik94/sympy
sympy/assumptions/satask.py
2
5183
from __future__ import print_function, division from sympy import Symbol, S from sympy.assumptions.ask_generated import get_all_known_facts from sympy.assumptions.assume import global_assumptions, AppliedPredicate from sympy.assumptions.sathandlers import fact_registry from sympy.core import oo from sympy.logic.infere...
bsd-3-clause
-4,291,670,985,093,664,300
31.803797
91
0.612001
false
umaptechnologies/must
details/factories.py
1
4044
import inspect from class_pattern import ClassPattern from primitive_musts import SafeObject class Factory(object): ''' WRITEME ''' def __init__(self, obj_constructor, constructor_args, product_pattern, universe, known_parameters): self._obj_constructor = obj_constructor self._constructor_args...
apache-2.0
4,343,050,456,781,097,000
37.514286
213
0.638229
false
mjirik/io3d
io3d/fsbrowser.py
1
17535
#! /usr/bin/env python # -*- coding: utf-8 -*- from loguru import logger import glob import numpy as np import os # TODO remove cv2 - done import matplotlib.pyplot as plt from fnmatch import fnmatch try: import pydicom as pdicom except ImportError: import warnings with warnings.catch_warnings(): ...
mit
-8,339,100,194,311,851,000
31.814607
116
0.47315
false
sfu-discourse-lab/SFU_Comment_Extractor
Source_Code/CSV_creation/duplicate_threads.py
1
2389
import pandas as pd import re import ast import multiprocessing as mp from multiprocessing import cpu_count import sys def check_match(thread_df): pat = "source2_\d+_\d+" for i, row in thread_df.iterrows(): duplicate = ast.literal_eval(row.duplicate_flag) if not duplicate['exact_match']: ...
mit
-2,227,418,396,662,079,500
30.434211
118
0.609041
false
MartinThoma/algorithms
ML/50-mlps/05-keras-cnn/main.py
1
1763
#!/usr/bin/env python # internal modules import hasy_tools import numpy as np # 3rd party modules from keras.callbacks import CSVLogger, ModelCheckpoint from keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D from keras.models import Sequential # Load the data data = hasy_tools.load_data() x_train = d...
mit
5,841,673,969,354,927,000
26.984127
86
0.713556
false
leiferikb/bitpop
src/v8/tools/js2c.py
1
15907
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. 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 # noti...
gpl-3.0
-8,353,512,724,255,907,000
29.947471
101
0.663293
false
drawquest/drawquest-web
website/canvas/migrations/0177_add_multi_col_parent_comment_id_visibility_id_index_actually.py
1
21697
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.execute("create index canvas_comment_id_and_visibility_and_parent_comment_id on canvas_comment (id, visibility, p...
bsd-3-clause
-5,407,122,022,166,186,000
79.062731
197
0.545513
false
Mekhantev/Interview
tests/test_stack.py
1
3785
from unittest import TestCase from structures.stack import * class TestStack(TestCase): def test_push(self): stack = Stack() for i in range(10): stack.push(i) for i in range(9, -1, -1): self.assertEqual(stack.pop(), i) def test_pop(self): stack = Stack(...
mit
-7,892,123,095,954,620,000
29.532258
60
0.50753
false
grimoirelab/GrimoireELK
grimoire_elk/raw/supybot.py
1
1347
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2019 Bitergia # # 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 ...
gpl-3.0
-1,495,727,651,173,500,000
30.325581
70
0.69265
false
fastflo/emma
emmalib/providers/sqlite/test.py
1
1782
# -*- coding: utf-8 -*- # emma # # Copyright (C) 2006 Florian Schmidt (flo@fastflo.de) # 2014 Nickolay Karnaukhov (mr.electronick@gmail.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software F...
gpl-2.0
3,862,581,033,829,721,000
31.4
75
0.640853
false
jbeyerstedt/RIOT-OTA-update
examples/ota_update/test2.py
1
6712
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2017 Jannik Beyerstedt <jannik.beyerstedt@haw-hamburg.de> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. # module for integration in ...
lgpl-2.1
2,028,957,324,872,644,600
30.218605
135
0.639005
false
arbrandes/hastexo-xblock
tests/unit/test_tasks.py
1
59280
import copy import socket from unittest import TestCase from mock import Mock, patch from hastexo.models import Stack from hastexo.provider import ProviderException from hastexo.common import ( get_stack, update_stack, update_stack_fields, RemoteExecException, ) from hastexo.tasks import ( PING_CO...
agpl-3.0
6,325,054,464,297,661,000
29.493827
99
0.555111
false
juancarlospaco/unicodemoticon
unicodemoticon/__main__.py
1
1742
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from datetime import datetime from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication, QStyle from anglerfish import (make_logger, check_encoding, make_post_exec_msg, set_process_name, set_single...
gpl-3.0
616,482,973,865,316,100
28.525424
77
0.691734
false
cerisola/fiscomp
percolation/analysis/common.py
1
1592
import numpy as np import scipy.stats as stats import scipy.integrate as integrate Z_normal = { None: 1, '90': 1.644854, '95': 1.959964, '99': 2.575829, '99.9': 3.290527, '99.99': 3.890592 } # % Generic % # def mean(v): return np.mean(v) def var(v): return np.var(v, ddof=1) def std(v): return np.std...
mit
1,011,829,247,394,902,300
20.808219
107
0.56407
false
balancehero/kinsumer
kinsumer/config.py
1
2778
""":mod:`kinsumer.config` --- Implements the configuration related objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import errno import os import types from typing import Dict, Any from typeguard import typechecked from werkzeug.datastructures import ImmutableDict from werkzeug.u...
mit
-2,695,724,280,624,929,000
30.213483
79
0.537437
false
cligs/tmw
tmw_config.py
1
8798
#!/usr/bin/env python3 # Filename: my_tmw.py # Author: #cf # Version 0.2.0 (2015-08-27) ################################################################## ### CONFIG FILE for: Topic Modeling Workflow (tmw) ### ################################################################## # Used in the following pape...
mit
6,944,172,194,449,163,000
36.918103
143
0.69285
false
schristakidis/p2ner
p2ner/components/plugin/holepuncher/holepuncher/holepuncher.py
1
8114
from p2ner.core.namespace import Namespace, initNS # Copyright 2012 Loris Corazza, Sakis Christakidis # # 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/l...
apache-2.0
1,949,153,275,522,752,800
32.390947
125
0.576165
false
wowkin2/react-redux-api
apps/courses.py
1
3362
from flask_restful import reqparse, abort, Resource from common import api, db from constants import HttpStatus, EMPTY_JSON from helpers import handle_bson COLL_COURSES = 'courses' course_parser = reqparse.RequestParser() course_parser.add_argument('id', required=True) course_parser.add_argument('title') course_par...
mit
4,885,421,960,994,691,000
31.019048
90
0.560976
false
Clinical-Developers/Clinical_Developer_Challenges
HCAs-Nurses/Solution.py
1
1260
# This is a maths problem not primarily a progamming one. # As such the solution function call might look like this: This is probably the most compact/clever way to express it in Python. def staffing(staff_units, patients): HCA, nurse = 2*staff_units-patients/2, patients/2-staff_units if HCA < 0 or nurse < 0 o...
gpl-3.0
-7,423,222,444,443,985,000
36.058824
128
0.706349
false
gooddata/openstack-nova
nova/tests/unit/virt/xenapi/test_vm_utils.py
1
104532
# Copyright 2013 OpenStack Foundation # 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 requ...
apache-2.0
6,270,026,338,861,540,000
42.446384
79
0.574169
false
bewareoftheapp/fluxapp
user/migrations/0001_initial.py
1
1219
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-09-18 23:37 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import user.models class Migration(migrations.Migration): initial = True dependencies = ...
mit
-2,177,746,098,601,376,000
32.861111
121
0.607055
false
tkchafin/mrbait
tests/benchmark_MIS.py
1
5580
#!/usr/bin/python import networkx as nx import time import networkx.algorithms.approximation as nxaa import matplotlib.pyplot as plt import numpy as np from networkx.utils import powerlaw_sequence """Code for ATTEMPTING to approximate the maximal independent set in a graph of conflicting sequences (e.g. aligned > thr...
gpl-3.0
7,596,444,725,467,537,000
31.823529
101
0.62957
false
skapfer/rubber
src/depend.py
1
11127
""" This module contains code for handling dependency graphs. """ # vim: noet:ts=4 import logging msg = logging.getLogger (__name__) import os.path import subprocess import rubber.contents from rubber.util import _ class MakeError (Exception): def __init__ (self, msg, errors): super (MakeError, self).__in...
gpl-2.0
1,698,966,926,278,784,000
35.126623
89
0.512717
false
bavardage/qtile
libqtile/widget/base.py
1
5948
from .. import command, utils, bar LEFT = object() CENTER = object() class _Drawer: """ A helper class for drawing and text layout. """ _fallbackFont = "-*-fixed-bold-r-normal-*-15-*-*-*-c-*-*-*" def __init__(self, qtile, window): self.qtile, self.window = qtile, window self.win...
mit
11,768,831,008,628,596
31.502732
94
0.566745
false
TribeMedia/synapse
synapse/rest/client/versions.py
2
1082
# -*- coding: utf-8 -*- # Copyright 2016 OpenMarket 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 la...
apache-2.0
-1,936,070,100,155,265,500
27.473684
74
0.669131
false
elopio/snapcraft
snapcraft/internal/lxd/_cleanbuilder.py
1
2770
#!/usr/bin/python3 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2017 Canonical Ltd # # 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. # # This program...
gpl-3.0
4,744,793,001,829,084,000
40.343284
76
0.646209
false
i-wind/pyqt_todo
db/model.py
1
2729
#!/usr/bin/env python # -*- coding: utf8 -*- """ @script : model.py @created : 2012-11-04 01:48:15.090 @changed : 2012-11-08 10:26:47.237 @creator : mkpy.py --version 0.0.27 @author : Igor A.Vetrov <qprostu@gmail.com> @about : model of TODO application """ from __future__ import print_function from argparse import...
mit
-2,385,009,913,102,353,000
30.011364
108
0.584463
false
UltrosBot/Ultros3K
tests/storage/config/test_ini.py
1
3888
# coding=utf-8 import os import secrets import shutil import tempfile from nose.tools import assert_equal, assert_true, assert_raises from unittest import TestCase from ultros.core.storage.config.ini import INIConfig from ultros.core.storage.manager import StorageManager __author__ = "Gareth Coles" class TestINI(...
artistic-2.0
5,767,956,039,330,450,000
24.083871
130
0.495628
false
vandenheuvel/tribler
Tribler/community/market/core/ttl.py
1
1473
class Ttl(object): """ The time to live is used for keeping track of how many nodes have relayed this messages. The number of relayed nodes should be kept low to prevent a flooding of the overlay network. Two was chosen because it provides the best balance between flooding the network and still reac...
lgpl-3.0
-1,377,557,892,165,886,200
26.792453
98
0.583842
false
trevor/calendarserver
txdav/caldav/datastore/scheduling/test/test_utils.py
1
7711
## # Copyright (c) 2013-2014 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
683,524,874,323,820,200
33.734234
128
0.652315
false
n-west/gnuradio-utils
json_plotter.py
1
6162
#!/usr/bin/python import json import re import copy import argparse import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np def read_results(input_file, kernels_regexp_list): ''' Read JSON output of volk_profile returning dict of results with filename being the top level...
gpl-2.0
-3,680,296,431,761,844,000
41.205479
135
0.632262
false
synctree/synctree-awsebcli
ebcli/lib/aws.py
1
10403
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
apache-2.0
-8,400,662,935,267,153,000
31.108025
88
0.612804
false
dekked/dynamodb-mock
ddbmock/database/storage/sqlite.py
1
3773
# -*- coding: utf-8 -*- from ..item import Item from ddbmock import config import sqlite3, cPickle as pickle # I know, using global "variable" for this kind of state *is* bad. But it helps # keeping execution times to a sane value. In particular, this allows to use # in-memory version of sqlite conn = sqlite3.connect...
lgpl-3.0
7,474,325,584,043,636,000
37.111111
123
0.536973
false
uclouvain/osis_louvain
base/business/proposal_xls.py
1
4218
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-4,826,060,251,302,619,000
45.855556
109
0.64904
false
digitalocean/netbox
netbox/dcim/tests/test_models.py
1
20944
from django.core.exceptions import ValidationError from django.test import TestCase from circuits.models import * from dcim.choices import * from dcim.models import * from tenancy.models import Tenant class RackGroupTestCase(TestCase): def test_change_rackgroup_site(self): """ Check that all chi...
apache-2.0
6,810,999,451,422,508,000
35.551483
116
0.603419
false
adamwiggins/cocos2d
tools/skeleton/skeleton_editor.py
2
5454
import os, sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..')) # import math from math import pi, atan import cPickle import glob from optparse import OptionParser import pyglet from pyglet.gl import * from pyglet.window import key import cocos from cocos.director import director from cocos.sprit...
bsd-3-clause
6,242,549,518,128,177,000
31.464286
84
0.595526
false
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/work_group_v20.py
1
5166
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
2,386,846,838,889,565,700
30.120482
119
0.590205
false
argriffing/arbtkf91
repro/data_source.py
1
1854
""" yield stuff from a hardcoded data source """ from __future__ import print_function, division import os import numpy as np from numpy.testing import assert_array_equal, assert_equal from Bio import SeqIO __all__ = ['gen_files', 'gen_sequence_pairs'] #mypath = os.path.realpath('../../stamatakis/benchMark_data') ...
gpl-2.0
2,098,660,419,289,982,200
24.75
61
0.600863
false
Scriptkiddi/Ankipubsub-Client
pubsub/gui/auto_gen/ankipubsub_settings.py
1
2166
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ankipubsub_settings.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fr...
gpl-3.0
377,500,660,763,704,260
38.381818
79
0.672207
false
shmilee/gdpy3
src/loaders/tests/test_zipraw.py
1
1387
# -*- coding: utf-8 -*- # Copyright (c) 2020 shmilee import os import unittest import tempfile import zipfile ZIPFILE = os.path.join(os.path.dirname(__file__), 'raw.zip') @unittest.skipUnless(zipfile.is_zipfile(ZIPFILE), "'%s' is not a tar archive!" % ZIPFILE) class TestZipRawLoader(unittest.T...
mit
-3,828,489,281,951,191,600
29.152174
81
0.596972
false
Squishymedia/feedingdb
src/feeddb/feed/migrations/0005_name2title_drop_name.py
1
36453
from south.db import db from django.db import models from feeddb.feed.models import * class Migration: def forwards(self, orm): # Deleting field 'Trial.name' db.delete_column('feed_trial', 'name') # Deleting field 'Experiment.name' db.delete_column('feed_expe...
gpl-3.0
-1,834,002,616,285,841,700
81.659864
189
0.551093
false
dashea/redhat-upgrade-tool
redhat_upgrade_tool/sysprep.py
1
8052
# sysprep.py - utility functions for system prep # # Copyright (C) 2012 Red Hat Inc. # # 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 ...
gpl-2.0
5,812,619,654,188,032,000
34.315789
84
0.643939
false
jefftc/changlab
Betsy/Betsy/modules/preprocess_mas5.py
1
1766
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, antecedents, out_attributes, user_options, num_cores, outfile): """preprocess the inputfile with MAS5 using preprocess.py will g...
mit
-8,856,985,929,441,454,000
35.791667
78
0.620612
false
DedMemez/ODS-August-2017
coghq/DistributedCogHQExteriorDoor.py
1
1122
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.coghq.DistributedCogHQExteriorDoor from direct.interval.IntervalGlobal import * from direct.distributed.ClockDelta import * from toontown.toonbase import ToontownGlobals from direct.directnotify import DirectNotifyGlobal from direct.fsm import Cla...
apache-2.0
-3,317,920,898,135,819,300
38.142857
102
0.704991
false
MissionCriticalCloud/marvin
marvin/cloudstackAPI/updateNetwork.py
1
11415
"""Updates a network""" from baseCmd import * from baseResponse import * class updateNetworkCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """the ID of the network""" """Required""" self.id = None self.typeInfo['id'] = 'uuid' """Force up...
apache-2.0
-8,208,851,891,698,272,000
40.061151
133
0.599124
false
python-bonobo/bonobo
bonobo/errors.py
1
1729
from bonobo.util import get_name class InactiveIOError(IOError): pass class InactiveReadableError(InactiveIOError): pass class InactiveWritableError(InactiveIOError): pass class ValidationError(RuntimeError): def __init__(self, inst, message): super(ValidationError, self).__init__( ...
apache-2.0
5,472,049,810,391,471,000
24.426471
118
0.727588
false
seppius-xbmc-repo/ru
plugin.video.shura.tv/canal_list.py
1
6531
# -*- coding: utf-8 -*- dc={ "2x2" : "d001", "дождь" : "d002", "домашний" : "d003", "звезда" : "d004", "карусель" : "d005", "мир" : "d006", "нтв" : "d007", "первый канал" : "d008", "перец" : "d009", "пятый канал" : "d010", "рен тв" : "d011", "россия 1" : "d012", "россия 2" : "d013", "россия 24" : "d014", "россия к" : ...
gpl-2.0
5,042,035,012,302,814,000
24.045249
57
0.589266
false
anthonyfok/frescobaldi
frescobaldi_app/quickinsert/__init__.py
1
2553
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 ...
gpl-2.0
-3,089,438,219,552,527,000
34.458333
94
0.712495
false