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
jnez71/aLQR
alqr/planner.py
1
12747
""" Class for planning with an augmented linear-quadratic regulator (aLQR) on a given system and associated with a given cost field. The system must be linearizable, time-invarient, and control affine: xdot = f(x) + B(x)*u with jac(f)|x_i = A_i such that xdot = A_i*x + B(x_i)*u is accurate near x_i. After running...
mit
-7,410,992,972,254,290,000
34.705882
121
0.645642
false
hackerspace-ntnu/coap-iot
src/server.py
1
2922
import logging import time import copy from nordicnode import Nordicnode from SECRET import SECRET_KEY from SERVCONFIG import SERVER_HOST,SERVER_PORT from flask_socketio import * app = flask.Flask(__name__,static_folder="../static",static_url_path="/static",template_folder="../templates") app.config['SECRET_KEY'] = ...
mit
-2,315,262,563,875,152,400
25.554545
110
0.645327
false
TheStackBox/xuansdk
Automation/automationApp/module/deviceManager/virtualActivityControllerModule.py
1
6034
############################################################################################## # Copyright 2014-2015 Cloud Media Sdn. Bhd. # # This file is part of Xuan Automation Application. # # Xuan Automation Application is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
gpl-3.0
4,313,313,291,423,156,700
51.415929
129
0.645675
false
kurainooni/nw.js
test/remoting/issue4184-no-opener/test.py
2
1409
import time import os import subprocess import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from nw_util import * from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common import utils chrome_options = Options() chrome_optio...
mit
6,784,161,942,924,301,000
30.311111
152
0.721079
false
noironetworks/aci-integration-module
aim/api/tree.py
1
2218
# Copyright (c) 2017 Cisco Systems # 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 require...
apache-2.0
6,164,328,256,708,781,000
26.04878
78
0.611812
false
OkBuilds/buck
src/com/facebook/buck/json/buck.py
1
63524
from __future__ import with_statement import __builtin__ import __future__ import contextlib from collections import namedtuple from pathlib import Path, PureWindowsPath, PurePath from pywatchman import bser from contextlib import contextmanager import copy import StringIO import cProfile import functools import has...
apache-2.0
-9,107,897,909,951,630,000
36.699703
115
0.606574
false
dol-sen/catalyst
arch/x86.py
1
5365
import builder,os from catalyst_support import * class generic_x86(builder.generic): "abstract base class for all x86 builders" def __init__(self,myspec): builder.generic.__init__(self,myspec) if self.settings["buildarch"]=="amd64": if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux...
gpl-2.0
1,686,649,570,494,139,000
34.065359
93
0.672134
false
tomasdelvechio/py-net-dev
Protocolos/10 - cristian client/cristian_server.py
1
1153
#!/usr/bin/env python # -*- coding: utf-8 -*- import socket, re, select, os, json from datetime import datetime class TimeServer: def __init__(self, host = '', port = 8081): self.host = host self.port = port self.sock_server = socket.socket(socket.AF_INET, socket.SOCK_DGRA...
gpl-3.0
-3,028,056,237,181,597,000
31.027778
78
0.503903
false
unrza72/qplotutils
tests/qplotutils/test_player.py
1
2168
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ========================== Test for qplotutils.player ========================== Autogenerated package stub. """ import unittest import logging import sys import os import numpy as np from qtpy.QtCore import * from qtpy.QtGui import * from qtpy.QtOpenGL import * fr...
mit
-5,500,140,090,238,841,000
20.058252
73
0.590406
false
Mesitis/community
sample-code/Python/01 Admin/get_partner_admin_users.py
1
1841
''' - login and get token - process 2FA if 2FA is setup for this account - Get list of child accounts for a parent user ''' import requests import json get_token_url = "https://api.canopy.cloud:443/api/v1/sessions/" validate_otp_url = "https://api.canopy.cloud:443/api/v1/sessions/otp/validate.json" #calling the pr...
mit
2,945,030,914,990,292
33.092593
137
0.730038
false
dgzzhb/GAOthello
player.py
1
1546
#!/usr/bin/env python """ player.py Humberto Henrique Campos Pinheiro Human and Computer classes """ from evaluator import Evaluator from config import WHITE, BLACK from minimax import Minimax import random def change_color ( color ): if color == BLACK: return WHITE else: return BLACK ...
mit
56,426,762,448,709,464
26.122807
95
0.593144
false
scottgigante/nanomod
nanomod/scripts/list_bam_reads.py
1
1278
#!/usr/bin/python # Usage: python list_bam_reads.py in1.bam [in2.bam ...] in.fasta """ A script for listing filenames of all reads in a bamfile """ import pysam import sys import os import shutil import multiprocessing import functools import itertools from Bio import SeqIO def loadRef(fasta): """ Create a ...
gpl-3.0
-7,381,394,498,573,507,000
26.191489
142
0.690923
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/logging_options/config/__init__.py
1
12773
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
-6,327,587,046,209,675,000
38.915625
387
0.596571
false
mas-dse-greina/neon
luna16/old_code/LUNA16_inferenceTesting_ResNet.py
1
4360
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright 2015-2017 Nervana Systems 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 #...
apache-2.0
1,161,641,553,766,834,000
32.282443
94
0.677752
false
Cadasta/cadasta-platform
cadasta/questionnaires/validators.py
1
10066
import re from functools import partial from django.conf import settings from django.utils.translation import ugettext as _ from core.messages import SANITIZE_ERROR from core.validators import sanitize_string from .choices import QUESTION_TYPES, XFORM_GEOM_FIELDS from .exceptions import InvalidQuestionnaire def valid...
agpl-3.0
-1,318,371,151,160,856,600
31.366559
79
0.598848
false
ktan2020/legacy-automation
win/Lib/ctypes/test/test_callbacks.py
1
8245
import unittest from ctypes import * import _ctypes_test class Callbacks(unittest.TestCase): functype = CFUNCTYPE ## def tearDown(self): ## import gc ## gc.collect() def callback(self, *args): self.got_args = args return args[-1] def check_type(self, typ, ...
mit
1,000,723,505,215,285,800
31.245968
79
0.552213
false
googleapis/python-debugger-client
tests/unit/gapic/debugger_v2/test_debugger2.py
1
71030
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-1,008,928,668,650,661,600
37.624252
106
0.664029
false
qurioust/StudyInterpreter
calc1.py
1
4666
# Token types # # EOF (end-of-file) token is used to indicate that # there is no more input left for lexical analysis INTEGER, OPERATOR, PLUS, MINUS, EOF = 'INTEGER', 'OPERATOR',\ 'PLUS', 'MINUS', 'EOF' class Token(object): def __init__(self, type, value): # token type: INTEGER, PLUS, or EOF s...
mit
-5,042,599,363,946,606,000
29.900662
69
0.564081
false
TsinghuaX/edx-platform
common/lib/xmodule/xmodule/conditional_module.py
1
9276
"""Conditional module is the xmodule, which you can use for disabling some xmodules by conditions. """ import json import logging from lazy import lazy from lxml import etree from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.modulestore import Location from xmodule.seq_module...
agpl-3.0
3,437,756,615,915,732,000
36.707317
116
0.577727
false
fisele/slimta-abusix
slimta/system.py
1
4772
# Copyright (c) 2012 Ian C. Good # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
mit
1,100,777,063,778,634,200
29.589744
79
0.649413
false
soccermetrics/soccermetrics-client-py
soccermetrics/rest/resources/base.py
1
12074
from easydict import EasyDict import requests from soccermetrics import SoccermetricsRestException from soccermetrics import __api_version__ as API_VERSION class Resource(object): """ Represents interactions with a REST API resource. Sets the high-level (versioning) endpoint for the API resource. :p...
mit
7,992,929,171,068,071,000
32.173077
94
0.527663
false
emory-libraries/pidman
pidman/pid/management/commands/datamigrate.py
1
9396
import sys from distutils.util import strtobool from django.db import transaction from django.db.utils import IntegrityError from django.core import serializers from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django....
apache-2.0
7,029,692,759,876,979,000
41.709091
99
0.621115
false
ericchill/gnofract4d
fract4dgui/gtkgradient.py
1
17671
import gtk import dialog import utils import random from fract4d import gradient def show_gradients(parent,f): GradientDialog.show(parent,f) class GradientDialog(dialog.T): def __init__(self,main_window,f): global userPrefs dialog.T.__init__( self, _("Gradients"), ...
bsd-3-clause
2,925,749,149,845,129,700
38.979638
133
0.541169
false
plumgrid/plumgrid-nova
nova/servicegroup/drivers/db.py
1
4198
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
apache-2.0
5,128,132,706,661,929,000
39.757282
79
0.629586
false
EBI-Metagenomics/emgapi
emgapi/migrations/0007_split_run.py
1
7178
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-04-24 08:25 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion def populate_status(apps, schema_editor): Status = apps.get_model("emgapi", "Status") st = ( (1, "draft"), ...
apache-2.0
-8,815,306,035,724,135,000
36.19171
185
0.549178
false
brynpickering/calliope
calliope/core/preprocess/lookup.py
1
10678
""" Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS. Licensed under the Apache 2.0 License (see LICENSE file). lookup.py ~~~~~~~~~~~~~~~~~~ Functionality to create DataArrays for looking up string values between loc_techs and loc_tech_carriers, to avoid string operations during backend operations. ""...
apache-2.0
4,899,294,421,289,023,000
37.970803
97
0.620435
false
viswimmer1/PythonGenerator
data/python_files/30550411/image.py
1
4132
import config from plyny.plio.image import PathedImage as Image, HTMLImage from web import Page, Url import unittest class TestCase(unittest.TestCase): def setUp(self): self.p = config.fake_proxy() self.p.activate() def tearDown(self): self.p.deactivate() def test_estimate_co...
gpl-2.0
3,638,669,286,041,727,500
36.563636
137
0.585189
false
romain-li/edx-platform
lms/djangoapps/student_account/test/test_views.py
1
30794
# -*- coding: utf-8 -*- """ Tests for student account views. """ import logging import re from unittest import skipUnless from urllib import urlencode import mock import ddt from django.conf import settings from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.core.url...
agpl-3.0
-920,371,217,686,803,700
38.438462
117
0.628438
false
OzBonus/LPTHW
ex35.py
1
6052
#!/usr/bin/env # -*- coding: utf-8 -*- """ Learn Python the Hard Way - Exercise 35 Branches and Functions This is pretty similar to what's in the book, but I added another room and toyed around for a bit with exception handling. The new death function is pretty cool, too. """ from sys import exit def start(): "...
unlicense
-1,063,138,685,989,453,300
29.877551
80
0.409617
false
ElricleNecro/LibThese
scripts/animation.py
1
8169
#! /usr/bin/env python3 # -*- coding:Utf8 -*- import matplotlib as ml ml.use('agg') import os import argparse as ap import logging as log import numpy as np from LibThese import Carte as c from LibThese.Plot import Animate as an from LibThese.Plot import hdf5 as h class FromHDF5(...
lgpl-3.0
-3,620,484,079,222,266,000
19.733503
115
0.604603
false
PnX-SI/GeoNature
contrib/occtax/backend/utils.py
1
2412
from flask import current_app from urllib.parse import urljoin # nomenclatures fields counting_nomenclatures = [ "id_nomenclature_life_stage", "id_nomenclature_sex", "id_nomenclature_obj_count", "id_nomenclature_type_count", "id_nomenclature_valid_status", ] occ_nomenclatures = [ "id_nomenclat...
gpl-3.0
5,279,955,531,874,626,000
29.923077
100
0.636401
false
watsonpy/watson-auth
docs/conf.py
1
2537
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Watson - Auth documentation build configuration file, created by # sphinx-quickstart on Fri Jan 17 14:49:48 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in thi...
bsd-3-clause
2,506,785,883,207,107,000
24.626263
92
0.637761
false
malkavi/lutris
lutris/runners/browser.py
1
1049
# -*- coding: utf-8 -*- from lutris.runners.runner import Runner class browser(Runner): """Runner for browser games""" human_name = "Browser" executable = "xdg-open" platform = "Web based games" description = "Run games in the browser" game_options = [ { "option": "main_fil...
gpl-3.0
-5,106,044,268,784,394,000
28.971429
79
0.531935
false
dokipen/whoosh
tests/test_writing.py
1
1798
import unittest import os, os.path, random from whoosh import fields, index, writing class TestWriting(unittest.TestCase): def make_dir(self, name): if not os.path.exists(name): os.mkdir(name) def destroy_dir(self, name): try: os.rmdir("testindex") except...
apache-2.0
-9,027,063,572,623,213,000
28.966667
108
0.553949
false
michaelMinar/limbo
limbo/plugins/phab_diffs.py
1
4035
"""Attach meta data to phab diffs posted in Slack Wants these environment variables: PHAB_HOST -- the hostname where your phabricator lives PHAB_API_TOKEN -- a valid api token for some phabricator bot account PHAB_FILE_HOST -- hostname for instance of https://github.com/emarschner/phabricator-file-proxy ...
mit
-4,127,171,925,487,468,000
32.07377
115
0.64114
false
ChameleonCloud/blazar
blazar/db/migration/alembic_migrations/env.py
1
2660
# Copyright 2014 Intel Corporation # 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 require...
apache-2.0
-4,238,370,901,641,621,000
30.666667
78
0.717293
false
anthony-kolesov/kts46
pylib/kts46/runtime/offlineWorker.py
1
5169
#!/usr/bin/python # Copyright 2010-2011 Anthony Kolesov # # 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
8,878,382,241,973,102,000
30.907407
102
0.657381
false
xalt/xalt
old/python/xalt_run_submission.py
1
13177
# -*- python -*- # # Git Version: @git@ #----------------------------------------------------------------------- # XALT: A tool that tracks users jobs and environments on a cluster. # Copyright (C) 2013-2014 University of Texas at Austin # Copyright (C) 2013-2014 University of Tennessee # # This library is free softw...
lgpl-2.1
-8,811,500,944,917,399,000
28.947727
129
0.580405
false
Rambatino/CHAID
tests/setup_tests.py
1
1483
""" This module provides helper functions for the rest of the testing module """ from collections import Iterable import os import sys from math import isnan import numpy as np ROOT_FOLDER = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) sys.path = [ROOT_FOLDER] + sys.path np.seter...
apache-2.0
186,268,665,436,612,480
31.955556
110
0.650708
false
onshape-public/onshape-clients
python/onshape_client/oas/models/bt_document_merge_info.py
1
5168
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
mit
906,366,393,798,433,700
32.341935
109
0.588816
false
lechat/envsample
state.py
1
5516
#!multiconf from multiconf.envs import EnvFactory from multiconf import ConfigRoot, ConfigItem, ConfigBuilder from multiconf.decorators import nested_repeatables, repeat, required, named_as @nested_repeatables('cloud_servers, jenkins, apache') @required('git') class Project(ConfigRoot): def __init__(self, selecte...
mit
-8,104,967,573,754,948,000
34.587097
91
0.635606
false
ActiveState/code
recipes/Python/577556_gopytranslte_script_google/recipe-577556.py
1
3023
#!/usr/bin/python3 # Python gopytranslte # Author : namakukingkong # Site : namakukingkong[dot]kandangbuaya[dot]com # Email : namakukingkong[at]gmail[dot]com # dependency : linux,windows, python3, internet # gopytranslte # .....|___gopytranslte.py # .....|___log-translate.txt # $mkdir gopytranslte # $cd gop...
mit
-834,119,816,352,338,400
32.588889
108
0.533576
false
normanjaeckel/THHome
THHome/migrations/0002_about.py
1
1221
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-06-08 20:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('THHome', '0001_initial'), ] operations = [ migrations.CreateModel( ...
mit
7,667,831,212,975,023,000
39.633333
217
0.588187
false
k0pernicus/PyFTP
src/prompt.py
1
1104
class prompt(object): """ Classe permettant d'afficher un prompt. Ce prompt permettra à l'utilisateur de savoir sur quel serveur et quel dossier\ il se trouve """ def __init__(self, login, serveur, chemin = "~"): """ Constructeur du prompt login : login de l'utilisateur...
gpl-2.0
2,537,156,798,828,644,000
27.894737
89
0.57377
false
danielreed/python-hpOneView
hpOneView/resources/settings/firmware_bundles.py
1
2953
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limi...
mit
4,896,147,919,376,708,000
38.373333
114
0.712157
false
sudo-dirk/pygal
auth/__init__.py
1
20058
import binascii import flask import hashlib import helpers import json import os from prefixes import prefix_userprofile import pygal_config as config from pylibs import fstools import time basepath = os.path.abspath(os.path.dirname(__file__)) class time_limited_token(dict): """ Account erstellung erzeugt nu...
gpl-2.0
-2,196,386,375,735,426,300
32.824621
237
0.586948
false
crashbit/twitter
twitter/cmdline.py
1
24330
# encoding: utf-8 """ USAGE: twitter [action] [options] ACTIONS: authorize authorize the command-line tool to interact with Twitter follow follow a user friends get latest tweets from your friends (default action) help print this help text that you are currently reading leave ...
mit
3,801,583,490,783,273,000
33.806867
144
0.58545
false
serverboards/serverboards
plugins/core-extractors/serverboards-extractors.py
1
6214
#!/usr/bin/python3 import serverboards_aio as serverboards import curio import asks import re from serverboards import print asks.init('curio') @serverboards.rpc_method def serverboards_extractor(config, table, quals, columns): if table == "service": return service_extractor(quals, columns) if table ...
apache-2.0
7,902,818,338,142,781,000
22.9
83
0.515288
false
rupakc/Kaggle-Compendium
Costa Rican Houshold Income/costarican_baseline.py
1
1639
import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.ensemble import GradientBoostingClassifier, BaggingClassifier from sklearn.metrics import classification_report, accuracy_score from sklearn.model_selection import train_test_split def ...
mit
-2,680,715,623,335,056,400
43.297297
101
0.736425
false
Hutspace/odekro
mzalendo/hansard/models/alias.py
1
3478
import re import datetime from django.db import models from hansard.models.base import HansardModelBase from core.models import Person class AliasQuerySet(models.query.QuerySet): def unassigned(self): """ Limit to aliases that have not been assigned. """ return self.filter(person_...
agpl-3.0
-4,108,658,098,933,847,000
31.212963
93
0.548016
false
ceos-seo/Data_Cube_v2
ui/django_site_v2/data_cube_ui/apps/task_manager/urls.py
1
1327
# Copyright 2016 United States Government as represented by the Administrator # of the National Aeronautics and Space Administration. All Rights Reserved. # # Portion of this code is Copyright Geoscience Australia, Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this file # except in c...
apache-2.0
8,367,908,716,041,028,000
38.029412
84
0.740769
false
nicoddemus/pytest
scripts/update-plugin-list.py
1
2960
import datetime import pathlib import re import packaging.version import requests import tabulate FILE_HEAD = r"""Plugins List ============ PyPI projects that match "pytest-\*" are considered plugins and are listed automatically. Packages classified as inactive are excluded. """ DEVELOPMENT_STATUS_CLASSIFIERS = ( ...
mit
-602,373,420,787,450,500
33.418605
102
0.567568
false
landryb/psutil
psutil/_psbsd.py
1
12394
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """FreeBSD platform implementation.""" import errno import functools import os import sys from collections import namedtuple from ...
bsd-3-clause
-6,845,531,133,759,220,000
30.861183
79
0.614087
false
ddico/odoo
addons/website_project/controllers/rating.py
1
4824
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from werkzeug.exceptions import NotFound from odoo import http from odoo.http import request class RatingProject(http.Controller): @http.route(['/project/rating'], type='http', auth="public", website=True, sitema...
agpl-3.0
2,790,613,335,742,636,000
48.22449
148
0.569237
false
uclouvain/osis
base/tests/business/test_learning_unit_deletion.py
1
23601
############################################################################## # # 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
9,197,838,440,479,958,000
55.312649
120
0.653232
false
aldebaran/qibuild
python/qibuild/test/test_build_config.py
1
9004
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ Test Build Config """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ im...
bsd-3-clause
9,037,416,494,774,680,000
36.206612
84
0.673034
false
esander91/NamespacePollution
Code/PythonCode/sqlalchemy_schema.py
1
1723
from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy import Index from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base # sets up Base as a basic table class for SQLalchemy Base = declarative_base() # This is the schema for the R package database class...
gpl-2.0
-7,141,175,519,199,869,000
32.784314
73
0.689495
false
anigaj/widget-manager
usr/share/widgetManager/qml/widgets.py
1
16602
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2015 Jolla Ltd. # Contact: Jussi Pakkanen <jussi.pakkanen@jolla.com> # All rights reserved. # # You may use this file under the terms of BSD license as follows: # # Redistribution and use in source and binary forms, with or without # modification, ar...
gpl-2.0
578,980,566,807,963,400
67.603306
440
0.463679
false
feruxmax/ml_sophie
feature_extraction.py
1
4887
import pandas as pd import numpy as np import datetime as dt def to_platform_indep(data, platform): if platform=='android': data.drop(['ios_ifa', 'ios_ifv', 'google_aid'], axis=1, inplace=True) # rename cols names = data.columns.tolist() names[names.index('android_id')] = 'id' ...
mit
-7,683,527,654,138,860,000
34.165468
95
0.622263
false
chengsoonong/crowdastro-projects
ATLAS-CDFS/scripts/plot_examples.py
1
6330
"""Plots examples of where classifiers are wrong. Matthew Alger <matthew.alger@anu.edu.au> Research School of Astronomy and Astrophysics The Australian National University 2017 """ import logging import astropy.io.ascii import astropy.io.fits import astropy.visualization import astropy.visualization.wcsaxes import a...
mit
8,300,272,526,829,215,000
41.2
174
0.634597
false
saviaga/crowdsource-platform
crowdsourcing/viewsets/project.py
1
7856
__author__ = 'elsabakiu, neilthemathguy, dmorina' from rest_framework import status, viewsets from rest_framework.response import Response from crowdsourcing.serializers.project import * from rest_framework.decorators import detail_route, list_route from crowdsourcing.models import Module, Category, Project, Requeste...
mit
-4,402,278,944,080,445,400
42.40884
131
0.693228
false
LEX2016WoKaGru/pyClamster
scripts/calibration/fe4/FE4_straight_calib.py
1
2283
#!/usr/bin/env python3 import pyclamster import numpy as np import logging import pickle logging.basicConfig(level=logging.DEBUG) imgshape = (1920,1920) ################################################### ### Read times and sun positions from filenames ### ################################################### sun_rea...
gpl-3.0
8,420,132,079,694,189,000
30.708333
79
0.686816
false
Bobspadger/python-amazon-mws
tests/request_methods/test_inboundshipments.py
1
38539
""" Tests for the InboundShipments API class. """ import datetime import unittest import mws from mws.apis.inbound_shipments import parse_item_args from mws.mws import MWSError from .utils import CommonRequestTestTools class ParseItemArgsTestCase(unittest.TestCase): """ Test cases that ensure `parse_item_args...
unlicense
969,043,841,742,487,800
40.350858
112
0.614183
false
ToxicFrog/bup
lib/bup/bloom.py
1
11000
"""Discussion of bloom constants for bup: There are four basic things to consider when building a bloom filter: The size, in bits, of the filter The capacity, in entries, of the filter The probability of a false positive that is tolerable The number of bits readily available to use for addressing filter bits There is...
lgpl-2.1
-1,738,329,360,173,287,200
42.307087
79
0.647909
false
gaberger/pybvc
samples/samplenetconf/cmds/show_nodeinfo.py
1
2712
#!/usr/bin/python """ Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC 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 retain the above copyright notice,...
bsd-3-clause
958,508,910,003,634,300
31.285714
76
0.713127
false
QISKit/qiskit-sdk-py
qiskit/pulse/timeslots.py
1
13794
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
apache-2.0
-4,743,011,261,028,549,000
31.533019
89
0.589967
false
nikhilgk/SimpleCV
SimpleCV/examples/display/animatedgifstation/animation_station.py
1
1200
#!/usr/bin/python from time import sleep from pyfirmata import Arduino, util from images2gif import writeGif from SimpleCV import * pyrinter_url = "http://localhost:8080/printtext/" flickr_user = "foo" flickr_tags = "ingenuitas" animation_file = "./animation.gif" c = Camera() board = Arduino("/dev/ttyUSB0") it = u...
bsd-3-clause
-1,597,685,478,510,621,200
22.076923
49
0.6625
false
xzenzza/Python_Code
Test_code_SMS_V1.py
1
11306
#!/usr/bin/env python from __future__ import division from subprocess import PIPE, Popen import psutil,time import RPi.GPIO as GPIO import smbus import time,spidev import urllib2 import simplejson as json # pip install simplejson import ast import sqlite3 import decimal import os import glob import psut...
gpl-3.0
-5,342,163,957,370,462,000
33.442006
122
0.505307
false
gdesmott/politube
plenary/dieren.py
1
2129
import urllib2 import json from plenary.models import Deputy, Party LIMIT = 200 def party_json_to_model(j): v= {} v['dieren_id'] = j['id'] v['name'] = j['name'] return v def sync_parties(): url = "http://www.dierentheater.be/api/v1/party/?format=json&limit=%d" % (LIMIT) data = urllib2.urlop...
agpl-3.0
7,766,233,959,621,692,000
27.013158
85
0.525599
false
trivedigaurav/pharma-c
server.py
1
2331
from flask import Flask, render_template, request, redirect, url_for from database import * import flask_login, json, re from bson.objectid import ObjectId from jinja2 import evalcontextfilter, Markup, escape from api import * from questions import * import random, time app = Flask(__name__) app.secret_key = '80e48d13...
mit
-5,845,801,163,826,443,000
23.291667
121
0.589447
false
hiker/stan
AOR/Declaration.py
1
37631
#!/usr/bin/env python import string from types import TupleType from AOR.DoubleList import DoubleList from AOR.BasicStatement import BasicStatement, BasicRepr from AOR.Statements import Assignment # ============================================================================== # Well, thi...
gpl-3.0
-4,707,259,919,243,086,000
46.815756
84
0.431586
false
GPNMilano/PyPRPImporter
PyPRPImport/alcm5crypt.py
1
5607
# # $Id: alcm5crypt.py 539 2006-07-19 17:17:06Z Robert The Rebuilder $ # # Copyright (C) 2005-2008 Alcugs PyPRP Project Team and 2008 GoW PyPRP Project Team # See the file AUTHORS for more info about the team # # This program is free software; you can redistribute it and/or modify # it under the terms of t...
gpl-2.0
-7,749,541,111,514,407,000
26.218447
134
0.566256
false
trygveaa/python-tunigo
tunigo/playlist.py
1
3914
from __future__ import unicode_literals import tunigo from tunigo import utils class Playlist(object): def __init__( self, created=0, description='', id='', image='', location='', main_genre=None, main_genre_template...
apache-2.0
-325,434,058,248,106,240
25.808219
78
0.509964
false
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/lib/tool_shed/repository_types/repository_suite_definition.py
1
1745
import logging from tool_shed.repository_types.metadata import TipOnly import tool_shed.repository_types.util as rt_util from tool_shed.util import basic_util from galaxy import eggs eggs.require( 'mercurial' ) from mercurial import hg from mercurial import ui log = logging.getLogger( __name__ ) class RepositorySuit...
gpl-3.0
-2,292,779,964,664,107,800
41.560976
104
0.659026
false
mwaskom/lyman
doc/conf.py
1
8580
# -*- coding: utf-8 -*- # # lyman documentation build configuration file, created by # sphinx-quickstart on Mon Jul 29 23:25:46 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
bsd-3-clause
-2,324,158,235,785,817,000
30.428571
80
0.697902
false
mkorman9/framepy
framepy/client.py
1
6015
import random import requests from framepy import modules import cherrypy HTTP_SERVER_ERRORS_BORDER = 500 PROTOCOL = 'http://' class Module(modules.Module): def before_setup(self, properties, arguments, beans): beans['http_template'] = HttpTemplate() def after_setup(self, properties, arguments, cont...
mit
-8,442,624,980,916,435,000
48.303279
115
0.675644
false
awd4/spnss
spnss/nbc.py
1
11216
''' Naive Bayes Clustering ''' import numpy as np import random from spnss.mathutil import argmax_fair, argmin_fair, logsumexp, log import knobs from fast import nbmix_likelihood_from_model as fast_nbmix_likelihood_from_model from history import best_index def nbmix_model(data, nvals, qa, smooth=0.1): data = d...
mit
6,382,970,886,419,357,000
29.644809
143
0.529957
false
jsj2008/kdegames
kajongg/src/predefined.py
1
21844
# -*- coding: utf-8 -*- """Copyright (C) 2009,2010 Wolfgang Rohdewald <wolfgang@rohdewald.de> kajongg is free software you can redistribute it and/or modifys 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
2,737,684,372,865,246,700
64.011905
120
0.674831
false
desihub/desitarget
py/desitarget/randoms.py
1
65732
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ desitarget.randoms ================== Monte Carlo Legacy Surveys imaging at the pixel level to model the imaging footprint """ import os import numpy as np import astropy.io.fits as fits from astropy.wcs import WCS from time im...
bsd-3-clause
-4,469,367,194,779,342,000
42.358839
104
0.604622
false
benhoyt/scandir
test/test_scandir.py
1
12030
"""Tests for scandir.scandir().""" from __future__ import unicode_literals import os import shutil import sys import time import unittest try: import scandir has_scandir = True except ImportError: has_scandir = False FILE_ATTRIBUTE_DIRECTORY = 16 TEST_PATH = os.path.abspath(os.path.join(os.path.dirname...
bsd-3-clause
3,193,638,761,835,304,000
37.312102
95
0.596841
false
WilsonWangTHU/neural_graph_evolution
environments/multitask_env/walkers.py
1
15916
#!/usr/bin/env python2 # ----------------------------------------------------------------------------- # @brief: # Several Walkers # @author: # Tingwu (Wilson) Wang, Nov. 22nd, 2017 # ----------------------------------------------------------------------------- import numpy as np from gym import utils ...
mit
-8,605,378,863,806,239,000
30.832
96
0.593868
false
Heufneutje/PyMoronBot
CommandInterface.py
1
1050
# -*- coding: utf-8 -*- from moronbot import MoronBot from IRCMessage import IRCMessage from IRCResponse import IRCResponse, ResponseType class CommandInterface(object): triggers = [] acceptedTypes = ['PRIVMSG'] help = '<no help defined (yet)>' runInThread = False priority = 0 def __init...
mit
-5,194,758,183,876,619,000
22.333333
94
0.574286
false
XENON1T/processing
montecarlo/fax_waveform_py/production_process/BuildMinitree.py
1
1916
import sys import os import numpy as np import pandas as pd pd.options.mode.chained_assignment = None from fax_production_process import ProductionProcess import hax class BuildMiniTree(ProductionProcess): '''Run hax to create minitree''' process_oerder = 5 __version__ = '0.0.1' def _check(self): ...
apache-2.0
-8,386,922,512,047,827,000
38.102041
181
0.61691
false
hsoft/pdfmasher
cocoa/inter/build_pane.py
1
1296
# Created By: Virgil Dupras # Created On: 2011-07-09 # Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPL v3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/lic...
gpl-3.0
2,776,110,651,597,024,000
28.454545
91
0.665895
false
persandstrom/home-assistant
homeassistant/components/homekit/type_locks.py
2
2779
"""Class to hold all lock accessories.""" import logging from pyhap.const import CATEGORY_DOOR_LOCK from homeassistant.components.lock import ( ATTR_ENTITY_ID, DOMAIN, STATE_LOCKED, STATE_UNLOCKED, STATE_UNKNOWN) from homeassistant.const import ATTR_CODE from . import TYPES from .accessories import HomeAccessory...
apache-2.0
461,050,968,249,763,300
37.597222
77
0.630083
false
svalenti/agnkey
trunk/src/agnkey/agnabsphotdef.py
1
52649
def deg2HMS(ra='', dec='', round=False): import string RA, DEC= '', '' if dec: if string.count(str(dec),':')==2: dec00=string.split(dec,':') dec0,dec1,dec2=float(dec00[0]),float(dec00[1]),float(dec00[2]) if '-' in str(dec0): DEC=(-1)*((dec2/60....
mit
-690,957,344,061,526,800
49.333652
202
0.531653
false
PWhiddy/kbmod
tests/test_search.py
1
2185
import unittest from kbmod import * class test_search(unittest.TestCase): def setUp(self): # test pass thresholds self.pixel_error = 0 self.velocity_error = 0.05 self.flux_error = 0.15 # image properties self.imCount = 20 self.dim_x = 80 self.dim_y = 60 self.n...
bsd-2-clause
-5,985,410,063,745,612,000
31.61194
82
0.59405
false
Azure/azure-sdk-for-python
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_policy_set_definitions_operations.py
1
32791
# 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
-4,460,960,425,632,557,600
48.161919
228
0.64722
false
campadrenalin/EJTP-lib-python
ejtp/router.py
1
4185
''' This file is part of the Python EJTP library. The Python EJTP library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. the Python EJTP ...
lgpl-3.0
6,737,040,065,496,525,000
30
89
0.601912
false
karst87/ml
algorithm/tree/TreePlotter.py
1
3837
# -*- coding:utf-8 -*-   import matplotlib.pyplot as plt # 定义文本框和箭头格式   decisionNode = dict(boxstyle="round4", color='#3366FF')  #定义判断结点形态   leafNode = dict(boxstyle="circle", color='#FF6633')  #定义叶结点形态   arrow_args = dict(arrowstyle="<-", color='g')  #定义箭头      #绘制带箭头的注释   def plotNode(nodeTxt, centerPt, parentPt, n...
mit
-5,427,900,443,987,626,000
36.25
95
0.602216
false
velezj425/what-to-make-site
what2make/search/models.py
1
1307
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models # ingredient type model class Ing_Type(models.Model): name = models.CharField(max_length=10) def __str__(self): return self.name # ingredient model class Ingredient(models.Model): name...
mit
-1,735,113,689,992,681,700
29.395349
69
0.709258
false
thricehex/thricemangle
thricemangle.py
1
8106
#!/usr/bin/env python3 __author__ = 'thricehex' __version__ = '7.3.15' # Script for generating password wordlists by mangling keywords, numbers, # or existing wordlists into common password structures. # Author: Garrett Smith(ThriceHex) # Version: 7.3.15 import argparse import os import subprocess descript = 'Gene...
gpl-2.0
-2,885,668,252,407,171,000
38.735294
164
0.627807
false
huku-/pyxed
tests/test_decode.py
1
2160
import pytest import pyxed def test_decode_invalid_instruction(xed32): xed32.itext = b"\xff" with pytest.raises(pyxed.InvalidInstructionError): xed32.decode() def test_decode_invalid_offset(xed32): xed32.itext = b"\xc3" xed32.itext_offset = 2 with pytest.raises(pyxed.InvalidOffsetError...
bsd-2-clause
7,286,809,739,988,972,000
27.051948
78
0.646296
false
JohnLZeller/dd-agent
ddagent.py
1
19329
#!/opt/datadog-agent/embedded/bin/python ''' Datadog www.datadoghq.com ---- Make sense of your IT Data Licensed under Simplified BSD License (see LICENSE) (C) Boxed Ice 2010 all rights reserved (C) Datadog, Inc. 2010-2013 all rights reserved ''' # set up logging before importing any other...
bsd-3-clause
3,860,178,566,576,881,000
35.469811
148
0.603032
false
hewittc/goldfish
proc/stat.py
1
3773
# # Copyright (C) 2015 Christopher Hewitt # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publ...
mit
-2,366,602,971,270,785,000
37.896907
82
0.578055
false
skosukhin/spack
var/spack/repos/builtin/packages/liboldx/package.py
1
1661
############################################################################## # 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,262,721,239,360,169,000
41.589744
78
0.671282
false
pdl30/rnaseq_misc
stop_codon_analysis.py
1
1827
#!/usr/bin/python ######################################################################## # 9 Jan 2015 # Patrick Lombard, Centre for Stem Stem Research # Core Bioinformatics Group # University of Cambridge # All right reserved. ######################################################################## import argparse ...
gpl-2.0
3,056,716,882,466,971,000
25.492754
123
0.569239
false
dacjames/mara-lang
bootstrap/mara/test/test_util.py
1
4454
import string import random from .. import util def _random_prefixes(): # pylint: disable=E1101 prefixes = { None: 10 } for _ in range(100): length = random.choice(range(1, 20)) prefix = ''.join([random.choice(string.letters) for _ in range(length)]) count = random.cho...
mit
-7,904,140,119,255,511,000
23.744444
87
0.577234
false
FPAL-Stanford-University/FloATPy
floatpy/utilities/data_reshaper.py
1
4970
import numpy class DataReshaper(object): def __init__(self, dimension, data_order='F'): if dimension < 1 or dimension > 3: raise ValueError("Number of dimensions should be between 1 and 3!") self._dim = dimension if data_order != 'C' and \ ...
lgpl-3.0
-4,283,810,559,916,288,000
37.230769
116
0.503421
false
HazyResearch/snorkel
snorkel/vis/tree_structs.py
1
4294
import json import os import re import lxml.etree as et from snorkel.utils import corenlp_cleaner directory = os.path.abspath(os.path.dirname(__file__)) # Load IPython display functionality libs if possible i.e. if in IPython try: from IPython.core.display import display_html, HTML, display_javascript, Javascript e...
apache-2.0
-6,988,357,913,014,187,000
32.811024
108
0.656497
false