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
kojo1/tinyTLS
examples/echo-client.py
1
1056
# echo-client.py # # Copyright (C) 2006-2017 wolfSSL Inc. # # This file is part of wolfSSL. (formerly known as CyaSSL) # # wolfSSL 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 Licens...
gpl-2.0
-4,838,476,359,355,766,000
32
79
0.754735
false
tgbugs/pyontutils
ttlser/ttlser/utils.py
1
1846
import rdflib rdflib.plugin.register('nifttl', rdflib.serializer.Serializer, 'ttlser', 'CustomTurtleSerializer') rdflib.plugin.register('cmpttl', rdflib.serializer.Serializer, 'ttlser', 'CompactTurtleSerializer') rdflib.plugin.register('uncmpttl', rdflib.serializer.Seriali...
mit
-1,344,507,736,967,548,200
34.5
71
0.602925
false
CNR-Engineering/TelTools
cli/slf_3d_to_2d.py
1
4035
#!/usr/bin/env python """ Perform a vertical operation on a 3D results file to get 2D """ import numpy as np import sys from tqdm import tqdm from pyteltools.geom.transformation import Transformation import pyteltools.slf.misc as operations from pyteltools.slf import Serafin from pyteltools.utils.cli_base import logg...
gpl-3.0
2,957,268,180,725,916,700
41.925532
116
0.615366
false
storpool/python-storpool
storpool/sputils.py
1
1408
# # Copyright (c) 2014 - 2019 StorPool. # 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 appli...
apache-2.0
3,257,509,325,098,804,700
24.6
74
0.674006
false
loggrio/loggr-unit-raspberry
raspi_loggr/util.py
1
3137
#!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess import logging from enum import Enum class LedStatusTypes(Enum): """Enum of led status types resp. colors""" ok = 1 # green sensor_broken = 2 # red request_error = 3 # orange pairing_succeeded = 4 # blue class SensorTypes(Enum):...
gpl-3.0
-4,851,364,773,348,961,000
24.92562
111
0.629582
false
wwrechard/pydlm
doc/source/conf.py
1
10025
# -*- coding: utf-8 -*- # # PyDLM documentation build configuration file, created by # sphinx-quickstart on Fri Sep 9 23:34:57 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
bsd-3-clause
-657,461,185,511,227,300
27.724928
80
0.691671
false
chapering/PyVolRender
stlineRender.py
1
1041
#!/usr/bin/env python import vtk from vtk.util.colors import * from tgdataReader import tgdataReader import sys stlineModel = tgdataReader( sys.argv[1] ) mapStreamLine = vtk.vtkPolyDataMapper() mapStreamLine.SetInput( stlineModel ) streamLineActor = vtk.vtkActor() streamLineActor.SetMapper(mapStreamLine) streamL...
gpl-2.0
-3,682,871,427,551,950,000
24.390244
50
0.770413
false
libyal/libyal
yaldevtools/source_generators/common.py
1
1219
# -*- coding: utf-8 -*- """The source file generator for common source files.""" from __future__ import unicode_literals import os from yaldevtools.source_generators import interface class CommonSourceFileGenerator(interface.SourceFileGenerator): """Common source files generator.""" _AUTHORS = 'Joachim Metz <...
apache-2.0
6,604,040,997,463,279,000
31.945946
79
0.696473
false
fniephaus/power-system-simulation
systems/producers.py
1
4740
import random class GasPoweredGenerator(object): def __init__(self, env): self.env = env self.gas_price_per_kwh = 0.0655 # Euro self.running = False self.workload = 0 self.current_gas_consumption = 0 # kWh self.current_thermal_production = 0 # kWh self....
mit
1,032,790,854,854,087,200
33.59854
116
0.597679
false
rusty1s/graph-based-image-classification
patchy/patchy.py
1
9132
import os import sys import json import tensorflow as tf from data import DataSet, Record, datasets from data import iterator, read_tfrecord, write_tfrecord from grapher import graphers from .helper.labeling import labelings, scanline from .helper.neighborhood_assembly import neighborhood_assemblies as neighb,\ ...
mit
1,591,233,635,957,854,200
36.892116
79
0.591984
false
AlanJAS/iknowAmerica
recursos/0ecuador/datos/0ecuador.py
1
6073
# -*- coding: utf-8 -*- from gettext import gettext as _ NAME = _('Ecuador') STATES = [ (_('Pichincha'), 254, 335, 210, 0), (_('Guayas'), 253, 138, 472, 0), (_('Azuay'), 252, 242, 622, 0), (_('Manabí'), 251, 122, 316, 0), (_('Esmeraldas'), 250, 234, 117, 0), (_('El Oro'), 249, 158, 693, 0), ...
gpl-3.0
55,632,034,487,499,710
38.051613
117
0.455972
false
internap/almanach
tests/builder.py
1
4540
# Copyright 2016 Internap. # # 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, so...
apache-2.0
7,253,645,098,605,232,000
27.553459
105
0.609471
false
SegFaultAX/hotchip
tests/test_main.py
1
1293
# -*- coding: utf-8 -*- from pytest import raises # The parametrize function is generated, so this doesn't work: # # from pytest.mark import parametrize # import pytest parametrize = pytest.mark.parametrize from hotchip import metadata from hotchip.main import main class TestMain(object): @parametrize('help...
mit
4,576,581,993,130,779,600
33.026316
76
0.637278
false
crichardson17/starburst_atlas
SFH_comparison/data/Padova_inst/padova_inst_6/fullgrid/peaks_reader.py
1
5057
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # ---------------------------------------------------...
gpl-2.0
-5,176,362,807,463,443,000
32.490066
109
0.636741
false
luoshao23/ML_algorithm
luolearn/metrics/classification.py
1
1875
import numpy as np from scipy.sparse import csr_matrix from ..utils import column_or_1d from ..utils import check_consistent_length from ..utils.multiclass import type_of_target from ..utils.sparsefuncs import count_nonzero def _check_targets(y_true, y_pred): check_consistent_length(y_true, y_pred) type_tru...
mit
-3,364,809,980,190,395,400
30.25
72
0.629333
false
yuhaya/vim
.ycm_extra_conf.py
1
6555
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
apache-2.0
1,071,250,335,781,771,500
32.106061
80
0.700686
false
amboycharlie/Child-Friendly-LCMS
leonardo/module/web/widgets/mixins.py
1
6783
from __future__ import unicode_literals import json from django.db import models from django.utils import timezone from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from .const import PAGINATION_CHOICES try: from urllib.parse import urlparse except Imp...
apache-2.0
7,673,815,014,192,175,000
27.620253
75
0.600914
false
AQuadroTeam/CellsCycle
doc/tests/list-communication/KeyTest.py
1
6180
from CellCycle.ChainModule.ListThread import * from start import loadSettings from start import loadLogger from CellCycle.MemoryModule.calculateSon import calculateSonId def add_check(): currentProfile = {"profile_name": "alessandro_fazio", "key_pair": "AWSCellCycle", "branch": "ListUtilities"} settings_to_l...
mit
-7,520,850,627,014,340,000
49.243902
116
0.652427
false
sweon/edx-dl
edx_dl/common.py
1
5361
# -*- coding: utf-8 -*- """ Common type definitions and constants for edx-dl The classes in this module represent the structure of courses in edX. The structure is: * A Course contains Sections * Each Section contains Subsections * Each Subsection contains Units Notice that we don't represent the full tree structu...
lgpl-3.0
-4,726,805,692,538,409,000
27.365079
79
0.598769
false
jbasko/pytest-random-order
random_order/bucket_types.py
1
1572
import functools import os.path from collections import OrderedDict bucket_type_keys = OrderedDict() def bucket_type_key(bucket_type): """ Registers a function that calculates test item key for the specified bucket type. """ def decorator(f): @functools.wraps(f) def wrapped(item, se...
mit
7,146,111,292,078,620,000
20.534247
106
0.646947
false
okfse/froide
froide/foirequest/urls.py
1
3247
from django.utils.six import text_type as str from django.core.urlresolvers import reverse from django.conf.urls import patterns from django.utils.translation import pgettext from django.shortcuts import redirect from .models import FoiRequest urlpatterns = patterns("froide.foirequest.views", (r'^%s/$' % pgette...
mit
-6,307,762,861,912,977,000
42.293333
94
0.581152
false
owlabs/incubator-airflow
tests/contrib/operators/test_aws_athena_operator.py
1
7752
# -*- 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 # "...
apache-2.0
7,077,962,466,399,328,000
50
109
0.664603
false
Dioptas/pymatgen
pymatgen/core/tests/test_surface.py
2
10627
#!/usr/bin/python import unittest import os import random import numpy as np from pymatgen.core.structure import Structure from pymatgen.core.lattice import Lattice from pymatgen.core.surface import Slab, SlabGenerator, generate_all_slabs, \ get_symmetrically_distinct_miller_indices from pymatgen.symmetry.group...
mit
3,577,662,483,260,128,000
40.838583
77
0.559612
false
bluesquall/okeanidanalysis
examples/sensors/rowe-adcp-bottom-track-summary.py
1
3719
#!/bin/env python """ e.g.: $ python rowe-adcp-bottom-track-summary.py /mbari/LRAUV/makai/missionlogs/devel/20150617-ADCP-in-tank/20150617T172914/ADCP-2015061717.ENS.mat """ import numpy as np import scipy as sp import scipy.io import matplotlib.pyplot as plt def plot_adcp_bottom_track_summary(infile, save=True, sho...
mit
-4,899,205,760,434,004,000
37.340206
149
0.600161
false
ofilipowicz/owndb
store/views.py
1
34136
from django.contrib.auth.models import User from django.views.generic import ListView, DetailView, View, CreateView, DeleteView from django.views.generic.base import TemplateView from django.db.models import Q from django.core.urlresolvers import reverse, reverse_lazy from django.contrib.auth.decorators import login_r...
mit
6,421,516,021,437,837,000
44.031662
191
0.555516
false
esanchezm/sqjobs
sqjobs/tests/worker_test.py
1
3311
import pytest from ..connectors.dummy import Dummy from ..worker import Worker from ..broker import Broker from .fixtures import Adder, FakeAdder, AbstractAdder class TestWorker(object): @property def connector(self): return Dummy() @property def broker(self): return Broker(self.con...
bsd-3-clause
-5,957,581,397,920,828,000
29.1
76
0.58804
false
Eldinnie/python-telegram-bot
tests/test_choseninlineresulthandler.py
1
5421
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
gpl-3.0
-3,852,272,266,382,345,700
38
90
0.654307
false
drytoastman/scorekeeperbackend
sync/tests/test_conflicts.py
1
2530
#!/usr/bin/env python3 import time from helpers import * def test_keyinsert(syncdbs, syncdata): """ Merge drivers, delete on one while linking to a car on the other, should undelete driver and maintain car """ syncx, mergex = syncdbs testid = '00000000-0000-0000-0000-000000000042' testcid = '0000000...
gpl-3.0
8,740,280,239,374,381,000
40.47541
193
0.607115
false
rapkis/prekiu-automatas
aparatas1.py
1
4408
#!/usr/bin/python import MySQLdb import datetime prekes = [None] * 16 automatoId=1 data = str(datetime.date.today()) prekesId = None prekesPav = "Niekas" def prisijungimas(): db = MySQLdb.connect(host="pardavimuaparatas2.mysql.database.azure.com", user="pi@pardavimuapar...
mit
849,941,584,960,501,600
35.675214
155
0.533348
false
bistromath/gr-air-modes
python/sbs1.py
1
7992
# # Copyright 2010 Nick Foster # # This file is part of gr-air-modes # # gr-air-modes 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) # any later version. # # gr-air-mo...
gpl-3.0
689,276,427,596,621,600
35
191
0.624875
false
ifuding/Kaggle
ADDC/Code/blend.py
1
5606
import numpy as np import pandas as pd import time from time import gmtime, strftime from main import * from sklearn import metrics import lightgbm as lgb from tensorflow.python.keras.models import load_model from keras_train import DNN_Model # len_train = 20905996 # len_valide = 20000001 # df = pd.read_pi...
apache-2.0
-9,144,364,364,217,793,000
42.492063
117
0.603639
false
fulfilio/trytond-picking-list-report
picking_list_report.py
1
2960
# -*- coding: utf-8 -*- """ picking_list_report.py """ from trytond.pool import PoolMeta, Pool from trytond.transaction import Transaction from openlabs_report_webkit import ReportWebkit __metaclass__ = PoolMeta __all__ = ['PickingListReport'] class ReportMixin(ReportWebkit): """ Mixin Class to inher...
bsd-3-clause
-1,181,353,906,449,676,300
28.89899
78
0.571284
false
Cecca/lydoc
setup.py
1
1336
from setuptools import setup, find_packages import io version = dict() with io.open("lydoc/_version.py", "r", encoding='utf-8') as fp: exec(fp.read(), version) with io.open("README.rst", "r", encoding='utf-8') as fp: long_desc = fp.read() setup( name='lydoc', version=version['__version__'], auth...
gpl-3.0
2,782,565,075,269,225,000
28.043478
75
0.583832
false
susundberg/Networkdroid
src/main_client_speak.py
1
4093
import json import argparse import sys import zmq import datetime from Sundberg.Logger import * from subprocess import call def get_command_line_arguments( ): parser = argparse.ArgumentParser(description='Speak-aloud espeak client') parser.add_argument("configfile", help = "Set configuration file to be used")...
gpl-2.0
-7,579,788,459,842,370,000
33.686441
113
0.597361
false
open-synergy/opnsynid-stock-logistics-warehouse
stock_picking_type_accounting_configuration/models/stock_move_account_source.py
1
1177
# 2020 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, api, fields from openerp.tools.safe_eval import safe_eval as eval class StockMoveAccountSource(models.Model): _name = "stock.move_account_source" _description = "Stock Move Account So...
agpl-3.0
-1,646,716,042,506,528,800
24.586957
68
0.571793
false
F1ashhimself/UISoup
uisoup/interfaces/i_soup.py
1
2577
#!/usr/bin/env python # Copyright (c) 2014-2017 Max Beloborodko. # # 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 # # Unl...
apache-2.0
5,912,929,335,668,427,000
27.318681
78
0.629802
false
desktopbsd/gbi
src/create_cfg.py
1
22837
#!/usr/bin/env python # # Copyright (c) 2013 GhostBSD # # See COPYING for licence terms. # # create_cfg.py v 1.4 Friday, January 17 2014 Eric Turgeon # import os import pickle from subprocess import Popen # Directory use from the installer. tmp = "/tmp/.gbi/" installer = "/usr/local/lib/gbi/" start_Install = 'python ...
bsd-3-clause
3,646,173,461,506,960,000
43.343689
75
0.556071
false
Juniper/tempest
tempest/api/compute/test_extensions.py
1
2103
# 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 requ...
apache-2.0
-5,326,168,622,325,801,000
37.236364
79
0.69805
false
XianliangJ/collections
CNUpdates/updates/examples/experiment_base_waxman.py
1
1647
from waxman_topo import Topology global networkSize networkSize = None def set_size(size): global networkSize networkSize = size def links_to_remove(version, graph): if version == 0: return [] if len(graph.coreSwitches) < 2: return [] return [ (graph.coreSwitches[idx], graph.edgeS...
gpl-3.0
-3,425,362,455,485,318,700
30.075472
114
0.645416
false
Sybrand/digital-panda
AutoUpdatePy/updater.py
1
10275
import os import urllib import httplib import json import hashlib import logging import time import zipfile import pythoncom import ConfigParser from win32com.client import Dispatch class AutoUpdate: def __init__(self, parent, upgradeHost): self.parent = parent # TODO: the config stuff is very mu...
mit
3,438,924,125,686,284,300
38.671815
108
0.598443
false
egtaonline/quiesce
egta/script/innerloop.py
1
5342
"""Script utility for running inner loop""" import asyncio import json import logging from concurrent import futures from gameanalysis import regret from egta import innerloop from egta import schedgame from egta.script import schedspec from egta.script import utils def add_parser(subparsers): """Create innerlo...
apache-2.0
7,585,665,042,589,189,000
33.915033
82
0.60745
false
MarkusHackspacher/PythonFarmGame
farmlib/gamemanager.py
1
8848
''' Created on 17-07-2012 @author: orneo1212 ''' import os import time from farmlib import DictMapper from farmlib.farm import FarmField, FarmObject, FarmTile, Seed, objects from farmlib.player import Player try: xrange except NameError: xrange = range class GameManager(object): """Game Manager class ...
gpl-3.0
-7,167,441,936,136,486,000
27.541935
78
0.493897
false
anortef/calico
calico/felix/config.py
1
17129
# -*- coding: utf-8 -*- # Copyright (c) 2014, 2015 Metaswitch Networks # 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/licens...
apache-2.0
-5,891,084,876,158,930,000
40.175481
83
0.578142
false
oesteban/preprocessing-workflow
fmriprep/workflows/bold/util.py
1
18323
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Utility workflows ^^^^^^^^^^^^^^^^^ .. autofunction:: init_bold_reference_wf .. autofunction:: init_enhance_and_skullstrip_bold_wf .. autofunction:: init_skullstrip_bold_wf """...
bsd-3-clause
8,292,137,848,406,605,000
40.08296
97
0.601867
false
googleapis/python-error-reporting
google/cloud/errorreporting_v1beta1/services/error_group_service/transports/grpc_asyncio.py
1
12859
# -*- 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
-2,248,714,581,095,441,200
43.649306
93
0.621199
false
dnsforever/dnsforever-web
dnsforever/web/__init__.py
1
1055
from flask import Flask, g from dnsforever.config import secret_key from dnsforever.models import Session from dnsforever.web.tools.session import get_user blueprints = ['apis', 'index', 'account', 'domain', 'domain_a', 'domain_ddns', 'domain_aaaa', 'domain_cname', 'domain_mx', ...
gpl-3.0
4,566,098,043,050,509,000
24.731707
70
0.589573
false
pbanaszkiewicz/amy
amy/extforms/tests/test_selforganised_submission_form.py
1
4753
from datetime import date from django.conf import settings from django.core import mail from django.urls import reverse from extforms.forms import SelfOrganisedSubmissionExternalForm from extrequests.models import SelfOrganisedSubmission from workshops.models import Curriculum, Language from workshops.tests.base impo...
mit
2,736,142,694,196,750,300
37.024
85
0.555228
false
FishyFing/FishBot
cogs/google.py
1
2253
import discord from discord.ext import commands from .utils import checks import urllib class SimplyGoogle: """A non sarcastic google command""" def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, no_pm=True) async def google(self, ctx, text): """Its google, y...
gpl-3.0
-4,040,341,036,851,990,500
41.509434
97
0.590324
false
nomadicfm/pyramid-views
tests/_test_dates.py
1
31005
from __future__ import unicode_literals import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings, skipUnlessDBFeature from django.test.utils import requires_tz_support from django.utils import timezone from .models import Book, BookSigning def _mak...
mit
4,528,030,635,448,044,000
48.608
140
0.652959
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.1/Lib/sqlite3/test/hooks.py
1
6677
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/hooks.py: tests for various SQLite-specific hooks # # Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for...
mit
-6,211,855,525,565,105,000
34.515957
91
0.59323
false
evansd/django-envsettings
envsettings/cache.py
1
4531
from .base import URLSettingsBase, is_importable class CacheSettings(URLSettingsBase): REDIS_CONFIG = {'BACKEND': 'django_redis.cache.RedisCache', 'OPTIONS': {}} CONFIG = { 'locmem': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}, 'file': {'BACKEND': 'django.core.cache.backends...
mit
6,058,745,335,508,903,000
38.745614
84
0.601854
false
akimtke/arke
textserver/main.py
1
2812
# -*- coding: utf-8 -*- import pyjsonrpc from gsmmodem.modem import GsmModem, SentSms, Sms from gsmmodem.exceptions import TimeoutException, PinRequiredError, IncorrectPinError def text(number, message, key): if key.strip() == '9703BB8D5A': print "Creating modem instance" modem = GsmModem('/dev/tt...
gpl-3.0
7,310,618,908,439,127,000
26.841584
85
0.562945
false
schleichdi2/OPENNFR-6.3-CORE
opennfr-openembedded-core/meta/lib/oeqa/selftest/cases/resulttooltests.py
1
6605
# # SPDX-License-Identifier: MIT # import os import sys basepath = os.path.abspath(os.path.dirname(__file__) + '/../../../../../') lib_path = basepath + '/scripts/lib' sys.path = sys.path + [lib_path] from resulttool.report import ResultsTextReport from resulttool import regression as regression from resulttool import...
gpl-2.0
-8,300,766,894,159,079,000
66.397959
139
0.421953
false
elifesciences/elife-metrics
src/article_metrics/ga_metrics/elife_v5.py
1
1848
"elife_v5, the addition of /executable paths" from . import elife_v1 from article_metrics.utils import lfilter import re import logging LOG = logging.getLogger(__name__) event_counts_query = elife_v1.event_counts_query event_counts = elife_v1.event_counts # views counting def path_counts_query(table_id, from_date,...
gpl-3.0
-3,663,562,856,745,356,300
36.714286
87
0.671537
false
credativ/gofer
src/gofer/messaging/consumer.py
1
4309
# Copyright (c) 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or implied, # including the impl...
lgpl-2.1
3,765,145,563,174,778,400
28.114865
95
0.576468
false
pyslackers/sirbot-slack
sirbot/slack/store/channel.py
1
3727
import json import logging import time from sirbot.core import registry from .store import SlackStore, SlackChannelItem from .. import database logger = logging.getLogger(__name__) class Channel(SlackChannelItem): """ Class representing a slack channel. """ def __init__(self, id_, raw=None, last_u...
mit
-1,458,524,759,698,175,000
26.007246
79
0.523209
false
JoshuaBaunach/RollerCoasterDataBot
main.py
1
3525
#!/usr/bin/python # This file is the main file that manages everything from redditManager import RedditManager import json import time import getpass import sys import traceback def main(): # Clear the logfile logfile = open('logfile.log', 'w') logfile.write('') logfile.close() writeLogfile('Sta...
gpl-3.0
3,522,323,599,883,457,500
32.894231
156
0.582695
false
pjh/vm-analyze
app_scripts/app_python.py
1
5200
# Virtual memory analysis scripts. # Developed 2012-2014 by Peter Hornyack, pjh@cs.washington.edu # Copyright (c) 2012-2014 Peter Hornyack and University of Washington # Python script to run another Python script as a test application. # # Build + setup instructions: do these once / occasionally by hand, not # done a...
bsd-3-clause
8,262,389,718,545,666,000
33.666667
78
0.688077
false
BBN-Q/Quince
quince/node.py
1
24377
# coding: utf-8 # Raytheon BBN Technologies 2016 # Contributiors: Graham Rowlands # # This file contains the node descriptions from qtpy.QtGui import * from qtpy.QtCore import * from qtpy.QtWidgets import * from .wire import * class Node(QGraphicsRectItem): """docstring for Node""" def __init__(self, name, s...
apache-2.0
7,390,747,057,331,082,000
38.254428
115
0.57345
false
orcasgit/py-wsse
wsse/encryption.py
1
11246
"""Functions for WS-Security (WSSE) encryption and decryption. Heavily based on test examples in https://github.com/mehcode/python-xmlsec as well as the xmlsec documentation at https://www.aleksey.com/xmlsec/. Some functions from https://github.com/mvantellingen/py-soap-wsse. Reading the xmldsig, xmlenc, and ws-secur...
bsd-3-clause
482,553,226,064,850,500
36.738255
79
0.669749
false
alanfbaird/PyTASA
tests/anisotropy_index_tests.py
1
1660
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the IO routines - based on the MSAT test cases """ import unittest import numpy as np import pytasa.anisotropy_index class TestAnisotropyIndex(unittest.TestCase): def setUp(self): """Some useful matricies for testing""" self.olivine = np.ar...
mit
8,203,978,501,412,045,000
35.086957
79
0.487349
false
kingsdigitallab/tvof-kiln
preprocess/prepare/xml_parser.py
1
11492
# -*- coding: utf-8 -*- import sys import os import re import glob import datetime import xml.etree.ElementTree as ET class XMLParser(object): suppressed_output = False default_output = u'parsed.xml' # TODO: implement this, but not possible with ElementTree... is_output_beautified = False def __...
apache-2.0
-6,888,239,231,041,055,000
31.463277
108
0.488688
false
novapost/django-email-change
src/email_change/urls.py
1
1900
# -*- coding: utf-8 -*- # # This file is part of django-email-change. # # django-email-change adds support for email address change and confirmation. # # Development Web Site: # - http://www.codetrax.org/projects/django-email-change # Public Source Code Repository: # - https://source.codetrax.org/hgroot/djang...
apache-2.0
-2,762,859,119,669,229,000
41.222222
115
0.715263
false
b3j0f/schema
b3j0f/schema/test/base.py
1
7880
#!/usr/bin/env python # -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and assoc...
mit
1,619,674,455,909,920,300
25.089404
79
0.582688
false
shacknetisp/vepybot
plugins/protocols/irc/core/users.py
1
8208
# -*- coding: utf-8 -*- import bot import time class Whois: def __init__(self): self.time = time.time() self.channels = {} ident = "" host = "" name = "" auth = "" idle = 0 signon = 0 server = "" class M_Whois(bot.Module): index = "whois" hidden = False ...
mit
-1,344,099,156,478,500,600
35
80
0.500731
false
pascalgutjahr/Praktikum-1
V704_Absorp_Beta_Gamma/gammaPB.py
1
1439
import matplotlib as mpl from scipy.optimize import curve_fit mpl.use('pgf') import matplotlib.pyplot as plt plt.rcParams['lines.linewidth'] = 1 import numpy as np mpl.rcParams.update({ 'font.family': 'serif', 'text.usetex': True, 'pgf.rcfonts': False, 'pgf.texsystem': 'lualatex', 'pgf.preamble': r'\use...
mit
-4,312,687,204,794,683,000
27.62
115
0.638015
false
marcuskelly/recover
app/manage_commands.py
1
1623
# This file defines command line commands for manage.py import datetime from app.init_app import app, db, manager from app.models import User, Role @manager.command def init_db(): """ Initialize the database.""" # Create all tables db.create_all() # Add all Users add_users() def add_users(): ...
bsd-2-clause
-1,381,855,864,617,946,000
27.982143
102
0.612446
false
lifemapper/LmQGIS
scripts/createQgisPackage.py
1
4111
""" @summary: This module creates a zip file for a plugin that can be uploaded to the QGIS repository. @author: CJ Grady @status: alpha @version: 1.0 @license: gpl2 @copyright: Copyright (C) 2014, University of Kansas Center for Research Lifemapper Project, lifemapper [at] ku [dot] edu, ...
gpl-2.0
5,150,867,926,875,265,000
37.064815
97
0.640477
false
klenwell/mushpup-demo
main.py
1
1071
"""`main` is the top level module for your Flask application.""" # Imports from os.path import dirname, join from datetime import date from flask import Flask import jinja2 # Constants JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(join(dirname(__file__), 'templates')), extensions=['ji...
apache-2.0
-4,553,135,595,806,245,000
24.5
76
0.69281
false
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/researcher_url_v30_rc1.py
1
9643
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
-3,776,811,176,968,661,000
28.31003
182
0.583843
false
pudo-attic/docstash
docstash/collection.py
1
2373
from os import path, walk, close, unlink from tempfile import mkstemp import shutil from docstash import util from docstash.document import Document class Collection(object): def __init__(self, stash, name): self.stash = stash self.name = name @property def path(self): return pa...
mit
2,439,511,797,433,378,000
31.067568
71
0.564686
false
dev-alberto/Bachelor2017
Code/PerformanceComparison/TestScripts/addition_tests.py
1
1385
from Code.DataStructures.PrimeCurves import P192, P224, P256, P384 from Code.PerformanceComparison.addition import AdditionPerformanceTest addTest192 = AdditionPerformanceTest(1000, P192) addTest192J = AdditionPerformanceTest(1000, P192, jacobi=True) addTest224 = AdditionPerformanceTest(1000, P224) addTest224J = Add...
apache-2.0
-2,048,588,028,924,258,300
27.854167
71
0.777617
false
Smart-Green/needle
setup.py
1
1056
#!/usr/bin/env python """ Setup file for pyhaystack """ #from pyhaystack.client.HaystackConnection import HaystackConnection #from pyhaystack.client.NiagaraAXConnection import NiagaraAXConnection #from pyhaystack import pyhaystack as ph import pyhaystack.info as info #from setuptools import setup from distutils.core i...
apache-2.0
794,013,742,930,574,100
31.030303
136
0.721591
false
marble/Toolchain_RenderDocumentation
18-Make-and-build/42-Latex/run_45-Copy-latex-typo3-stuff.py
1
5072
#!/usr/bin/env python # coding: utf-8 from __future__ import print_function from __future__ import absolute_import import os import re import shutil import stat import sys import tct from os.path import exists as ospe, join as ospj from tct import deepget params = tct.readjson(sys.argv[1]) binabspath = sys.argv[2] ...
mit
4,781,026,684,952,183,000
29.554217
115
0.51321
false
WarmMe/alpha1
WarmMe/thermostat/Activator.py
1
3097
#!/usr/bin/python # set gpio18 to high when content of file state is 'ON' import RPi.GPIO as GPIO import time import MySQLdb as mdb import sys import time # set GPIO (pin 12) that command the releais GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(12, GPIO.OUT) def run(): # Vary curTime = time.strftime(...
gpl-3.0
-5,307,279,268,875,629,000
29.362745
286
0.659671
false
Couby/rocket-bike-challenge
hardware/rpm.py
1
1834
#!/usr/bin/python3 from gpiozero import Button from http.server import BaseHTTPRequestHandler, HTTPServer import time import threading hostName = "192.168.1.27" hostPort = 9000 turns = 0 # HTTP server class. class MyServer(BaseHTTPRequestHandler): def do_GET(self): global turns s...
mit
-7,046,286,909,193,763,000
30.75
99
0.585605
false
kiahosseini/django-form-validation
setup.py
1
1327
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-form-validation', version='0...
mit
2,919,118,836,394,630,000
35.861111
78
0.636775
false
ufal/neuralmonkey
neuralmonkey/encoders/cnn_encoder.py
1
13814
"""CNN for image processing.""" from typing import cast, Callable, Dict, List, Tuple, Union from typeguard import check_argument_types import numpy as np import tensorflow as tf from neuralmonkey.dataset import Dataset from neuralmonkey.decorators import tensor from neuralmonkey.model.feedable import FeedDict from n...
bsd-3-clause
7,487,356,232,433,098,000
38.022599
79
0.597872
false
NeCTAR-RC/heat
heat/tests/test_fault_middleware.py
1
6446
# 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
1,952,317,835,905,729,500
44.394366
79
0.547626
false
wrapp/txwebtest
tests.py
1
2259
from klein import Klein from twisted.internet import defer from twisted.trial.unittest import TestCase from txwebtest import TestClient from urlparse import parse_qs class Tests(TestCase): def setUp(self): self.app = TestClient(create_app().resource()) @defer.inlineCallbacks def test_status_check...
mit
813,507,418,160,723,800
29.12
68
0.59938
false
brokenseal/local
server/local/local/messages.py
1
1789
from __future__ import unicode_literals import logging import pymongo from django.core import signing from django.conf import settings from . import models, exceptions SECRET_KEY = "test" routing = {} logger = logging.getLogger(__name__) def resolve(name): return routing[name] def event(message_or_func): ...
mit
3,372,694,716,418,899,000
22.539474
81
0.644494
false
tboyce1/home-assistant
homeassistant/components/switch/mqtt.py
4
5255
""" Support for MQTT switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.mqtt/ """ import asyncio import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components.mqtt import ( CONF_STATE_TOP...
apache-2.0
-8,304,095,297,446,679,000
32.050314
79
0.631399
false
ganga-devs/ganga
ganga/GangaCore/Core/GangaRepository/GangaRepositoryXML.py
1
53576
# Note: Following stuff must be considered in a GangaRepository: # # * lazy loading # * locking from GangaCore.Core.GangaRepository import GangaRepository, RepositoryError, InaccessibleObjectError from GangaCore.Utility.Plugin import PluginManagerError import os import os.path import time import errno import copy impo...
gpl-2.0
-6,180,378,785,507,544,000
43.646667
177
0.559075
false
google/starthinker
dags/bigquery_function_dag.py
1
4467
########################################################################### # # 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/l...
apache-2.0
-8,183,038,106,305,137,000
32.088889
145
0.570405
false
eggsandbeer/scheduler
synergy/db/model/daemon_process_entry.py
1
2920
__author__ = 'Bohdan Mushkevych' from odm.document import BaseDocument from odm.fields import StringField, DictField, ListField from synergy.scheduler.scheduler_constants import TYPE_MANAGED, TYPE_FREERUN, TYPE_GARBAGE_COLLECTOR, EXCHANGE_UTILS, \ TYPE_DAEMON PROCESS_NAME = 'process_name' CLASSNAME = 'classname...
bsd-3-clause
1,068,565,629,341,200,000
31.444444
119
0.621575
false
updownlife/multipleK
bin/reads2kmer/reads2kmer.py
1
1433
#!/usr/bin/env python import sys from Bio import SeqIO from optparse import OptionParser parser = OptionParser() parser.add_option('-o','--output', dest = "outputFile", help = "Name of the output file") parser.add_option('-k','--klength', dest = "kmerLength", help = "Length of kmer") parser.add_option('-r','--readsfil...
gpl-2.0
-4,149,227,004,103,901,000
32.325581
111
0.665736
false
f3at/feat
src/feat/agencies/messaging/emu.py
1
6790
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version...
gpl-2.0
-3,548,642,203,115,684,400
29.863636
79
0.614286
false
michaeltchapman/flaskmon
app.py
1
6975
from flask import Flask, render_template, request, jsonify from sqlalchemy import create_engine, Table, MetaData from sqlalchemy.orm import sessionmaker from rrdtool import fetch import time from os import listdir graph_height = 50.0 app = Flask(__name__) ### SqlAlchemy stuff for accessing Openstack State ### db = c...
bsd-3-clause
2,899,113,168,013,195,000
35.139896
435
0.531613
false
easel/gamestats
src/django/gamestats/loot/submission.py
1
1871
from xml.etree import ElementTree from django.contrib.auth.models import User from gamestats.loot.models import Character, Item, Loot, Attendance, Kill, LootType def parse_xml(xml): """ Parse an XML submission """ root = ElementTree.fromstring(xml) submitter = User.objects.get(username__iexact=roo...
mit
-6,596,245,406,597,632,000
35.686275
83
0.590593
false
sharonlev/pyLoggingExtras
test/OutputSetter.py
1
2060
__author__ = 'Sharon Lev' __email__ = 'sharon_lev@yahoo.com' __date__ = '10/25/16' import sys from StringIO import StringIO from unittest import TestCase from logging import root from json import dumps class OutputSetter(TestCase): """ """ temp_stdout = None @classmethod def setUpClass(cls): ...
gpl-3.0
-1,023,077,614,002,122,000
27.625
97
0.562136
false
vaishaksuresh/udacity_data_analyst
P2/ProblemSets_2_to_4/P2_02.py
1
1339
import pandas import pandasql def max_temp_aggregate_by_fog(filename): ''' This function should run a SQL query on a dataframe of weather data. The SQL query should return two columns and two rows - whether it was foggy or not (0 or 1) and the max maxtempi for that fog value (i.e., the maximum ma...
gpl-2.0
-4,712,227,669,270,800,000
38.382353
93
0.704257
false
nharraud/invenio-celery
invenio_celery/version.py
1
1193
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 later...
gpl-2.0
7,263,255,283,209,021,000
35.151515
76
0.743504
false
maas/maas
src/maasserver/api/tests/test_domains.py
1
9830
# Copyright 2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for Domain API.""" import http.client import json import random from django.conf import settings from django.urls import reverse from testtools.matchers import Contains...
agpl-3.0
-6,530,128,466,336,639,000
34.232975
78
0.605595
false
michaupl/braincloud
braincloud/urls.py
1
1388
from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth.views import login, logout from tastypie.api import Api from brainblog.views import * from brainblog.api import UserResource from brainindex.api import TextThoughtAjaxResource admin.autodiscover() # rest ap...
apache-2.0
-6,159,524,557,304,039,000
29.173913
75
0.654179
false
TUBvision/hrl
misc/old/simpledisplay.py
1
1532
import hrl import pygame as pg from pygame.locals import * from OpenGL.GL import * from patterns import * from random import shuffle,randint ntls = 4 wdth = 1024 hght = 766 def circle(y,ptch): y = np.mod(y,2) - 1 x = np.sin(-np.pi * y)/2 + 0.5 y = np.abs(y) return np.round((wdth-ptch.wd...
lgpl-2.1
-4,229,200,050,737,147,000
22.709677
93
0.54765
false
Mellthas/quodlibet
quodlibet/quodlibet/player/xinebe/cdefs.py
1
9844
# Copyright 2006 Lukas Lalinsky # # 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. import ctypes from quodlibet.util im...
gpl-2.0
7,453,561,007,139,033,000
33.907801
78
0.701849
false
dkriegner/xrayutilities
tests/test_amorphous.py
1
1314
# This file is part of xrayutilities. # # xrayutilities 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
-650,083,536,945,599,600
33.578947
71
0.716895
false
ctalbert/mozharness
configs/signing/android_mozilla-esr10.py
1
4482
#!/usr/bin/env python LOCALES = ["en-US", "multi"] # override tag for all repos TAG = None #AUS_SERVER = "dev-stage01.build.mozilla.org" AUS_SERVER = "aus3-staging.mozilla.org" #FTP_SERVER = "dev-stage01.build.mozilla.org" FTP_SERVER = "stage.mozilla.org" AUS_UPLOAD_BASE_DIR = "/opt/aus2/snippets/staging" AUS_DIR_BASE...
mpl-2.0
8,020,089,138,990,125,000
33.21374
136
0.598394
false
deepfield/ibis
ibis/sql/mysql/compiler.py
1
6887
import pandas as pd import sqlalchemy as sa import sqlalchemy.dialects.mysql as mysql from ibis.sql.alchemy import (unary, fixed_arity, infix_op, _variance_reduction) import ibis.common as com import ibis.expr.types as ir import ibis.expr.datatypes as dt import ibis.expr.operations as ops...
apache-2.0
-8,932,553,061,287,775,000
25.590734
79
0.62422
false
Cad/nameko-rethinkdb
test/test_nameko_rethinkdb.py
1
3632
import os import uuid import pytest from weakref import WeakKeyDictionary from nameko.testing.services import entrypoint_hook, dummy from nameko.testing.utils import get_extension from mock import Mock import rethinkdb as r from rethinkdb.errors import RqlRuntimeError from nameko_rethinkdb import RDB, RDB_KEY RDB_...
apache-2.0
-1,585,711,963,583,978,000
24.222222
75
0.609031
false