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
amdegroot/ssd.pytorch
layers/box_utils.py
1
9435
# -*- coding: utf-8 -*- import torch def point_form(boxes): """ Convert prior_boxes to (xmin, ymin, xmax, ymax) representation for comparison to point form ground truth data. Args: boxes: (tensor) center-size default boxes from priorbox layers. Return: boxes: (tensor) Converted xmin, y...
mit
5,635,319,637,972,045,000
38.443515
80
0.594463
false
opendatatrentino/ckan-api-client
ckan_api_client/tests/unit/test_utils_diff.py
1
1092
from ckan_api_client.tests.utils.diff import diff_mappings, diff_sequences def test_diff_dicts(): dct1 = { 'one': 'VAL-1', 'two': 'VAL-2', 'three': 'VAL-3', 'four': 'VAL-4', 'five': 'VAL-5', } dct2 = { 'three': 'VAL-3', 'four': 'VAL-4-2', 'fi...
bsd-2-clause
2,361,998,526,642,072,000
26.3
74
0.508242
false
hyperreal/GanjaBot
magnet_utils.py
1
4242
# # This file is part of Magnet2. # Copyright (c) 2011 Grom PE # # Magnet2 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
-5,035,402,395,565,944,000
34.057851
813
0.635078
false
map0logo/hmm_tagging
bigram_tagging.py
1
10176
""" Implementation of bigram part-of speech (POS) tagger based on first-order hidden Markov models from scratch. """ from __future__ import division from __future__ import unicode_literals import numpy as np import pandas as pd import codecs POS_UNIVERSAL = ('VERB', 'NOUN', 'PRON', 'ADJ', 'ADV', 'ADP', ...
gpl-2.0
-3,219,382,188,687,192,000
30.214724
86
0.592571
false
TomAugspurger/pandas
pandas/tests/arrays/boolean/test_construction.py
1
12938
import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.arrays import BooleanArray from pandas.core.arrays.boolean import coerce_to_array @pytest.fixture def data(): return pd.array( [True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False], ...
bsd-3-clause
-719,118,255,221,504,500
36.393064
88
0.655588
false
YongseopKim/crosswalk-test-suite
wrt/wrt-packertool2-android-tests/packertool2/projectonlytest.py
1
3008
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
-4,399,023,799,283,816,400
47.516129
152
0.702793
false
suminb/translator
tests/test_translate_api.py
1
4303
# -*- coding: utf-8 -*- from translator.api import translate, HTTPException import pytest import json def test_translate_1(): """Tests translation where source language and target language are identical.""" actual = translate('This is a test', '1', 'en', 'en')['translated_text'] expected = 'This is...
gpl-3.0
-1,596,437,705,747,291,600
29.207143
79
0.665878
false
alvinwan/tex2py
setup.py
1
1510
import sys from setuptools import setup from setuptools.command.test import test as TestCommand install_requires = ['TexSoup==0.1.4', 'pptree==2.0'] tests_require = ['pytest', 'pytest-cov==2.5.1', 'coverage == 3.7.1', 'coveralls == 1.1'] # hack install_requires = install_requires + tests_require class PyTest(TestComm...
bsd-2-clause
-4,880,245,095,279,423,000
29.816327
88
0.635762
false
pepetreshere/odoo
addons/website/models/website_visitor.py
2
15826
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta import uuid import pytz from odoo import fields, models, api, _ from odoo.addons.base.models.res_partner import _tz_get from odoo.exceptions import UserError from odoo.tools.misc...
agpl-3.0
-45,463,958,355,934,510
48.611285
185
0.623784
false
marco-mariotti/selenoprofiles
libraries/networkx/algorithms/flow/mincost.py
1
26221
# -*- coding: utf-8 -*- """ Minimum cost flow algorithms on directed connected graphs. """ __author__ = """Loïc Séguin-C. <loicseguin@gmail.com>""" # Copyright (C) 2010 Loïc Séguin-C. <loicseguin@gmail.com> # All rights reserved. # BSD license. __all__ = ['network_simplex', 'min_cost_flow_cost', ...
gpl-2.0
4,067,730,387,553,061,400
35.821629
104
0.56265
false
DavidPowell/OpenModes
openmodes/helpers.py
1
6055
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # OpenModes - An eigenmode solver for open electromagnetic resonantors # Copyright (C) 2013 David Powell # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
gpl-3.0
-6,340,580,178,052,489,000
30.536458
103
0.61635
false
drewcsillag/skunkweb
pylibs/skunkdoc/scanners/common.py
1
1465
# # Copyright (C) 2001 Andrew T. Csillag <drew_csillag@geocities.com> # # You may distribute under the terms of either the GNU General # Public License or the SkunkWeb License, as specified in the # README file. # import sys import string import ParseSkunkDoc def doDocString(s): """**if <cod...
gpl-2.0
-243,526,687,297,408,400
30.847826
78
0.526962
false
Hossein-Noroozpour/PyHDM
hml/testunits/test_001.py
1
2306
#!/usr/bin/python3.3 __author__ = 'Hossein Noroozpour Thany Abady' from hml.core.HDataEncoderM2 import EncM2 from sklearn.preprocessing import scale from sklearn.preprocessing import normalize from sklearn.decomposition import PCA from sklearn.tree import DecisionTreeClassifier from sklearn.svm import SVC from sklearn....
mit
-5,941,045,483,948,872,000
35.619048
81
0.634432
false
AlertaDengue/AlertaDengue
AlertaDengue/dbf/tests/test_validation.py
1
3682
from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.files import File from django.test import TestCase from datetime import date import unittest # local from dbf.models import DBF from dbf.validation import is_valid_dbf import datetime import os __all__ = ...
gpl-3.0
-1,538,261,545,143,088,000
35.82
79
0.630092
false
rave-engine/rave
modules/opengl/core3/texture.py
1
3655
from OpenGL import GL import numpy import ctypes from . import shaders class Texture: __slots__ = ('width', 'height', 'data', 'texture') def __init__(self, width, height, data): self.width = width self.height = height self.data = data self.texture = GL.glGenTextures(1) ...
bsd-2-clause
4,593,637,646,586,049,500
33.158879
166
0.59617
false
puolival/multipy
multipy/scripts/analyze_data.py
1
1952
# -*- encoding: utf-8 -*- """Script for analyzing data from the simulated primary and follow-up experiments.""" # Allow importing modules from parent directory. import sys sys.path.append('..') from fdr import lsu, tst, qvalue from fwer import bonferroni, sidak, hochberg, holm_bonferroni from permutation import tfr_p...
bsd-3-clause
-2,987,823,949,373,830,000
30.483871
73
0.656762
false
aESeguridad/GERE
venv/lib/python2.7/site-packages/weasyprint/layout/markers.py
1
2049
# coding: utf-8 """ weasyprint.layout.markers ------------------------- Layout for list markers (for ``display: list-item``). :copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division, unicode_literals ...
gpl-3.0
6,302,328,897,577,311,000
36.181818
78
0.627384
false
jjhelmus/berryconda
tools/find_outdated_packages_pypi.py
1
3975
#! /usr/bin/env python """ Find conda packages which are out of date compared to PyPI. """ import argparse import json import xmlrpc.client as xmlrpclib import conda.api as api try: from packaging.version import parse as parse_version except ImportError: from pip._vendor.packaging.version import parse as par...
bsd-3-clause
-6,458,492,364,811,764,000
33.868421
79
0.636226
false
am0d/bit
bit/utils.py
1
1479
# Utility functions for various actions import os import sys import time import shutil import hashlib from bit.instance import bit from bit.cprint import error, warning def hash(file_name): try: with open(file_name, 'rb') as hashable: algo = hashlib.new(bit.options.hash_type) algo...
bsd-3-clause
7,232,347,731,415,690,000
28.58
82
0.615957
false
Schibum/naclports
lib/naclports/pkg_info.py
1
3150
# Copyright 2014 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shlex import string from naclports.error import PkgFormatError VALID_KEYS = ['NAME', 'VERSION', 'URL', 'ARCHIVE_ROOT', 'LICENSE', 'DEPENDS', ...
bsd-3-clause
-8,466,547,247,953,835,000
35.627907
78
0.578413
false
Azure/azure-sdk-for-python
sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_operations.py
1
4791
# 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 may ...
mit
7,840,496,075,989,891,000
42.954128
133
0.643498
false
romain-fontugne/RTTanalysis
dpgmm.py
1
8500
import numpy as np import glob import dpcluster as dpc import pandas as pd import os import sys try: import matplotlib.pylab as plt import matplotlib as mpl except Exception, e: sys.stderr.write("Matplotlib is not available!") def loadData(filename, format="rttEstimate"): """Load a csv file in me...
gpl-2.0
-7,810,559,939,886,170,000
31.319392
118
0.601765
false
WuShichao/computational-physics
2/figure_2_2/figure_2_2.py
1
1143
# -*- coding: utf-8 -*- """ Created on Sun Jan 10 15:52:36 2016 P23 figure2.2的源程序 @author: nightwing """ import matplotlib.pyplot as plt DENSITY = 1.29 #空气密度(kg/m3) C = 1.0 #阻力系数 A = 0.33 #截面积(m2) M = 70.0 #人车质量(kg) v1 = 4.0 #(无阻力)速度(m/s) v2 = 4.0 #(有阻力)速度(m/s) P = 400.0 #功率(w) t =...
gpl-3.0
-5,247,181,144,916,056,000
22.8
59
0.560463
false
owen-chen/wireless-testing-platform
wtp/DeviceUtils.py
1
3223
# -*- coding: utf-8 -*- ''' Created on May 21, 2015 @author: chenchen ''' import os from CommonLib import callCommand class DeviceUtils: processlock = '/sdcard/processlock.pid' """ 根据手机序列号获取手机产品型号 """ @staticmethod def getProductBySerial(serial): return callCommand("adb -s %s shell getp...
gpl-2.0
-2,518,703,167,617,819,000
34.949367
159
0.63156
false
antoinedube/django-spine-news-display
Server/RadioCanada/infrastructure.py
1
1266
from django.utils import timezone from urllib.request import urlopen import xml.etree.ElementTree as et import json from RadioCanada.models import NewsItem class Downloader: def __init__(self): pass def fetch(self): f = urlopen('http://rss.radio-canada.ca/fils/nouvelles/nouvelles.xml') ...
gpl-3.0
1,697,606,006,735,934,000
26.521739
78
0.548973
false
weltliteratur/vossanto
theof/graph.py
1
3086
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Reads source-modifier pairs and outputs a graphviz .dot file. # # Usage: # # Author: rja # # Changes: # 2018-08-17 (rja) # - initial version import fileinput import math import random from collections import Counter def filter_graph(sources, modifiers, edges): fi...
gpl-3.0
2,003,152,647,947,842,300
29.254902
148
0.579391
false
dmitriy0611/django
django/db/migrations/executor.py
1
10302
from __future__ import unicode_literals from django.apps.registry import apps as global_apps from django.db import migrations from .loader import MigrationLoader from .recorder import MigrationRecorder from .state import ProjectState class MigrationExecutor(object): """ End-to-end migration execution - load...
bsd-3-clause
917,353,421,160,323,000
46.256881
115
0.599981
false
psychopy/versions
psychopy/core.py
1
5931
#!/usr/bin/env python # -*- coding: utf-8 -*- """Basic functions, including timing, rush (imported), quit """ # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2020 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). from __future__ import abs...
gpl-3.0
8,450,671,426,704,044,000
34.303571
79
0.669364
false
HITGmbH/py-convergent-encryption
tests/test_crypto.py
1
8807
# Copyright (c) 2011, HIT Information-Control GmbH # 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,...
bsd-3-clause
-2,827,714,815,581,517,000
39.773148
140
0.647212
false
ianblenke/awsebcli
ebcli/bundled/botocore/utils.py
1
18227
# Copyright 2012-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 ac...
apache-2.0
4,503,787,993,518,301,700
33.390566
82
0.600208
false
jepler/linuxcnc-mirror
tests/tool-info/random-no-startup-tool/test-ui.py
1
8177
#!/usr/bin/env python import linuxcnc import hal import math import time import sys import subprocess import os import signal import glob import re def wait_for_linuxcnc_startup(status, timeout=10.0): """Poll the Status buffer waiting for it to look initialized, rather than just allocated (all-zero). Retu...
lgpl-2.1
-7,770,383,162,234,791,000
30.817121
159
0.660756
false
fluo-io/fluo-deploy
lib/tests/ec2/test_config.py
1
6124
# # 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 us...
apache-2.0
-129,113,717,068,885,630
35.452381
74
0.595526
false
bradmwalker/wanmap
sandbox/run.py
1
8687
#!/usr/bin/python3 """ Create a network and inject scanner agents. """ from ipaddress import ip_interface import logging from pathlib import Path from signal import signal, SIGINT, SIGTERM import subprocess import sys from threading import Thread from time import sleep from typing import Sequence import libvirt impor...
mit
868,238,204,597,778,200
30.589091
87
0.596063
false
jabesq/home-assistant
homeassistant/components/amcrest/camera.py
1
17637
"""Support for Amcrest IP cameras.""" import asyncio from datetime import timedelta import logging from urllib3.exceptions import HTTPError from amcrest import AmcrestError import voluptuous as vol from homeassistant.components.camera import ( Camera, CAMERA_SERVICE_SCHEMA, SUPPORT_ON_OFF, SUPPORT_STREAM) from ho...
apache-2.0
6,563,436,508,412,655,000
35.515528
79
0.594829
false
IskyN/submeter-bill-generator
get_submeter_data.py
1
6582
from sys import stdout from os import makedirs from os.path import exists, abspath from requests import Session from datetime import datetime, timedelta from getpass import getpass periods_path = abspath(__file__ + "/../periods.txt") site_url = "http://meterdata.submetersolutions.com" login_url = "/login.php" file_ur...
apache-2.0
4,653,421,852,300,319,000
36.827586
93
0.558037
false
Glottotopia/aagd
moin/local/moin/MoinMoin/macro/_tests/test_Hits.py
1
3829
# -*- coding: iso-8859-1 -*- """ MoinMoin - MoinMoin.macro Hits tested @copyright: 2007-2008 MoinMoin:ReimarBauer @license: GNU GPL, see COPYING for details. """ import os from MoinMoin import caching, macro from MoinMoin.logfile import eventlog from MoinMoin.PageEditor import PageEditor from ...
mit
7,299,168,824,747,804,000
43.047059
104
0.64116
false
briennakh/BIOF509
Wk02/genetic_algorithm_optimizer.py
1
5552
"""Module to calculate best path between multiple points, using genetic algorithm Functions: new_path -- path altering function that creates a new path distance -- cost function that calculates distance as the cost of a path select_best -- function that selects the best paths in a population recombine -- path altering...
mit
957,501,307,047,593,300
42.359375
115
0.698018
false
amkahn/event-extraction
extract_events.py
1
12233
#!/usr/bin/python # Written by Andrea Kahn # Last updated Aug. 29, 2014 ''' This script takes as input: 1) A path to a file containing patients' clinic notes, each line having the format: MRN [tab] date [tab] description [tab] note (one note per line; date must be in format YYYY-MM-DD, YYYY-MM, or YYYY) 2) A path to...
mit
6,596,118,473,499,229,000
45.340909
422
0.622578
false
opentrials/opentrials-airflow
dags/pubmed.py
1
1359
import datetime from airflow.models import DAG from airflow.operators.latest_only_operator import LatestOnlyOperator import utils.helpers as helpers args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime.datetime(2017, 4, 1), 'retries': 1, } dag = DAG( dag_id='pubmed', d...
mpl-2.0
7,137,762,957,153,894,000
23.709091
73
0.729948
false
evfredericksen/gmapsbounds
gmapsbounds/reader.py
1
6819
from gmapsbounds import utils from gmapsbounds import constants from gmapsbounds import llpx from gmapsbounds import polygon def get_nodes(rgb_image): nodes = [] width, height = rgb_image.size do_not_check = set() menu_borders = utils.get_menu_borders(rgb_image) for x in range(width): for y...
mit
9,046,952,827,354,978,000
37.971429
101
0.555947
false
arunchandramouli/fanofpython
code/features/datatypes/lists1.py
1
3368
''' Aim :: To demonstrate the use of a list Define a simple list , add values to it and iterate and print it A list consists of comma seperated values which could be of any type which is reprsented as [,,,,] .. all values are enclosed between '[' and ']' ** A list object is a mutable datatype which means it...
gpl-3.0
158,409,647,628,030,750
19.542683
149
0.663005
false
deepmind/spriteworld
spriteworld/configs/cobra/exploration.py
1
2320
# Copyright 2019 DeepMind Technologies Limited. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
-3,151,919,387,541,338,600
30.780822
78
0.677155
false
IntersectAustralia/dc2c
mecat/rifcs/publishservice.py
1
2428
from tardis.tardis_portal.publish.publishservice import PublishService PARTY_RIFCS_FILENAME = "MyTARDIS-party-%s.xml" COLLECTION_RIFCS_FILENAME = "MyTARDIS-%s-dataset-%s.xml" class PartyPublishService(PublishService): def get_template(self, type): return self.provider.get_template(type=type) ...
gpl-3.0
-6,296,705,034,827,789,000
43.163636
107
0.601318
false
CSIS/proccer
src/proccer/t/test_periodic.py
1
1030
from __future__ import with_statement from datetime import datetime, timedelta from mock import patch from proccer.database import Job from proccer.periodic import main from proccer.t.testing import setup_module def test_periodic(): still_bad_job = Job.create(session, 'foo', 'bar', 'baz') still_bad_job.last_...
mit
-5,977,464,837,307,305,000
33.333333
79
0.683495
false
houqp/floyd-cli
floyd/cli/experiment.py
1
11976
import click from tabulate import tabulate from time import sleep import webbrowser import sys from shutil import copyfile import os import floyd from floyd.cli.utils import ( get_module_task_instance_id, normalize_job_name, get_namespace_from_name ) from floyd.client.experiment import ExperimentClient fro...
apache-2.0
-4,036,297,198,941,373,000
35.181269
150
0.632933
false
raphaelgyory/django-rest-messaging-centrifugo
runtests.py
1
2355
#! /usr/bin/env python from __future__ import print_function import pytest import sys import os import subprocess PYTEST_ARGS = { 'default': ['tests'], 'fast': ['tests', '-q'], } FLAKE8_ARGS = ['rest_messaging_centrifugo', 'tests', '--ignore=E501'] sys.path.append(os.path.dirname(__file__)) def exit_on_...
isc
-397,090,748,982,040,600
24.879121
75
0.592357
false
arthurdejong/python-stdnum
stdnum/eu/vat.py
1
5505
# vat.py - functions for handling European VAT numbers # coding: utf-8 # # Copyright (C) 2012-2021 Arthur de Jong # Copyright (C) 2015 Lionel Elie Mamane # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Soft...
lgpl-2.1
-3,631,167,909,865,830,000
35.946309
87
0.695186
false
tinloaf/home-assistant
homeassistant/components/homekit_controller/__init__.py
1
10546
""" Support for Homekit device discovery. For more details about this component, please refer to the documentation at https://home-assistant.io/components/homekit_controller/ """ import json import logging import os from homeassistant.components.discovery import SERVICE_HOMEKIT from homeassistant.helpers import disco...
apache-2.0
554,708,964,111,326,800
34.870748
78
0.591125
false
williamroot/opps
opps/channels/admin.py
1
3732
# -*- coding: utf-8 -*- from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from mptt.admin import MPTTModelAdmin from .models import Channel from .forms import ChannelAdminForm from opps.core.admin import PublishableAdmin from opps.core.admin import apply_opps_rules from opps.cor...
mit
-3,664,716,400,936,687,000
34.542857
79
0.556002
false
foursquare/pants
tests/python/pants_test/engine/scheduler_test_base.py
1
3930
# coding=utf-8 # Copyright 2015 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 import shutil from builtins import object from pants.base.file_system_project_...
apache-2.0
5,303,034,757,333,562,000
37.529412
100
0.692366
false
ptrsxu/snippetpy
ds/ringbuffer.py
1
1268
#!/usr/bin/env python # -*- coding: utf-8 -*- """from python cookbook 2nd edition.""" class RingBuffer(object): """ a ringbuffer not filled """ def __init__(self, size_max): self.max = size_max self.data = [] class __Full(object): """ a ringbuffer filled """ def append(se...
mit
683,121,483,345,865,500
22.924528
63
0.518927
false
TheProjecter/jxtl
test/test.py
1
1738
# # $Id$ # # Description # Runs the same tests, but does it by using the Python language bindings. # The Python bindings need to be be built and installed to run this. # # Copyright 2010 Dan Rinehimer # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
apache-2.0
-1,674,219,676,627,167,200
30.6
75
0.659379
false
FourthLion/pydatasentry
pydatasentry/capture.py
1
1585
#!/usr/bin/env python import uuid import inspect import json import os, sys import copy from .config import get_config from .helpers import dumper, merge from .process import summarize_run def capture_input(args, kwargs, metadata): """ Capture the function parameters for the functions that have been ins...
mit
5,243,514,757,579,922,000
23.384615
81
0.536278
false
mrakitin/sirepo
sirepo/srdb.py
1
1714
# -*- coding: utf-8 -*- u"""db configuration :copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkconfig from pykern import pkinspect from pykern import pki...
apache-2.0
8,552,786,995,130,998,000
29.070175
75
0.63769
false
StichtingOpenGeo/transitpubsub
src/zmq_network.py
1
1444
from consts import ZMQ_SERVER_NETWORK, ZMQ_PUBSUB_KV17 from network import network from helpers import serialize import zmq import sys # Initialize the cached network sys.stderr.write('Caching networkgraph...') net = network() sys.stderr.write('Done!\n') # Initialize a zeromq context context = zmq.Context() # Set up...
agpl-3.0
4,215,510,292,400,556,500
30.391304
130
0.693906
false
maxalbert/colormap-selector
mapping_3d_to_2d_test.py
1
1798
import numpy as np from cross_section import Plane from mapping_3d_to_2d import * def test_initialise_mapping_3d_to_2d_simple(): """ Check that for a plane orthogonal to the x-axis the transformation simply drops the constant x-coordinate. """ plane1 = Plane([50, 0, 0], n=[1, 0, 0]) f1 = Mappi...
mit
6,102,046,278,074,886,000
33.576923
82
0.585095
false
bram85/topydo
test/test_view.py
1
1542
# Topydo - A todo.txt client written in Python. # Copyright (C) 2014 - 2015 Bram Schoenmakers <bram@topydo.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 3 of the License,...
gpl-3.0
3,500,970,238,699,097,000
35.714286
71
0.723735
false
thoreg/suds
suds/client.py
1
25571
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will b...
lgpl-3.0
7,985,433,385,657,277,000
31.95232
82
0.573032
false
liamcurry/py3kwarn
py3kwarn2to3/pgen2/pgen.py
1
13781
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Pgen imports from __future__ import print_function from . import grammar, token, tokenize class PgenGrammar(grammar.Grammar): pass class ParserGenerator(object): def __init__(self, filenam...
mit
-1,833,032,193,287,119,000
34.702073
78
0.495682
false
JNU-Include/CNN
Test/lab-11-4-mnist_cnn_ensemble2.py
1
2134
# Lab 11 MNIST and Deep learning CNN import tensorflow as tf from lib.ensemble.ensemble_core import EnsembleCore from lib.ensemble.mnist_core import MnistCore from lib.ensemble.cnn_core import CNNCore class MyCNN (CNNCore): def init_network(self): self.set_placeholder(784, 10, 28, 28) self.DO = tf...
mit
3,337,229,261,010,518,000
26.358974
73
0.628397
false
compas-dev/compas
src/compas_rhino/objects/inspectors/meshinspector.py
1
3026
from __future__ import print_function from __future__ import absolute_import from __future__ import division from System.Collections.Generic import List from System.Drawing.Color import FromArgb from Rhino.Geometry import Point3d from Rhino.Geometry import Line from compas_rhino.conduits import BaseConduit from compa...
mit
1,955,176,110,724,072,700
33
127
0.618638
false
dls-controls/pymalcolm
tests/test_profiler.py
1
2778
import ast import logging import time import unittest from malcolm.profiler import Profiler # https://github.com/bdarnell/plop/blob/master/plop/test/collector_test.py class ProfilerTest(unittest.TestCase): def filter_stacks(self, results): # Kind of hacky, but this is the simplest way to keep the tests ...
apache-2.0
-715,875,177,703,284,500
31.682353
85
0.527358
false
mysociety/pombola
pombola/core/kenya_import_scripts/import_contacts_from_tuples.py
1
1646
#!/usr/bin/env python import os import sys # Horrible boilerplate - there must be a better way :) sys.path.append( os.path.abspath( os.path.dirname(__file__) + '../../..' ) ) from pombola.core import models from django.contrib.contenttypes.models import ContentType import mp_contacts phone_kind ...
agpl-3.0
-652,200,642,074,956,900
22.514286
82
0.565006
false
linuxscout/tashaphyne
tashaphyne/stemming.py
1
47427
# -*- coding: UTF-8 -*- """ Arabic Light Stemmer A class which provides a configurable stemmer and segmentor for arabic text. Features: ========= - Arabic word Light Stemming. - Root Extraction. - Word Segmentation - Word normalization - Default Arabic Affixes list. - An customizable Light ste...
gpl-3.0
-4,222,205,376,867,603,500
34.792945
136
0.546386
false
fpsw/Servo
servo/forms/devices.py
1
2204
# -*- coding: utf-8 -*- from django import forms from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from servo.models import Tag, Device, Customer from servo.forms import DatepickerInput, AutocompleteCharField product_lines = [(k, x['name']) for k, x in Device.PRODU...
bsd-2-clause
-8,518,432,263,230,593,000
28.783784
81
0.632033
false
kevinselwyn/pokestop
api.py
1
5080
#!/usr/bin/python # coding=utf-8 """Pokéstop API""" import sys import argparse import json from pokestop import Pokestop from flask import Flask, jsonify from flask_restful import Api, reqparse, Resource #----------------------------------------------------------------# # Constants HOSTNAME = '0.0.0.0' PORT ...
gpl-3.0
4,443,108,776,689,280,500
23.394231
110
0.493102
false
Jamonek/Robinhood
docs/conf.py
1
2026
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- projec...
mit
3,453,407,910,459,892,000
31.15873
78
0.671273
false
nke001/attention-lvcsr
libs/Theano/theano/sandbox/cuda/cula.py
1
3988
import pkg_resources import theano from theano.sandbox.cuda.type import CudaNdarrayType from theano.sandbox.cuda import GpuOp from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable try: from theano.sandbox.cuda import cuda_ndarray dimshuffle = cuda_ndarray.cuda_ndarray.dimshuffle except ImportErro...
mit
737,977,525,252,001,200
27.898551
77
0.515547
false
tkln/HelvarNet
http_gateway.py
1
1266
#!/usr/bin/python3 import http.server import socketserver import helvar helvarNet = helvar.HelvarNet('10.254.1.2', 50000) leds = [helvar.LedUnit(helvarNet, '1.2.1.1'), helvar.LedUnit(helvarNet, '1.2.1.2'), helvar.LedUnit(helvarNet, '1.2.1.3'), helvar.LedUnit(helvarNet, '1.2.1.4'), ...
mit
3,007,065,090,095,122,400
28.44186
63
0.578989
false
ddico/account-financial-tools
account_reversal/tests/test_account_reversal.py
1
4593
# -*- coding: utf-8 -*- # Copyright 2014 Stéphane Bidoul <stephane.bidoul@acsone.eu> # Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.tests.common import TransactionCase import random class TestAccountReversal(TransactionCase...
agpl-3.0
-5,675,361,029,071,802,000
36.333333
76
0.514155
false
levilucio/SyVOLT
UMLRT2Kiltera_MM/Properties/from_thesis/HMM1_then1_ConnectedLHS.py
1
2650
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HMM1_then1_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HMM1_then1_ConnectedLHS. """ #...
mit
8,863,518,393,962,690,000
42.442623
125
0.47434
false
digris/openbroadcast.org
website/apps/alibrary/models/artistmodels.py
1
13676
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import os import uuid import arating import tagging from alibrary.models import MigrationMixin, Relation, Profession from alibrary.util.slug import unique_slugify from alibrary.util.storage import get_dir_for_object, OverwriteStorage from ...
gpl-3.0
-6,412,760,050,981,160,000
29.663677
92
0.602369
false
justinvanwinkle/wextracto
tests/test_etree.py
1
7886
from __future__ import unicode_literals, print_function from six import BytesIO from lxml import html from operator import itemgetter from wex.cache import Cache from wex.response import Response, parse_headers from wex import etree as e from wex.iterable import first, flatten example = b"""HTTP/1.1 200 OK X-wex-reque...
bsd-3-clause
1,704,647,111,772,380,400
27.064057
76
0.593584
false
heLomaN/NetCrawler
nga_hot.py
1
1579
#!/usr/bin/env python # coding=utf-8 import requests as rq import random as rd import sys reload(sys) sys.setdefaultencoding('utf-8') headers = { 'Connection': 'keep-alive', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) Apple...
apache-2.0
-929,872,826,803,928,700
25.762712
126
0.670044
false
lynchnf/maneki-neko-web
socialmedia/tests.py
1
1601
from django.test import TestCase from cms.api import add_plugin from cms.models import Placeholder from socialmedia.cms_plugins import SocialLinkPlugin from socialmedia.models import ICON_CHOICES class SocialLinkPluginTest(TestCase): def test_plugin_context(self): placeholder = Placeholder.objects.creat...
mit
-7,077,663,203,663,897,000
38.073171
160
0.613991
false
smartdong/PythonPractise
Chapter 04/BombCatcher.py
1
1793
import sys, random, time, pygame from pygame.locals import * def print_text(font, x, y, text, color=(255,255,255)): imgText = font.render(text, True, color) screen.blit(imgText, (x,y)) pygame.init() screen = pygame.display.set_mode((600,500)) pygame.display.set_caption("Bomb Catching Game") font1 = pygame.font.Font...
mit
-304,384,762,807,505,800
20.105882
68
0.625767
false
PHLF/rasa_nlu
_pytest/test_sanity.py
1
2984
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import import importlib import pkgutil from collections import defaultdict import pytest from multiprocessing import Queue, Process from six import PY2 def import_submodules(...
apache-2.0
-1,151,380,040,605,416,700
32.155556
111
0.656836
false
eduardoklosowski/ergo-notes
ergonotes/migrations/0001_initial.py
1
1776
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
agpl-3.0
-3,621,076,773,664,285,700
45.684211
216
0.56708
false
asimshankar/tensorflow
tensorflow/python/keras/integration_test.py
1
13458
# Copyright 2016 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
-2,980,240,026,002,302,500
40.409231
80
0.588572
false
g2p/SimpleTAL
examples/elementtree-example/basic-example.py
1
2377
#!/usr/bin/python """ Example TAL program Copyright (c) 2009 Colin Stewart (http://www.owlfish.com/) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must ...
bsd-3-clause
628,443,351,640,474,600
37.967213
75
0.766933
false
techtonik/warehouse
tests/accounts/test_db.py
1
1989
# Copyright 2013 Donald Stufft # # 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, so...
apache-2.0
6,569,239,910,698,849,000
27.414286
74
0.641528
false
CiscoSystems/nova
nova/tests/test_notifications.py
1
13358
# Copyright (c) 2012 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 ...
apache-2.0
-8,300,314,221,059,833,000
40.484472
78
0.64613
false
DataDog/integrations-extras
storm/tests/conftest.py
1
1254
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import os import socket import pytest from datadog_checks.dev import docker_run, get_here, run_command from datadog_checks.dev.conditions import WaitFor from .common import HOST, INSTANCE def wait_for_thrift()...
bsd-3-clause
-365,325,387,029,298,400
35.882353
110
0.69059
false
Suwmlee/XX-Net
Python3/lib/socket.py
1
27859
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are avai...
bsd-2-clause
-947,895,180,707,628,000
35.800543
95
0.56786
false
Heappl/scripts
context.py
1
3041
#!/usr/bin/python3 def parse_commandline_options(): from optparse import OptionParser parser = OptionParser() parser.add_option("-s", "--stack", action='store_true', dest="stack", help="produces stack trace for each running component") parser.add_option("-l", "--last_line", type='int', dest="line"...
gpl-2.0
6,712,782,048,356,157,000
32.788889
130
0.585334
false
yiwen-luo/LeetCode
Python/design-log-storage-system.py
1
1067
# Time: put: O(1) # retrieve: O(n + dlogd), n is the size of the total logs # , d is the size of the found logs # Space: O(n) class LogSystem(object): def __init__(self): self.__logs = [] self.__granularity = {'Year': 4, 'Month': 7, 'Day': 10, \ ...
mit
8,674,042,364,039,677,000
25.675
69
0.469541
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
pelme/vasa
vasa/http/endpoints.py
1
1052
import asyncio import mimetypes from pathlib import Path from .response import DataResponse, ResponseNotFound @asyncio.coroutine def index(request, writer, settings): full_path = (Path(settings.webapp_root) / 'index.html').resolve() with full_path.open('rb') as f: return DataResponse(writer, data=f....
mit
-6,921,504,578,001,710,000
28.222222
77
0.689163
false
ezralanglois/arachnid
arachnid/core/parallel/process_tasks.py
1
12031
''' Common parallel/serial design patterns This module defines a set of common tasks that can be performed in parallel or serial. .. Created on Jun 23, 2012 .. codeauthor:: Robert Langlois <rl2528@columbia.edu> ''' import process_queue import logging import numpy.ctypeslib import multiprocessing.sharedctypes _logge...
gpl-2.0
7,339,000,769,296,700,000
36.596875
134
0.555232
false
penguintutor/networking-quiz
src/quizstrings.py
1
2597
# Text has been moved to this class, potential to add different languages in future # Note that this is not complete, some text (eg. buttons) has not been changed # The corresponding json file, must be consistant by having all entries for all pages # If an entry is not required (or is updated using a different method ...
gpl-3.0
1,300,464,390,233,187,300
42.3
199
0.562187
false
RoboJackets/robocup-software
soccer/gameplay/tactics/positions/celebration.py
1
2691
import behavior import robocup import constants import single_robot_composite_behavior import main import enum import skills import random import time class Celebration( single_robot_composite_behavior.SingleRobotCompositeBehavior): MaxSpinAngle = 360 SpinPerTick = 1 class State(enum.Enum): ...
apache-2.0
-893,343,985,385,578,400
31.421687
77
0.586771
false
ncadou/proctor
proctor/tor.py
1
10805
from datetime import datetime from itertools import chain, cycle from os import path from threading import Event, Lock, Thread from time import sleep import socks from desub import desub from proctor.socket import InstrumentedSocket import logging log = logging.getLogger(__name__) class TorProcess(Thread): """...
bsd-3-clause
-6,406,841,245,967,044,000
38.870849
79
0.537436
false
qiyuangong/Basic_Mondrian
basic_mondrain_test.py
1
1879
import unittest from mondrian import mondrian # from utils.read_data import read_data, read_tree from models.gentree import GenTree from models.numrange import NumRange import random import pdb # Build a GenTree object ATT_TREE = [] def init(): global ATT_TREE ATT_TREE = [] tree_temp = {} tree = Gen...
mit
86,076,437,654,644,900
26.632353
59
0.432145
false
KanoComputing/terminal-quest
linux_story/story/challenges/challenge_10.py
1
6406
# challenge_10.py # # Copyright (C) 2014-2016 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2 # # A chapter of the story from linux_story.StepTemplate import StepTemplate from linux_story.step_helper_functions import unblock_commands_with_cd_hint from linux_story.story.terminals.termin...
gpl-2.0
7,936,211,760,984,238,000
28.657407
96
0.503278
false
saikrishnar/AudioRenderingofSTEM
systems/technique3/code/3.py
1
13759
# -*- coding: utf-8 -*- from lxml import etree as et import sys import os # for TTS(default system TTS) import pyttsx #coding: utf-8 #function that reads the xhtml file and returns the root of the document def getData(fname): with open(fname) as f: parser = et.XMLParser(load_dtd=True, no_network=False,resolve_...
apache-2.0
-669,407,135,783,003,500
27.819706
124
0.590456
false
GoteoFoundation/goteo-api
goteoapi/ratelimit.py
1
1974
# -*- coding: utf-8 -*- import time from functools import update_wrapper from flask import request, g from flask_redis import FlaskRedis from .helpers import bad_request from . import app # # REDIS RATE LIMITER # ================== redis = False if app.config['REDIS_URL']: redis = FlaskRedis(app) class RateLi...
agpl-3.0
721,773,584,731,300,600
28.462687
71
0.581054
false
pombredanne/openaire
bibsched/lib/bibsched_tasklets/bst_openaire_check_rights.py
1
2572
#!/usr/bin/env python ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 2012 CERN. ## ## Invenio 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 op...
gpl-2.0
5,037,854,944,358,963,000
36.823529
123
0.641135
false
chetan/cherokee
admin/consts.py
1
7437
# -*- coding: utf-8 -*- # # Cherokee-admin # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2001-2010 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free S...
gpl-2.0
-8,224,613,567,037,564,000
26.544444
67
0.477746
false
cbertinato/pandas
pandas/tests/sparse/test_combine_concat.py
1
19708
import itertools import numpy as np import pytest from pandas.errors import PerformanceWarning import pandas as pd import pandas.util.testing as tm class TestSparseArrayConcat: @pytest.mark.parametrize('kind', ['integer', 'block']) def test_basic(self, kind): a = pd.SparseArray([1, 0, 0, 2], kind=k...
bsd-3-clause
3,471,453,257,615,332,000
40.578059
79
0.559823
false
hassy/informatics-explorer
utils.py
1
1514
# author: Hasan Veldstra <hasan.veldstra@gmail.com> # license: MIT import os import fnmatch try: import simplejson as json except: import json def locate(pattern, root=os.getcwd()): """ Generate of all files in a directory that match the pattern. """ for path, dirs, files in os.walk(root): ...
mit
741,321,748,822,468,600
21.954545
132
0.599736
false