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
hide-tono/python-training
deep-learning-tf-keras/ch04/mnist_defs_tf.py
1
4221
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.utils import shuffle np.random.seed(0) tf.set_random_seed(1234) def inference(x, keep_prob, n_in, n_hiddens, n_out): def weight_variable(shape)...
apache-2.0
9,006,583,419,889,451,000
26.232258
95
0.560531
false
agdsn/pycroft
tests/frontend/test_fields.py
1
1257
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. import string import pytest from wtforms_widgets.fields.core import DateField __author__ = 'shreyder' def te...
apache-2.0
4,335,578,972,140,562,000
38.28125
83
0.692124
false
testmana2/test
Helpviewer/VirusTotal/VirusTotalApi.py
1
15389
# -*- coding: utf-8 -*- # Copyright (c) 2011 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the <a href="http://www.virustotal.com">VirusTotal</a> API class. """ from __future__ import unicode_literals try: str = unicode except NameError: pass import json from PyQt5.QtCore imp...
gpl-3.0
-7,896,726,135,286,818,000
36.534146
79
0.576841
false
chenzilin/git-repo
subcmds/help.py
1
4832
# # Copyright (C) 2008 The Android Open Source Project # # 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
-7,711,002,196,199,770,000
28.284848
94
0.617343
false
fga-gpp-mds/2017.2-Receituario-Medico
medical_prescription/user/test/test_model_send_invitation.py
1
1112
# Standard library import hashlib import random import datetime # Django imports from django.test import TestCase # Local django imports from user.models import SendInvitationProfile, Patient class TestSendInvitationProfile(TestCase): def setUp(self): self.send_invitation_profile = SendInvitationProfil...
mit
954,918,931,982,965,900
40.037037
111
0.636282
false
google/nitroml
examples/metalearning_benchmark.py
1
7286
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
3,418,842,400,522,188,300
39.477778
106
0.650425
false
TiagoDGomes/py-ad-ldap
ad_ldap/errors.py
1
2402
#!/usr/bin/python """A module containing the exception classes for the adldap module. Copyright 2010 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...
apache-2.0
-282,757,042,359,981,980
26.295455
79
0.754788
false
hzlf/openbroadcast
website/apps/abcast/views/schedulerviews.py
1
11454
from django.views.generic import DetailView, ListView, FormView, UpdateView from django.views.generic.detail import SingleObjectTemplateResponseMixin from django.shortcuts import get_object_or_404, render_to_response from django.db.models import Avg from django import http from django.http import HttpResponse, HttpRe...
gpl-3.0
4,984,770,444,386,933,000
26.868613
114
0.620918
false
jonhadfield/acli
lib/acli/output/vpc.py
1
4347
# -*- coding: utf-8 -*- from __future__ import (absolute_import, print_function, unicode_literals) from acli.output import (output_ascii_table, output_ascii_table_list, dash_if_none) from colorclass import Color, Windows Windows.enable(auto_colors=True, reset_atexit=True) def get_tag(name=None, tags=None): if tag...
mit
8,650,758,224,400,534,000
46.769231
116
0.517138
false
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/lib/galaxy/model/migrate/versions/0059_sample_dataset_file_path.py
1
1937
""" Migration script to modify the 'file_path' field type in 'sample_dataset' table to 'TEXT' so that it can support large file paths exceeding 255 characters """ from sqlalchemy import * from sqlalchemy.orm import * from migrate import * from migrate.changeset import * from sqlalchemy.exc import * from galaxy.model....
gpl-3.0
8,046,237,435,248,791,000
31.830508
112
0.636551
false
damoxc/vsmtpd
vsmtpd/tests/plugins/test_connection_time.py
1
1076
# # vsmtpd/tests/plugins/test_connection_time.py # # Copyright (C) 2011 Damien Churchill <damoxc@gmail.com> # # 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, or (at your option...
gpl-3.0
-8,641,858,165,633,547,000
30.647059
70
0.727695
false
vanadium23/catalog-project
catalog/app/models.py
1
2366
from sqlalchemy import Column, Integer, String, ForeignKey from sqlalchemy.orm import relationship from app.database import Base class User(Base): """This is an ORM model for logging users""" __tablename__ = 'users' id = Column(Integer, primary_key=True) name = Column(String(50), nullable=False) ...
mit
-6,516,774,220,803,841,000
31.861111
66
0.592139
false
py-in-the-sky/challenges
mine_allocations.py
1
8134
""" Greedy Algorithm https://community.topcoder.com/stat?c=problem_statement&pm=1957&rd=4650 Discussion: https://www.topcoder.com/community/data-science/data-science-tutorials/greedy-is-good/ "[T]he [expected] profit of allocating an extra worker to a mine is always higher or equal with the [expected] profit of alloc...
mit
-5,176,688,691,923,415,000
38.678049
243
0.512294
false
Nic30/hwtHls
hwtHls/examples/pid.py
1
1640
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from hwt.code import Add from hwt.synthesizer.param import Param from hwtHls.platform.virtual import VirtualHlsPlatform from hwtHls.hls import Hls from hwtLib.logic.pid import PidController class PidControllerHls(PidController): def _config(self): super(Pid...
mit
-3,685,152,865,492,009,500
29.943396
77
0.570732
false
fbmnds/FSharp-Computational-Fluid-Dynamics
FSharp-Computational-Fluid-Dynamics/test/lesson-11.py
1
9123
from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import matplotlib.pyplot as plt import numpy as np ### def print_u (f, label1, u, ny, nx, label2): f.write(label1) for j in range(ny): f.write("[") for i in range(nx): f.write(str(u[j,i])) if i < nx-1: ...
apache-2.0
465,601,827,552,391,360
22.634715
102
0.446892
false
TinkerMill/mms-server
mmsServer/__init__.py
1
5213
#!/usr/bin/env python # __init__.py ### IMPORTS ### import os import sys import os.path import time import json from datetime import datetime from flask import Flask, g, render_template, request from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import create_engine from sqlalchemy.orm impo...
apache-2.0
-2,763,381,210,062,170,000
28.48538
114
0.647995
false
ColumbiaCMB/kid_readout
apps/data_taking_scripts/old_scripts/highq_power_sweep_140423_0813f4.py
1
5959
import matplotlib from kid_readout.roach import baseband matplotlib.use('agg') import numpy as np import time import sys from kid_readout.utils import data_file,sweeps from kid_readout.analysis.resonator import fit_best_resonator ri = baseband.RoachBasebandWide() ri.initialize() #ri.set_fft_gain(6) #f0s = np.load('/...
bsd-2-clause
-5,829,926,809,568,526,000
32.105556
114
0.606813
false
ebertti/nospam
configuracao.py
1
1030
# coding: utf-8 import os PROJECT_DIR = os.path.dirname(__file__) DATASET_COMPLETO = os.path.join(PROJECT_DIR, 'dataset/completo/youtube_comments_20120117.csv') DATASET_TREINO = os.path.join(PROJECT_DIR, 'dataset/treino/') DATASET_PREPARADO = os.path.join(PROJECT_DIR, 'dataset/preparado/') HOST_MONITOR = 'localhost'...
mit
-8,956,428,627,889,489,000
24.775
94
0.538835
false
fengalin/gstation-edit
gstation_edit/midi/port.py
1
1045
""" gstation-edit MidiPort definition """ # this file is part of gstation-edit # Copyright (C) F LAIGNEL 2009-2017 <fengalin@free.fr> # # gstation-edit 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...
lgpl-3.0
1,040,199,894,642,888,700
36.321429
74
0.69378
false
audy/banana
banana.py
1
4205
#!/usr/bin/env python # YAM SPLIT - Austin G. Davis-Richardson # Splits barcoded, 3-paired illumina files based on a .yaml config file import sys import os from glob import glob import string try: import yaml except ImportError: print >> sys.stderr, "could not import yaml\ntry:\n sudo easy_install pyyaml" ...
mit
-1,384,405,166,370,904,000
31.099237
107
0.524614
false
barrachri/epcon
assopy/views.py
1
23911
# -*- coding: UTF-8 -*- from django import forms from django import http from django.conf import settings as dsettings from django.contrib import auth from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.admin.util import unquote from django.core.urlresolvers...
bsd-2-clause
-1,515,016,967,348,325,000
34.253687
139
0.602251
false
ahjulstad/mathdom-python3
mathml/utils/sax_pmathml.py
1
1682
from mathml.pmathml.element import * from mathml.pmathml.mtoken import MToken import xml.sax.handler class MathMLHandler(xml.sax.handler.ContentHandler): class Elem(object): __slots__ = ('parent', 'name', 'attributes', 'text', 'children') def __init__(self, plotter): self.plotter = plotter self.current ...
mit
2,438,675,304,666,861,600
28
67
0.709275
false
MJL85/mnet
natlas/network.py
1
19257
#!/usr/bin/python ''' natlas network.py Michael Laforest mjlaforest@gmail.com Copyright (C) 2015-2018 Michael Laforest This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publishe...
gpl-2.0
-6,000,111,495,897,117,000
35.333962
117
0.503505
false
dataflow/DataStage
test/FileShare/tests/TestWebDAVAccess.py
1
9093
# --------------------------------------------------------------------- # # Copyright (c) 2012 University of Oxford # # 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, incl...
mit
1,142,535,707,683,466,100
31.244681
143
0.598152
false
linii/ling229-final
metrics/noun_cluster_plot.py
1
2306
#!/usr/bin/python import os import sys # hack to make this able to import topic_modeling. must be run from final_project/ dir lib_path = os.path.abspath(os.path.join('.')) sys.path.append(lib_path) import numpy as np import pylab import pickle from collections import Counter from topic_modeling.topic_mo...
gpl-3.0
5,005,873,616,967,561,000
32.447761
94
0.656548
false
zeldin/libsigrokdecode
decoders/lpc/pd.py
1
13089
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de> ## ## 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 of t...
gpl-3.0
4,092,020,724,565,551,000
34.762295
88
0.53969
false
Glottotopia/aagd
moin/local/moin/contrib/googleimport/driver.py
1
7520
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- """ MoinMoin wiki project -> Google Project Hosting converter Full of evil antipatterns, incl. Exception exceptions. @copyright: 2007,2010 MoinMoin:AlexanderSchremmer @license: GNU GPL, see COPYING for details. """ import sys import re import urllib2 f...
mit
5,125,018,128,756,069,000
35.788945
235
0.557181
false
dims/heat
heat/tests/test_translation_rule.py
1
26801
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
5,504,096,451,595,284,000
32.543179
78
0.461065
false
kpreid/shinysdr
setup.py
1
4716
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013, 2014, 2015, 2016, 2019 Kevin Reid and the ShinySDR contributors # # This file is part of ShinySDR. # # ShinySDR 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 Soft...
gpl-3.0
5,016,024,157,505,470,000
32.446809
143
0.658185
false
tobegit3hub/cinder_docker
cinder/tests/unit/objects/test_snapshot.py
1
13201
# Copyright 2015 SimpliVity 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 o...
apache-2.0
4,037,696,467,265,548,300
45.319298
78
0.61715
false
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/twitch.py
1
20771
# coding: utf-8 from __future__ import unicode_literals import itertools import re import random import json from .common import InfoExtractor from ..compat import ( compat_kwargs, compat_parse_qs, compat_str, compat_urllib_parse_urlencode, compat_urllib_parse_urlparse, ) from ..utils import ( clean_html, Extr...
gpl-3.0
-2,672,165,837,656,433,700
27.610193
108
0.628135
false
bogobog/hierarchy_config_parser
bin/config_variable_processor/CallableConfigParser.py
1
4615
import ConfigParser, re try: import cStringIO as StringIO except ImportError: import StringIO class CallableConfigParser( ConfigParser.ConfigParser ): file_cache = {} FUNC_PATTERN = re.compile(r"\|\( ?([^ ]*) (.*)\)") def __init__(self, funcs = {}, *args, **kwargs ): ConfigPars...
gpl-2.0
6,231,090,226,505,312,000
40.576577
271
0.384832
false
ronen/Halide
python_bindings/tutorial/lesson_12_using_the_gpu.py
1
11813
#!/usr/bin/python3 # Halide tutorial lesson 12. # This lesson demonstrates how to use Halide to run code on a GPU. # This lesson can be built by invoking the command: # make tutorial_lesson_12_using_the_gpu # in a shell with the current directory at the top of the halide source tree. # Otherwise, see the platform...
mit
7,020,487,303,896,136,000
34.79697
130
0.584018
false
pathscale/ninja
platform_helper.py
1
2126
#!/usr/bin/env python # Copyright 2011 Google Inc. # Copyright 2013 Patrick von Reth <vonreth@kde.org> # 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://ww...
apache-2.0
9,217,081,902,934,273,000
29.811594
74
0.629351
false
OpenHydrology/OH-Auto-Statistical-REST-API
application.py
1
2633
import flask import flask_restful import flask.ext.cors from celery import Celery from resources.analysis import AnalysisRes, AnalysisStatusRes from resources.catchment import CatchmentListRes, CatchmentRes from resources.dataimport import DataImportRes import floodestimation import floodestimation.loaders import flood...
gpl-3.0
-304,302,401,893,663,360
35.569444
117
0.651348
false
stormi/tsunami
src/primaires/objet/types/veste.py
1
1791
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # lis...
bsd-3-clause
-1,354,158,303,473,432,800
43.8
79
0.765494
false
eduardoklosowski/ergo-notes
ergonotes/admin.py
1
1098
# -*- coding: utf-8 -*- # # Copyright 2015 Eduardo Augusto Klosowski # # This file is part of Ergo Notes. # # Ergo Notes is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
agpl-3.0
-931,401,604,839,511,800
34.419355
100
0.720401
false
datawire/quark
quarkc/test/ffi/expected/py/org_example_foo/docs/conf.py
1
1045
# -*- coding: utf-8 -*- # # org_example_foo documentation build configuration file, created by Quark extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon' ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'org_example_foo' copyright = u'2015, org_example_foo authors' ...
apache-2.0
8,611,617,387,620,865,000
28.027778
75
0.679426
false
yephper/django
django/utils/feedgenerator.py
1
18261
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by th...
bsd-3-clause
-5,429,916,121,263,096,000
37.784314
107
0.579048
false
zork9/pygame-pyMM
maproomdungeon.py
1
4377
# Copyright (c) 2013 Johan Ceuppens. # All rights reserved. # Redistribution and use in source and binary forms are permitted # provided that the above copyright notice and this paragraph are # duplicated in all such forms and that any documentation, # advertising materials, and other materials related to such # dis...
gpl-2.0
2,741,953,282,796,637,700
31.422222
79
0.664839
false
gofed/gofed-ng
services/deps/service.py
1
4379
#!/bin/python # -*- coding: utf-8 -*- # #################################################################### # gofed-ng - Golang system # Copyright (C) 2016 Fridolin Pokorny, fpokorny@redhat.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Lice...
gpl-3.0
6,155,984,285,590,203,000
33.480315
87
0.622745
false
lcy-seso/models
fluid/ocr_recognition/_ce.py
1
1463
# this file is only used for continuous evaluation test! import os import sys sys.path.append(os.environ['ceroot']) from kpi import CostKpi, DurationKpi, AccKpi # NOTE kpi.py should shared in models in some way!!!! train_cost_kpi = CostKpi('train_cost', 0.05, 0, actived=True) test_acc_kpi = AccKpi('test_acc', 0.005,...
apache-2.0
-8,328,208,520,477,808,000
22.983607
73
0.608339
false
asphalt-framework/asphalt-mailer
tests/test_api.py
1
4504
from email.headerregistry import Address from email.message import EmailMessage from typing import Union, Iterable import pytest from asphalt.mailer.api import Mailer class DummyMailer(Mailer): def __init__(self, **message_defaults): super().__init__(message_defaults) self.messages = [] asy...
apache-2.0
-8,442,663,657,538,835,000
37.698276
95
0.658721
false
dansan/spring-replay-site
spring_replay_site/settings.py
1
5436
from os.path import abspath, dirname, join as path_join from django.conf import global_settings BASE_DIR = dirname(dirname(abspath(__file__))) SRS_FILE_ROOT = path_join(BASE_DIR, "srs") IMG_PATH = path_join(SRS_FILE_ROOT, "static/img") MAPS_PATH = path_join(SRS_FILE_ROOT, "static/maps") REPLAYS_PATH = path_join(SRS_...
gpl-3.0
-5,946,639,781,393,324,000
30.604651
115
0.673105
false
openenglishbible/USFM-Tools
transform/support/asciiRenderer.py
1
5744
# -*- coding: utf-8 -*- # import codecs import io import os import textwrap import abstractRenderer # # Simplest renderer. Ignores everything except ascii text. # class Renderer(abstractRenderer.AbstractRenderer): def __init__(self, inputDir, outputDir, outputName, config): self.identity = 'asci...
mit
-775,057,629,401,138,200
34.8375
121
0.537147
false
bsanders/kazoo
kazoo/tests/test_counter.py
1
1240
import uuid from nose.tools import eq_ from kazoo.testing import KazooTestCase class KazooCounterTests(KazooTestCase): def _makeOne(self, **kw): path = "/" + uuid.uuid4().hex return self.client.Counter(path, **kw) def test_int_counter(self): counter = self._makeOne() eq_(co...
apache-2.0
4,873,811,123,374,780,000
25.382979
59
0.558871
false
ophiry/dvc
dvc/logger.py
1
1532
import sys import logging import colorama colorama.init() class Logger(object): DEFAULT_LEVEL = logging.INFO LEVEL_MAP = { 'debug': logging.DEBUG, 'info': logging.INFO, 'warn': logging.WARNING, 'error': logging.ERROR } COLOR_MAP = { 'debug': colorama.Fore.BLU...
apache-2.0
-5,935,070,204,051,028,000
22.569231
85
0.609008
false
fzimmermann89/pyload
module/plugins/internal/Captcha.py
1
4078
# -*- coding: utf-8 -*- from __future__ import with_statement import os import time from module.plugins.internal.Plugin import Plugin from module.plugins.internal.utils import encode class Captcha(Plugin): __name__ = "Captcha" __type__ = "captcha" __version__ = "0.47" __status__ = "stable" ...
gpl-3.0
4,668,200,575,721,839,000
30.859375
129
0.576018
false
Karaage-Cluster/karaage-debian
karaage/plugins/kgapplications/templatetags/applications.py
1
3655
# Copyright 2015 VPAC # # This file is part of Karaage. # # Karaage 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. # # Karaage is dist...
gpl-3.0
2,375,639,057,141,617,700
31.061404
79
0.685636
false
usc-isi/extra-specs
nova/tests/api/openstack/compute/contrib/test_quotas.py
1
8680
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
apache-2.0
7,071,073,384,831,385,000
38.634703
79
0.521429
false
googleads/google-ads-python
examples/shopping_ads/add_shopping_product_listing_group_tree.py
1
15958
#!/usr/bin/env python # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
7,351,844,020,958,273,000
35.43379
80
0.665058
false
appium/appium
sample-code/python/test/test_ios_selectors.py
1
1831
import pytest import os import copy from appium import webdriver from helpers import report_to_sauce, take_screenshot_and_syslog, IOS_BASE_CAPS, EXECUTOR class TestIOSSelectors(): @pytest.fixture(scope='function') def driver(self, request, device_logger): calling_request = request._pyfuncitem.name ...
apache-2.0
-5,515,809,657,299,300,000
34.901961
119
0.680502
false
devincornell/networkxtimeseries
NetTS.py
1
13522
 # system imports import multiprocessing import pickle import sys from itertools import * # anaconda imports import networkx as nx import numpy as np import pandas as pd import matplotlib.pyplot as plt class NetTS: ''' Network Time Series ''' ### member vars ### # self.nts - list of networks repres...
mit
-2,272,877,648,505,575,000
33.402036
140
0.564867
false
tensorflow/benchmarks
scripts/tf_cnn_benchmarks/cnn_util.py
1
8496
# 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
2,613,338,284,972,577,300
32.581028
80
0.668432
false
cartertech/odoo-hr-ng
hr_transfer/__init__.py
1
1064
#-*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 One Click Software (http://oneclick.solutions) # and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you ca...
agpl-3.0
-1,945,479,425,682,072,300
45.26087
80
0.614662
false
simodalla/newage
newage/views.py
1
2723
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.http import Http404 from django.shortcuts import get_object_or_404 from django.core.exceptions import ObjectDoesNotExist from django.views.generic import ListView, DetailView from django.utils.translation import ugettext_lazy ...
bsd-3-clause
3,315,744,594,874,511,000
37.352113
79
0.634594
false
kansanmuisti/kamu
Attic/eduskunta/find-mp-twitter.py
1
2082
#!/usr/bin/env python import sys import pickle from twython import Twython from django.core.management import setup_environ sys.path.append('.') import settings setup_environ(settings) from parliament.models import Member, MemberSocialFeed PICKLE_FILE="mp-twitter.pickle" twitter = Twython() def read_twitter_list...
agpl-3.0
-8,833,156,142,159,256,000
26.76
82
0.59318
false
JustinTulloss/harmonize.fm
fileprocess/fileprocess/configuration.py
1
2469
# A configuration file for the fileprocess. We could do a .ini, but everybody # knows python here import logging import os from logging import handlers config = { 'port': 48260, 'S3.accesskey': '17G635SNK33G1Y7NZ2R2', 'S3.secret': 'PHDzFig4NYRJoKKW/FerfhojljL+sbNyYB9bEpHs', 'S3.music_bucket': 'music.r...
mit
-6,707,404,347,512,413,000
27.056818
80
0.649656
false
wger-project/wger
wger/weight/api/views.py
1
1461
# -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
agpl-3.0
63,408,866,045,461,896
30.76087
78
0.711841
false
swingr/meeseeks
meeseeks.py
1
1298
import pebble as p import audio class Meeseeks(): def __init__(self, id="464F", name="Mr. Meeseeks"): self.id = id self.name = name self.pebble = None self.score = [] def connect(self): self.pebble = p.Pebble(self.id) def send(self, msg): self.pebble.notifi...
mit
8,157,238,295,061,237,000
22.178571
82
0.572419
false
operasoftware/dragonfly-build-tools
df2/codegen/msgdefs.py
1
3763
import os import sys import time import protoparser import protoobjects import utils INDENT = " " CSS_CLASSES = { protoobjects.NUMBER: "number", protoobjects.BUFFER: "string", protoobjects.BOOLEAN: "boolean", } def indent(count): return count * INDENT def print_doc(file, field, depth):...
apache-2.0
5,219,118,924,902,811,000
40.280899
120
0.594738
false
mudragada/util-scripts
PyProblems/CodeSignal/uberShortestDistance.py
1
3276
#Consider a city where the streets are perfectly laid out to form an infinite square grid. #In this city finding the shortest path between two given points (an origin and a destination) is much easier than in other more complex cities. #As a new Uber developer, you are tasked to create an algorithm that does this calc...
mit
2,286,087,225,133,462,500
27.920354
144
0.612607
false
kbase/auth_service
python-libs/oauth.py
1
8778
import logging import httplib2 import json import os import hashlib # This module performs authentication based on the tokens # issued by Globus Online's Nexus service, see this URL for # details: # http://globusonline.github.com/nexus-docs/api.html # # Import the Globus Online client libraries, originally # sourced f...
mit
-9,132,790,155,269,310,000
39.451613
127
0.640009
false
SecuredByTHEM/ndr-server
ndr_server/recorder.py
1
5041
#!/usr/bin/python3 # Copyright (C) 2017 Secured By THEM # Original Author: Michael Casadevall <mcasadevall@them.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of...
agpl-3.0
4,874,409,016,993,405,000
38.077519
89
0.620115
false
mvaled/sentry
tests/sentry/api/endpoints/test_organization_user_issues.py
1
3349
from __future__ import absolute_import import six from datetime import timedelta from django.core.urlresolvers import reverse from django.utils import timezone from sentry import tagstore from sentry.models import EventUser, OrganizationMemberTeam from sentry.testutils import APITestCase class OrganizationUserIssu...
bsd-3-clause
5,731,906,424,005,365,000
36.211111
100
0.640191
false
phildini/django-invitations
invitations/models.py
1
2846
import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.utils.crypto import get_random_string from django.utils.encoding import python_2_unicode_compatible from django.contrib.sites.models import Site from django.core.urlresolve...
gpl-3.0
-2,722,871,065,632,220,700
31.340909
89
0.625439
false
massimo-nocentini/competitive-programming
UVa/1062.py
1
2541
#_________________________________________________________________________ import fileinput from contextlib import contextmanager @contextmanager def line_bind(line, *ctors, splitter=lambda l: l.split(' '), do=None): ''' Split `line` argument producing an iterable of mapped elements, in the sense of `ctors`....
mit
-4,782,286,211,673,975,000
34.291667
92
0.623377
false
the-duck/launcher
duck_launcher/defaultConfig.py
1
1158
#! /usr/bin/python # -*- coding: utf-8 -*- ######### #Copyright (C) 2014 Mark Spurgeon <theduck.dev@gmail.com> # 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 Li...
gpl-2.0
5,718,008,555,111,466,000
28.692308
106
0.666667
false
markvdw/mltools
mltools/optimise_scg.py
1
5939
# Copyright I. Nabney, N.Lawrence and James Hensman (1996 - 2014) # Scaled Conjuagte Gradients, originally in Matlab as part of the Netlab toolbox by I. Nabney, converted to python N. Lawrence and given a pythonic interface by James Hensman # Modified from GPy SCG optimisation from __future__ import print_function i...
mit
-192,725,720,858,400,350
32.937143
228
0.555144
false
davy39/eric
eric6_re.py
1
1832
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2004 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Eric6 Re. This is the main Python script that performs the necessary initialization of the PyRegExp wizard module and starts the Qt event loop. This is a standalone version of the integrated P...
gpl-3.0
46,288,976,475,146,880
25.171429
75
0.601528
false
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/resources/types/keyword_plan_campaign_keyword.py
1
2588
# -*- 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
3,933,835,017,101,767,700
28.409091
95
0.63949
false
ayrokid/yowsup
send.py
1
1165
from yowsup.demos import sendclient #import logging #tampilan log khusus centos os import MySQLdb import MySQLdb.cursors db = MySQLdb.connect(host="localhost", # your host, usually localhost user="root", # your username passwd="root", # your password db="push", cursorclass=MySQLdb.cursors.DictCursor) # name of the data...
gpl-3.0
-5,198,567,450,660,308,000
28.125
96
0.670386
false
trou/gdb-x86-sysutils
intel_sys_structs.py
1
6572
# Copyright 2015 - Raphaël Rigo # # 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 of the License, or # (at your option) any later version. # # This program is distributed ...
gpl-2.0
5,077,701,676,599,962,000
34.907104
251
0.455943
false
goerz/LPBS
LPBS/Config.py
1
9634
# -*- coding: utf-8 -*- ############################################################################ # Copyright (C) 2015 by Michael Goerz # # http://michaelgoerz.net # # ...
gpl-3.0
7,518,117,689,724,686,000
37.536
80
0.605148
false
lupyuen/RaspberryPiImage
usr/share/pyshared/ajenti/plugins/fm/backend.py
1
6269
import grp import logging import os import pwd import re import subprocess import stat import shutil from datetime import datetime from ajenti.api import * from ajenti.util import str_fsize from ajenti.plugins import manager from ajenti.plugins.tasks.manager import TaskManager from ajenti.plugins.tasks.tasks import Co...
apache-2.0
-8,778,958,459,631,277,000
29.285024
92
0.535971
false
vrutkovs/beehive
beehive4cmd0/failing_steps.py
1
1081
# -*- coding: utf-8 -*- """ Generic failing steps. Often needed in examples. EXAMPLES: Given a step fails When another step fails Then a step fails Given ... When ... Then it should fail because "the person is unknown". """ from beehive import step, then # -----------------------------...
bsd-2-clause
2,706,280,226,738,522,000
24.139535
79
0.552266
false
layzerar/gospel
gospel/scripts/gossc.py
1
8923
# -*- coding: utf-8 -*- import io import operator import os import re import sys import signal import tempfile import subprocess import argparse try: import psutil except ImportError: psutil = None def _log_info(msg, **kwds): if kwds: msg = msg.format(**kwds) sys.stdout.write(msg) sys.st...
mit
7,736,834,664,173,986,000
30.754448
77
0.545781
false
kevinseelbach/generic_utils
src/generic_utils/json_utils.py
1
7686
""" Functions which support creating dicts (mappings) with interesting structures and simplify getting or setting values which may be nested deeply within the object. """ from __future__ import absolute_import # stdlib import collections def query_json_struct_from_path(json_struct, path): """ Query the json...
bsd-3-clause
-6,572,456,200,221,115,000
36.31068
109
0.63362
false
WalrusCow/euler
Solutions/problem12.py
1
1428
# Project Euler Problem 12 # Created on: 2012-06-15 # Created by: William McDonald import math # Short list of prime numbers under 20 primeList = [2, 3, 5, 7, 9, 11, 13, 17, 19] last = 21 # Returns True if n is prime, otherwise False def isPrime(n): prime = True for i in primeList: if n % i == 0: ...
mit
-6,129,487,564,086,719,000
20.636364
50
0.52381
false
sgenoud/scikit-learn
sklearn/lda.py
1
9466
""" The :mod:`sklearn.lda` module implements Linear Discriminant Analysis (LDA). """ # Authors: Matthieu Perrot # Mathieu Blondel import warnings import numpy as np from scipy import linalg, ndimage from .base import BaseEstimator, ClassifierMixin, TransformerMixin from .utils.extmath import logsumexp cla...
bsd-3-clause
-2,355,859,689,835,530,000
32.807143
79
0.553243
false
abossi/42projects
api/app.py
1
1356
from flask import Flask, send_from_directory, jsonify, request from flask_socketio import SocketIO import settings import os app = Flask(__name__, static_url_path='') socketio = SocketIO(app) @app.route('/', methods=['GET']) def home(): return send_from_directory('../front', 'index.html') @app.route('/front/<pat...
mit
-6,426,062,721,653,113,000
27.270833
82
0.584808
false
gotostack/neutron-lbaas
neutron_lbaas/drivers/haproxy/synchronous_namespace_driver.py
1
26298
# Copyright 2014-2015 Rackspace # # 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 agr...
apache-2.0
5,295,248,444,146,570,000
38.427286
79
0.599589
false
messagebird/python-rest-api
tests/test_number.py
1
3373
import unittest from unittest.mock import Mock from messagebird import Client, ErrorException class TestNumber(unittest.TestCase): def test_available_numbers_list(self): http_client = Mock() http_client.request.return_value = '{"items":[{"number":"3197010260188","country":"NL","region":"","local...
bsd-2-clause
-8,275,679,311,754,160,000
43.973333
277
0.628817
false
hanteng/pyCHNadm1
pyCHNadm1/02_converting_csv_pkl.py
1
2853
# -*- coding: utf-8 -*- #歧視無邊,回頭是岸。鍵起鍵落,情真情幻。 import ConfigParser Config = ConfigParser.ConfigParser() Config.read("config.ini") dir_src = Config.get("Directory",'source') dir_out = Config.get("Directory",'outcome') fn_suffix = Config.get("Filename",'suffix') fn_datasrc= Config.get("Filename",'datasource') fn_mappi...
gpl-3.0
-2,508,967,665,729,506,300
27.938144
132
0.633773
false
UCSBarchlab/PyRTL
tests/test_memblock.py
1
15471
import unittest import pyrtl from random import randint # ------------------------------------------------------------------- class RTLMemBlockDesignBase(unittest.TestCase): def setUp(self): pyrtl.reset_working_block() self.bitwidth = 3 self.addrwidth = 5 self.output1 = pyrtl.Outpu...
bsd-3-clause
-3,061,218,392,473,956,000
39.289063
96
0.572103
false
dchabot/ophyd
ophyd/mca.py
2
5086
import logging from collections import OrderedDict from .signal import (EpicsSignal, EpicsSignalRO) from .device import Device from .device import Component as C, DynamicDeviceComponent as DDC from .areadetector import EpicsSignalWithRBV as SignalWithRBV logger = logging.getLogger(__name__) class ROI(Device): ...
bsd-3-clause
-7,716,721,573,256,273,000
33.835616
76
0.638223
false
awsteiner/bamr
bamr_ex2.py
1
3952
# ------------------------------------------------------------------- # # Copyright (C) 2020, Andrew W. Steiner and Sarah Wellence # # This file is part of bamr. # # bamr 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...
gpl-3.0
5,815,714,334,031,064,000
39.326531
71
0.541498
false
CLVsol/oehealth
oehealth_professional/oehealth_tag.py
1
1876
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
1,110,120,343,766,397,000
55.848485
80
0.405117
false
GoWebyCMS/goweby-core-dev
blog/views.py
1
2842
from django.shortcuts import render, get_object_or_404 from django.views.generic import ListView from itertools import chain from django.core.paginator import Paginator, EmptyPage,PageNotAnInteger from django.db.models import Count from .forms import SearchForm from .models import Post, Category, Tag # Create your vi...
mit
-833,982,272,543,700,500
31.666667
105
0.607671
false
jamespcole/home-assistant
homeassistant/components/generic/camera.py
1
5982
""" Support for IP Cameras. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/camera.generic/ """ import asyncio import logging import aiohttp import async_timeout import requests from requests.auth import HTTPDigestAuth import voluptuous as vol from home...
apache-2.0
7,431,058,157,576,323,000
37.101911
79
0.636242
false
3dfxsoftware/cbss-addons
report_aeroo/wizard/report_print_by_action.py
1
2630
############################################################################## # # Copyright (c) 2008-2012 Alistek Ltd (http://www.alistek.com) All Rights Reserved. # General contacts <info@alistek.com> # # WARNING: This program as such is intended to be used by professional # programmers who take th...
gpl-2.0
-1,483,548,834,182,775,600
40.746032
126
0.637262
false
whiteear/cloudbase-init
cloudbaseinit/tests/plugins/windows/test_winrmcertificateauth.py
1
6477
# Copyright 2013 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
8,448,140,944,114,927,000
41.611842
78
0.630076
false
SoFolichon/ISN-Twitter
src/lib/mttkinter.py
1
9704
"""Thread-safe version of tkinter. Copyright (c) 2014, Andrew Barnert Based on mtTkinter (for Python 2.x), copyright (c) 2009, Allen B. Taylor This module 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 v...
gpl-3.0
1,259,108,486,377,189,400
34.940741
105
0.613355
false
DonHilborn/DataGenerator
faker/providers/lt_LT/person.py
1
3340
# -*- coding: utf-8 -*- from __future__ import unicode_literals from ..person import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{last_name}}, {{first_name}}' ) first_names = ( ...
mit
6,121,079,894,068,943,000
59.685185
86
0.529753
false
JaneliaSciComp/osgpyplusplus
examples/rough_translated1/osgcubemap.py
1
5601
#!/bin/env python # Automatically translated python version of # OpenSceneGraph example program "osgcubemap" # !!! This program will need manual tuning before it will work. !!! import sys from osgpypp import osg from osgpypp import osgDB from osgpypp import osgGA from osgpypp import osgUtil from osgpypp import osgV...
bsd-3-clause
-8,895,560,723,117,979,000
36.34
109
0.725763
false
msiemens/PyGitUp
PyGitUp/tests/test_rebase_arguments.py
1
1524
# System imports import os from os.path import join import pytest from git import * from PyGitUp.git_wrapper import RebaseError from PyGitUp.tests import basepath, write_file, init_master, update_file, testfile_name test_name = 'rebase-arguments' repo_path = join(basepath, test_name + os.sep) def _read_file(path): ...
mit
-9,036,158,272,451,131,000
23.983607
87
0.674541
false
woutersmet/Zeosummer
lib/zeobuilder/gui/visual/camera.py
2
10839
# Zeobuilder is an extensible GUI-toolkit for molecular model construction. # Copyright (C) 2007 - 2009 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center # for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights # reserved unless otherwise stated. # # This file is part of Zeobuilder. # # Zeobuilde...
gpl-3.0
2,054,813,364,544,159,200
34.890728
104
0.640834
false
Crystal-SDS/dashboard
crystal_dashboard/dashboards/crystal/projects/groups/tables.py
1
2270
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy from django.core.urlresolvers import reverse from horizon import tables from horizon import exceptions from crystal_dashboard.api import projects as api class MyFilterAction(tables.FilterAction): name = "...
gpl-3.0
4,537,338,068,862,969,300
28.102564
94
0.634361
false
enriquefynn/dwm-scripts
status_bar.py
1
3351
#!/usr/bin/env python import json import time import urllib2 import re from subprocess import call,check_output redfg = '\x1b[38;5;196m' bluefg = '\x1b[38;5;21m' darkgreenfg = '\x1b[38;5;78m' darkbluefg = '\x1b[38;5;74m' winefg = '\x1b[38;5;118m' yellowfg = '\x1b[38;5;226m' redbg = '\x1b[48;5;196m' greenbg = '\x1b[4...
bsd-3-clause
-1,261,675,721,522,088,000
27.887931
133
0.587586
false
looooo/paraBEM
examples/vtk/vtk_cylinder_linear_dirichlet.py
1
1537
import numpy as np import paraBEM from paraBEM.pan2d import DirichletDoublet1Case2 as Case from paraBEM.utils import check_path from paraBEM.vtk_export import VtkWriter # geometry numpoints = 100 phi = np.linspace(0, 2 * np.pi, numpoints + 1) x = np.cos(phi)[:-1] y = np.sin(phi)[:-1] xy = np.transpose(np.array([x, y])...
gpl-3.0
-7,619,371,730,664,298,000
33.954545
90
0.676643
false