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
joke2k/faker
faker/providers/currency/th_TH/__init__.py
1
10596
from .. import Provider as CurrencyProvider # Names taken from https://std.moc.go.th/std/codelist_detail/40 class Provider(CurrencyProvider): # Format: (code, name) currencies = ( ("AED", "ดีแรห์ม สหรัฐอาหรับเอมิเรตส์"), ("AFN", "อัฟกานิ"), ("ALL", "เลค"), ("AMD", "ดีแรห์ม อาร...
mit
2,836,218,077,930,482,700
32.537634
66
0.38538
false
obedmr/MPIaaS
app/echoserv.py
1
1498
#!/usr/bin/env python from twisted.internet.protocol import Protocol, Factory from twisted.internet import reactor import twisted.internet.error import sys import ConfigParser CONFIG_CONF = "setup.conf" PORT=8000 class Echo(Protocol): def dataReceived(self, data): """ As soon as any data is rece...
apache-2.0
-7,503,330,617,456,163,000
25.280702
56
0.55474
false
qedsoftware/commcare-hq
custom/ilsgateway/tests/handlers/utils.py
1
8375
from corehq.apps.accounting.models import BillingAccount, DefaultProductPlan, SoftwarePlanEdition, Subscription from corehq.apps.accounting.tests import generator from corehq.apps.commtrack.models import CommtrackActionConfig from corehq.apps.custom_data_fields import CustomDataFieldsDefinition from corehq.apps.custom_...
bsd-3-clause
273,365,825,518,556,500
41.085427
115
0.615522
false
SimoneLucia/EmbASP-Python
languages/asp/answer_set.py
1
1221
from languages.asp.asp_mapper import ASPMapper class AnserSet(object): """A collection of data representing a generic Answer Set""" def __init__(self, value, weightMap=dict()): self.__value = value # Where data of answer set is stored self.__weight_map = weightMap # Where weights of the ...
mit
-8,103,394,283,243,837,000
31.131579
83
0.564292
false
nkoep/pymanopt
pymanopt/manifolds/psd.py
1
15204
import warnings import numpy as np from numpy import linalg as la, random as rnd from scipy.linalg import expm # Workaround for SciPy bug: https://github.com/scipy/scipy/pull/8082 try: from scipy.linalg import solve_continuous_lyapunov as lyap except ImportError: from scipy.linalg import solve_lyapunov as lyap...
bsd-3-clause
3,308,188,274,906,176,000
36.173594
79
0.615496
false
UrLab/DocHub
www/rest_urls.py
1
1862
from rest_framework.routers import APIRootView, DefaultRouter import catalog.rest import documents.rest import notifications.rest import search.rest import telepathy.rest import users.rest import www.rest class DochubAPI(APIRootView): """ This is the API of DocHub. You are free to use it to crawl DocHub...
agpl-3.0
402,545,330,675,040,000
34.807692
100
0.762084
false
pombredanne/django-bulbs
example/settings.py
1
2779
import os MODULE_ROOT = os.path.dirname(os.path.realpath(__file__)) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:' } } USE_TZ = True, CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } TEMPLATE_DIRS = (...
mit
1,383,098,583,233,259,800
24.263636
65
0.56783
false
pombredanne/discern
examples/problem_grader/grader/models.py
1
5156
from django.db import models from django.contrib.auth.models import User from django.forms.models import model_to_dict from django.db.models.signals import post_save, pre_save import random import string from django.conf import settings import requests import json import logging log= logging.getLogger(__name__) class...
agpl-3.0
7,535,211,253,820,330,000
32.480519
119
0.632661
false
mabotech/mabo.io
py/AK/test/redis_lua000.py
1
1801
# -*- coding: utf-8 -*- """ redis lua redis eval, notyify in lua script """ import time import redis def main(key, val, key2, val2): # connection pool r = redis.Redis(host='localhost', port=6379, db=5) d = {"a":"v1"} """ eval("lua script","number of kkeys", keys[],argv[]) KEYS[...
mit
-3,571,517,743,080,625,000
17.770833
61
0.481954
false
switchboardpy/switchboard
switchboard/manager.py
1
7753
""" switchboard.manager ~~~~~~~~~~~~~~~~ :copyright: (c) 2015 Kyle Adams. :license: Apache License 2.0, see LICENSE for more details. """ import logging from .base import ModelDict from .models import ( Switch, DISABLED, SELECTIVE, GLOBAL, INHERIT, INCLUDE, EXCLUDE, ) from .proxy import SwitchProxy from ...
apache-2.0
-1,019,915,879,707,345,900
32.562771
115
0.559267
false
levilucio/SyVOLT
t_core/HTopClass2TableNAC0.py
1
8862
from core.himesis import Himesis, HimesisPreConditionPatternNAC import cPickle as pickle from uuid import UUID class HTopClass2TableNAC0(HimesisPreConditionPatternNAC): def __init__(self, LHS): """ Creates the himesis graph representing the AToM3 model HTopClass2TableNAC0. """ ...
mit
731,728,089,143,411,300
47.233333
117
0.51072
false
Paytokens/payblockd
lib/components/assets.py
1
14549
import os import logging import decimal import base64 import json from datetime import datetime from lib import config, util, util_litecoin ASSET_MAX_RETRY = 3 D = decimal.Decimal def parse_issuance(db, message, cur_block_index, cur_block): if message['status'] != 'valid': return def modify_extended...
mit
-6,619,063,133,526,564,000
51.146953
159
0.589113
false
MalloyDelacroix/DownloaderForReddit
Tools/ui_converter.py
1
5130
#!/usr/bin/env python import sys import os import subprocess class Converter: base_ui_path = os.path.relpath('Resources/ui_files') base_out_path = os.path.relpath('DownloaderForReddit/guiresources') def __init__(self, ui_file): self.ui_file = ui_file self.callable_methods = [ ...
gpl-3.0
8,101,822,332,021,041,000
26.433155
116
0.571345
false
duncan-r/SHIP
ship/utils/fileloaders/fileloader.py
1
2254
""" Summary: Main file loader for the API. This offers convenience methods to make it simple to load any type of file from one place. Author: Duncan Runnacles Created: 01 Apr 2016 Copyright: Duncan Runnacles 2016 TODO: Updates: """ from __future__ import unicode_literals fro...
mit
366,836,191,615,290,940
26.82716
93
0.60071
false
arrabito/DIRAC
ConfigurationSystem/Service/ConfigurationHandler.py
1
3918
""" The CS! (Configuration Service) """ __RCSID__ = "$Id$" from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERROR from DIRAC.ConfigurationSystem.private.ServiceInterface import ServiceInterface from DIRAC.Core.DISET.RequestHandler import RequestHandler from DIRAC.Core.Utilities import DErrno gServiceInterface =...
gpl-3.0
-4,709,197,104,656,305,000
33.368421
114
0.710822
false
lunixbochs/nullstatic
gen.py
1
2581
#!/usr/bin/env python2 from collections import defaultdict from datetime import date, datetime from email.Utils import formatdate import frontmatter import jinja2 import markdown import os import sys import time import yaml @jinja2.contextfilter def _render(context, data): return env.from_string(data['source']).re...
mit
-623,981,896,369,554,700
37.522388
127
0.586594
false
owais/django-simple-activity
simple_activity/models.py
1
1965
from django.db import models from django.utils.timezone import now from django.conf import settings from django.contrib.contenttypes.models import ContentType from filtered_contenttypes.fields import FilteredGenericForeignKey from django_pgjson.fields import JsonBField from .managers import ActionManager from . impor...
bsd-2-clause
2,345,284,087,180,824,000
34.727273
80
0.672774
false
EmanueleCannizzaro/scons
test/Clean/Option.py
1
2620
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to us...
mit
-4,647,620,131,027,711,000
29.465116
94
0.711832
false
olhoneles/olhoneles
montanha/management/commands/collectors/algo.py
1
12094
# -*- coding: utf-8 -*- # # Copyright (©) 2010-2013 Estêvão Samuel Procópio # Copyright (©) 2010-2013 Gustavo Noronha Silva # Copyright (©) 2013 Marcelo Jorge Vieira # Copyright (©) 2014 Wilson Pinto Júnior # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero...
agpl-3.0
-3,635,771,197,065,837,000
34.532353
110
0.552934
false
mupif/mupif
mupif/Field.py
1
42683
# # MuPIF: Multi-Physics Integration Framework # Copyright (C) 2010-2015 Borek Patzak # # Czech Technical University, Faculty of Civil Engineering, # Department of Structural Mechanics, 166 29 Prague, Czech Republic # # This library is free software; you can redistribute it and/or # modify i...
lgpl-3.0
7,138,186,339,437,092,000
43.094008
381
0.597896
false
j4321/tkFileBrowser
docs/conf.py
1
5256
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
gpl-3.0
8,686,003,906,744,522,000
29.034286
79
0.649543
false
unisport/thumblr
thumblr/tasks.py
1
1681
from django.conf import settings from celery import Celery, Task from raven import Client import usecases client = Client(settings.SENTRY_DSN) celery = Celery('tasks') celery.conf.update( AWS_ACCESS_KEY_ID=settings.AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY=settings.AWS_SECRET_ACCESS_KEY, CELERY_TASK_SE...
mit
-463,160,966,042,746,240
33.326531
100
0.558001
false
guaka/trust-metrics
trustlet/pymmetry/file_certs.py
1
9725
#!/usr/bin/env python """ file_certs.py: File-based Trust Metric Profiles (example code) Copyright (C) 2001 Luke Kenneth Casson Leighton <lkcl@samba-tng.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 S...
gpl-2.0
-2,231,080,821,749,822,500
27.943452
77
0.668072
false
natduca/ndbg
util/vec2.py
1
3522
# Copyright 2011 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,...
apache-2.0
5,074,446,273,003,439,000
20.47561
121
0.561045
false
KT26/PythonCourse
8. Class/8.py
1
1268
# Created by PyCharm Pro Edition # User: Kaushik Talukdar # Date: 24-04-17 # Time: 12:29 AM # INHERITANCE # We can create a new class, but instead of writing it from scratch, we can base it on an existing class. # Lets understand inheritance better with an exa...
mit
-6,550,018,117,725,046,000
31.368421
116
0.630126
false
mjocean/PyProcGameHD-SkeletonGame
procgame/game/game.py
1
34216
import os import sys import pinproc import Queue import yaml import time import copy import logging from procgame import config from gameitems import * from procgame import util from mode import * from pdb import PDBConfig, LED from procgame import LEDs def config_named(name): if not os.path.isfile(name): # If we ...
mit
6,916,193,888,872,393,000
43.902887
211
0.573679
false
Faeriol/news-summarizer
summarizer.py
1
3274
import os from goose3 import Goose from selenium import webdriver from selenium.common.exceptions import UnexpectedAlertPresentException, SessionNotCreatedException, WebDriverException from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer from sumy.summarizers.lsa import LsaSummar...
mit
-2,505,183,108,841,201,700
32.408163
118
0.626145
false
corerd/PyDomo
powerman/pwrmonitor.py
1
6768
#!/usr/bin/env python # # The MIT License (MIT) # # Copyright (c) 2019 Corrado Ubezio # # 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 r...
mit
-1,850,814,616,450,463,200
30.18894
85
0.655585
false
David-Estevez/telegram-bots
JukeBot/JukeBot.py
1
3850
######################################################################### ## ## JukeBot - Telegram bot to control a media player ## ######################################################################### import ConfigParser import os import re, string from twx.botapi import TelegramBot, ReplyKeyboardMarkup from Med...
gpl-2.0
314,643,668,958,966,200
31.083333
91
0.473247
false
jolyonb/edx-platform
common/lib/chem/chem/miller.py
1
9303
""" Calculation of Miller indices """ from __future__ import absolute_import import decimal import fractions as fr import json import math import numpy as np from six.moves import map from six.moves import range from functools import reduce def lcm(a, b): """ Returns least common multiple of a, b Args:...
agpl-3.0
2,638,268,032,322,332,000
32.584838
122
0.5868
false
maaaaz/fgpoliciestocsv
fgaddressestocsv.py
1
6306
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of fgpoliciestocsv. # # Copyright (C) 2014, 2020, Thomas Debize <tdebize at mail.com> # All rights reserved. # # fgpoliciestocsv is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as pu...
gpl-3.0
7,071,415,867,654,911,000
35.04
165
0.595465
false
s5brown/MLfeatures
assignment_1_Sebastian_Brown.py
1
3964
"""Assignment 1.""" from assignment_1_eval import pairs vowels = ['a', 'e', 'i', 'o', 'u'] es_sounds = ['ch', 's', 'z'] no_change = [ 'economics', 'mathematics', 'statistics', 'luggage', 'baggage', 'furniture', 'information', 'gymnastics', 'news'] always_singular = ['fish', 'barracks', 'deer',...
gpl-3.0
-5,668,059,858,905,396,000
31.760331
114
0.573411
false
qtproject/pyside-pyside
tests/QtQml/registertype.py
1
3725
############################################################################# ## ## Copyright (C) 2016 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of PySide2. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ## Licensees holding valid commercial ...
lgpl-2.1
2,296,957,859,559,989,800
30.567797
96
0.651812
false
vmarkovtsev/django-apiblueprint-tests
__main__.py
1
2997
# -*- coding: utf-8 -*- """ Django REST framework tests generator which is based on API Blueprint (https://apiblueprint.org/) documents. Released under New BSD License. Copyright © 2015, Vadim Markovtsev :: AO InvestGroup All rights reserved. Redistribution and use in source and binary forms, with or without modifica...
bsd-3-clause
-5,848,360,594,570,658,000
48.114754
79
0.70227
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/campaign_simulation_service/client.py
1
19104
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-7,526,720,101,945,983,000
45.144928
280
0.63505
false
bmd/twittrscrapr
twittrscrapr/scrapers/timelinescrapr.py
1
1459
import logging from ..parsers import DictParser from base_scraper import TwittrScrapr log = logging.getLogger('scrapers.TimelineScrapr') class TimelineScrapr(TwittrScrapr): def __init__(self, api_keys, writer): super(TimelineScrapr, self).__init__(api_keys, writer) def _fetch_user_timeline(self, us...
mit
-2,145,231,821,339,842,000
33.738095
112
0.592872
false
astroclark/BayesSpec
waveforms/waveforms2hdf5.py
1
1186
#!/usr/bin/env python """ waveforms2hdf5.py loops over the list of waveforms defined in this script and dumps out an hdf5 file for the plus polarisation. The idea is to then compute the Shannon entropy of the waveforms using Matlab's wentropy.m function. """ import h5py import numpy as np import pmns_utils wfs='/Use...
gpl-2.0
-5,496,950,762,767,886,000
29.410256
78
0.713322
false
Ziqi-Li/bknqgis
pandas/pandas/core/reshape/reshape.py
1
45812
# pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 from pandas.compat import range, zip from pandas import compat import itertools import re import numpy as np from pandas.core.dtypes.common import ( _ensure_platform_int, is_list_like, is_bool_dtype, needs_i8_conversion) from pandas.c...
gpl-2.0
8,329,274,033,396,292,000
33.239163
79
0.56005
false
zackw/pelican
pelican/readers.py
1
25554
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import logging import os import re from collections import OrderedDict import docutils import docutils.core import docutils.io from docutils.writers.html4css1 import HTMLTranslator, Writer import six from six.moves.html_parser import HTM...
agpl-3.0
7,005,900,722,206,514,000
35.349929
79
0.559678
false
Wikidata/StrepHit
strephit/commons/date_normalizer.py
1
7746
from __future__ import absolute_import import yaml import re import os import logging logger = logging.getLogger(__name__) class DateNormalizer(object): """ find matches in text strings using regular expressions and transforms them according to a pattern transformation expression evaluated on the match ...
gpl-3.0
4,360,993,509,104,244,700
41.097826
98
0.590627
false
FedericoRessi/networking-odl
networking_odl/ml2/network_topology.py
1
12691
# Copyright (c) 2015-2016 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 # # Un...
apache-2.0
132,776,603,059,931,380
38.659375
79
0.588527
false
tayebzaidi/PPLL_Spr_16
chat/client3.py
1
1260
from multiprocessing.connection import Client from random import random from time import sleep from multiprocessing.connection import Listener from multiprocessing import Process local_listener = (('127.0.0.1', 5003),'secret client 3 password') def client_listener(): cl = Listener(address=local_listener[0], auth...
gpl-3.0
7,113,699,005,899,186,000
28.302326
80
0.605556
false
laalaguer/gae-blog-module
gaesession/handlers.py
1
7633
import webapp2 from webapp2_extras import sessions class MainHandler(webapp2.RequestHandler): def get(self): # Session is stored on both client browser and our database session_1 = self.session_store.get_session(name='dbcookie',backend='datastore') previous_value_1 = session_1.get("my_attr_...
apache-2.0
-2,670,067,092,621,807,600
45.266667
120
0.617844
false
fluxcapacitor/pipeline
libs/pipeline_model/tensorflow/core/framework/tensor_slice_pb2.py
1
4870
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/core/framework/tensor_slice.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.proto...
apache-2.0
6,296,427,293,374,174,000
35.343284
406
0.742094
false
nrz/ylikuutio
external/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/sensors/sensor.py
2
15551
# Lint as: python3 """A sensor prototype class. The concept is explained in: go/minitaur-gym-redesign-1.1 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from typing import Any, Iterable, Optional, Sequence, Text, Tuple, Union import gin import gym im...
agpl-3.0
3,822,107,709,921,278,000
33.481153
82
0.663301
false
winklerand/pandas
asv_bench/benchmarks/replace.py
1
2171
from .pandas_vb_common import * class replace_fillna(object): goal_time = 0.2 def setup(self): self.N = 1000000 try: self.rng = date_range('1/1/2000', periods=self.N, freq='min') except NameError: self.rng = DatetimeIndex('1/1/2000', periods=self.N, offset=date...
bsd-3-clause
1,624,599,673,181,421,300
30.014286
91
0.587748
false
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Lib/encodings/cp737.py
1
7357
""" Python Character Mapping Codec generated from 'CP737.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(s...
gpl-3.0
5,513,657,414,712,581,000
40.773256
79
0.735626
false
sebastiaangroot/kmaldetect
tools/build/gen_syscall_table.py
1
1860
""" A simple python script to generate a sh table that takes the name of a syscall as input and translates it to the number corrosponding with that syscall. This function is used in the sig_gen.sh script, used to generate an application signature for detection in kmaldetect. Keep in mind that the '\n' characters used h...
gpl-2.0
9,037,986,725,254,694,000
38.595745
152
0.634409
false
nodermann/holdem_poker_combinations
tests.py
1
1924
__author__ = 'Lucian' from poker_combinations import get_combo_name from sort import sort_high_to_low, sort_by_color from const import values, colors, color_names import time def get_deck(): deck = [] for i, color in enumerate(colors): for value in list(reversed(values)): deck.a...
mit
5,263,241,053,939,743,000
31.206897
91
0.515593
false
lijoantony/django-oscar-api
oscarapi/basket/operations.py
1
3871
"This module contains operation on baskets and lines" from django.conf import settings from oscar.core.loading import get_model, get_class from oscar.core.utils import get_default_currency from oscar.core.prices import Price __all__ = ( 'apply_offers', 'assign_basket_strategy', 'prepare_basket', 'get_b...
bsd-3-clause
7,321,325,571,453,484,000
27.463235
72
0.675794
false
mtils/ems
ems/qt/graphics/scene_manager.py
1
7140
from ems.typehint import accepts from ems.qt.event_hook_proxy import SignalEventHookProxy from ems.qt import QtWidgets, QtGui, QtCore, QtPrintSupport from ems.qt.graphics.graphics_scene import GraphicsScene, BackgroundCorrector from ems.qt.graphics.graphics_widget import GraphicsWidget from ems.qt.graphics.storage.int...
mit
2,377,236,452,932,278,300
32.683962
110
0.67605
false
pgmillon/ansible
lib/ansible/modules/database/postgresql/postgresql_tablespace.py
1
16280
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Flavien Chantelot (@Dorn-) # Copyright: (c) 2018, Antoine Levy-Lambert (@antoinell) # Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ...
gpl-3.0
-1,845,519,248,354,585,000
31.047244
120
0.615602
false
inspirehep/invenio-formatter
invenio_formatter/models.py
1
1670
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2015 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 option) any...
gpl-2.0
-1,471,349,621,209,438,200
26.377049
74
0.651497
false
Wolkabout/WolkConnect-Python-
wolk/models/__init__.py
1
1275
from .ActuatorCommand import ActuatorCommand from .ActuatorCommandType import ActuatorCommandType from .ActuatorState import ActuatorState from .ActuatorStatus import ActuatorStatus from .Alarm import Alarm from .ConfigurationCommand import ConfigurationCommand from .ConfigurationCommandType import ConfigurationCommand...
apache-2.0
-2,715,640,380,868,830,000
31.692308
62
0.807059
false
Polytechnique-org/xorgauth
xorgauth/accounts/migrations/0012_make_user_names_blank.py
1
1028
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-01-04 13:41 from __future__ import unicode_literals from django.db import migrations, models import xorgauth.utils.fields class Migration(migrations.Migration): dependencies = [ ('accounts', '0011_make_user_ids_blank'), ] operations =...
agpl-3.0
2,887,847,014,832,465,000
31.125
110
0.577821
false
Souloist/Audio-Effects
Effects/Amplitude_Modulation/AM_example.py
1
1911
# Play a wave file with amplitude modulation. # Assumes wave file is mono. # This implementation reads and plays a one frame (sample) at a time (no blocking) """ Read a signal from a wave file, do amplitude modulation, play to output Original: pyrecplay_modulation.py by Gerald Schuller, Octtober 2013 Modified to read ...
mit
-6,821,632,004,709,263,000
26.695652
82
0.6719
false
mattpitkin/GraWIToNStatisticsLectures
figures/scripts/pvalue.py
1
1242
#!/usr/bin/env python """ Make plots showing how to calculate the p-value """ import matplotlib.pyplot as pl from scipy.stats import norm from scipy.special import erf import numpy as np mu = 0. # the mean, mu sigma = 1. # standard deviation x = np.linspace(-4, 4, 1000) # x # set plot to render labels using latex ...
mit
2,189,113,514,410,378,800
22.884615
100
0.625604
false
mozvip/Sick-Beard
sickbeard/logger.py
1
6374
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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...
gpl-3.0
-7,407,349,847,844,336,000
32.464865
118
0.568089
false
c2corg/v6_api
c2corg_api/search/mappings/image_mapping.py
1
1144
from c2corg_api.models.image import IMAGE_TYPE, Image from c2corg_api.search.mapping import SearchDocument, BaseMeta from c2corg_api.search.mapping_types import QueryableMixin, QEnumArray, \ QInteger, QDate class SearchImage(SearchDocument): class Meta(BaseMeta): doc_type = IMAGE_TYPE activities ...
agpl-3.0
6,425,518,314,371,161,000
29.105263
79
0.681818
false
ar4s/django
django/forms/widgets.py
1
32506
""" HTML Widget classes """ from __future__ import unicode_literals import copy from itertools import chain import warnings from django.conf import settings from django.forms.utils import flatatt, to_current_timezone from django.utils.datastructures import MultiValueDict, MergeDict from django.utils.html import cond...
bsd-3-clause
-8,474,089,965,727,551,000
35.813137
130
0.596628
false
gift-surg/GIFT-Grab
src/tests/blackmagic/stereo_capture.py
1
4325
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Example demonstrating how stereo video frames can be captured using a frame grabber card that supports this feature. """ import time import cv2 import numpy as np from pygiftgrab import (IObserver, VideoSourceFactory, ColourSpace, Device, Vide...
bsd-3-clause
-5,324,610,510,568,604,000
32.269231
71
0.52
false
arcade-lab/tia-infrastructure
tools/simulator/system.py
1
9352
""" Top-level system wrapper. """ import re import sys import pandas as pd from simulator.exception import SimulatorException class System: """ A system class to wrap a collection of processing and memory elements as well as the channels through which they communicate. """ def __init__(self): ...
mit
3,835,425,596,161,252,000
34.558935
118
0.572391
false
Mariaanisimova/pythonintask
IVTp/2014/Shcherbakov_R_A/task_12_22.py
1
1719
# Задача 12. Вариант 22. # Разработайте игру "Крестики-нолики". (см. М.Доусон Программируем на Python # гл. 6). # Щербаков Р.А. # 22.05.2016 print(""" Добро пожаловать на игру крестики нолики чтобы сделать ход введите число от 0 до 8 0 | 1 | 2 --------- 3 | 4 | 5 ------...
apache-2.0
7,851,925,064,230,096,000
25.137931
76
0.446205
false
muff1nman/duplicity
duplicity/manifest.py
1
16791
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License...
gpl-2.0
-1,987,972,922,932,362,800
32.183794
128
0.546602
false
karpeev/libmesh
doc/statistics/libmesh_citations.py
1
2340
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Number of "papers using libmesh" by year. # # Note 1: this does not count citations "only," the authors must have actually # used libmesh in part of their work. Therefore, these counts do not include # things like Wolfgang citing us in his pap...
lgpl-2.1
-5,032,296,851,778,894,000
26.529412
78
0.674359
false
meisterluk/print-nonascii.py
printnonascii/char.py
1
2308
#!/usr/bin/env python3 class Character: def __init__(self, c): self.character = c self.unicode_point = None self.lineno = None self.colno = None self.category = None self.description = None self.line = None def asciionly(self): assert self.descri...
bsd-3-clause
-7,909,865,003,349,707,000
30.135135
75
0.503906
false
building4theweb/soundem-api
soundem/views.py
1
5875
from flask import g, jsonify, request, abort from flask_cors import cross_origin from soundem import app from .decorators import auth_token_required from .models import Artist, Album, Song, User @app.route('/api/v1/login', methods=['POST']) @cross_origin(headers=['Content-Type', 'Authorization']) def login(): d...
mit
6,891,862,848,539,757,000
24.323276
65
0.584
false
notkarol/banjin
experiment/python_word_matching_speed.py
1
4650
#!/usr/bin/python # Takes in a dictionary of words # Verifies that all functions return the same answers # Generates random hands from the probability of getting tiles from the bunch # Then prints out how long each function takes to find all matching words # Generates various hand sizes to see if there's any scaling ...
mit
6,223,729,968,353,600,000
29.794702
99
0.60043
false
cloudtools/nymms
nymms/reactor/handlers/ses_handler.py
1
1939
import logging from nymms.reactor.handlers.Handler import Handler from nymms.utils.aws_helper import ConnectionManager from jinja2 import Template from nymms.utils.templates import SimpleUndefined logger = logging.getLogger(__name__) class SESHandler(Handler): """ A basic handler to send alerts to people via e...
bsd-2-clause
-822,869,434,789,663,400
35.584906
76
0.638989
false
asweigart/pyganim
examples/sprite_sheet_demo.py
1
1276
# trex image from Wyverii on http://opengameart.org/content/unsealed-terrex import sys import os sys.path.append(os.path.abspath('..')) import pygame from pygame.locals import * import pyganim pygame.init() # set up the window windowSurface = pygame.display.set_mode((320, 240), 0, 32) pygame.display.set_caption('Spr...
bsd-3-clause
-1,025,960,563,565,159,800
27.377778
83
0.633229
false
Xeralux/tensorflow
tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py
1
59833
# Copyright 2017 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
-8,393,192,901,681,401,000
40.782821
94
0.670449
false
Vladimir-Ivanov-Git/raw-packet
Scripts/DHCP/dhcp_rogue_server.py
1
47873
#!/usr/bin/env python # region Import from sys import path from os.path import dirname, abspath project_root_path = dirname(dirname(dirname(abspath(__file__)))) utils_path = project_root_path + "/Utils/" path.append(utils_path) from base import Base from network import Ethernet_raw, ARP_raw, IP_raw, UDP_raw, DHCP_raw...
unlicense
2,859,265,539,066,611,700
41.478261
131
0.544649
false
jadhavhninad/-CSE_515_MWD_Analytics-
Phase 1/Project Code/phase1_code/differentiate_genre.py
1
17298
from mysqlConn import DbConnect import argparse import operator from math import log,fabs import pprint #DB connector and curosor db = DbConnect() db_conn = db.get_connection() cur2 = db_conn.cursor(); #Argument parser parser = argparse.ArgumentParser() parser.add_argument("GENRE1") parser.add_argument("GENRE2") par...
gpl-3.0
3,274,444,029,248,706,600
33.875
133
0.578737
false
mettadatalabs1/oncoscape-datapipeline
db/db_config.py
1
2247
from yaml import load as load_yaml config_file = "/Users/namelessnerd/oncodata/db/connection_params.yml" def load_db_configuration(config_file=config_file): with open(config_file, "r") as config_file: configs = load_yaml(config_file) return configs def create_mongo_protocol(project_id, connection_par...
apache-2.0
-1,887,707,074,555,252,500
43.058824
78
0.546951
false
campaul/dicebox
dicebox/test/test_dice.py
1
4083
import mock import pytest from dicebox.dice import Add, Best, Die, DiceFactory, Modifier, Pool, Sort, Worst class TestDiceFactory(object): @pytest.fixture def sides(self): return 20 def test_call(self, sides): assert type(DiceFactory()(sides)) == Die def test_bias(self, sides): ...
mit
7,768,028,179,165,356,000
21.311475
81
0.590987
false
brettdh/rbtools
rbtools/commands/status.py
1
2506
import logging from rbtools.commands import Command, Option from rbtools.utils.repository import get_repository_id from rbtools.utils.users import get_username class Status(Command): """Display review requests for the current repository.""" name = "status" author = "The Review Board Project" descript...
mit
7,896,034,050,389,022,000
33.805556
77
0.553472
false
mennanov/django-blueprint
project_name/apps/navigation/models.py
1
1661
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from mptt.models import TreeForeignKey, TreeManyToManyField, MPTTModel class Navigation(models.Model): """ Navigation menu """ key = models.CharField(_(u'key'), max_length=32, help_text=_(u'Thi...
gpl-2.0
-8,933,735,953,260,462,000
30.358491
118
0.64118
false
ity/pants
src/python/pants/engine/nodes.py
1
17119
# 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, generators, nested_scopes, print_function, unicode_literals, with_statement) from abc import abst...
apache-2.0
3,330,527,426,951,108,000
38.904429
139
0.691629
false
Hummer12007/pomu
pomu/repo/repo.py
1
9456
"""Subroutines with repositories""" from os import path, rmdir, makedirs from shutil import copy2 from git import Repo from patch import PatchSet import portage from pomu.package import Package, PatchList from pomu.util.cache import cached from pomu.util.fs import remove_file, strip_prefix from pomu.util.result impo...
gpl-2.0
5,766,960,781,250,393,000
38.07438
167
0.579315
false
Siosm/contextd-capture
piga-systrans/selaudit/selaudit.py
2
25513
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Configuration # Templates basepolname = 'template/module' base_transpol_name = 'template/temp_transition' makefile_path = 'template/Makefile' # Default value for the template variables user_u_default = 'user_u' user_r_default = 'user_r' user_t_default = 'user_t' module_d...
gpl-3.0
-7,108,910,309,036,765,000
32.52431
267
0.65428
false
rossella/neutron
quantum/openstack/common/rpc/impl_zmq.py
1
25519
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Cloudscaling Group, 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/LI...
apache-2.0
-8,324,594,890,385,945,000
31.018821
78
0.568361
false
anlutro/botologist
plugins/qlranks.py
1
2116
import logging log = logging.getLogger(__name__) import requests import requests.exceptions import botologist.plugin def _get_qlr_data(nick): url = "http://www.qlranks.com/api.aspx" response = requests.get(url, {"nick": nick}, timeout=4) return response.json()["players"][0] def _get_qlr_elo(nick, mod...
mit
1,812,270,986,986,135,800
28.388889
86
0.58034
false
Aloomaio/googleads-python-lib
examples/ad_manager/v201808/reconciliation_report_row_service/get_reconciliation_report_rows_for_reconciliation_report.py
1
2609
#!/usr/bin/env python # # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
5,258,400,101,180,364,000
39.765625
78
0.706401
false
ZeitOnline/zeit.content.article
src/zeit/content/article/tests/test_article.py
1
17840
# coding: utf8 from zeit.cms.workflow.interfaces import CAN_PUBLISH_ERROR from zeit.cms.workflow.interfaces import CAN_PUBLISH_SUCCESS import lxml.etree import mock import zeit.cms.checkout.helper import zeit.cms.content.interfaces import zeit.cms.content.reference import zeit.cms.interfaces import zeit.cms.workflow.in...
bsd-3-clause
5,625,414,481,670,800,000
40.635514
79
0.654714
false
minimalparts/Tutorials
RLcafe/caffe.py
1
3150
import numpy as np import random environment = { 0: [('buongiorno',[[1,0,1]]),('un caffè',[[7,0,1]])], 1: [('un caffè',[[2,0,0.8],[12,-2,0.2]])], 2: [('per favore',[[3,0,1]]),('EOS',[[5,-2,0.9],[6,-1,0.1]])], 3: [('EOS',[[4,-1,1]])], 7: [('per favore',[[8,0,1]]),('EOS',[[9,-3,1]])], 8: [('EOS',[[10,-2,0.9],[11,-...
mit
-4,122,450,842,618,977,300
30.148515
161
0.586459
false
2prime/DeepLab
NMResNet/init.py
1
2336
''' MSRA INIT net parameter initialization. He K, Zhang X, Ren S, et al. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification, arxiv:1502.01852 Reference:http://damon.studio/2017/06/11/WeightsInitialization/ ''' import torch.nn as nn import torch.nn.init as init ''' usage: class...
mit
-4,048,549,762,413,042,700
28.961538
92
0.536387
false
broadinstitute/cms
cms/power/power_func.py
1
8625
## functions for analyzing empirical/simulated CMS output ## last updated 09.14.2017 vitti@broadinstitute.org import matplotlib as mp mp.use('agg') import matplotlib.pyplot as plt import numpy as np import math from scipy.stats import percentileofscore ################### ## DEFINE SCORES ## ################### def...
bsd-2-clause
7,845,082,051,252,510,000
34.9375
143
0.679072
false
vmg/hg-stable
hgext/patchbomb.py
1
21405
# patchbomb.py - sending Mercurial changesets as patch emails # # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''command to send changesets as (a series of) patch ...
gpl-2.0
-2,522,663,191,073,142,300
37.15508
80
0.575286
false
geosohh/AnimeTorr
animetorr/manager/log.py
1
7132
# -*- coding: utf-8 -*- """ Log window. """ __author__ = 'Sohhla' import os from PyQt4 import QtGui, QtCore from qt.log import Ui_Dialog as Ui_Log from shared import constant # TODO: Works, but waaaaaay too slow to load class LogUpdater(QtCore.QObject): """ Updates the [Log window]. """ finish = Qt...
gpl-2.0
-3,731,463,448,882,287,600
35.768041
122
0.514582
false
metno/gridpp
tests/neighbourhood_quantile_fast_test.py
1
5647
from __future__ import print_function import unittest import gridpp import numpy as np lats = [60, 60, 60, 60, 60, 70] lons = [10,10.1,10.2,10.3,10.4, 10] """Simple check 20 21 22 23 24 15 16 17 18 19 10 11 12 13 nan 5 6 7 nan 9 0 1 2 3 4 """ values = np.reshape(range(25), [5, 5]).astype(float) values[1, 3] ...
gpl-2.0
6,977,101,496,407,008,000
39.335714
132
0.606517
false
Fenixin/yogom
tryengine/fontrenderer.py
1
8186
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of TryEngine. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
gpl-3.0
-3,237,735,693,081,282,000
32.137652
107
0.5719
false
kgn/cssutils
src/cssutils/tokenize2.py
1
9735
#!/usr/bin/env python # -*- coding: utf-8 -*- """New CSS Tokenizer (a generator) """ __all__ = ['Tokenizer', 'CSSProductions'] __docformat__ = 'restructuredtext' __version__ = '$Id$' from cssproductions import * from helper import normalize import itertools import re _TOKENIZER_CACHE = {} class Tokeni...
gpl-3.0
-3,785,011,545,157,365,000
41.851351
101
0.451567
false
googleapis/python-dataproc
google/cloud/dataproc_v1/types/__init__.py
1
5250
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
7,266,723,360,725,168,000
24.119617
74
0.719238
false
startcode/apollo
modules/tools/prediction/mlp_train/merge_h5.py
1
2643
#!/usr/bin/env python ############################################################################### # Copyright 2018 The Apollo 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 ...
apache-2.0
-8,108,443,370,418,419,000
32.455696
92
0.595157
false
twitter/heron
integration_test/src/python/integration_test/topology/one_spout_multi_tasks/one_spout_multi_tasks.py
2
1572
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- # 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 Apach...
apache-2.0
4,743,227,587,584,489,000
40.368421
81
0.741094
false
webbhorn/Arduino-Switch-Controller
arduino/arduino.py
1
2214
#!/usr/bin/env python import serial, time class Arduino(object): __OUTPUT_PINS = -1 def __init__(self, port, baudrate=9600): self.serial = serial.Serial(port, baudrate) def __str__(self): return "Arduino is on port %s at %d baudrate" %(self.serial.port, self.serial.baudrate) def ou...
mit
4,657,381,806,307,410,000
24.744186
95
0.555104
false
jimmycallin/master-thesis
architectures/conll16st-v34-focused-rnns/v34/train.py
1
11478
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=C0103,W0621 """ Train the discourse relation sense classifier (CoNLL16st). """ __author__ = "GW [http://gw.tnode.com/] <gw.2016@tnode.com>" __license__ = "GPLv3+" import argparse import codecs import json import logging import os import sys from keras.mod...
mit
9,170,306,203,527,456,000
39.702128
187
0.694372
false
clouserw/zamboni
mkt/websites/views.py
1
1959
from django.db.transaction import non_atomic_requests from rest_framework.generics import ListAPIView from rest_framework.permissions import AllowAny from mkt.api.authentication import (RestOAuthAuthentication, RestSharedSecretAuthentication) from mkt.api.base import CORSMixin, Mar...
bsd-3-clause
-3,533,117,552,146,456,000
38.979592
79
0.720265
false
rizumu/bootmachine
bootmachine/management/__init__.py
1
3322
# (c) 2008-2011 James Tauber and contributors; written for Pinax (http://pinaxproject.com) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php import os import sys import bootmachine BOOTMACHINE_COMMAND_DIR = os.path.join( os.path.dirname(bootmachine.__file__), "management", "com...
mit
-1,116,202,746,595,356,300
30.339623
90
0.54124
false
DiCarloLab-Delft/PycQED_py3
pycqed/utilities/pulse_scheme.py
1
5469
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches def new_pulse_fig(figsize): ''' Open a new figure and configure it to plot pulse schemes. ''' fig, ax = plt.subplots(1, 1, figsize=figsize, frameon=False) ax.axis('off') fig.subplots_adjust(bottom=0, top=1, left=0, ri...
mit
-4,925,029,477,719,938,000
32.552147
89
0.585848
false