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
gdsfactory/gdsfactory
pp/components/coupler.py
1
2755
import pp from pp.component import Component from pp.components.coupler_straight import coupler_straight from pp.components.coupler_symmetric import coupler_symmetric from pp.cross_section import get_waveguide_settings from pp.snap import assert_on_1nm_grid from pp.types import ComponentFactory @pp.cell_with_validato...
mit
505,920,847,848,893,060
29.955056
84
0.52559
false
Murali-group/GraphSpace
applications/uniprot/models.py
1
1246
from __future__ import unicode_literals from sqlalchemy import ForeignKeyConstraint, text from applications.users.models import * from django.conf import settings from graphspace.mixins import * Base = settings.BASE # ================== Table Definitions =================== # class UniprotAlias(IDMixin, TimeStamp...
gpl-2.0
1,488,446,659,459,923,500
27.976744
136
0.695024
false
rohithredd94/Computer-Vision-using-OpenCV
Particle-Filter-Tracking/PF_Tracker.py
1
4110
import cv2 import numpy as mp from similarity import * from hist import * class PF_Tracker: def __init__(self, model, search_space, num_particles=100, state_dims=2, control_std=10, sim_std=20, alpha=0.0): self.model = model self.search_space = search_space[::-1] s...
mit
-8,084,760,379,983,337,000
37.92233
132
0.584672
false
weso/CWR-DataApi
tests/grammar/factory/record/test_publisher_territory.py
1
4905
# -*- coding: utf-8 -*- import unittest from pyparsing import ParseException from tests.utils.grammar import get_record_grammar """ CWR Publisher Territory of Control (SPT) grammar tests. The following cases are tested: """ __author__ = 'Bernardo Martínez Garrido' __license__ = 'MIT' __status__ = 'Development' c...
mit
8,518,170,453,060,950,000
36.435115
102
0.681077
false
dc3-plaso/plaso
tests/storage/fake_storage.py
1
6205
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the fake storage.""" import unittest from plaso.containers import errors from plaso.containers import event_sources from plaso.containers import reports from plaso.containers import sessions from plaso.containers import tasks from plaso.lib import definitions fro...
apache-2.0
-6,102,286,598,320,775,000
27.204545
75
0.72361
false
ella/django-ratings
django_ratings/aggregation.py
1
1768
""" This file is for aggregation records from Rating,Agg tables to Agg and TotalRate table """ import logging from datetime import datetime, timedelta from django_ratings.models import Rating, Agg, TotalRate logger = logging.getLogger('django_ratings') # aggregate ratings older than 2 years by year DELTA_TIME_YEAR ...
bsd-3-clause
4,587,567,461,580,501,500
28.966102
90
0.675339
false
natcoin/natcoin
contrib/bitrpc/bitrpc.py
1
7836
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
mit
1,866,030,577,551,255,300
23.185185
79
0.66169
false
javipalanca/ojoalplato
ojoalplato/users/models.py
1
1358
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.contrib.auth.models import AbstractUser from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy...
mit
3,922,233,845,667,998,000
30.581395
78
0.694404
false
dwitvliet/CATMAID
django/applications/catmaid/control/link.py
1
6452
import json from django.http import HttpResponse from django.core.exceptions import ObjectDoesNotExist from catmaid.models import UserRole, Project, Relation, Treenode, Connector, \ TreenodeConnector, ClassInstance from catmaid.control.authentication import requires_user_role, can_edit_or_fail @requires_user...
gpl-3.0
-8,270,022,877,487,769,000
51.032258
257
0.688314
false
manankalra/Twitter-Sentiment-Analysis
main/sentiment/tweepy_demo/tweep.py
1
1099
#!/usr/bin/env python """ tweepy(Twitter API) demo """ __author__ = "Manan Kalra" __email__ = "manankalr29@gmail.com" from tweepy import Stream, OAuthHandler from tweepy.streaming import StreamListener import time # Add your own consumer_key = "" consumer_secret = "" access_token = "" access_token_secret = "" c...
mit
3,081,403,557,936,290,300
23.422222
75
0.605096
false
Bladefidz/wfuzz
plugins/iterations.py
1
2703
from externals.moduleman.plugin import moduleman_plugin import itertools class piterator_void: text="void" def count(self): return self.__count def __init__(self, *i): self._dic = i self.__count = max(map(lambda x:x.count(), i)) self.it = self._dic[0] def next(self):...
gpl-2.0
2,271,427,541,823,712,800
24.261682
181
0.564928
false
berkmancenter/mediacloud
apps/common/src/python/mediawords/db/locks.py
1
3477
"""Constants and routines for handling advisory postgres locks.""" import mediawords.db from mediawords.util.log import create_logger from mediawords.util.perl import decode_object_from_bytes_if_needed log = create_logger(__name__) """ This package just has constants that can be passed to the first value of the post...
agpl-3.0
1,828,699,678,270,009,600
33.425743
117
0.667242
false
QTek/QRadio
tramatego/src/tramatego/transforms/ipv4_to_score.py
1
1161
#!/usr/bin/env python from canari.maltego.utils import debug, progress from canari.framework import configure #, superuser from canari.maltego.entities import IPv4Address, Phrase from common.launchers import get_qradio_data __author__ = 'Zappus' __copyright__ = 'Copyright 2016, TramaTego Project' __credits__ = [] _...
apache-2.0
7,825,119,063,382,835,000
24.822222
115
0.676141
false
coinkite/connectrum
connectrum/findall.py
1
4527
#!/usr/bin/env python3 # # import bottom, random, time, asyncio from .svr_info import ServerInfo import logging logger = logging.getLogger('connectrum') class IrcListener(bottom.Client): def __init__(self, irc_nickname=None, irc_password=None, ssl=True): self.my_nick = irc_nickname or 'XC%d' % random.ran...
mit
8,429,156,360,593,355,000
31.106383
103
0.610559
false
wilima/cryptography
tests/test.py
1
3828
import unittest from cryptography import (eratosthenes, euler, extended_gcd, factorization, gcd, modular_multiplicative_inverse) from cryptography.ciphers import affine, shift, substitution, vigener from .context import cryptography class GcdTestSuite(unittest.TestCase): """Basic test ...
mit
-8,716,949,002,094,197,000
26.148936
124
0.625653
false
zstyblik/infernal-twin
sql_insert.py
1
3025
import MySQLdb import db_connect_creds from datetime import datetime username, password = db_connect_creds.read_creds() cxn = MySQLdb.connect('localhost', user=username, passwd=password) date = datetime.now() cxn.query('CREATE DATABASE IF NOT EXISTS InfernalWireless') cxn.commit() cxn.close() cxn = MySQLdb.connec...
gpl-3.0
-3,604,638,107,569,597,000
25.077586
315
0.676694
false
kevinlee12/oppia
core/domain/draft_upgrade_services_test.py
1
56055
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
3,962,984,640,161,375,000
40.399557
80
0.42758
false
ksteinfe/decodes
src/decodes/core/dc_mesh.py
1
6004
from decodes.core import * from . import dc_base, dc_vec, dc_point, dc_has_pts #here we may only import modules that have been loaded before this one. see core/__init__.py for proper order if VERBOSE_FS: print("mesh.py loaded") import copy, collections class Mesh(HasPts): """ a very simple mesh class "...
gpl-3.0
8,685,016,591,844,526,000
30.276042
164
0.460693
false
hjoliver/cylc
tests/unit/tui/test_data.py
1
1331
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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 Licen...
gpl-3.0
-3,680,273,964,827,430,400
34.026316
72
0.664162
false
JonathonReinhart/scuba
scuba/config.py
1
11648
import os import yaml import re import shlex from .constants import * from .utils import * class ConfigError(Exception): pass class ConfigNotFoundError(ConfigError): pass # http://stackoverflow.com/a/9577670 class Loader(yaml.SafeLoader): def __init__(self, stream): self._root = os.path.split(st...
mit
8,631,149,680,808,919,000
31.088154
117
0.571171
false
kmiller96/Shipping-Containers-Software
lib/core.py
1
8600
# AUTHOR: Kale Miller # DESCRIPTION: The 'main brain' of the program is held in here. # 50726f6772616d6d696e6720697320627265616b696e67206f66206f6e652062696720696d706f737369626c65207461736b20696e746f20736576 # 6572616c207665727920736d616c6c20706f737369626c65207461736b732e # DEVELOPMENT LOG: # 07/12/16: Initi...
mit
3,282,703,609,942,576,000
39.148325
120
0.570698
false
amerlyq/airy
vim/res/ycm_extra_conf.py
1
5213
# SEE: CACHE/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py import os import ycm_core # These are the compilation flags that will be used in case there's no # compilation database set (by default, one is not set). # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ '-Wall', '-Wex...
mit
1,835,712,547,090,115,600
36.235714
115
0.689047
false
sangwonl/stage34
webapp/api/handlers/stage.py
1
6612
from django.views import View from django.conf import settings from datetime import datetime from api.helpers.mixins import AuthRequiredMixin from api.helpers.http.jsend import JSENDSuccess, JSENDError from api.models.resources import Membership, Stage from libs.utils.model_ext import model_to_dict from worker.tasks...
mit
3,603,858,691,656,666,600
33.082474
105
0.628403
false
globaltoken/globaltoken
test/functional/test_framework/authproxy.py
1
7759
# Copyright (c) 2011 Jeff Garzik # # Previous copyright, from python-jsonrpc/jsonrpc/proxy.py: # # Copyright (c) 2007 Jan-Klaas Kollhof # # This file is part of jsonrpc. # # jsonrpc is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # th...
mit
-3,351,838,090,374,952,400
42.105556
155
0.621601
false
jtomasek/tuskar-ui-1
tuskar_ui/infrastructure/resource_management/resource_classes/workflows.py
1
12384
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 applicabl...
apache-2.0
-6,819,238,934,805,473,000
37.222222
79
0.566053
false
forman/dectree
examples/intertidal_flat_classif/intertidal_flat_classif.py
1
12362
from numba import jit, jitclass, float64 import numpy as np @jit(nopython=True) def _B1_LT_085(x): # B1.LT_085: lt(0.85) if 0.0 == 0.0: return 1.0 if x < 0.85 else 0.0 x1 = 0.85 - 0.0 x2 = 0.85 + 0.0 if x <= x1: return 1.0 if x <= x2: return 1.0 - (x - x1) / (x2 - x1) ...
mit
-7,789,529,066,740,844,000
24.647303
270
0.44928
false
pfouque/deezer-python
deezer/tests/test_resources.py
1
9053
# -*- coding: utf-8 -*- import json import unittest from types import GeneratorType import deezer from mock import patch from .mocked_methods import fake_urlopen class TestResources(unittest.TestCase): def setUp(self): self.patcher = patch('deezer.client.urlopen', fake_urlopen) self.patcher.start...
mit
5,145,083,881,017,740,000
34.498039
100
0.610252
false
isabellemao/Hello-World
python/Junior2015CCCJ4.py
1
1278
#Problem J4: Arrival Time departure_time = input() split_departure = list(departure_time) #The time of departure, split into a list. #Split the list departure_hour = split_departure[0:2] departure_minute = split_departure[3:5] #Change the split list to integers. departure_hour = int("".join(departure_hour)) departur...
apache-2.0
-2,193,184,907,640,587,300
22.666667
88
0.640063
false
googleapis/python-pubsublite
google/cloud/pubsublite_v1/types/__init__.py
1
4702
# -*- 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
5,778,659,300,799,625,000
26.658824
74
0.746278
false
robosafe/testbench_vRAL_hydro
bert2_simulator/sim_step_monitors/assertion_monitor_manager.py
1
2830
#!/usr/bin/env python """ Assertion Monitor Manager Created by David Western, June 2015. """ from coverage import coverage import imp import rospkg import rospy from std_msgs.msg import UInt64 from std_srvs.srv import Empty import sys class AMM: def __init__(self,AM_list_file,trace_label): # Read list...
gpl-3.0
1,416,007,924,697,365,000
31.906977
109
0.602473
false
eayunstack/eayunstack-upgrade
ansible/library/keystone_v2_endpoint.py
1
9178
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kevin Carter <kevin.carter@rackspace.com> # # Copyright 2014, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
apache-2.0
-101,433,040,338,243,950
28.322684
78
0.552953
false
shakamunyi/nova
nova/tests/unit/db/test_migrations.py
1
32632
# Copyright 2010-2011 OpenStack Foundation # Copyright 2012-2013 IBM Corp. # 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/li...
apache-2.0
-8,949,497,123,520,721,000
44.009655
79
0.610199
false
Kivvix/stage-LPC
compareSrc/searchSDSSdata.py
1
4221
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import os import glob from config import * import data.calexp import data.src ## @def attributs # @brief attributs which we select in SDSS DB and src fits file attributs = 'objid,run,camcol,field,ra,dec,u,g,r,i,z' ## Calexp treatment ## def coordCalexp( fit...
mit
-5,985,041,647,614,164,000
33.040323
875
0.644871
false
xaled/wunderous-analytics
wunderous/drive.py
1
5688
import os import sys import httplib2 from oauth2client.file import Storage from apiclient import discovery from oauth2client.client import OAuth2WebServerFlow from wunderous.config import config OAUTH_SCOPE = 'https://www.googleapis.com/auth/drive' SHEETS_OAUTH_SCOPE = 'https://www.googleapis.com/auth/drive https://ww...
mit
7,538,950,005,650,568,000
37.174497
249
0.651371
false
Goamaral/SCC
inputWindow.py
1
31922
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'inputWindow.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s...
mit
-5,630,341,833,755,718,000
55.576241
105
0.701934
false
toinbis/369old
src/web369/conf/base.py
1
2325
from pkg_resources import resource_filename DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'web369', 'USER': 'root', 'PASSWORD': '', } }...
bsd-3-clause
-2,580,828,059,716,364,300
23.734043
73
0.667097
false
smallyear/linuxLearn
salt/salt/client/ssh/state.py
1
6047
# -*- coding: utf-8 -*- ''' Create ssh executor system ''' from __future__ import absolute_import # Import python libs import os import tarfile import tempfile import json import shutil from contextlib import closing # Import salt libs import salt.client.ssh.shell import salt.client.ssh import salt.utils import salt.u...
apache-2.0
7,802,137,446,918,748,000
30.331606
79
0.539937
false
rapidpro/chatpro
chatpro/rooms/models.py
1
2494
from __future__ import absolute_import, unicode_literals from chatpro.profiles.tasks import sync_org_contacts from dash.orgs.models import Org from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ class Room(models.Model): """ Corresp...
bsd-3-clause
-7,098,435,995,584,484,000
34.628571
100
0.631917
false
JoKnopp/wp-import
test/test_postgresql.py
1
4427
# -*- coding: UTF-8 -*- # © Copyright 2009 Wolodja Wentland. All Rights Reserved. # This file is part of wp-import. # # wp-import 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 Licen...
gpl-3.0
-6,150,922,383,525,190,000
33.578125
76
0.615906
false
hkemmel/tal
affichage.py
1
2209
# -*- coding: utf-8 -*- """ Created on Tue Apr 25 14:34:25 2017 @author: manfred.madelaine """ import time def affStart(): msg1 = "*** Binvenue dans i-Opinion ou Opinion Way ***" msg2 = "Le logiciel d'analyse et de classification des revues cinématographiques !" listMsg = [] listMsg.append("") ...
gpl-3.0
181,424,775,493,336,640
19.342593
87
0.474954
false
LuizGsa21/p4-conference-central
models.py
1
7226
#!/usr/bin/env python """models.py Udacity conference server-side Python App Engine data & ProtoRPC models $Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $ created/forked from conferences.py by wesc on 2014 may 24 """ __author__ = 'wesc+api@google.com (Wesley Chun)' import httplib import endpoints from protor...
apache-2.0
4,306,855,950,322,396,700
31.696833
98
0.687517
false
PyBossa/pybossa
pybossa/default_settings.py
1
4813
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 Scifabric LTD. # # PYBOSSA 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 op...
agpl-3.0
167,789,960,090,039,200
28.429448
116
0.689806
false
Naoto-Imamachi/MIRAGE
scripts/module/preparation/phastcons_score_list.py
1
3683
#!usr/bin/env python import sys import re import shelve from parameter.common_parameters import common_parameters import utils.setting_utils as utils utils.now_time("phastcons_score_list script starting...") p = utils.Bunch(common_parameters) def main(): utils.now_time("Input_file: " + p.phastcons_sc...
mit
-2,538,876,580,107,515,400
41.329412
203
0.524572
false
DerekK88/PICwriter
picwriter/components/stripslotconverter.py
1
9317
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np import gdspy import picwriter.toolkit as tk class StripSlotConverter(tk.Component): """Strip-to-Slot Side Converter Cell class. Adiabatically transforms a strip to a slot waveguide mode,...
mit
7,310,835,208,231,276,000
36.268
396
0.545347
false
dzamie/weasyl
weasyl/blocktag.py
1
4024
# blocktag.py from error import PostgresError import define as d import profile import searchtag from libweasyl import ratings from weasyl.cache import region # For blocked tags, `rating` refers to the lowest rating for which that tag is # blocked; for example, (X, Y, 10) would block tag Y for all ratings, whereas...
apache-2.0
-8,802,983,478,453,803,000
30.193798
120
0.587227
false
EndyKaufman/django-postgres-angularjs-blog
app/manager/migrations/0006_properties.py
1
1170
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-04-24 14:05 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency...
mit
-7,519,078,480,483,792,000
39.344828
150
0.62906
false
bert9bert/statsmodels
statsmodels/tsa/statespace/kalman_filter.py
2
86079
""" State Space Representation and Kalman Filter Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function from warnings import warn import numpy as np from .representation import OptionWrapper, Representation, FrozenRepresentation from .tools import (validate_v...
bsd-3-clause
3,883,965,358,522,059,000
41.340876
79
0.594628
false
rjw57/cubbie
migrations/versions/316bb58e84f_add_user_identities.py
1
1110
"""add user_identities Revision ID: 316bb58e84f Revises: 38c8ec357e0 Create Date: 2015-03-11 01:40:12.157458 """ # revision identifiers, used by Alembic. revision = '316bb58e84f' down_revision = '38c8ec357e0' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic ...
mit
7,870,348,524,913,182,000
30.714286
130
0.684685
false
cwgreene/Nanostructure-Simulator
utils/plot_trajectories.py
1
1140
import os import sys import re import pylab def parse_trajectory_line(line): trajectory = [] for x,y in re.findall("\(([0-9.]+), ([0-9.]+)\)",line): trajectory.append((float(x),float(y))) return trajectory def generate_trajectories(file): #get rid fo two first lines file.readline() file.readline() #parse eac...
mit
-5,705,216,141,029,246,000
20.923077
56
0.669298
false
jonathansick/androcmd
scripts/phat_baseline_test.py
1
3612
#!/usr/bin/env python # encoding: utf-8 """ Grid computation of dust attenuation for old vs. young stellar populations. 2015-05-12 - Created by Jonathan Sick """ import argparse from androcmd.phatpipeline import PhatCatalog from androcmd.baselineexp import SolarZPipeline, ThreeZPipeline def main(): args = pars...
mit
-6,061,255,170,724,512,000
35.484848
78
0.623477
false
lhellebr/spacewalk
backend/server/rhnLib.py
1
8211
# # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
8,887,653,560,759,876,000
30.580769
98
0.629765
false
m-r-hunt/invaders
enemies.py
1
6646
# Invaders # Copyright (C) 2013 Maximilian Hunt # # 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 ...
gpl-2.0
-4,189,515,760,736,269,300
41.06962
124
0.614354
false
thaihungle/deepexp
rare-mann/mimic_gen.py
1
5981
import numpy as np import os import random import pickle class MimicDataLoader(object): def __init__(self, data_folder, batch_size=1, max_sequence=10, max_iter=None, split = 0.75, train_keep=1): super(MimicDataLoader, self).__init__() self.data_folder = data_folder self.batch_size = batch...
mit
2,495,038,114,839,712,000
38.609272
110
0.585521
false
boppreh/keyboard
setup.py
1
1333
""" Usage instructions: - If you are installing: `python setup.py install` - If you are developing: `python setup.py sdist --format=zip bdist_wheel --universal bdist_wininst && twine check dist/*` """ import keyboard from setuptools import setup setup( name='keyboard', version=keyboard.version, author='Bo...
mit
5,545,354,428,995,627,000
34.078947
121
0.651913
false
2Minutes/davos-dev
davos/core/utils.py
1
7692
import re import sys import os import os.path as osp from fnmatch import fnmatch from pytd.gui.dialogs import promptDialog from pytd.util.logutils import logMsg from pytd.util.sysutils import importModule, toStr, inDevMode, getCaller from pytd.util.fsutils import pathSplitDirs, pathResolve, pathNorm, pathJoin from py...
gpl-3.0
-7,329,362,235,480,504,000
23.341772
94
0.597634
false
solarsail/aerosol-tools
clustatlib/clucsv.py
1
3752
import numpy as np import os import os.path class csvbuilder: def __init__(self, cs): self.cs = cs if not os.path.isdir('csv'): os.mkdir('csv') def month_type_csv(self, site = None): label = 'all' if site == None else site values, percentages = self.cs.month...
gpl-3.0
-5,397,643,248,379,671,000
41.647727
203
0.539179
false
HazyResearch/metal
metal/logging/writer.py
1
4223
import copy import json import os from collections import defaultdict from subprocess import check_output from time import strftime from metal.utils import recursive_transform class LogWriter(object): """Class for writing simple JSON logs at end of runs, with interface for storing per-iter data as well. ...
apache-2.0
-3,689,918,546,375,237,000
34.191667
83
0.582998
false
hawkeyexp/plugin.video.netflix
resources/lib/services/nfsession/session/base.py
1
2055
# -*- coding: utf-8 -*- """ Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix) Copyright (C) 2018 Caphm (original implementation module) Copyright (C) 2019 Stefano Gottardo - @CastagnaIT Initialize the netflix session SPDX-License-Identifier: MIT See LICENSES/MIT.md for more informatio...
mit
8,894,260,233,918,521,000
33.830508
93
0.66618
false
playerNaN/NaNPyGameEngine
engine.py
1
5921
import pygame import sys import os from collections import namedtuple import time import resourcemanager ColorList = namedtuple("ColorList", "black white red green blue") colors = ColorList((0,0,0),(0xFF,0xFF,0xFF),(0xFF,0,0),(0,0xFF,0),(0,0,0xFF)) PyListener = namedtuple("PyListener", "condition effect") PyEventList...
unlicense
-5,850,025,484,649,098,000
32.647727
103
0.575578
false
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py
1
21363
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
8,239,307,016,554,352,000
49.503546
234
0.654356
false
muminoff/savollar
savollar/pipelines.py
1
2093
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don"t forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html from scrapy.exceptions import DropItem from scrapy.conf import settings from scrapy import log from elasticsearch import Elastic...
apache-2.0
5,381,455,535,540,653,000
33.883333
85
0.565695
false
shanot/imp
modules/rmf/examples/link.py
2
1236
## \example rmf/link.py # This example is like module/rmf/pdb.py except that instead of creating a # new hierarchy from the rmf file, it simply links the existing hierarchy # to the file. This mechanism can be used for loading multiple # conformations for scoring or other analysis without having to set up # restraints ...
gpl-3.0
2,193,594,142,939,475,700
25.869565
74
0.7411
false
karesansui/karesansui
bin/restart_network.py
1
4392
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Karesansui. # # Copyright (C) 2012 HDE, 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, incl...
mit
2,224,646,137,374,195,000
36.538462
116
0.645492
false
qnzhou/ThingiverseCrawler
thingiverse_crawler.py
1
9320
#!//usr/bin/env python import argparse import datetime import os import os.path import requests import re import time import urllib import urlparse from subprocess import check_call def utc_mktime(utc_tuple): """Returns number of seconds elapsed since epoch Note that no timezone are taken into consideration. ...
mit
-6,989,201,447,378,768,000
33.64684
158
0.593777
false
PyBossa/pybossa
pybossa/model/counter.py
2
1787
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2017 Scifabric LTD. # # PYBOSSA 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 op...
agpl-3.0
-4,575,830,606,666,470,400
39.613636
77
0.684947
false
marbu/pylatest
tests/xdocutils/test_utils.py
1
6663
# -*- coding: utf8 -*- """ Tests of helper functions from pylatest.xdocutils.utils module. """ # Copyright (C) 2018 Martin Bukatovič <martin.bukatovic@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 S...
gpl-3.0
7,024,286,174,276,592,000
25.12549
72
0.655509
false
gogogo/gogogo-hk
gogogo/models/property.py
1
3233
from google.appengine.ext import db from django import forms from django.utils.translation import ugettext_lazy as _ class TransitTypeProperty(db.IntegerProperty): """ Transit Type Property - Storage of transit type """ def __init__ (self,*args,**kwargs): kwargs["choices"] = range(0,8) ...
agpl-3.0
2,126,706,793,343,167,200
30.086538
93
0.554903
false
bmazin/ARCONS-pipeline
examples/Pal2014-J0337/hTestLimit.py
1
8356
#Filename: hTestLimit.py #Author: Matt Strader # #This script opens a list of observed photon phases, import numpy as np import tables import numexpr import matplotlib.pyplot as plt import multiprocessing import functools import time from kuiper.kuiper import kuiper,kuiper_FPP from kuiper.htest import h_test,h_fp...
gpl-2.0
-5,455,971,314,414,658,000
44.413043
272
0.728698
false
Saevon/webdnd
shared/utils/debug_toolbars.py
1
1502
import django from django.conf import settings from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from debug_toolbar.panels import DebugPanel import sys class VersionDebugPanel(DebugPanel): ''' Panel that displays the Django version. ''' name =...
mit
-4,841,625,695,873,232,000
18.25641
78
0.608522
false
stefco/geco_data
geco_irig_plot.py
1
5662
#!/usr/bin/env python # (c) Stefan Countryman, 2016-2017 DESC="""Plot an IRIG-B signal read from stdin. Assumes that the timeseries is a sequence of newline-delimited float literals.""" FAST_CHANNEL_BITRATE = 16384 # for IRIG-B, DuoTone, etc. # THE REST OF THE IMPORTS ARE AFTER THIS IF STATEMENT. # Quits immediately...
mit
2,641,587,764,302,819,300
40.028986
80
0.628753
false
TNick/pyl2extra
pyl2extra/datasets/images.py
1
13590
""" Dataset for images and related functionality. This module does not have dependencies inside pyl2extra package, so you can just copy-paste it inside your source tree. To use this dataset prepare a .csv file with targets (integers or real numbers) on first column and file paths on the second column: .. code:: ...
bsd-3-clause
5,339,343,264,149,101,000
36.960894
79
0.576306
false
mahak/cloudify-cli
cloudify_cli/commands/users.py
1
9023
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
apache-2.0
-221,964,532,561,751,600
30.883392
78
0.654217
false
openstack/heat
heat/engine/update.py
1
12695
# # 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
3,472,610,170,852,946,400
41.316667
79
0.579992
false
diefenbach/django-lfs
lfs/marketing/models.py
1
1821
# django imports from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext # lfs imports from lfs.catalog.models import Product from lfs.order.models import Order class Topseller(models.Model): """Selected products are in any case among topsellers. """ product = model...
bsd-3-clause
-2,391,349,366,419,636,700
29.864407
93
0.667216
false
rain2o/collective.pfg.skiplogic
setup.py
1
1050
from setuptools import setup, find_packages import os version = '0.1' setup(name='collective.pfg.skiplogic', version=version, description="Adds skip logic capabilities to ploneformgen forms", long_description=open("README.txt").read() + "\n" + open(os.path.join("docs", "HISTOR...
gpl-2.0
-539,731,365,731,175,900
28.166667
72
0.569524
false
benregn/itu-courses
itu/pipelines.py
1
1027
import pymongo from scrapy.exceptions import DropItem from scrapy.conf import settings from scrapy import log class MongoDBPipeline(object): def __init__(self): connection = pymongo.Connection( settings['MONGODB_SERVER'], settings['MONGODB_PORT']) db = connection[settings['MONGODB_DB...
mit
7,761,366,228,736,481,000
33.233333
77
0.581305
false
robertnishihara/ray
streaming/python/tests/test_word_count.py
1
1689
import os import ray from ray.streaming import StreamingContext def test_word_count(): ray.init(_load_code_from_local=True) ctx = StreamingContext.Builder() \ .build() ctx.read_text_file(__file__) \ .set_parallelism(1) \ .flat_map(lambda x: x.split()) \ .map(lambda x: (x, 1...
apache-2.0
-5,655,306,037,818,127,000
27.15
63
0.536412
false
letolab/airy
airy/utils/cache.py
1
9676
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
bsd-2-clause
-6,054,072,846,640,393,000
39.655462
88
0.671042
false
znick/anytask
anytask/users/models.py
1
9320
# -*- coding: utf-8 -*- import logging import os from courses.models import Course from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save from groups.models import Group from mail.models import Message from users.model_user_status import UserStatus from...
mit
-698,361,928,609,399,700
49.378378
114
0.720172
false
QQuick/Transcrypt
transcrypt/modules/org/transcrypt/autotester/__init__.py
1
12645
# First run a test from the command prompt, generating an HTML file. # The output of the test is stored in a DIV. # Also the script is automatically included in the HTML file. # Loading the HTML file will run the script. # This will compare the output of the script running in the browswer to the output in the DIV. ...
apache-2.0
-3,752,604,880,992,353,000
37.515625
129
0.535152
false
walterbender/Pippy
pippy_app.py
2
59457
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2007,2008,2009 Chris Ball, based on Collabora's # "hellomesh" demo. # # Copyright (C) 2013,14 Walter Bender # Copyright (C) 2013,14 Ignacio Rodriguez # Copyright (C) 2013 Jorge Gomez # Copyright (C) 2013,14 Sai Vineet # # This program is free software; you ca...
gpl-3.0
-1,851,500,253,610,730,000
37.860784
79
0.564677
false
infrascloudy/flask-base
app/models/user.py
1
6385
from flask import current_app from flask_login import AnonymousUserMixin, UserMixin from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from itsdangerous import BadSignature, SignatureExpired from werkzeug.security import check_password_hash, generate_password_hash from app import db, login_manager ...
mit
1,365,562,869,490,029,800
31.576531
76
0.592482
false
ME-ICA/me-ica
meica.libs/mdp/graph/graph.py
1
13012
# inspired by some code by Nathan Denny (1999) # see http://www.ece.arizona.edu/~denny/python_nest/graph_lib_1.0.1.html try: # use reduce against BDFL's will even on python > 2.6 from functools import reduce except ImportError: pass class GraphException(Exception): """Base class for exception in the g...
lgpl-2.1
-8,937,105,326,309,814,000
31.448878
80
0.587919
false
caffeinehit/yell
yell/backends/celery.py
1
2316
from __future__ import absolute_import from celery.task import Task from yell import Notification, notify, registry class CeleryNotificationTask(Task): """ Dispatch and run the notification. """ def run(self, name=None, backend=None, *args, **kwargs): """ The Celery task. Deli...
mit
-3,298,192,501,619,146,000
32.565217
105
0.603195
false
CiNC0/Cartier
cartier-python-resign-linux/tests/test_versioning.py
1
1194
#!/usr/bin/env python import os.path import importlib import unittest tests_dir = os.path.abspath(os.path.dirname(__file__)) package_name = tests_dir.split(os.path.sep)[-2].replace('-', '_') package = importlib.import_module(package_name) class VersioningTestCase(unittest.TestCase): def assert_proper_attribute(...
apache-2.0
-6,473,486,557,290,887,000
28.85
65
0.60804
false
rgerkin/pyNeuroML
pyneuroml/tune/NeuroMLSimulation.py
1
5357
''' A class for running a single instance of a NeuroML model by generating a LEMS file and using pyNeuroML to run in a chosen simulator ''' import sys import time from pyneuroml import pynml from pyneuroml.lems import generate_lems_file_for_neuroml try: import pyelectro # Not used here, just f...
lgpl-3.0
-7,017,770,894,526,758,000
31.271084
127
0.417958
false
Azure/azure-sdk-for-python
sdk/powerbiembedded/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_py3.py
1
1163
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
5,197,764,973,507,058,000
33.205882
78
0.574377
false
Anderson0026/mapproxy
mapproxy/script/conf/app.py
1
6606
# -:- encoding: utf-8 -:- # This file is part of the MapProxy project. # Copyright (C) 2013 Omniscale <http://omniscale.de> # # 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.a...
apache-2.0
-2,084,402,879,449,501,700
34.713514
110
0.65607
false
stefan-jonasson/home-assistant
homeassistant/components/telegram_bot/__init__.py
2
26538
""" Component to send and receive Telegram messages. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/telegram_bot/ """ import asyncio import io from functools import partial import logging import os import requests from requests.auth import HTTPBasicAuth...
mit
-1,572,939,203,941,558,300
40.272162
79
0.579094
false
SonarOpenCommunity/sonar-cxx
cxx-sensors/src/tools/clangsa_createrules.py
1
6838
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # SonarQube C++ Community Plugin (cxx plugin) # Copyright (C) 2010-2021 SonarOpenCommunity # http://github.com/SonarOpenCommunity/sonar-cxx # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # Lic...
lgpl-3.0
6,750,779,244,084,423,000
33.0199
81
0.580579
false
pyfidelity/rest-seed
backend/backrest/tests/test_change_password.py
1
1714
from pytest import fixture, mark from transaction import commit @fixture(scope='module') def url(testing): return testing.route_url('password-change') @mark.user('alice') def test_change_password(browser, url, alice): data = dict(password='foo!', current='alice') browser.put_json(url, data) assert a...
bsd-2-clause
-1,270,315,287,765,068,800
31.961538
74
0.673279
false
mikedh/trimesh
trimesh/proximity.py
1
19400
""" proximity.py --------------- Query mesh- point proximity. """ import numpy as np from . import util from .grouping import group_min from .constants import tol, log_time from .triangles import closest_point as closest_point_corresponding from .triangles import points_to_barycentric try: from scipy.spatial im...
mit
8,312,762,869,782,250,000
32.448276
88
0.609227
false
hcseob/py_spectre
py_spectre/psf.py
1
50756
# -*- coding: latin-1 -*- """ Copyright (c) 2008 Pycircuit Development Team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: a. Redistributions of source code must retain the above copyright notice, ...
mit
7,594,775,208,493,014,000
31.022713
190
0.569805
false
TresysTechnology/setools
tests/nodeconquery.py
1
10617
# Copyright 2014, Tresys Technology, LLC # Copyright 2017, Chris PeBenito <pebenito@ieee.org> # # This file is part of SETools. # # SETools 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...
lgpl-2.1
-6,016,288,394,831,459,000
42.512295
100
0.655081
false
unix-beard/matasano
set1/detect_single_character_xor/detect_single_character_xor.py
1
1514
#!/usr/bin/env python3 ################################################################################ # The matasano crypto challenges # http://cryptopals.com/sets/1/challenges/4/ # Set 1 Challenge 4 # Detect single-character XOR ################################################################################ # On...
mit
4,528,978,805,032,337,400
30.541667
94
0.509247
false
RaphaelKimmig/django_helpful
django_helpful/__init__.py
1
1416
# Copyright (c) 2013, Raphael Kimmig # 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 # list of conditions and the fo...
bsd-2-clause
-2,272,355,786,306,520,300
49.571429
79
0.786723
false
looker/sdk-examples
python/soft_delete_dashboard.py
1
1367
import sys from typing import Sequence import exceptions from looker_sdk import client, error, models sdk = client.setup("../looker.ini") def main(): """Given a dashboard title, get the ids of all dashboards with matching titles and move them to trash. $ python soft_delete_dashboard.py "An Unused Dash...
mit
-5,936,345,032,288,775,000
26.897959
86
0.675933
false
robmcmullen/peppy
peppy/major_modes/fortran_95.py
1
1742
# peppy Copyright (c) 2006-2009 Rob McMullen # Licenced under the GPLv2; see http://peppy.flipturn.org for more info """Fortran 95 programming language editing support. Major mode for editing Fortran 95 files. Supporting actions and minor modes should go here only if they are uniquely applicable to this major mode an...
gpl-2.0
-6,352,703,335,974,964,000
32.5
85
0.723307
false
awacha/cct
cct/qtgui/devices/motor/movemotor/movemotor.py
1
4527
import logging from PyQt5 import QtWidgets, QtGui from .movemotor_ui import Ui_Form from ....core.mixins import ToolWindow from .....core.devices import Motor from .....core.instrument.privileges import PRIV_MOVEMOTORS logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class MoveMotor(QtWidgets.QWi...
bsd-3-clause
2,612,978,641,138,935,300
38.365217
95
0.664237
false
venkatant/msproject
flow_statistics.py
1
7329
__author__ = 'venkat' from header import * from json_http_handler import * class FlowWindow: bottom_frame = 0 bottom_row = 0 class FlowTable: def __init__(self): self.dest_ip = None self.dest_mask = None self.dest_mac = None self.dest_port = None self.dest_...
gpl-2.0
-5,882,701,297,109,460,000
32.167421
118
0.583163
false