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
uber/pyro
pyro/contrib/gp/likelihoods/binary.py
1
1963
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import torch import pyro import pyro.distributions as dist from pyro.contrib.gp.likelihoods.likelihood import Likelihood class Binary(Likelihood): """ Implementation of Binary likelihood, which is used for binary classi...
apache-2.0
8,119,565,542,898,236,000
36.037736
98
0.62812
false
flexpeace/btb
printing/print_mail.py
1
4166
import os import sys import glob import json from collections import defaultdict from utils import UnicodeReader, slugify, count_pages, combine_pdfs, parser import addresscleaner from click2mail import Click2MailBatch parser.add_argument("directory", help="Path to downloaded mail batch") def fix_lines(address): ...
agpl-3.0
2,824,114,001,440,336,400
31.546875
98
0.590494
false
Tunghsu/SAMS
SAMS/urls.py
1
1355
from django.conf.urls import patterns, include, url import settings from SAMS.views import root, tallview, allview, nework, profile, login, logout, checkassign, result, admin, check, submit, view, viewAssignment, download, course, classes,rate,search # Uncomment the next two lines to enable the admin: # from django.con...
gpl-3.0
-7,862,490,464,631,492,000
34.657895
182
0.590406
false
mdraeger/gmapcatcher
gmapcatcher/tilesRepo/tilesRepoRMaps.py
1
16125
## @package gmapcatcher.tilesRepo.tilesRepoRMaps # This module provides sqlite3 tile repository functions in the format # used by the RMaps android app. # # Usage: # # - constructor requires MapServ instance, because method # 'get_tile_from_coord' is provided in the MapServ # import os import gtk import sys import t...
gpl-2.0
3,090,410,139,767,253,500
33.235669
144
0.57631
false
kbase/assembly
lib/assembly/plugins/discovar.py
1
1581
import glob import logging import os import subprocess from plugins import BaseAssembler from yapsy.IPlugin import IPlugin logger = logging.getLogger(__name__) class DiscovarAssembler(BaseAssembler, IPlugin): def run(self): """ Build the command and run. Return list of contig file(s) ...
mit
-849,724,596,757,140,000
30
163
0.55408
false
linuxscout/arramooz
scripts/nouns/stardict.py
1
3461
#!/usr/bin/python2 # -*- coding=utf-8 -*- #************************************************************************ # $Id: generatenoundict.py,v 0.7 2011/03/26 01:10:00 Taha Zerrouki $ # # ------------ # Description: # ------------ # Copyright (c) 2011, Arabtechies, Arabeyes Taha Zerrouki # # This file is the main fi...
gpl-2.0
-9,102,461,087,602,533,000
33.049505
110
0.443734
false
ActiveState/code
recipes/Python/578369_War_Game_Version_5/recipe-578369.py
1
7275
from random import randint, seed from time import time # region: change # from window import * from Zpaw import * from cards import * card_list = [card_0, card_1, card_2, card_3, card_4, card_5, card_6, card_7, card_8, card_9] # endregion def game(): print 'Welcome to WAR V5!' print asking = True while...
mit
-4,348,524,934,949,283,000
43.090909
119
0.485636
false
RomainBrault/OVFM
Climate/climate2.py
1
7428
import numpy as np from sklearn import ensemble from sklearn import cross_validation from sklearn import metrics from sklearn import preprocessing from sklearn import linear_model import OVFM.Model as md import OVFM.FeatureMap as fm import OVFM.Risk as rsk import OVFM.LearningRate as lr import OVFM.DataGeneration as d...
mit
-1,827,408,120,212,465,400
38.094737
145
0.593296
false
amorphic/sparkcc-formulapi
tests/test_formula.py
1
2017
from mock import patch from race_code import race_code_globals from . import FormulaPiTestCase class TestFormula(FormulaPiTestCase): def setUp(self): # Capture all of the global defaults and reset them after we modify them with this code # to keep sanity when running tests. self.original_...
mit
6,386,742,852,895,019,000
34.385965
98
0.608825
false
ContextLab/hypertools
hypertools/tools/df2mat.py
1
1267
#!/usr/bin/env python import pandas as pd def df2mat(data, return_labels=False): """ Transforms a Pandas DataFrame into a Numpy array with binarized text columns This function transforms single-level df to an array so it can be plotted with HyperTools. Additionally, it uses the Pandas.Dataframe.get...
mit
7,591,116,103,792,897,000
27.155556
80
0.665351
false
sebatyler/django_tdd
django_tdd/settings.py
1
3108
""" Django settings for django_tdd project. Generated by 'django-admin startproject' using Django 1.11.6. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import...
mit
6,978,576,545,869,449,000
24.9
91
0.68758
false
cargocult/rowan-python
rowan/controllers/base.py
1
2016
""" Some base classes for common styles of controller. """ import logging class LoggingMixin(object): """ We generally want to be able to log the behavior of controllers. This mixin makes a logging object available. """ @classmethod def get_logger(cls): if not hasattr(cls, "_logger"): ...
mit
1,128,868,552,093,589,100
26.616438
75
0.614583
false
sony/nnabla
python/test/utils/test_graph_converters/test_identity.py
1
2169
# Copyright 2020,2021 Sony Corporation. # # 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 i...
apache-2.0
-1,049,547,621,589,168,800
28.712329
81
0.68142
false
TE-ToshiakiTanaka/alize
project/blue/testrunner.py
1
1428
import os import sys import alize PATH = os.path.abspath(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) if not PATH in sys.path: sys.path.insert(0, PATH) if alize.__version__ < "0.1.0": sys.exit("alize version over 0.1.0. : %s " % (alize.__version__)) from alize.application import AlizeRunner f...
mit
-1,571,979,897,884,462,000
30.733333
83
0.651961
false
JamHsu/Pocketmap
script/crawler/model/tabelog.py
1
1390
import json from urlparse import urlparse class Restaurant(object): def __init__(self, data): self.url = data.get('@id', '') self.tabelog_id = self.parse_id_from_url(self.url) self.name = data.get('name', '').encode('utf8') self.img_url = data.get('image', '') geo = data.ge...
mit
4,636,327,346,200,734,000
31.348837
77
0.553957
false
pietromarchesi/pidpy
setup.py
1
1173
try: from setuptools import setup except ImportError: from distutils.core import setup import numpy as np from distutils.extension import Extension def readme(): with open('README.md') as f: return f.read() setup(name='pidpy', version='0.1', description='Partial Information Decompo...
gpl-3.0
-1,308,581,805,493,007,000
25.681818
66
0.595908
false
angr/angr
angr/storage/memory_mixins/paged_memory/pages/list_page.py
1
12194
# pylint:disable=abstract-method import logging from typing import Optional, List, Set, Tuple from sortedcontainers import SortedSet from . import PageBase from angr.storage.memory_object import SimMemoryObject from .cooperation import MemoryObjectMixin l = logging.getLogger(name=__name__) class ListPage(MemoryOb...
bsd-2-clause
-4,268,543,217,243,824,600
42.241135
174
0.542316
false
pombredanne/PyGithub
github/Authorization.py
1
7655
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
-3,392,938,758,577,682,400
41.06044
205
0.55885
false
andras-tim/StoreKeeper
server/test/e2e/views/test_work.py
1
17825
from app.modules.example_data import ExampleWorkItems as WorkItems, ExampleWorks as Works, \ ExampleItems as Items, ExampleVendors as Vendors, ExampleUnits as Units, ExampleCustomers as Customers, \ ExampleUsers as Users from test.e2e.base_api_test import CommonApiTest, append_mandatory_field_tests from test.e2...
gpl-2.0
7,240,236,778,862,567,000
45.298701
113
0.620084
false
andres-hurtado-lopez/naranjaverdeprod
app/functionality_access/__init__.py
1
3538
#!/usr/bin/env python # -*- coding: utf-8 -*- from bottle import template, redirect, request import utils, json from passlib.hash import bcrypt def GET(**params): table = utils.RenderTable(\ """SELECT * FROM users""",\ (),\ u""" <tr> <th><input type="checkbox"></th> <th>Usuario</th>...
mit
-3,747,365,128,313,200,000
25.601504
166
0.552289
false
geodynamics/lithomop
lithomop3d/tests/lithomop3dapp.py
1
1631
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Lithomop3d by Charles A. Williams # Copyright (c) 2003-2005 Rensselaer Polytechnic Institute # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated...
mit
-2,781,755,995,276,597,000
35.244444
80
0.647456
false
lorensen/VTKExamples
src/Python/Widgets/EmbedInPyQt.py
1
1287
#!/usr/bin/env python import sys import vtk from PyQt4 import QtGui from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor class MainWindow(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self, parent) self.frame = QtGui.QFrame() self....
apache-2.0
2,054,659,394,894,716,700
22.833333
73
0.639472
false
Passaudage/PLD
simulateur/jacky.py
1
5825
import GenerateurEntrees import Intersection import SimulationManager import Troncon import Coordonnees import Vehicule def charger_simulateur(): longueur_troncon = 5000 sm = SimulationManager.SimulationManager(5) gen_sud = GenerateurEntrees.GenerateurEntrees([[1 , 20]]) sm.add_listener(gen_sud) ...
mit
-3,497,025,016,034,291,000
34.090361
128
0.586266
false
dennisss/sympy
sympy/core/evalf.py
1
47559
""" Adaptive numerical evaluation of SymPy expressions, using mpmath for mathematical functions. """ from __future__ import print_function, division import math import sympy.mpmath.libmp as libmp from sympy.mpmath import make_mpc, make_mpf, mp, mpc, mpf, nsum, quadts, quadosc from sympy.mpmath import inf as mpmath_in...
bsd-3-clause
528,281,993,822,744,960
32.421644
99
0.536449
false
auduny/chains
lib/chains/common/cusb.py
1
4584
import usb.core import usb.util usb_iclass_map = { usb.CLASS_PER_INTERFACE: 'PerInterface', # 0 usb.CLASS_AUDIO: 'Audio', # 1 usb.CLASS_COMM: 'Comm', # 2 usb.CLASS_HID: 'HID', # 3 usb.CLASS_PRINTER: 'Printer', # 7 usb.CLASS_MASS_STORAGE: 'MassStorage', # 8 usb.CLASS_HUB: 'Hub', # 9 ...
gpl-2.0
-2,259,089,511,217,608,400
26.781818
85
0.52356
false
sahat/Wappalyzer
drivers/python/wappalyzer.py
1
1417
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import PyV8 import urllib from urlparse import urlparse try: import json except ImportError: import simplejson as json class Wappalyzer(object): def __init__(self, url): self.file_dir = os.path.dirname(__file__) f = ope...
gpl-3.0
1,305,981,902,608,662,500
25.735849
135
0.568102
false
ittner/sked
libsked/options.py
1
2982
# -*- coding: utf-8 -*- # Sked - a wikish scheduler with Python and PyGTK # (c) 2006-10 Alexandre Erwin Ittner <alexandre@ittner.com.br> # # 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; eithe...
gpl-2.0
-8,001,215,012,241,772,000
26.611111
70
0.560698
false
Suwings/Yeinw
src/Suwings/security/oth_pxfilter.py
1
7109
# -*- coding: utf-8 -*- """ Python 富文本XSS过滤类 @package XssHtml @version 0.1 @link http://phith0n.github.io/python-xss-filter @since 20150407 @copyright (c) Phithon All Rights Reserved Based on native Python module HTMLParser purifier of HTML, To Clear all javascript in html You can use it in all python web framework Wr...
gpl-3.0
8,411,199,126,742,387,000
32.428571
107
0.529563
false
felipenaselva/felipe.repository
script.module.universalscrapers/lib/universalscrapers/scraperplugins/housemovies.py
1
3241
import requests import re, base64 import xbmc from ..scraper import Scraper from ..common import clean_title,clean_search,random_agent class housemovie(Scraper): domains = ['https://housemovie.to/'] name = "Housemovies" sources = [] def __init__(self): self.base_link = 'https://housemovie.t...
gpl-2.0
5,268,606,886,261,176,000
53.016667
245
0.523604
false
pylint-bot/astroid-unofficial
astroid/protocols.py
1
21725
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid 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 #...
gpl-2.0
8,057,490,289,828,611,000
36.328179
83
0.590012
false
ddurieux/alignak
test/test_disable_active_checks.py
1
3446
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free So...
agpl-3.0
3,982,005,406,517,748,700
32.446602
85
0.685631
false
SaintAttila/attila
attila/processes.py
1
7909
""" Tools for controlling and interacting with Windows processes. """ import time import pywintypes import win32api import win32com.client import win32con from .utility import only from .exceptions import TooFewItemsError, verify_type, verify_callable __author__ = 'Aaron Hosford' __all__ = [ "process_exists...
mit
-3,496,954,635,227,142,000
30.50996
98
0.663801
false
tensorflow/runtime
third_party/llvm/expand_cmake_vars.py
1
2647
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-6,928,396,880,634,280,000
28.741573
80
0.649037
false
ericholscher/django
django/contrib/admindocs/views.py
1
15158
from importlib import import_module import inspect import os import re from django import template from django.template import RequestContext from django.conf import settings from django.contrib.admin.views.decorators import staff_member_required from django.db import models from django.shortcuts import render_to_resp...
bsd-3-clause
-5,536,292,160,864,529,000
37.866667
143
0.591701
false
mlcommons/training
translation/tensorflow/process_data.py
1
15302
# Copyright 2018 MLBenchmark Group. 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
2,412,527,883,679,697,400
34.09633
80
0.668213
false
imankulov/sentry
src/sentry/plugins/sentry_mail/models.py
1
5759
""" sentry.plugins.sentry_mail.models ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sentry from django.conf import settings from django.core.urlresolvers impo...
bsd-3-clause
8,034,038,789,124,717,000
29.796791
102
0.592464
false
anbangleo/NlsdeWeb
Python-3.6.0/Lib/test/test_warnings/__init__.py
1
47896
from contextlib import contextmanager import linecache import os from io import StringIO import re import sys import textwrap import unittest from test import support from test.support.script_helper import assert_python_ok, assert_python_failure from test.test_warnings.data import stacklevel as warning_tests import w...
mit
6,476,962,123,155,680,000
41.049166
87
0.58642
false
psychopy/psychopy
psychopy/gui/wxgui.py
1
15627
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). """To build simple dialogues etc. (requires wxPython) """ from __future__ import absolute...
gpl-3.0
6,954,707,252,832,250,000
35.769412
83
0.580278
false
mvondracek/wifimitm
wifimitm/tests/test_capture.py
1
1702
#!/usr/bin/env python3 """ Unit tests for capture module Automation of MitM Attack on WiFi Networks Bachelor's Thesis UIFS FIT VUT Martin Vondracek 2016 """ import time as _time import typing as _typing import unittest as _unittest from wifimitm.updatableProcess import UpdatableProcess from wifimitm.capture import Du...
mit
-3,613,036,492,186,075,000
34.458333
110
0.694477
false
OpenDaisy/daisy-api
daisy/gateway.py
1
12287
# Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # 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/LIC...
apache-2.0
8,565,885,868,649,443,000
45.896947
79
0.674697
false
fabioz/mu-repo
mu_repo/repos_with_changes.py
1
2688
from mu_repo.action_diff import ParsePorcelain from mu_repo.execute_parallel_command import ParallelCmd, ExecuteInParallel #=================================================================================================== # ComputeReposWithChanges #====================================================================...
gpl-3.0
3,322,202,696,225,994,000
39.119403
104
0.56436
false
cisco-openstack/tempest
tempest/api/network/admin/test_routers.py
1
11969
# 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
8,357,789,090,428,257,000
46.3083
78
0.623277
false
biswajit-mandal/contrail-webui-third-party
fetch_packages.py
1
11100
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import os import errno import re import shutil import subprocess import sys, getopt import platform from time import sleep _RETRIES = 5 _OPT_VERBOSE = None _OPT_DRY_RUN = None _PACKAGE_CACHE='/tmp/cache/' + os.environ['USER'] + '/we...
apache-2.0
-6,112,047,089,367,081,000
30.355932
97
0.53036
false
jbloomlab/phydms
phydmslib/simulate.py
1
6135
"""Functions for performing simulations, mostly using ``pyvolve``. Written by Jesse Bloom and Sarah Hilton. """ import os import sys import math import phydmslib.models from phydmslib.constants import (NT_TO_INDEX, AA_TO_INDEX, ALMOST_ZERO) import pyvolve import numpy from tempfile import mkstemp import random import...
gpl-3.0
3,644,956,278,045,778,400
37.829114
78
0.558924
false
IBT-FMI/SAMRI
samri/utilities.py
1
13239
import multiprocessing as mp import nibabel as nib import nipype.interfaces.io as nio import numpy as np import os import pandas as pd from itertools import product from joblib import Parallel, delayed from os import path # PyBIDS 0.6.5 and 0.10.2 compatibility try: from bids.grabbids import BIDSLayout except ModuleNo...
gpl-3.0
6,278,964,047,147,906,000
36.610795
248
0.720296
false
Azure/azure-sdk-for-python
sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_operations.py
1
4729
# 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
-814,979,723,569,684,100
42.385321
133
0.639459
false
artisanofcode/flask-generic-views
docs/conf.py
1
10315
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Flask-Generic-Views documentation build configuration file, created by # sphinx-quickstart on Wed Dec 30 04:16:44 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present ...
mit
8,997,364,476,504,771,000
32.49026
90
0.693747
false
padraic-padraic/StabilizerSearch
stabilizer_search/search/brute_force.py
1
3184
from itertools import combinations from math import factorial from six import PY2 from random import shuffle from ._search import _Search from ._result import _Result from ..core.linalg import get_projector, projection_distance, subspace_distance from ..stabilizers import get_stabilizer_states from numba import njit ...
gpl-3.0
-47,993,443,974,661,890
34.775281
87
0.643216
false
CLVsol/odoo_clvhealth_jcafb
project/install.py
1
6159
#!/usr/bin/env python # -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
411,191,009,144,921,200
34.194286
82
0.585972
false
mattstibbs/blockbuster-server
blockbuster/messaging/bb_pushover_handler.py
1
1566
import http.client import urllib import logging import redis from rq import Queue import blockbuster.config as config import blockbuster.bb_auditlogger as bb_auditlogger # Set up RQ queue conn = redis.from_url(config.REDIS_URL) q = Queue(connection=conn) log = logging.getLogger(__name__) def send_push_notification...
mit
-340,374,393,596,961,600
30.32
108
0.619413
false
richardkiss/pycoinnet
pycoinnet/examples/address_keeper.py
1
5205
#!/usr/bin/env python """ This bitcoin client does little more than try to keep an up-to-date list of available clients in a text file "addresses". """ import asyncio import binascii import logging import random import time from pycoinnet.helpers.standards import initial_handshake, version_data_for_peer from pycoinn...
mit
-1,233,479,060,370,532,000
34.408163
104
0.603266
false
nesl/mercury
Services/Mapping/rescaleScripts/rescaleBatch.py
1
1170
import os import sys filenames = [ 'Albuquerque_6x6.tfix', 'Atlanta_6x6.tfix', 'Austin_6x6.tfix', 'Baltimore_6x6.tfix', 'Boston_6x6.tfix', 'Charlotte_6x6.tfix', 'Chicago_6x6.tfix', 'Cleveland_6x6.tfix', 'Columbus_6x6.tfix', 'Dallas_6x6.tfix', 'Denver_6x6.tfix', 'Detroit_6x6.tfix', 'El_Paso_6x6.tfix', 'Fort_Worth_6x6.t...
gpl-2.0
9,173,531,642,800,253,000
20.272727
82
0.677778
false
chadversary/chromiumos.chromite
cbuildbot/stages/build_stages.py
1
12895
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module containing the build stages.""" import functools import glob import os import shutil from chromite.cbuildbot import commands from chromite...
bsd-3-clause
7,007,675,836,784,965,000
38.194529
80
0.658007
false
dzolnierz/mysql-utilities
mysql/utilities/common/sql_transform.py
1
61521
# # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in th...
gpl-2.0
-7,321,135,944,833,890,000
39.288802
79
0.560101
false
Mymoza/trello-similar-labels
tests/Test_TrelloWrapper.py
1
1090
import TrelloWrapper as wrapper import unittest class PrimesTestCase(unittest.TestCase): """Tests for TrelloWrapper.""" """ TESTS FOR LEVENSHTEIN DISTANCE """ def test_0_levenshtein_distance(self): """Is 0 successfully determined in the levenshtein distance?""" # Two identical words shou...
mit
-5,889,056,139,202,562,000
34.193548
71
0.666055
false
lgarren/spack
var/spack/repos/builtin/packages/r-annotationfilter/package.py
1
1981
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-4,270,355,889,196,540,000
46.166667
133
0.683998
false
fugitifduck/exabgp
lib/exabgp/bgp/message/update/nlri/evpn/nlri.py
1
2044
""" evpn.py Created by Thomas Morin on 2014-06-23. Copyright (c) 2014-2015 Orange. All rights reserved. """ from struct import pack from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI # ========================================================================= EVPN # +-------------------...
bsd-3-clause
-7,025,846,381,177,260,000
23.926829
138
0.576321
false
quantumlib/Cirq
cirq-google/cirq_google/engine/engine_job_test.py
1
20894
# Copyright 2019 The Cirq Developers # # 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 agreed to in ...
apache-2.0
-871,607,955,485,668,900
30.85061
95
0.582177
false
vherman3/AxonSegmentation
AxonDeepSeg/learn_model.py
1
12287
import tensorflow as tf import math import numpy as np import os import pickle import time from learning.input_data import input_data import sys def learn_model(trainingset_path, model_path, model_restored_path = None, learning_rate = None, verbose = 1): if not learning_rate : learning_rate = 0.0005 ...
mit
6,847,251,026,175,072,000
39.96
172
0.567348
false
WebAssembly/sexpr-wasm-prototype
test/update-spec-tests.py
1
3609
#!/usr/bin/env python3 # # Copyright 2016 WebAssembly Community Group participants # # 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 # # Unles...
apache-2.0
5,995,394,094,434,507,000
34.732673
81
0.651704
false
openconfig/oc-pyang
openconfig_pyang/plugins/util/html_helper_test.py
1
2086
""" Copyright 2015 Google, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
apache-2.0
2,804,690,863,647,126,000
21.923077
72
0.678811
false
blackjade/aci2xml
aci2xml.py
1
4226
# # Copyright (c) 2015 Fluke Networks. # All rights reserved. # No part of this source code may be copied, used, or modified # without the express written consent of Fluke Networks. # # aci2xml.py: Convert the policy manager related section in a *.aci # file to xml. For example, these lines: # [\Polic...
apache-2.0
7,077,029,358,062,470,000
30.015152
123
0.559158
false
freundTech/deepl-cli
deepl/__main__.py
1
2176
import argparse import locale import sys from deepl import translator def print_results(result, extra_data, verbose=False): if verbose: print("Translated from {} to {}".format(extra_data["source"], extra_data["target"])) print(result) def main(): parser = argparse.ArgumentParser(description="Tr...
mit
-357,198,274,125,609,200
35.283333
101
0.617188
false
fredericklussier/ObservablePy
tests/testObserverStore.py
1
5291
#!/usr/bin/python3 # -*- coding: utf-8 -*- import unittest from observablePy.ObserverStore import ObserverStore from observablePy.ObserverTypeEnum import observerTypeEnum class ObserverStoreTests(unittest.TestCase): """ setUp each test """ def setUp(self): self.observers = ObserverStore() ...
mit
4,673,484,907,610,565,000
25.193069
78
0.571726
false
AvengerMoJo/DeepSea
srv/modules/runners/upgrade.py
1
3678
# -*- coding: utf-8 -*- # pylint: disable=modernize-parse-error """ Verify that an automated upgrade is possible """ from __future__ import absolute_import from __future__ import print_function # pylint: disable=import-error,3rd-party-module-not-gated,redefined-builtin import salt.client import salt.utils.error class...
gpl-3.0
-6,941,238,278,801,299,000
31.263158
80
0.507069
false
clones/wtforms
wtforms/ext/appengine/fields.py
1
3025
import decimal from wtforms import fields, widgets class ReferencePropertyField(fields.SelectFieldBase): """ A field for ``db.ReferenceProperty``. The list items are rendered in a select. """ widget = widgets.Select() def __init__(self, label=u'', validators=None, reference_class=None, ...
bsd-3-clause
-4,359,445,590,405,354,500
30.842105
100
0.549752
false
pyrocko/pyrocko
src/apps/colosseo.py
1
7525
from __future__ import print_function # http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg---------- import sys import logging import os.path as op from optparse import OptionParser from pyrocko import util, scenario, guts, gf from pyrocko import __version__ logger = lo...
gpl-3.0
5,485,994,843,530,995,000
22.964968
79
0.592292
false
Darktel/Homework
Translit.py
1
1089
__author__ = 'Darktel' def translit(Mystring): """ String (Rus) -> String (Eng) """ RusString = 'а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ы,ь,ъ,э,ю,я,*, ,' EngString = "a,b,v,g,d,e,yo,zh,z,i,j,k,l,m,n,o,p,r,s,t,u,f,h,c,ch,sh,xh,y,',`,q,ju,ya,*,-," RusChar = RusString.split(','...
gpl-2.0
5,363,980,151,163,219,000
22.390244
95
0.555787
false
yephper/django
tests/transactions/tests.py
1
20076
from __future__ import unicode_literals import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TransactionTestCase, skipIfDBFeature, ski...
bsd-3-clause
9,000,106,414,789,370,000
43.627273
85
0.616258
false
hornedbull/gmailPy
gmailPy.py
1
13792
# Vatsal Shah # ECE-C433 Mini-Project 2 # gmailPy - A terminal gmail client # Tested on Python 2.7.3 # imapclient is not a part of the standard python library # install using sudo pip install imapclient import getpass from imapclient import IMAPClient import operator import email import optparse import sys class gma...
gpl-2.0
-6,506,492,856,560,792,000
47.055749
226
0.583019
false
xlorepdarkhelm/colors
colors/html.py
1
1085
"""Contains the implementation of the HTML color group.""" __all__ = ( 'HTML', ) import enum from colors import base class HTML(base.ColorGroup): """ The color group for HTML 4.01 approved colors. These are the colors as defined in the HTML 4.01 specification from 1999. See Also: `Wiki...
mit
1,404,955,823,179,742,200
28.324324
79
0.584332
false
wuzhy/autotest
scheduler/drones_unittest.py
1
1912
#!/usr/bin/python2.4 """Tests for autotest_lib.scheduler.drones.""" import cPickle import common from autotest_lib.client.common_lib import utils from autotest_lib.client.common_lib.test_utils import mock, unittest from autotest_lib.scheduler import drones from autotest_lib.server.hosts import ssh_host class Remot...
gpl-2.0
-8,609,757,872,621,830,000
34.407407
78
0.618724
false
Sumith1896/sympy
sympy/matrices/expressions/matadd.py
1
3161
from __future__ import print_function, division from sympy.core.compatibility import reduce from operator import add from sympy.core import Add, Basic, sympify from sympy.functions import adjoint from sympy.matrices.matrices import MatrixBase from sympy.matrices.expressions.transpose import transpose from sympy.strat...
bsd-3-clause
-7,329,370,434,409,728,000
27.736364
81
0.595698
false
robwebset/script.pinsentry
resources/lib/database.py
1
18767
# -*- coding: utf-8 -*- import xbmc import xbmcaddon import xbmcvfs import sqlite3 import xbmcgui # Import the common settings from settings import log from settings import os_path_join ADDON = xbmcaddon.Addon(id='script.pinsentry') ################################# # Class to handle database access ###############...
gpl-2.0
6,275,682,289,483,418,000
40.519912
132
0.6326
false
josephsuh/extra-specs
nova/tests/api/openstack/compute/contrib/test_keypairs.py
1
11623
# Copyright 2011 Eldar Nugaev # 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 ...
apache-2.0
210,862,576,793,496,740
35.550314
78
0.580573
false
eevee/flax
flax/ui/console/util.py
1
3170
"""Utility widgets, not really specific to the game.""" import sys import urwid class LogWidget(urwid.ListBox): # Can't receive focus on its own; assumed that some parent widget will # worry about scrolling us _selectable = False def __init__(self): super().__init__(urwid.SimpleListWalker([]...
mit
-6,422,756,433,398,865,000
27.558559
81
0.543218
false
Kismuz/btgym
btgym/research/strategy_gen_5/base.py
1
37905
############################################################################### # # Copyright (C) 2017-2018 Andrew Muzikin # # 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 t...
lgpl-3.0
1,417,447,790,621,117,000
39.889968
120
0.573407
false
rbuffat/pyidf
tests/test_airflownetworkintrazonelinkage.py
1
1949
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.natural_ventilation_and_duct_leakage import AirflowNetworkIntraZoneLinkage log = logging.getLogger(__name__) class TestAirflowNetworkIntraZoneLinkage(unittest.TestCase): de...
apache-2.0
4,970,112,966,095,272,000
35.111111
142
0.691637
false
tadamic/sokoenginepy
tests/manager/board_manager_spec.py
1
12342
from itertools import permutations import pytest from sokoenginepy import ( DEFAULT_PIECE_ID, BoardManager, CellAlreadyOccupiedError, SokobanBoard, SokobanPlus, ) class DescribeBoardManager: def it_memoizes_pushers( self, board_manager, pushers_positions, invalid_pusher_position ...
gpl-3.0
-4,757,934,307,954,671,000
39.201954
88
0.631826
false
adobe-research/spark-cluster-deployment
initial-deployment-puppet/modules/spark/files/spark/examples/src/main/python/wordcount.py
1
1306
# # 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
8,318,567,125,479,649,000
36.314286
74
0.687596
false
vlfedotov/django-business-logic
business_logic/rest/serializers.py
1
9163
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.utils import six from rest_framework import serializers from ..models import (ExceptionLog, Execution, ExecutionArgument, Ex...
mit
-2,308,939,436,610,275,000
29.543333
119
0.68973
false
joelarmstrong/analysis-purgatory
splitting-top-down/plot.py
1
2309
#!/usr/bin/env python import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def main(): sns.set_style('ticks') df = pd.read_csv('results.csv') df['fraction_good_splits'] = (df['perfect_splits']/df['fraction_perfect_splits'] - df['mismatching_leaf_sets'] - df['flipped_splits']) / (df['p...
mit
1,598,443,924,317,746,700
73.483871
372
0.658294
false
vinodpanicker/scancode-toolkit
src/scancode/format.py
1
5795
# # Copyright (c) 2015 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
apache-2.0
590,873,037,973,926,900
33.088235
82
0.663158
false
aagusti/e-gaji
egaji/views/user_unit.py
1
8985
from email.utils import parseaddr from sqlalchemy import not_ from pyramid.view import ( view_config, ) from pyramid.httpexceptions import ( HTTPFound, ) import colander from deform import ( Form, widget, ValidationFailure, ) from ..models import ( DBSession, User, ) from ..m...
gpl-2.0
7,830,063,188,745,901,000
31.089286
93
0.563606
false
Valitseja/Postcard
postcard/cli.py
1
1812
# -*- coding: utf-8 -*- """Description""" import json import sys import os import click from postcard.postcard import Postcard from postcard.mailer import Mailman import postcard.templater as templater @click.command() @click.option('--config', type=click.Path(exists=True), help="Path to configuration file") @click.a...
mit
2,748,098,555,682,565,600
28.225806
90
0.607064
false
daeilkim/refinery
refinery/bnpy/bnpy-dev/bnpy/init/FromTruth.py
1
2192
''' FromTruth.py Initialize params of a bnpy model using "ground truth" information, such as human annotations These are provided within a Data object, as a "TrueLabels" field ''' import numpy as np import FromScratchMult def init_global_params(hmodel, Data, initname=None, seed=0, nRepeatTrue=2, **kwargs): ''' In...
mit
-7,890,607,368,942,962,000
30.328571
85
0.671989
false
leppa/home-assistant
homeassistant/components/person/__init__.py
1
17106
"""Support for tracking people.""" from collections import OrderedDict from itertools import chain import logging from typing import Optional import uuid import voluptuous as vol from homeassistant.auth import EVENT_USER_REMOVED from homeassistant.components import websocket_api from homeassistant.components.device_t...
apache-2.0
-8,455,843,230,876,657,000
31.214689
87
0.603882
false
pszemus/grpc
examples/python/debug/get_stats.py
1
1475
# Copyright 2019 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
-7,507,955,330,443,291,000
28.5
74
0.697627
false
amjames/psi4
psi4/driver/driver.py
1
119607
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2018 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
-2,847,176,584,611,929,000
56.55871
166
0.476895
false
icgc-dcc/egasub
tests/test_dataset.py
1
1522
from egasub.ega.entities.dataset import Dataset from egasub.ega.entities.dataset_link import DatasetLink from egasub.ega.entities.attribute import Attribute links = [DatasetLink('label 1','url1'),DatasetLink('label 2','url2')] attributes = [Attribute('The tag 1','The value 1','an unit'),Attribute('The tag 2','The valu...
gpl-3.0
-2,194,082,586,187,153,400
32.844444
129
0.634691
false
nisavid/spruce-collections
spruce/collections/_exc.py
1
1237
"""Exceptions""" __copyright__ = "Copyright (C) 2014 Ivan D Vasin" __docformat__ = "restructuredtext" import exceptions as _py_exc class Exception(_py_exc.Exception): pass class Error(RuntimeError, Exception): pass class UnsupportedUniversalSetOperation(Error): """ A finite set operation was at...
lgpl-3.0
4,857,376,909,560,219,000
21.089286
64
0.607114
false
walac/build-mozharness
configs/single_locale/release_mozilla-beta_android_api_9.py
1
5018
BRANCH = "mozilla-beta" MOZ_UPDATE_CHANNEL = "beta" MOZILLA_DIR = BRANCH OBJDIR = "obj-l10n" EN_US_BINARY_URL = "http://ftp.mozilla.org/pub/mozilla.org/mobile/candidates/%(version)s-candidates/build%(buildnum)d/android-api-9/en-US" #STAGE_SERVER = "dev-stage01.srv.releng.scl3.mozilla.com" STAGE_SERVER = "stage.mozilla....
mpl-2.0
7,271,432,839,921,403,000
41.525424
182
0.567756
false
ScottWales/threddsclient
threddsclient/nodes.py
1
6231
""" Python objects for modelling a Thredds server """ from bs4 import BeautifulSoup as BSoup import urlparse from .utils import size_in_bytes import logging logger = logging.getLogger(__name__) FILE_SERVICE = "HTTPServer" OPENDAP_SERVICE = "OPENDAP" WMS_SERVICE = "WMS" WCS_SERVICE = "WCS" class Node(object): "...
apache-2.0
-6,310,311,489,160,708,000
29.694581
118
0.606965
false
Eric89GXL/sphinx-gallery
sphinx_gallery/backreferences.py
1
10042
# -*- coding: utf-8 -*- # Author: Óscar Nájera # License: 3-clause BSD """ Backreferences Generator ======================== Parses example file code in order to keep track of used functions """ from __future__ import print_function, unicode_literals import ast import codecs import collections from html import escape...
bsd-3-clause
6,789,566,557,589,119,000
34.985663
79
0.555777
false
snark/ignorance
tests/test_git_walk.py
1
6883
import ignorance import os try: # pathlib is in python stdlib in python 3.5+ from pathlib import Path except ImportError: from pathlib2 import Path import pytest def test_basic_walk(tmpdir_builder): path = tmpdir_builder.setup('git/basic_match') files = [] for r, d, f in ignorance.git.walk(pat...
isc
1,623,514,140,519,473,200
34.663212
78
0.634171
false
renmengye/resnet
resnet/utils/lr_schedule.py
1
3191
"""Learning rate scheduler utilities.""" from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from resnet.utils import logger log = logger.get() class FixedLearnRateScheduler(object): """Adjusts learning rate according to a fixed schedule...
mit
-5,248,840,209,165,210,000
32.239583
79
0.606393
false
sunjinopensource/threadactive
examples/example1/main.py
1
1330
import time import threading import threadactive class BackWorker(threadactive.Agent): def tick(self): threadactive.Agent.tick(self) print("[%s][%d] front" % (threading.current_thread().getName(), time.clock()) ) self.print_in_front2() self.print_in_back() time.sleep(1) ...
mit
4,238,513,690,836,113,000
26.729167
95
0.56391
false
kret0s/gnuhealth-live
tryton/server/trytond-3.8.3/trytond/tools/datetime_strftime.py
1
1478
# This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. # Copyright (c) 2002-2007 John D. Hunter; All Rights Reserved import time def datetime_strftime(date, fmt): ''' Allow datetime strftime formatting for years before 19...
gpl-3.0
-6,176,057,413,424,030,000
28.56
72
0.583221
false
codexgigassys/codex-backend
src/Utils/PEHeaderReader.py
1
4752
# Copyright (C) 2016 Deloitte Argentina. # This file is part of CodexGigas - https://github.com/codexgigassys/ # See the file 'LICENSE' for copying permission. import pefile import math import os import sys import shutil import time from test import test class PEHeaderReader(): # def __init__(self,file): # ...
mit
-6,858,042,678,559,217,000
29.658065
128
0.53851
false
chovanecm/sacredboard
sacredboard/app/data/pymongo/metricsdao.py
1
3216
""" Module responsible for accessing the Metrics data in MongoDB. Issue: https://github.com/chovanecm/sacredboard/issues/60 """ from bson import ObjectId from bson.errors import InvalidId from sacredboard.app.data import NotFoundError from .genericdao import GenericDAO from ..metricsdao import MetricsDAO class Mon...
mit
2,635,387,023,477,506,000
31.16
77
0.560634
false