repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
vangj/py-bbn
tests/graph/test_variable.py
1
1107
import copy from nose import with_setup from pybbn.graph.variable import Variable def setup(): """ Setup. :return: None. """ pass def teardown(): """ Teardown. :return: None. """ pass @with_setup(setup, teardown) def test_copy(): """ Tests variable copy. :retu...
apache-2.0
-6,682,240,162,407,768,000
17.762712
52
0.566396
false
3.109551
false
false
false
detrout/telepathy-python
examples/roomlist.py
1
2757
from __future__ import print_function import dbus.glib import gobject import logging import sys from time import sleep from account import connection_from_file from telepathy.client.channel import Channel from telepathy.constants import ( CONNECTION_HANDLE_TYPE_NONE as HANDLE_TYPE_NONE, CONNECTION_HANDLE_TYP...
lgpl-2.1
-2,763,615,783,980,631,000
28.329787
74
0.574175
false
4.072378
false
false
false
gregorlarson/loxodo
src/random_password.py
1
3092
#!/usr/bin/env python """ A simple script for making random passwords, WITHOUT 1,l,O,0. Because those characters are hard to tell the difference between in some fonts. """ import sys from random import Random class random_password(object): def __init__(self): self._characters = { 'righthand...
gpl-2.0
-8,314,864,223,982,383,000
34.953488
71
0.494179
false
4.348805
false
false
false
nhuntwalker/expense_tracker
expense_tracker/expense_tracker/views/default.py
1
4951
"""The main views for our expense_tracker app.""" from pyramid.view import view_config, forbidden_view_config from expense_tracker.models import Expense from pyramid.httpexceptions import HTTPFound from pyramid.response import Response import datetime from expense_tracker.security import check_credentials from pyramid...
mit
7,871,310,019,494,615,000
29.561728
75
0.633407
false
3.895358
true
false
false
go2school/Python-HierarchicalSVM
python/liblinear_xiao.py
1
8774
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library import sys import os # For unix the prefix 'lib' is not considered. if find_library('linear'): liblinear = CDLL(find_library('linear')) elif find_library('liblinear'): liblinear = CDLL(find_library('liblinear')) else: if sys.platform =...
bsd-3-clause
6,014,900,592,383,761,000
30.67509
155
0.658992
false
2.691411
false
false
false
ronreiter/interactive-tutorials
constants.py
1
12253
IDEONE_USERNAME = "ronreiter" IDEONE_PASSWORD = "18132ce2b97e" CACHE_HOST = "direct.learnpython.org" DB_HOST = "direct.learnpython.org" SECRET_KEY = "this is a secret. really." LEARNPYTHON_DOMAIN = "learnpython.org" LEARNJAVA_DOMAIN = "learnjavaonline.org" LEARNC_DOMAIN = "learn-c.org" LEARNCPP_DOMAIN = "learn-cpp.org...
apache-2.0
-8,052,458,547,135,455,000
25.350538
84
0.568106
false
2.796212
false
false
false
diego-carvalho/FAiR
app/src/plotGraphs.py
1
3083
# -*- coding: utf-8 -* import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np import seaborn as sns def plot_graphs(listX, listY, labelX, labelY, out, t='nada'): fig, ax = plt.subplots() plt.plot(listX, listY, linewidth=3.0) ax.set_xlabel(labelX, fontsize='xx-large'...
mit
6,083,376,086,326,227,000
27.027273
105
0.639961
false
2.875933
false
false
false
DQE-Polytech-University/Beamplex
src/laserstructure.py
1
3771
import matplotlib.pyplot as plt #stores information about laser structure #saves refraction and electric field profiles in text and graphic form to HDD class Laser: refraction = [] field = [] gridX = [] gridN = [] field = [] def __init__(self, (wavelength, concentration, thickness...
mit
-3,386,450,447,366,524,000
39.43956
119
0.581543
false
4.090022
false
false
false
PhyNerd/pi-timolo
source/pi-timolo.py
1
37923
#!/usr/bin/python # pi-timolo - Raspberry Pi Long Duration Timelapse, Motion Detection, with Low Light Capability # written by Claude Pageau Dec-2014 (original issue) # getStreamImage function based on utpalc code based on brainflakes lightweight motion detection code on Raspberry PI forum - Thanks # Complete pi-timol...
mit
-3,198,899,546,623,500,000
50.736698
188
0.584764
false
4.287992
true
false
false
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/funnyordie.py
1
4662
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, int_or_none, unified_timestamp, ) class FunnyOrDieIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?funnyordie\.com/(?P<type>embed|articles|videos)/(?P<id>[0-9a-f]+)(?:$|[...
gpl-3.0
4,937,359,392,362,063,000
27.777778
112
0.607465
false
2.718367
false
false
false
MuckRock/muckrock
muckrock/jurisdiction/filters.py
1
1513
""" Filters for jurisdiction Views """ # Third Party import django_filters from dal import forward # MuckRock from muckrock.core import autocomplete from muckrock.jurisdiction.models import Exemption, Jurisdiction LEVELS = (("", "All"), ("f", "Federal"), ("s", "State"), ("l", "Local")) class JurisdictionFilterSet(...
agpl-3.0
2,079,680,591,371,576,800
29.26
81
0.643093
false
3.879487
false
false
false
noplay/gns3-gui
gns3/modules/dynamips/ui/atm_bridge_configuration_page_ui.py
1
10574
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/grossmj/workspace/git/gns3-gui/gns3/modules/dynamips/ui/atm_bridge_configuration_page.ui' # # Created: Sun Mar 16 11:16:57 2014 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! from PyQt...
gpl-3.0
2,089,908,112,776,014,600
61.568047
149
0.746832
false
3.651243
true
false
false
WebCampZg/conference-web
ui/templatetags/webcamp.py
1
3417
import json import math import re from urllib.parse import urlparse, parse_qs from django import template from django.utils.safestring import mark_safe from ui.utils import get_icon_svg register = template.Library() @register.filter def labelize(value): return mark_safe(re.sub(r"\[(\w+)\]", r'<span class="yell...
bsd-3-clause
-6,631,614,206,404,134,000
27.475
105
0.614574
false
3.455005
false
false
false
Mandalo/mandalo
mandalo/mandalo/settings.py
1
3176
""" Django settings for mandalo project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os...
gpl-3.0
6,032,108,704,326,601,000
25.247934
91
0.687343
false
3.471038
false
false
false
ardi69/pyload-0.4.10
pyload/plugin/crypter/DlProtectCom.py
1
2395
# -*- coding: utf-8 -*- import base64 import re import time from pyload.plugin.internal.SimpleCrypter import SimpleCrypter class DlProtectCom(SimpleCrypter): __name = "DlProtectCom" __type = "crypter" __version = "0.03" __pattern = r'https?://(?:www\.)?dl-protect\.com/((en|fr)/)?\w+' __co...
gpl-3.0
7,238,583,991,759,091,000
35.846154
98
0.546138
false
3.51173
false
false
false
SUSE/azurectl
test/unit/defaults_test.py
1
3658
from .test_helper import argv_kiwi_tests from mock import patch import mock from azurectl.defaults import Defaults class TestDefaults: def __set_account_type_docopts(self): self.account_type_docopts = { '--locally-redundant': False, '--zone-redundant': False, '--geo-re...
apache-2.0
7,178,612,053,280,598,000
35.949495
80
0.614543
false
3.548012
true
false
false
tiancj/emesene
emesene/e3/xmpp/SleekXMPP/sleekxmpp/plugins/xep_0191/blocking.py
1
2536
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging from sleekxmpp import Iq from sleekxmpp.plugins import BasePlugin from sleekxmpp.xmlstream.handler import Callb...
gpl-3.0
5,357,166,866,941,608,000
29.554217
86
0.616325
false
3.483516
false
false
false
tylertian/Openstack
openstack F/python-glanceclient/tests/v2/test_images.py
1
19273
# Copyright 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
-4,692,995,391,996,027,000
34.756957
79
0.522493
false
3.268826
true
false
false
cstein/fmo-ie-analyzer
src/fie_ui.py
1
2694
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'fie.ui' # # Created: Fri May 31 09:50:27 2013 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeEr...
mit
-2,192,095,076,984,438,500
46.263158
140
0.698589
false
3.549407
false
false
false
ttreeagency/PootleTypo3Org
pootle/apps/pootle_app/management/commands/__init__.py
1
9386
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009-2012 Zuza Software Foundation # # This file is part of Pootle. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2...
gpl-2.0
7,473,940,043,474,504,000
39.808696
80
0.575112
false
4.365581
false
false
false
MaikeMota/bulk-downloader
bulk-downloader.py
1
3289
import requests import sys, getopt, os import time import datetime CHUNK_SIZE = 1024 MB_SIZE = 1048576 links = None outputdir = None def main(): try: opts, args = getopt.getopt(sys.argv[1:],"hf:o:",["file=","outdir="]) except getopt.GetoptError: print('usage: bulk-downloader.py -f <link.txt>...
mit
1,124,491,160,564,913,800
35.966292
87
0.472484
false
4.065513
false
false
false
talon-one/talon_one.py
test/test_role_assign.py
1
2130
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
mit
8,608,335,731,823,112,000
32.809524
647
0.604225
false
4.30303
true
false
false
lobnek/pyutil
source/conf.py
1
1730
#!/usr/bin/env python3 import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.dirname...
mit
3,677,162,227,022,036,000
25.212121
79
0.684971
false
3.649789
false
false
false
NickRuiz/wikitrans-pootle
local_apps/wt_articles/utils.py
1
3867
from goopytrans import translate as gtranslate from apyrtium import translate as atranslate import nltk.data from django.utils.safestring import SafeUnicode from wt_languages.models import TARGET_LANGUAGE, SOURCE_LANGUAGE, BOTH from wt_languages.models import LanguageCompetancy from wt_articles.models import SourceAr...
gpl-2.0
-6,224,162,047,502,436,000
32.059829
102
0.698733
false
3.711132
false
false
false
globocom/GloboNetworkAPI-client-python
networkapiclient/ApiVlan.py
1
5003
# -*- coding: 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 Apache License, Version 2.0 # (the "Lic...
apache-2.0
4,708,255,731,514,050,000
34.232394
88
0.620228
false
4.23624
false
false
false
eek6/squeakspace
www/proxy/scripts/proxy/last_message_time.py
1
1171
import squeakspace.common.util as ut import squeakspace.common.util_http as ht import squeakspace.proxy.server.db_sqlite3 as db import squeakspace.common.squeak_ex as ex import config def get_handler(environ): query = ht.parse_get_request(environ) cookies = ht.parse_cookies(environ) user_id = ht.get_requ...
gpl-3.0
1,875,072,872,462,335,700
29.815789
104
0.678907
false
3.208219
false
false
false
ethanbao/artman
artman/tasks/format_tasks.py
1
4309
# 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 required by applicable law or agree...
apache-2.0
-1,544,038,701,614,378,200
37.473214
79
0.629148
false
3.892502
false
false
false
ladybug-tools/honeybee
honeybee_plus/radiance/factory.py
1
4428
"""Material utility.""" import honeybee_plus.radiance.material.bsdf import honeybee_plus.radiance.material.glass import honeybee_plus.radiance.material.glow import honeybee_plus.radiance.material.light import honeybee_plus.radiance.material.metal import honeybee_plus.radiance.material.mirror import honeybee_plus.radian...
gpl-3.0
-8,126,225,587,974,622,000
32.293233
86
0.681798
false
3.758913
false
false
false
greenpau/PyEwsClient
pyewsclient/ews_helper.py
1
2656
# PyEwsClient - Microsoft Office 365 EWS (Exchange Web Services) Client Library # Copyright (C) 2013 Paul Greenberg <paul@greenberg.pro> # # 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 Foundatio...
gpl-3.0
-2,420,592,681,874,634,000
33.947368
103
0.623117
false
3.928994
false
false
false
pcmagic/stokes_flow
codeStore/support_fun_table.py
1
139054
# coding: utf-8 # !/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 19 11:05:23 2017 @author: zhangji """ import matplotlib import subprocess import os devnull = open(os.devnull, 'w') latex_installed = not subprocess.call(['which', 'latex'], stdout=devnull, stderr=devnull) matplotlib.use('agg') fo...
mit
-917,454,301,623,532,400
43.856129
128
0.557158
false
2.80764
false
false
false
daveol/Fedora-Test-Laptop
tests/wifi_connect_ap.py
1
1432
#!/usr/bin/env python # Copyright 2017 Nick Dekker, Marthe Veldhuis. # # This work is licensed under the terms of the MIT license. # For a copy, see LICENSE.txt. from avocado import Test from utils import internet, utils import time class WifiConnectAP(Test): """ Uses the first access point from internet_data...
mit
6,230,230,109,215,572,000
31.545455
83
0.652235
false
3.58
false
false
false
pagea/unstyle
experimental/feature_extraction.py
1
7752
# -*- coding: utf-8 -*- """ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in...
mit
5,541,036,737,737,882,000
29.761905
116
0.660604
false
2.937476
false
false
false
Unfocused/Sublime-DXR
DXR.py
1
2850
import sublime, sublime_plugin import os from urllib.parse import urlencode def open_dxr(query): base_url = "http://dxr.mozilla.org/mozilla-central/search?" params = {"tree": "mozilla-central", "q": query } query_string = urlencode(params) sublime.active_window().run_command('open_url', { "url": base_url + query...
mpl-2.0
-6,245,010,098,013,954,000
24
84
0.697895
false
2.833002
false
false
false
nightrune/ola
python/ola/UID.py
1
2958
# This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be use...
lgpl-2.1
6,715,555,315,331,315,000
25.890909
78
0.675118
false
3.706767
false
false
false
tkzeng/molecular-design-toolkit
moldesign/helpers/helpers.py
1
4716
# Copyright 2016 Autodesk 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
-513,517,205,098,998,400
28.85443
87
0.609415
false
3.477876
false
false
false
myhro/myhronet
myhronet/migrations/0002_auto_20140501_1545.py
1
1268
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ (b'myhronet', b'0001_initial'), ] operations = [ migrations.AddField( model_name=b'url', name=b'ip', ...
mit
2,269,109,178,985,048,300
27.818182
91
0.544953
false
4.07717
false
false
false
memray/seq2seq-keyphrase
emolga/layers/recurrent.py
1
22901
# -*- coding: utf-8 -*- from abc import abstractmethod from .core import * class Recurrent(MaskedLayer): """ Recurrent Neural Network """ @staticmethod def get_padded_shuffled_mask(mask, pad=0): """ change the order of dims of mask, to match the dim of inputs outside ...
mit
8,013,153,729,195,206,000
38.277873
124
0.517752
false
3.145467
false
false
false
ksmit799/Toontown-Source
toontown/safezone/RegenTreasurePlannerAI.py
1
1653
from direct.distributed.ClockDelta import * from direct.showbase import DirectObject from direct.directnotify import DirectNotifyGlobal from direct.task import Task import random import TreasurePlannerAI class RegenTreasurePlannerAI(TreasurePlannerAI.TreasurePlannerAI): notify = DirectNotifyGlobal.directNotify.new...
mit
-6,763,203,890,189,821,000
36.568182
108
0.727163
false
3.5625
false
false
false
jpopelka/fabric8-analytics-common
perf-tests/src/measurements.py
1
2526
"""Module with functions that read data and metadata from the S3 and retrieve durations.""" from s3interface import * from duration import * from botocore.exceptions import * def read_component_analysis_from_core_data(s3, ecosystem, component, version): """Read component analysis from the core data and retrieve ...
apache-2.0
-8,453,762,179,332,420,000
36.701493
92
0.674188
false
3.898148
false
false
false
developerworks/horizon
horizon/utils/validators.py
1
1149
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
apache-2.0
-6,168,565,720,718,603,000
33.818182
79
0.656223
false
3.389381
false
false
false
ajfriend/cyscs
cyscs/test/test_workspace.py
1
2974
import cyscs as scs import pytest import cyscs.examples as ex import numpy as np def test_cache(): data, cone = ex.many_iter_ecp() work = scs.Workspace(data, cone) sol = work.solve() def test_settings(): expected_keys = set(['normalize', 'use_indirect', 'scale', 'verbose', ...
mit
1,000,583,587,743,262,100
23.783333
90
0.61466
false
3.062822
true
false
false
pusateri/vsd
webapp/ui/management/commands/build_files.py
1
1545
from django.core.management.base import BaseCommand, CommandError from library.ui.models import Fileinfo, Media from settings import MEDIA_ROOT import os from mutagen.mp4 import MP4 class Command(BaseCommand): args = '' help = 'build list of media filenames' def handle(self, *args, **options): fil...
mit
2,368,409,360,834,580,500
28.150943
67
0.53657
false
3.777506
false
false
false
uber/tchannel-python
tchannel/thrift/rw.py
1
13504
# Copyright (c) 2016 Uber Technologies, Inc. # # 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
6,518,467,213,706,256,000
31.856448
79
0.623741
false
4.415958
false
false
false
like2000/PyCOBRA
PyCOBRA_beam.py
1
2276
from abc import ABCMeta, abstractmethod import numpy as np from scipy.constants import e, m_p def gaussian_generator(eps_geo, phase_space_tuple=('x', 'xp'), alpha=0, beta=1): sigma = np.sqrt(eps_geo) def generate(bunch): n_macroparticles = bunch.n_macroparticles x = np.random.normal(scale=s...
mit
5,275,692,509,039,961,000
30.611111
80
0.611599
false
3.134986
false
false
false
ut-planteco/ssu-pipeline
pipeline_parse_blast.py
1
3045
#!/usr/bin/env python from __future__ import division import os import argparse import console import sys """ Parsing XML BLAST output for tab delimited file for easier parsing with samples, hit descripttions, hit identities and hit aligment length values. Input is taken from STDIN, use it in pipe command. """ pa...
gpl-3.0
9,045,750,180,031,306,000
30.071429
124
0.549754
false
2.636364
false
false
false
gatecat/prjoxide
timing/util/extract_route.py
1
1535
import lapie import pickle import sys def main(): udb = sys.argv[1] # Get actual routed path using Tcl nets = lapie.list_nets(udb) routing = lapie.get_routing(udb, nets) # (source, sink) -> pips arc2pips = {} # Keep track of fanout - we'll need this later! wire_fanout = {} for ne...
isc
7,013,076,900,119,699,000
29.098039
73
0.503583
false
3.771499
false
false
false
jailuthra/asr
filegen.py
1
2657
#!/usr/bin/env python '''Generate configuration files for decoding via Kaldi. The input directory (wavdir) should contain 16-bit 8KHz wav files, with the naming convention <spk_id>_<utt_id>.wav. For example: 0001_0001.wav, 0002_0001.wav etc. ''' import sys import os from glob import glob def get_filepaths(directory)...
mit
-5,146,011,456,511,642,000
29.54023
74
0.610463
false
3.133255
true
false
false
MattJDavidson/python-adventofcode
tests/test_04.py
1
1270
import pytest from advent.problem_04 import (acceptable_hash, first_acceptable_hash, generate_hash) def test_acceptable_hash(): assert acceptable_hash('00000') == True assert acceptable_hash('000001dbbfa') == True assert acceptable_hash('000006...
bsd-2-clause
2,326,567,479,929,284,600
37.484848
82
0.666929
false
3.638968
false
false
false
mgorny/PyGithub
tests/Connection.py
1
5202
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2019 Adam Baratz <adam.baratz@gmail.com> # # ...
lgpl-3.0
1,172,037,639,037,431,600
43.461538
186
0.539216
false
4.484483
true
false
false
WZQ1397/automatic-repo
python/FileSystem/BTpanel/btclass/panelSSL.py
1
9341
#coding: utf-8 #------------------------------------------------------------------- # 宝塔Linux面板 #------------------------------------------------------------------- # Copyright (c) 2015-2016 宝塔软件(http:#bt.cn) All rights reserved. #------------------------------------------------------------------- # Author: 黄文良 <287962...
lgpl-3.0
-1,451,442,486,167,215,600
41.138249
129
0.531007
false
3.554821
false
false
false
quaddra/dist_job_mgr
dist_job_mgr/test_json_model.py
1
1930
import unittest import logging import model import json_model import tempfile import shutil import copy import json import os.path from common import * import json_model class TestModelSaving(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() self.model = json_model.ModelAd...
apache-2.0
-5,679,407,207,214,755,000
28.242424
79
0.56943
false
3.27674
true
false
false
jgrynczewski/Assistive-Prototypes
modules/ewriting/eplatform.py
1
14724
#!/bin/env python2.7 # -*- coding: utf-8 -*- # This file is part of AP - Assistive Prototypes. # # AP is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
gpl-3.0
8,931,400,673,670,100,000
35.162162
395
0.52378
false
3.595017
false
false
false
feranick/SpectralMachine
Archive/SpectraKeras/20180926a/SpectraKeras_MLP.py
1
7841
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' ********************************************************** * SpectraKeras - MLP * 20180926a * Uses: Keras, TensorFlow * By: Nicola Ferralis <feranick@hotmail.com> *********************************************************** ''' print(__doc__) import numpy as np import ...
gpl-3.0
638,412,869,959,671,800
34.640909
116
0.508098
false
3.360909
true
false
false
CivicKnowledge/ambry
ambry/orm/__init__.py
1
13456
"""Object-Rlational Mapping classess, based on Sqlalchemy, for representing the dataset, partitions, configuration, tables and columns. Copyright (c) 2015 Civic Knowledge. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ __docformat__ = 'restructuredte...
bsd-2-clause
-6,827,046,663,386,977,000
29.374718
113
0.638005
false
4.01073
false
false
false
clockspot/master-clock
calibrate-meter.py
1
2413
#!/usr/bin/env python #Use this script to find calibration points for your meter (add to settings.py). #External settings import settings #External modules import time if settings.piMode: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(settings.slavePin, GPIO.OUT) if(settings.meterPin != Fa...
mit
7,565,959,822,144,746,000
34.5
108
0.662246
false
3.497101
false
false
false
titienmiami/mmc.repository
plugin.video.tvalacarta/tvalacarta/channels/tvn.py
1
4763
# -*- coding: utf-8 -*- #------------------------------------------------------------ # tvalacarta - XBMC Plugin # Canal para TVN (Chile) # http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/ #------------------------------------------------------------ import urlparse,re import urllib from core import logger from cor...
gpl-2.0
-1,261,113,166,664,057,600
37.967213
191
0.636517
false
3.347887
false
false
false
edek437/Zastosowanie-informatyki-w-gospodarce-projekt
lotnisko/migrations/0006_auto_20160117_2111.py
1
1331
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lotnisko', '0005_auto_20160117_1041'), ] operations = [ migrations.RemoveField( model_name='reservedseat', ...
mit
-8,412,982,665,111,262,000
28.577778
201
0.552968
false
4.321429
false
false
false
classcat/cctf
cctf/helpers/summarizer.py
1
3079
from __future__ import division, print_function, absolute_import import tensorflow as tf from .. import summaries """ Summarizer contains some useful functions to help summarize variables, activations etc... in Tensorboard. """ def summarize_all(train_vars, grads, activations, summary_collection="...
agpl-3.0
654,663,146,128,021,200
33.595506
80
0.688535
false
4.306294
false
false
false
Mozu/mozu-python-sdk
mozurestsdk/platform/secureappdata.py
1
3372
""" This code was generated by Codezu. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from mozurestsdk.mozuclient import default as default_client from mozurestsdk.mozuurl import MozuUrl; from mozurestsdk.urllocation import UrlLocation from mozure...
apache-2.0
6,208,607,910,808,804,000
29.64486
266
0.70433
false
3.444331
false
false
false
open-synergy/opnsynid-l10n-indonesia
l10n_id_taxform_bukti_potong_pph_f113313/models/bukti_potong_pph_f113313_in.py
1
1102
# -*- coding: utf-8 -*- # Copyright 2017 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api class BuktiPotongPPhF113313In(models.Model): _name = "l10n_id.bukti_potong_pph_f113313_in" _inherit = "l10n_id.bukti_potong_pph" _table = ...
agpl-3.0
-7,598,236,411,724,964,000
33.4375
74
0.629764
false
2.642686
false
false
false
ma89long/google-python-class
babynames/babynames.py
1
2902
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import sys import re """Baby Names exercise Define the extract_names() function below and c...
apache-2.0
8,827,361,729,426,963,000
28.313131
79
0.661268
false
3.203091
false
false
false
gusam/drnau_project
drnau_project/project/models.py
1
1601
from django.db import models from django.contrib.auth.models import User # Create your models here. TRANSMISSION = (('1','Vivo'),('2','Grabado')) class Project(models.Model): proj_name = models.CharField(max_length=30, unique=True, verbose_name='Nombre del Proyecto') proj_date = models.DateField(auto_now_add=...
mit
8,242,514,081,713,468,000
43.416667
96
0.714196
false
3.345188
false
false
false
pmajka/3dbar
bin/parsers/whs_0.6.2/data.py
1
5969
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # # # This file is part of 3d Brain Atlas Reconstructor # # ...
gpl-3.0
-6,340,810,528,607,758,000
50.017094
235
0.614843
false
3.504991
false
false
false
collective/mr.poe
raven/handlers/logbook.py
1
2748
""" raven.handlers.logbook ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import logbook import sys import traceback from raven.base import Client from raven.utils.encoding import to_string from raven.utils import a...
bsd-3-clause
-5,173,493,003,048,261,000
33.35
122
0.564774
false
4.273717
false
false
false
google/fedjax
fedjax/aggregators/aggregator.py
1
2676
# Copyright 2021 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 agreed to in writing, ...
apache-2.0
165,806,188,716,476,260
33.753247
79
0.727952
false
4.187793
false
false
false
ScottBuchanan/eden
modules/s3/s3validators.py
1
147861
# -*- coding: utf-8 -*- """ Custom Validators @requires: U{B{I{gluon}} <http://web2py.com>} @copyright: (c) 2010-2015 Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the...
mit
4,414,899,895,666,440,000
38.259692
138
0.418878
false
4.514014
false
false
false
jredrejo/web2pyreactpoc
languages/es.py
1
21332
# -*- coding: utf-8 -*- { '!langcode!': 'es', '!langname!': 'Español', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', '%(nr...
gpl-3.0
8,112,073,307,084,498,000
46.647856
281
0.705941
false
2.819663
true
false
false
sspickle/assessdb
webapp/assessdb/views/appViews.py
1
2866
from pyramid.httpexceptions import HTTPFound from pyramid.security import ( remember, forget, ) from pyramid.response import Response from sqlalchemy.exc import DBAPIError from ..models import Course from pyramid.view import ( view_config, view_defaults ) from ..security import ( USE...
bsd-2-clause
4,265,857,922,636,594,700
29.489362
81
0.606071
false
4.214706
false
false
false
cirocosta/avisenchente
src/endpoints_proto_datastore/ndb/model.py
1
60098
# Copyright 2012 Google Inc. All Rights Reserved. """EndpointsModel definition and accompanying definitions. This model can be used to replace an existing NDB model and allow simple conversion of model classes into ProtoRPC message classes. These classes can be used to simplify endpoints API methods so that only enti...
mit
-4,827,608,363,860,962,000
38.694848
80
0.684998
false
4.507801
false
false
false
georgiascott/sosleep
sosleep/wsgi.py
1
2223
""" WSGI config for sosleep project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` ...
bsd-3-clause
5,322,176,296,629,473,000
34.285714
79
0.730544
false
3.8
false
false
false
snawara/TensorKart
record.py
1
5968
#!/usr/bin/env python import numpy as np import os import shutil import wx import matplotlib matplotlib.use('WXAgg') from datetime import datetime from matplotlib.figure import Figure from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas from utils import take_screenshot, XboxController SAMPLE...
mit
7,111,182,449,239,946,000
27.555024
132
0.572386
false
3.584384
false
false
false
zwChan/VATEC
~/eb-flask/features.py
1
14055
__author__ = 'Jason' import os, re, csv, ast, csv import math import jinja2 jinja_environment = jinja2.Environment(autoescape=True, loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates'))) import flask from utils import encode def _show_frequent_features(mysql,g_sty): topk...
apache-2.0
4,179,736,863,392,049,700
45.329966
449
0.594379
false
3.555527
false
false
false
cmars/hockeypuck
contrib/pyinfra/lxd.py
1
1080
# A LXD inventory that idempotently provisions LXD containers. You could # probably do something similar with cloud APIs if so inclined. import json import os from subprocess import check_output, check_call, CalledProcessError containers=['hkp1', 'hkp2'] addrs=[] def ensure_container(name): try: check_ou...
agpl-3.0
5,309,524,329,987,346,000
44
154
0.621296
false
3.243243
false
false
false
scikit-hep/uproot
uproot3/rootio.py
1
78562
#!/usr/bin/env python # BSD 3-Clause License; see https://github.com/scikit-hep/uproot3/blob/master/LICENSE from __future__ import absolute_import import keyword import numbers import os import re import struct import sys try: from urlparse import urlparse except ImportError: from urllib.parse import urlpars...
bsd-3-clause
2,335,658,211,488,084,500
44.516802
306
0.580968
false
3.785938
false
false
false
mesosphere/dispatch
dispatch/job.py
1
1034
from __future__ import absolute_import, print_function import json import socket import urlparse import uuid from . import state class Job(object): resource = { "cpus": 0.01, "mem": 10 } def __init__(self, data): self.data = data self.id = str(uuid.uuid4()) sel...
apache-2.0
6,089,966,219,099,346,000
24.85
74
0.5706
false
3.843866
false
false
false
drak0viens/ccsocket
nfq_handler.py
1
9623
#!/usr/bin/python # -*- coding: UTF-8 -*- ## This file is part of ccsocket ## Copyright (C) Tomas Dragoun <drakoviens@gmail.com> ## This program is published under a GPLv3 license ######################################################## import nfqueue import sys import signal from multiprocessing import Process, Pipe...
gpl-3.0
-3,009,712,564,005,565,400
45.713592
87
0.488309
false
4.991183
false
false
false
davidsonpaul/python-bucket
import.py
1
6337
#!/usr/local/bin/python # # Simple Python (2.7.2) program that fetches bookmarks from your delicious account # and imports it into your pinboard account. # # Created this (my first python program, so it probably sucks, but it works!) after # getting repeated 'read failed' errors when trying to import my delicious ...
mit
-4,337,314,912,735,955,000
35.843023
121
0.67745
false
3.703682
false
false
false
jdgranberry/Word-Pair-Colocation-Frequency
word_freq_reducer.py
1
1341
#!/usr/bin/python ''' This reduction script is derived almost entirely from the reducer.py script found here: http://www.michael-noll.com/tutorials/writing-an-hadoop-mapreduce-program-in-python/ Thanks to Michael Noll for posting his Hadoop MapReduce with Python. I make no claims to have created th...
mit
361,622,477,208,370,940
29.477273
88
0.653244
false
3.909621
false
false
false
easyNav/easyNav-pi
StartUpPk.py
1
4223
import subprocess import time import speaker import fileinput import os class StartUp(object): def __init__(self): self.speakery=speaker.newSpeaker() self.server="" self.dispatcher = "" self.nav = "" self.voice = "" self.serial = "" self.alert = "" self.cruncher = "" self.ctr = 0 def monitor(self...
mit
2,544,761,257,595,453,400
27.153333
129
0.694293
false
2.967674
false
false
false
vanam/clustering
clustering_system/clustering/igmm/DdCrpClustering.py
1
10933
import math import random from typing import List, Tuple, Callable import numpy as np import scipy.misc from clustering_system.clustering.ClusteringABC import CovarianceType from clustering_system.clustering.GibbsClusteringABC import GibbsClusteringABC from clustering_system.clustering.mixture.GaussianMixtureABC impo...
mit
3,526,969,188,711,163,400
33.488959
120
0.584286
false
4.025405
false
false
false
rafajaques/ExemplosPyGame
Caindo/caindo.py
1
2494
#coding:utf-8 import pygame, os, random from pygame.locals import * # Define a posição da janela os.environ['SDL_VIDEO_WINDOW_POS'] = "100,100" # Inicia o PyGame pygame.init() # Tela de 640x480 tela = pygame.display.set_mode((1024,768)) pygame.display.set_caption("Caindo!") # Máximo FPS do jogo fps = 80 # Encurta...
mit
-550,836,296,841,306,700
23.245098
100
0.675293
false
2.371045
false
false
false
meteorcloudy/tensorflow
tensorflow/contrib/eager/python/examples/revnet/blocks.py
1
12195
# Copyright 2018 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
-6,062,346,454,275,266,000
32.687845
80
0.621812
false
3.677624
false
false
false
sztomi/conan-msgpack
conanfile.py
1
1063
from conans import ConanFile, tools import os class MsgpackConan(ConanFile): name = "msgpack" version = "2.1.5" license = "Boost Software License 1.0" url = "https://github.com/sztomi/conan-msgpack" description = "The official C++ library for MessagePack" @property def extracted_dir(self...
mit
-3,734,861,266,448,066,000
30.264706
86
0.600188
false
3.519868
false
false
false
akittas/geocoder
geocoder/google_places.py
1
5188
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import import time from geocoder.base import Base from geocoder.keys import google_key # todo: Paging (pagetoken) is not fully supported since we only return the first result. Need to return all results to the user so paging will make sense # todo: Add...
mit
7,096,630,817,115,258,000
33.818792
154
0.650925
false
4.091483
false
false
false
rcmorehead/simplanets
simptest.py
1
1124
import matplotlib matplotlib.use('Agg') import simple_abc import simple_model #from astropy.io import ascii import numpy as np import pickle import pylab as plt import time from scipy import stats def main(): #TODO Choose new random seed after testing np.random.seed(917) steps = 5 eps = 0.25 m...
mit
456,676,408,633,863,000
19.814815
91
0.622776
false
3.06267
false
false
false
Implaier/CS50
PSET6/sentiments/helpers.py
1
3013
import os import sys import html import plotly import socket from twython import Twython from analyzer import Analyzer from twython import TwythonAuthError, TwythonError, TwythonRateLimitError def chart(positive, negative, neutral): """Return a pie chart for specified sentiments as HTML.""" # offline plot ...
unlicense
4,223,524,419,650,702,300
32.853933
84
0.622635
false
3.823604
false
false
false
clarete/curdling
tests/functional/test_wheel.py
1
2336
# Curdling - Concurrent package manager for Python # # Copyright (C) 2014 Lincoln Clarete <lincoln@clarete.li> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
-8,828,636,233,160,780,000
31
72
0.650257
false
3.47619
false
false
false
pingswept/pysolar
test/test_solar.py
1
10841
#!/usr/bin/python3 # Library for calculating location of the sun # Copyright Brandon Stafford # # This file is part of Pysolar. # # Pysolar 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; e...
gpl-3.0
-8,645,552,175,771,938,000
51.882927
233
0.765889
false
2.880946
true
false
false
joopert/home-assistant
homeassistant/components/zha/__init__.py
1
4608
"""Support for Zigbee Home Automation devices.""" import logging import voluptuous as vol from homeassistant import config_entries, const as ha_const import homeassistant.helpers.config_validation as cv from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE # Loading the config flow file will register t...
apache-2.0
1,980,362,114,776,705,300
30.135135
88
0.645833
false
3.574864
true
false
false
pizzapanther/Church-Source
churchsource/people/migrations/0001_initial.py
1
6849
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Household' db.create_table('people_household', ( ('id', self.gf('django.db.mod...
gpl-3.0
422,170,590,105,335,230
63.009346
123
0.572784
false
3.561622
false
false
false
BrainiacBug/Python-scripts
robot_txt_finder_EST_top/analyse_robot_txts.py
1
2790
import os from collections import Counter # List for disallows from file disallow = [] def list_all_files(): """Lists all files in robots folder""" os.chdir("robots") robot_files = os.listdir(os.curdir) print "[*] Found number of files:" + str(len(robot_files)) return robot_files def open_txt_f...
mit
-4,199,506,048,067,817,500
29.326087
69
0.578136
false
3.345324
false
false
false
gstiebler/odemis
src/odemis/driver/picoquant.py
1
33026
# -*- coding: utf-8 -*- ''' Created on 14 Apr 2016 @author: Éric Piel Copyright © 2016 Éric Piel, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Odemis is...
gpl-2.0
-2,291,997,670,940,585,200
33.908034
226
0.569997
false
3.799241
false
false
false
wakita-ncch/Radiomics
src/Radiomics/group3_glrl.py
1
3248
import pyximport import numpy as np pyximport.install(setup_args={'include_dirs':[np.get_include()]}, inplace=True) from _glrl_loop import _glrl_vector_loop from profiling_tools import time def glrl_vector_loop(image, direction, bin_width): # convert pixel intensities into gray levels wi bin_width = int(b...
mit
5,497,817,697,771,615,000
29.942857
85
0.623153
false
2.999077
false
false
false
Bolt64/my_code
Code Snippets/daily_programmer/martian_spell_check.py
1
1701
#!/usr/bin/env python3 def offset_string(string, offset): rows=[ "qwertyuiop", "QWERTYUIOP", "asdfghjkl", "ASDFGHJKL", "zxcvbnm", "ZXCVBNM" ] new_string="" for char in string: alphabet=False for row in rows: ...
mit
2,700,639,331,335,054,000
29.927273
104
0.552616
false
4.138686
false
false
false
ShashaQin/frappe
frappe/translate.py
1
19876
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ frappe.translate ~~~~~~~~~~~~~~~~ Translation tools for frappe """ import frappe, os, re, codecs, json from frappe.utils.jinja import render_include from frappe.utils im...
mit
4,988,395,309,964,704,000
32.071547
139
0.691839
false
3.099813
false
false
false
anqxyr/jarvis
jarvis/autoban.py
1
3248
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import arrow import collections import fnmatch import pyscp import re import threading from . import core, lex #####...
mit
-8,457,858,097,561,709,000
29.074074
79
0.502155
false
3.839243
false
false
false
encukou/freeipa
ipapython/dogtag.py
1
8227
# Authors: Rob Crittenden <rcritten@redhat.com> # # Copyright (C) 2009 Red Hat # see file 'COPYING' for use and warranty information # # 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 v...
gpl-3.0
6,374,223,435,190,193,000
31.389764
102
0.650055
false
3.877003
false
false
false
guy-mograbi-at-gigaspaces/widget-dd-checks
build/vagrant/synced_folder/checks.d/pool_size.py
1
1677
import os import json import requests import re import unicodedata from checks import AgentCheck # http://code.activestate.com/recipes/577257-slugify-make-a-string-usable-in-a-url-or-filename/ _slugify_strip_re = re.compile(r'[^\w\s-]') _slugify_hyphenate_re = re.compile(r'[-\s]+') def _slugify(value): if not is...
mit
-7,010,372,455,501,986,000
29.509091
134
0.613596
false
3.443532
false
false
false
omniscale/gbi-server
app/gbi_server/views/admin_services.py
1
9888
# This file is part of the GBI project. # Copyright (C) 2015 Omniscale GmbH & Co. KG <http://omniscale.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
apache-2.0
5,397,853,354,094,718,000
34.568345
89
0.605583
false
3.599563
false
false
false
crcresearch/osf.io
osf/models/preprint_service.py
1
9785
# -*- coding: utf-8 -*- import urlparse from dirtyfields import DirtyFieldsMixin from django.db import models from django.utils import timezone from django.utils.functional import cached_property from django.contrib.contenttypes.fields import GenericRelation from framework.postcommit_tasks.handlers import enqueue_pos...
apache-2.0
9,132,083,858,299,472,000
36.205323
162
0.6093
false
4.140923
false
false
false