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
walchko/pygecko
retired/find_geckocore.py
1
1087
# #!/usr/bin/env python3 # # -*- coding: utf-8 -*- # ############################################## # # The MIT License (MIT) # # Copyright (c) 2018 Kevin Walchko # # see LICENSE for full details # ############################################## # # import time # import argparse # import os # from pygecko.transport.beac...
mit
-3,143,877,320,339,952,600
31.939394
107
0.516099
false
yoshrote/valid_model
valid_model/descriptors.py
1
7772
from datetime import datetime, timedelta import six from .base import Generic, Object from .exc import ValidationError from .utils import is_descriptor class SimpleType(Generic): """This descriptor will not attempt to coerce the value on __set__.""" _type_klass = None _type_label = None def __set_...
mit
7,817,542,412,266,166,000
28.439394
89
0.573726
false
paulmartel/voltdb
src/catgen/catalog_utils/strings.py
1
1677
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2016 VoltDB Inc. # # 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 the # License, or (at you...
agpl-3.0
2,273,630,477,120,155,100
38.928571
75
0.731067
false
jazzabeanie/python_koans
python2/koans/about_none.py
1
2911
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutNil in the Ruby Koans # from runner.koan import * class AboutNone(Koan): def test_none_is_an_object(self): "Unlike NULL in a lot of languages" self.assertEqual(True, isinstance(None, object)) # so isinstance(1, 2) checks whether 1 ...
mit
-8,089,154,453,468,490,000
49.189655
287
0.651323
false
ZeitgeberH/nengo
nengo/networks/tests/test_oscillator.py
1
1526
import logging import pytest import nengo from nengo.utils.functions import piecewise from nengo.utils.numpy import rmse from nengo.utils.testing import Plotter logger = logging.getLogger(__name__) def test_oscillator(Simulator, nl): model = nengo.Network(label='Oscillator', seed=789) with model: ...
gpl-3.0
-4,465,944,502,416,498,000
28.346154
73
0.598296
false
walterbender/story
collabwrapper.py
1
33058
# Copyright (C) 2015 Walter Bender # Copyright (C) 2015 Sam Parkinson # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
3,951,370,830,328,633,000
36.438279
79
0.616038
false
Teifion/concision
views/old_forms.py
1
9057
# import transaction # import datetime from pyramid.httpexceptions import HTTPFound # from pyramid.renderers import get_renderer from ..models import ( StoredQuery, ) # import json from ..lib import joins from .. import config def alter_query_type(request): request.do_not_log = True query_id = in...
bsd-2-clause
3,480,844,766,862,487,000
33.701149
107
0.643259
false
amsimoes/bat-country
batcountry/batcountry.py
1
6348
# import the necessary packages from __future__ import print_function from google.protobuf import text_format from cStringIO import StringIO from PIL import Image import scipy.ndimage as nd import numpy as np import caffe import os class BatCountry: def __init__(self, base_path, deploy_path, model_path, patch_model...
mit
-3,119,327,493,951,980,500
28.525581
78
0.675961
false
KonradBreitsprecher/espresso
doc/tutorials/09-swimmer_reactions/EXERCISES/reaction.py
1
9461
################################################################################ # # # Copyright (C) 2010,2011,2012,2013,2014,2015,2016 The ESPResSo project # # ...
gpl-3.0
-1,595,223,305,182,569,700
31.071186
115
0.530599
false
heilaaks/snippy
tests/test_api_search_snippet.py
1
58285
# -*- coding: utf-8 -*- # # SPDX-License-Identifier: AGPL-3.0-or-later # # snippy - software development and maintenance notes manager. # Copyright 2017-2020 Heikki J. Laaksonen <laaksonen.heikki.j@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
agpl-3.0
-5,150,466,451,538,383,000
38.30209
135
0.556455
false
DawidvanGraan/HomeAutomation
Raspberry/api.py
1
3437
#!/bin/sh from flask import Flask, jsonify import smbus import time import RPi.GPIO as io import requests # Plex Call plexUrl = 'http://192.168.1.100/jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "duration", "showtitle"], "playerid": 1 }, "id": "VideoGetIt...
mit
-7,297,475,318,174,467,000
22.380952
206
0.603142
false
hirofumi0810/asr_preprocessing
swbd/main.py
1
15071
#! /usr/bin/env python # -*- coding: utf-8 -*- """Make dataset for the End-to-End model (Switchboard corpus). Note that feature extraction depends on transcripts. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from os.path import join, isfile impor...
mit
-8,193,133,252,302,720,000
43.196481
96
0.544224
false
ar0551/Wasp
devFiles/data/waspCatalogFix.py
1
54170
# Wasp: Discrete Design with Grasshopper plug-in (GPL) initiated by Andrea Rossi # # This file is part of Wasp. # # Copyright (c) 2017, Andrea Rossi <a.rossi.andrea@gmail.com> # Wasp is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published # by the ...
gpl-3.0
6,861,793,551,399,903,000
33.263757
210
0.642644
false
NCPlayz/CassBotPy
cassandra/bot.py
1
4014
import datetime import json import discord import os from discord.ext import commands from discord.ext.commands.converter import * class CassandraContext(commands.Context): def is_float(self, argument): """Checks if the argument is a float.""" try: return float(string) # T...
mit
-1,071,383,508,198,149,500
32.016949
115
0.550573
false
GNOME/gnome-lirc-properties
test/test-policykit-is-authorized.py
1
1051
#!/usr/bin/python import dbus import os bus = dbus.SystemBus() policy_kit = bus.get_object('org.freedesktop.PolicyKit', '/') #print policy_kit_mechanism.Introspect() if(policy_kit == None): print("Error: Could not get the PolicyKit interface.\n") action_id = "org.gnome.clockapplet.mechanism.settimezone" result...
gpl-2.0
-5,090,127,664,131,929,000
28.194444
101
0.720266
false
Franky333/crazyflie-clients-python
src/cfclient/ui/tabs/LogTab.py
1
3242
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
gpl-2.0
3,133,045,078,609,853,000
33.860215
79
0.614436
false
m4tx/egielda
utils/test_utils.py
1
3014
# This file is part of e-Giełda. # Copyright (C) 2014-2015 Mateusz Maćkowski and Tomasz Zieliński # # e-Giełda 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 ...
agpl-3.0
-6,714,624,736,140,098,000
36.148148
118
0.698239
false
spinningbytes/deep-mlsa
code/architectures/default_cnn.py
1
2153
import logging from keras.layers import Dense, ZeroPadding1D, Embedding, Convolution1D, MaxPooling1D, Flatten, Input from keras.models import Model from utils.data_utils import load_embedding_matrix def create_default_model(config_data): nb_filter = 200 filter_length = 6 hidden_dims = nb_filter embe...
apache-2.0
6,691,548,136,573,418,000
33.190476
116
0.668834
false
openstack/networking-plumgrid
networking_plumgrid/neutron/tests/unit/extensions/test_providernet.py
1
2158
# Copyright 2015 PLUMgrid, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
-443,667,551,993,928,500
36.859649
78
0.659407
false
rndusr/stig
stig/client/filters/base.py
1
22315
# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful # but...
gpl-3.0
6,356,354,278,953,972,000
37.407917
106
0.540444
false
pattisdr/osf.io
api/collections/urls.py
1
1807
from django.conf.urls import url from api.collections import views app_name = 'osf' urlpatterns = [ url(r'^$', views.CollectionList.as_view(), name=views.CollectionList.view_name), url(r'^(?P<collection_id>\w+)/$', views.CollectionDetail.as_view(), name=views.CollectionDetail.view_name), url(r'^(?P<colle...
apache-2.0
3,097,952,686,044,146,000
89.35
196
0.741007
false
mcellteam/gamer
tools/blendgamer/src/colormap_enums.py
1
1151
# *************************************************************************** # This file is part of the GAMer software. # Copyright (C) 2016-2018 # by Christopher Lee, Tom Bartol, John Moody, Rommie Amaro, J. Andrew McCammon, # and Michael Holst # This library is free software; you can redistribute it and/or # mod...
gpl-2.0
-8,186,576,608,163,925,000
45.08
79
0.646394
false
sajeeshcs/nested_quota_final
nova/tests/unit/virt/libvirt/test_vif.py
1
48234
# Copyright 2012 Nicira, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
7,805,289,528,933,048,000
46.103516
79
0.475432
false
jeremy24/494-graph-algos
python/hw2/timeit.py
1
1308
from __future__ import print_function import time import os from graph import Graph from graph import make from graph import GraphException from graph import Matrix def run(name): graph = make( name ) ret = [0,0] start = time.time() graph.dfs(0) ret[1] = (time.time()-star...
mit
3,221,412,540,978,325,000
17.818182
84
0.482416
false
Jackman3005/CUAutograding
CUAutogradingScripts/GradingScriptLibrary/LocalBatchGrading/BatchGrader.py
1
3612
#THESE LINES ARE NEEDED TO ADD THE GradingScriptLibrary path to the system path so they can be imported!!! import os,sys,inspect cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"../../"))) if cmd_subfolder not in sys.path: sys.path.insert(0, ...
agpl-3.0
-1,942,210,317,177,647,000
43.04878
243
0.703765
false
keepkey/python-keepkey
tests/test_msg_signtx_xfer.py
1
22824
# This file is part of the TREZOR project. # # Copyright (C) 2012-2016 Marek Palatinus <slush@satoshilabs.com> # Copyright (C) 2012-2016 Pavol Rusnak <stick@satoshilabs.com> # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as pu...
lgpl-3.0
-6,478,775,842,627,732,000
62.840909
647
0.637443
false
gnarula/eden_deployment
modules/s3db/asset.py
1
56243
# -*- coding: utf-8 -*- """ Sahana Eden Assets Model @copyright: 2009-2014 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software withou...
mit
1,738,867,762,911,502,600
41.161169
178
0.406131
false
samw3/PyTweeps
pytweeps.py
1
20531
# PyTweeps: Simple Python program to help manage your twitter followers. # https://github.com/samw3/PyTweeps import pkg_resources import tweepy import webbrowser import shelve import pprint import sys import traceback import time import collections from datetime import datetime from datetime import timedelta from conf...
gpl-2.0
3,758,599,949,243,339,000
35.859964
132
0.509814
false
3dfxsoftware/cbss-addons
invoice_report_per_journal/report/invoice_report_demo.py
1
2131
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/ # All Rights Reserved. # info Vauxoo (info@vauxoo.com) ####################################...
gpl-2.0
633,159,658,367,753,600
39.980769
80
0.604411
false
dataplumber/edge
src/main/python/libraries/edge/dateutility.py
2
1665
from datetime import date, datetime, timedelta import dateutil.parser import calendar """ Utility class for date and time conversion. """ class DateUtility(object): RFC_822_GMT_FORMAT = "%a, %d %b %Y %H:%M:%S GMT" @staticmethod def convertTimeLongToIso(time): isoTime = '' try: ...
apache-2.0
-214,491,296,849,177,860
28.210526
103
0.606006
false
MikeFair/www.gittip.com
gittip/csrf.py
1
6543
"""Cross Site Request Forgery middleware, borrowed from Django. See also: https://github.com/django/django/blob/master/django/middleware/csrf.py https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ https://github.com/zetaweb/www.gittip.com/issues/88 """ import rfc822 import re import time import urlpa...
cc0-1.0
-2,196,269,443,329,078,800
36.388571
81
0.643741
false
ksang/error-extractor
lib/markdown.py
1
2193
''' MarkDown format generator ''' class MarkDown: 'convert raw text to markdown syntax' def __init__(self): self.escape_table = {"\\": "\\\\", "`": "\`", "*": "\*", "_": "\_", "{": "\{", "}": "\}", "[": ...
mit
8,219,994,262,008,899,000
29.472222
74
0.401277
false
levilucio/SyVOLT
ECore_Copier_MM/transformation-Large/HeoperationlefteAnnotationsSolveRefEOperationEAnnotationEOperationEAnnotation.py
1
5078
from core.himesis import Himesis class HeoperationlefteAnnotationsSolveRefEOperationEAnnotationEOperationEAnnotation(Himesis): def __init__(self): """ Creates the himesis graph representing the AToM3 model HeoperationlefteAnnotationsSolveRefEOperationEAnnotationEOperationEAnnotation. """ ...
mit
2,488,468,065,536,911,000
48.300971
298
0.522844
false
zrhans/pythonanywhere
pyscripts/ply_wrose.py
1
1678
""" DATA,Chuva,Chuva_min,Chuva_max,VVE,VVE_min,VVE_max,DVE,DVE_min,DVE_max,Temp.,Temp._min,Temp._max,Umidade,Umidade_min,Umidade_max,Rad.,Rad._min,Rad._max,Pres.Atm.,Pres.Atm._min,Pres.Atm._max,Temp.Int.,Temp.Int._min,Temp.Int._max,CH4,CH4_min,CH4_max,HCnM,HCnM_min,HCnM_max,HCT,HCT_min,HCT_max,SO2,SO2_min,SO2_max,O3,O3...
apache-2.0
3,732,984,452,064,682,000
32.52
507
0.665274
false
Travelport-Czech/apila
tasks/Lambda.py
1
8808
import zipfile import tempfile import shutil import os import os.path import hashlib import base64 import json import logging import subprocess import re import botocore import tasks.name_constructor as name_constructor import tasks.bototools as bototools from tasks.Task import Task class Lambda(Task): """Create a ...
mit
2,048,214,956,815,787,300
41.346154
271
0.655654
false
kyuupichan/electrumx
docs/conf.py
1
5054
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config # -- Path setup ------------------------------------------------------------...
mit
5,676,769,521,636,768,000
29.263473
79
0.647804
false
gcallah/Indra
indraV1/models/markov_attempts/two_pop_markov_model.py
1
1534
""" You can clone this file and its companion two_pop_m_run.py to easily get started on a new two pop markov model. It also is a handy tool to have around for testing new features added to the base system. The agents don't move. They have 50% chance of changing color from red to blue, or from blue to red. """ import i...
gpl-3.0
7,503,514,805,912,917,000
26.890909
73
0.602999
false
imankulov/android2po
tests/test_commands.py
3
6703
"""TOOD: We need to test the basic command functionality, ensuring that at it's core, import, export and init are operative, create the files they should create, skip the files they should skip when they should be skipped, etc. In particular, we should test both the case of multiple XML input files (strings.xml, arrays...
bsd-2-clause
8,881,129,003,231,269,000
36.238889
115
0.603312
false
parksandwildlife/biosys
biosys/apps/main/tests/api/test_species_observation.py
1
71256
import datetime import re from os import path import json from django.contrib.gis.geos import Point from django.core.urlresolvers import reverse from django.utils import timezone, six from openpyxl import load_workbook from rest_framework import status from main.models import Dataset, Record from main.tests.api impor...
apache-2.0
-7,408,917,784,714,279,000
35.635476
119
0.53705
false
perchrn/TaktPlayer
src/configuration/ConfigurationHolder.py
1
24848
''' Created on 11. jan. 2012 @author: pcn ''' from xml.etree.ElementTree import Element, SubElement from xml.etree import ElementTree from BeautifulSoup import BeautifulStoneSoup import os import random import sys def getDefaultDirectories(): taktPackageConfigDir = os.path.join(os.getcwd(), "config...
gpl-2.0
4,916,540,883,233,829,000
38.012882
149
0.538031
false
timm-tem/RPi_mediaserver
piface/outputallon.py
1
1251
# THIS IS THE PYTHON CODE FOR PiFACE OUTPUT ON # # Copyright (C) 2014 Tim Massey # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
gpl-3.0
8,116,197,362,531,765,000
40.7
77
0.733813
false
infojasyrc/client_dataws
client_dataws/lib/util/file_verificator.py
1
2208
''' Created on Feb 02, 2013 @author: Jose Sal y Rosas @contact: arturo.jasyrc@gmail.com ''' import zlib import hashlib class Verificator(object): def __init__(self): pass def set_parameters(self, path='', algorithm='crc32', blocksize=8192): self.path = path self.algorithm = algorit...
mit
8,283,340,951,751,417,000
23.544444
112
0.567029
false
itdxer/django-project-template
{{cookiecutter.project_name}}/apps/users/migrations/0001_initial.py
1
2579
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import django.core.validators class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( ...
mit
6,700,627,795,742,435,000
68.702703
289
0.651028
false
puttarajubr/commcare-hq
corehq/apps/api/tests.py
1
47922
import json from datetime import datetime import dateutil.parser from django.utils.http import urlencode from django.test import TestCase from django.core.urlresolvers import reverse from tastypie.models import ApiKey from tastypie.resources import Resource from tastypie import fields from corehq.apps.groups.models i...
bsd-3-clause
2,962,651,482,476,640,000
36.062645
129
0.596073
false
andrewchenshx/vnpy
vnpy/app/algo_trading/algos/dma_algo.py
1
2651
from vnpy.trader.constant import Offset, Direction, OrderType from vnpy.trader.object import TradeData, OrderData, TickData from vnpy.trader.engine import BaseEngine from vnpy.app.algo_trading import AlgoTemplate class DmaAlgo(AlgoTemplate): """""" display_name = "DMA 直接委托" default_setting = { ...
mit
3,550,596,912,636,014,000
25.69697
67
0.501703
false
smartczm/python-learn
Old-day01-10/s13-day5/get/day5/Atm/src/crontab.py
1
2023
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import json import time from config import settings from src.backend import logger def main(): card_list = os.listdir(settings.USER_DIR_FOLDER) for card in card_list: basic_info = json.load(open(os.path.join(settings.USER_DIR_FOLDER, card, 'basic...
gpl-2.0
-718,927,813,982,822,900
34.134615
135
0.536946
false
openvswitch/ovn-scale-test
rally_ovs/plugins/ovs/ovsclients_impl.py
1
19591
# Copyright 2016 Ebay Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
apache-2.0
-7,918,983,159,370,553,000
32.835924
119
0.509418
false
IsmoilovMuhriddin/allgo
rasp/diagnosis.py
1
3928
import signal import time import wiringpi as wp from rasp.allgo_utils import PCA9685 from rasp.allgo_utils import ultrasonic as uls LOW = 0 HIGH = 1 OUTPUT = wp.OUTPUT INPUT = wp.INPUT CAR_DIR_FW = 0 CAR_DIR_BK = 1 CAR_DIR_LF = 2 CAR_DIR_RF = 3 CAR_DIR_ST = 4 DIR_DISTANCE_ALERT = 20 preMillis = 0 ...
mit
-4,003,689,042,530,230,300
20.944134
196
0.647912
false
ppppn/twitter-bot
ReplyAndFav.py
1
6678
#!/usr/bin/python # coding: UTF-8 from tweepy.error import TweepError import random import re from const import * from words import * from replies import replies import datetime import logging from API import GetAPI logging.basicConfig(level=LOGLEVEL) api = None # 説明 # 関数リスト # FUNCTION_NAME(args) > Returns(SUCCES...
mit
-1,916,938,151,522,885,000
32.989418
89
0.622821
false
futureshocked/RaspberryPi-FullStack
Complete_Python2_app/lab_app.py
1
6719
from flask import Flask, request, render_template import time import datetime import arrow app = Flask(__name__) app.debug = True # Make this False if you are no longer debugging @app.route("/") def hello(): return "Hello World!" @app.route("/lab_temp") def lab_temp(): import sys import Adafruit_DHT humidity,...
mit
111,837,944,110,198,480
37.843931
159
0.651883
false
michaelhkw/incubator-impala
tests/comparison/query_profile.py
1
30490
# 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 # "License"); you may not u...
apache-2.0
5,076,192,376,453,511,000
37.546144
90
0.638373
false
itdxer/neupy
tests/layers/test_activations.py
1
13302
import math import six import numpy as np import tensorflow as tf from neupy.utils import asfloat from neupy.exceptions import ( LayerConnectionError, WeightInitializationError, ) from neupy import layers, algorithms, init from base import BaseTestCase from helpers import simple_classification class Activa...
mit
-8,575,744,215,459,305,000
33.195373
79
0.587957
false
karlch/vimiv
vimiv/thumbnail_manager.py
1
10586
# vim: ft=python fileencoding=utf-8 sw=4 et sts=4 """Provides classes to store and load thumbnails from a shared cache. The ThumbnailStore transparently creates and loads thumbnails according to the freedesktop.org thumbnail management standard. The ThumbnailManager provides a asynchronous mechanism to load thumbnails...
mit
974,612,254,628,089,200
35.885017
80
0.601833
false
OpenKMIP/PyKMIP
kmip/pie/objects.py
1
68704
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory # 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/LICEN...
apache-2.0
5,590,796,173,671,300,000
34.45098
79
0.593939
false
rackerlabs/marconi
marconi/queues/transport/wsgi/v1_0/homedoc.py
1
4656
# Copyright (c) 2013 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
9,216,185,514,893,187,000
31.788732
79
0.391323
false
tdeboissiere/DeepLearningImplementations
DenseNet/run_cifar10.py
1
7219
from __future__ import print_function import os import time import json import argparse import densenet import numpy as np import keras.backend as K from keras.datasets import cifar10 from keras.optimizers import Adam from keras.utils import np_utils def run_cifar10(batch_size, nb_epoch, ...
mit
-2,395,165,933,684,536,000
34.214634
79
0.532207
false
dex4er/django-pyc
django_pyc/management/commands/clearpyc.py
1
2097
import argparse import os import re import sys from django.core.management import base class Command(base.BaseCommand): help = \ """ Clears .pyc files from the project. """ pattern = r'^.+\.pyc$' def add_arguments(self, parser): parser.add_argument( '--noinpu...
lgpl-3.0
5,796,214,227,565,749,000
36.446429
98
0.48784
false
daite/textparser
analyze_japanese.py
1
5424
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2015 daite # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limi...
mit
-3,033,339,715,961,497,000
29.133333
80
0.665007
false
znick/anytask
anytask/tasks/models.py
1
16245
# coding: utf-8 import copy import sys import json from datetime import timedelta from django.utils import timezone from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db.models import Q, Max from django.utils.translation import ugettext_lazy as _ from...
mit
2,597,945,272,377,163,300
39.148615
119
0.650166
false
elishowk/django-poser
poser/utils/page.py
1
2014
# -*- coding: utf-8 -*- from django.conf import settings import re APPEND_TO_SLUG = "-copy" COPY_SLUG_REGEX = re.compile(r'^.*-copy(?:-(\d)*)?$') def is_valid_page_slug(page, slug, site, path=None): """Validates given slug depending on settings. """ # Exclude the page with the publisher_state == page.PUBL...
agpl-3.0
1,039,450,840,049,646,100
31.483871
95
0.618669
false
donkawechico/arguman.org
web/premises/views.py
1
23259
# -*- coding:utf-8 -*- import json from datetime import timedelta from markdown2 import markdown from django.contrib import messages from django.core.urlresolvers import reverse from django.utils import timezone from django.db.models import Max, Sum from django.utils.timezone import now from django.http import HttpRe...
mit
-2,597,903,517,027,247,000
32.458993
79
0.603122
false
jnosal/seth
seth/tests/test_authentication.py
1
2947
from seth import auth from seth.tests import IntegrationTestBase from seth.classy.rest import generics class DefaultAuthenticatedResource(generics.GenericApiView): authentication_policy = None def get(self, **kwargs): return {} class BaseAuthenticatedTestCase(IntegrationTestBase): def extend_a...
mit
4,533,596,743,129,733,600
33.682353
95
0.673906
false
mitsuhiko/django
django/test/utils.py
1
7082
from __future__ import with_statement import sys import time import os import warnings from django.conf import settings, UserSettingsHolder from django.core import mail from django.core.mail.backends import locmem from django.test.signals import template_rendered, setting_changed from django.template import Template, ...
bsd-3-clause
2,877,639,968,131,744,300
30.616071
78
0.656735
false
foursquare/pants
tests/python/pants_test/java/test_nailgun_integration.py
1
1196
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals from pants_test.pants_run_integration_test import PantsRunIntegrationTest class TestNai...
apache-2.0
4,745,170,059,667,853,000
43.296296
99
0.72408
false
PyCQA/astroid
astroid/__pkginfo__.py
1
1535
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2014 Google, Inc. # Copyright (c) 2015-2017 Ceridwen <ceridwenv@gmail.com> # Copyright (c) 2015 Florian Bruhin <me@the-compiler.org> # Copyright (c) 2015 Radosław Ga...
lgpl-2.1
-3,546,346,228,540,776,000
53.678571
85
0.745265
false
KSchopmeyer/smipyping
smicli/__init__.py
1
1459
# (C) Copyright 2017 Inova Development Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
mit
-666,475,931,558,996,700
40.685714
74
0.7183
false
rustyhowell/raytracer_py
hitable.py
1
2340
from collections import namedtuple from vector3 import Vec3, dot from math import sqrt from ray import Ray HitRecord = namedtuple("HitRecord", ['t', 'p', 'normal', 'material']) class Hitable: def hit(self, ray_, t_min, t_max): """ Determine if the ray will hit the object :param ray_: ...
mit
6,299,270,001,141,219,000
29
71
0.478205
false
heracek/django-nonrel
tests/regressiontests/file_uploads/tests.py
1
11960
#! -*- coding: utf-8 -*- import errno import os import shutil from StringIO import StringIO from django.core.files import temp as tempfile from django.core.files.uploadedfile import SimpleUploadedFile from django.http.multipartparser import MultiPartParser from django.test import TestCase, client from django.utils imp...
bsd-3-clause
-6,755,040,905,477,396,000
36.952381
110
0.573484
false
PaddlePaddle/models
PaddleRec/dssm/infer.py
1
1407
import paddle.fluid as fluid import numpy as np import sys import args import logging logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s') logger = logging.getLogger("fluid") logger.setLevel(logging.INFO) def infer(args): place = fluid.CUDAPlace(0) if args.use_gpu else fluid.CPUPlace() exe ...
apache-2.0
-6,892,686,518,800,901,000
31.465116
105
0.55914
false
andres-liiver/IAPB13_suvendatud
Kodutoo_16/Kodutoo_16_Andres.py
1
2985
''' Kodutoo 16 14.11.2014 Andres Liiver ''' import time from matplotlib import pyplot as plt from Tund16gen import * def timeFunc(func, *args): start = time.clock() func(*args) return time.clock() - start def linear_search(lst, num): for item in lst: if item == num: return True ...
mit
-7,427,043,884,688,275,000
23.883333
90
0.529313
false
shouya/thinking-dumps
automata/homework/project2/CYK.py
1
4714
''' CYK algorithm for Context Free Language Author: Chenguang Zhu CS154, Stanford University ''' import sys,traceback import os import string maxProductionNum = 100 #max number of productions VarNum = 4 production = [[0] * 3 for i in range(maxProductionNum+1)] '''Prouductions in Chomsky Normal Form (C...
mit
6,106,430,936,488,291,000
27.098765
157
0.530972
false
nexusriot/cinder
cinder/volume/drivers/remotefs.py
1
57137
# Copyright (c) 2012 NetApp, Inc. # Copyright (c) 2014 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
apache-2.0
-5,967,509,913,570,102,000
38.459254
109
0.548926
false
Connexions/openstax-cms
news/models.py
1
15456
from bs4 import BeautifulSoup from django.db import models from django import forms from wagtail.core.models import Page, Orderable from wagtail.core.fields import RichTextField, StreamField from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel, InlinePanel from wagtail.images.edit_handlers import Imag...
agpl-3.0
-7,732,224,415,095,894,000
29.788845
119
0.614777
false
gonicus/gosa
common/src/gosa/common/components/mqtt_proxy.py
1
3896
# This file is part of the GOsa framework. # # http://gosa-project.org # # Copyright: # (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de # # See the LICENSE file in the project's top-level directory for details. import uuid from tornado import gen from gosa.common import Environment from gosa.common.components...
lgpl-2.1
8,577,437,640,126,136,000
31.198347
120
0.61037
false
XtremeTeam/Lucy-bot
brain/plugins/delirium.py
1
13549
#===islucyplugin=== # -*- coding: utf-8 -*- # lucy plugin # delirium.py # Initial Copyright © 2007 Als <Als@exploit.in> # Modifications Copyright © 2014 x-team <x-team@muc.xtreme.im> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-2.0
-7,725,319,307,172,654,000
35.870166
468
0.633551
false
Sightline-Networks/email_bar
email_bar.py
1
1124
#!/bin/python3 from argparse import ArgumentParser from configparser import ConfigParser from os.path import expanduser from mailbox import MaildirMessage, Maildir config = ConfigParser() config_mailboxes = {} config.read(expanduser('~/.config/email_bar.cfg')) parser = ArgumentParser() parser.add_argument('--on...
gpl-2.0
-6,381,215,655,860,284,000
22.416667
87
0.689502
false
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/kafka/protocol/admin.py
1
7824
from __future__ import absolute_import from .api import Request, Response from .types import Array, Boolean, Bytes, Int16, Int32, Schema, String class ApiVersionResponse_v0(Response): API_KEY = 18 API_VERSION = 0 SCHEMA = Schema( ('error_code', Int16), ('api_versions', Array( ...
mit
-3,200,656,330,581,579,300
25.255034
79
0.576176
false
kylef/bluepaste
bluepaste/models.py
1
2381
import datetime import json from hashlib import sha1 import requests import peewee from rivr_peewee import Database from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import JsonLexer from bluepaste.lexer import BlueprintLexer from bluepaste.config import BLUEPRINT_PARSER...
mit
5,149,579,032,192,973,000
27.686747
110
0.660227
false
ovnicraft/server-tools
auth_brute_force/tests/test_brute_force.py
1
14413
# -*- coding: utf-8 -*- # Copyright 2017 Tecnativa - Jairo Llopis # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from threading import current_thread from urllib import urlencode from decorator import decorator from mock import patch from werkzeug.utils import redirect from odoo import http from od...
agpl-3.0
-5,105,628,558,397,867,000
35.6743
79
0.497398
false
jacquerie/inspire-dojson
inspire_dojson/hep/rules/bd0xx.py
1
12752
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
gpl-3.0
-6,248,574,016,785,603,000
28.587007
107
0.559912
false
scopenco/netblock-tools
netnull.py
1
3572
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Author: Andrey Skopenko <andrey@scopenco.net> '''A tool create ip route rules that blackhole networks by country code (ex: RU CN etc.) For the correct execution of script need to download geip database and country codes.''' import csv import sys import optparse import os...
bsd-3-clause
179,938,823,875,172,540
34.019608
79
0.493001
false
trolldbois/ctypeslib
setup.py
1
1432
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name="ctypeslib2", version="2.3.2", description="ctypeslib2 - FFI toolkit, relies on clang", long_description=open("README.md").read(), long_description_content_type="text/markdown", author="Loic Jaquemet", a...
mit
6,116,087,930,440,521,000
33.926829
71
0.549581
false
ju1ius/clisnips
clisnips/tui/widgets/progress/process.py
1
2218
import multiprocessing import os import signal from clisnips.tui.logging import logger from .message_queue import MessageQueue class Process(multiprocessing.Process): def __init__(self, message_queue: MessageQueue, target, args=(), kwargs=None): super().__init__(target=target, args=args, kwargs=kwargs o...
gpl-3.0
8,363,412,266,626,529,000
32.606061
82
0.584761
false
sanyaade-mobiledev/renderer-service-upnp
test/rendererconsole.py
1
5827
# -*- coding: utf-8 -*- # renderer-console # # Copyright (C) 2012 Intel Corporation. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. #...
lgpl-2.1
-1,308,506,136,399,219,500
28.420513
79
0.62402
false
fresskarma/tinyos-1.x
tools/python/pytos/util/RoutingMessages.py
1
7725
# "Copyright (c) 2000-2003 The Regents of the University of California. # All rights reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose, without fee, and without written agreement # is hereby granted, provided that the above copyright notice, the follow...
bsd-3-clause
4,245,047,028,988,728,300
36.139423
95
0.667961
false
avian2/unidecode
unidecode/x1d4.py
1
3863
data = ( 'A', # 0x00 'B', # 0x01 'C', # 0x02 'D', # 0x03 'E', # 0x04 'F', # 0x05 'G', # 0x06 'H', # 0x07 'I', # 0x08 'J', # 0x09 'K', # 0x0a 'L', # 0x0b 'M', # 0x0c 'N', # 0x0d 'O', # 0x0e 'P', # 0x0f 'Q', # 0x10 'R', # 0x11 'S', # 0x12 'T', # 0x13 'U', # 0...
gpl-2.0
9,157,324,283,306,575,000
13.972868
15
0.341703
false
newsages/nQTrucks
ntrain/puertoct/truck2/prep.py
1
5615
#!/usr/bin/python import os from PIL import Image import uuid import shutil import sys WIDTH=52 HEIGHT=13 COUNTRY='trucks2' #WIDTH=52 #HEIGHT=13 #COUNTRY='eu' #constants OPENCV_DIR= '/usr/bin' SAMPLE_CREATOR = OPENCV_DIR + '/opencv_createsamples' BASE_DIR = './' OUTPUT_DIR = BASE_DIR + "out...
gpl-3.0
-3,035,221,647,513,750,500
28.708995
225
0.636331
false
marnnie/Cable-buenaventura
plugin.video.genesis/resources/lib/sources/mvsnap_mv_tv.py
1
4444
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any ...
gpl-2.0
2,883,124,037,299,441,000
31.437956
126
0.54928
false
metabrainz/botbot-web
botbot/apps/plugins/core/logger.py
1
2002
import re from botbot.apps.logs.models import Log from botbot_plugins.base import BasePlugin import botbot_plugins.config as config class Config(config.BaseConfig): ignore_prefixes = config.Field( default=["!-"], required=False, help_text=""" Specify a list of regular expressi...
mit
801,682,193,017,813,800
28.880597
77
0.545455
false
evanmiltenburg/Dutch-corpora
overheid/scripts/make_xml_plain.py
1
1350
from bs4 import BeautifulSoup import nltk.data from nltk.tokenize import word_tokenize import glob import gzip import sys tokenizer = nltk.data.load('tokenizers/punkt/dutch.pickle') def good_sentence(s): if len(s) < 4 or s.count(',') > 4: return False else: digits = filter(lambda x:x.isdigit()...
apache-2.0
3,827,033,118,878,343,000
31.926829
86
0.568148
false
erikdejonge/newsrivr
daemons/oauth.py
1
23551
""" The MIT License Copyright (c) 2007 Leah Culver Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
gpl-2.0
6,105,287,884,939,560,000
34.416541
86
0.617893
false
datapythonista/pandas
pandas/core/arrays/sparse/accessor.py
2
11479
"""Sparse accessor""" import numpy as np from pandas.compat._optional import import_optional_dependency from pandas.core.dtypes.cast import find_common_type from pandas.core.accessor import ( PandasDelegate, delegate_names, ) from pandas.core.arrays.sparse.array import SparseArray from pandas.core.arrays.sp...
bsd-3-clause
-6,695,402,877,092,622,000
29.287599
86
0.531492
false
nkalodimas/invenio
modules/bibsched/lib/bibtask.py
1
50380
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 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 ## ...
gpl-2.0
5,392,646,837,147,061,000
41.622673
228
0.583426
false
alanmcruickshank/superset-dev
superset/connectors/druid/models.py
1
45334
# pylint: disable=invalid-unary-operand-type from collections import OrderedDict from copy import deepcopy from datetime import datetime, timedelta import json import logging from multiprocessing import Pool from dateutil.parser import parse as dparse from flask import escape, Markup from flask_appbuilder import Model...
apache-2.0
-5,881,308,706,200,281,000
35.677994
89
0.527088
false
shsdev/khclass
khclarifai/khclarifai_predict.py
1
1302
#!/usr/bin/env python # coding=UTF-8 import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from math import floor from clarifai.rest import ClarifaiApp from config.configuration import data_path, test_set_id, clarifai_api_key, clarifai_model_name def floored_percentage(val, digits): ...
gpl-3.0
-7,671,868,139,313,991,000
34.189189
115
0.667435
false
h2g2bob/ynmp-wikipedia-sync
chgparty_dot.py
1
5461
import csv from collections import defaultdict from collections import namedtuple class Pty(object): def __init__(self, ynmp, name, rank=3, color="white"): self.ynmp = ynmp self.name = name.replace('"', '').replace("'", "") self.rank = rank self.color = color self.code = "".join(x for x in self.ynmp if x.is...
agpl-3.0
-6,079,931,843,688,282,000
38.572464
298
0.680461
false
underyx/TheMajorNews
main.py
1
2711
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import config import requests from requests_oauthlib import OAuth1 from base64 import b64encode def get_access_token(): token = config.twitter_app_key + ':' + config.twitter_app_secret h = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', ...
mit
2,091,146,900,491,236,900
28.467391
79
0.569532
false
meerkat-code/meerkat_frontend
meerkat_frontend/views/homepage.py
1
5469
""" homepage.py A Flask Blueprint module for the homepage. """ from flask import Blueprint, render_template, current_app, g from flask import request, make_response, redirect, flash, abort from flask_babel import gettext from meerkat_frontend import app, auth from meerkat_frontend import common as c from meerkat_front...
mit
4,114,660,971,303,595,000
32.552147
79
0.602121
false
hunse/vrep-python
dvs-play.py
1
1515
""" Play DVS events in real time TODO: deal with looping event times for recordings > 65 s """ import numpy as np import matplotlib.pyplot as plt import dvs def close(a, b, atol=1e-8, rtol=1e-5): return np.abs(a - b) < atol + rtol * b def imshow(image, ax=None): ax = plt.gca() if ax is None else ax ax.i...
gpl-2.0
5,992,263,968,722,449,000
21.279412
81
0.59538
false
jasonmaier/CircularEconomyBlog
db_repository/versions/013_migration.py
1
1155
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() tasks = Table('tasks', pre_meta, Column('id', INTEGER, primary_key=True, nullable=False), Column('priority', INTEGER, nullable=False), Column('user_id', INTEGER), Column('ta...
bsd-3-clause
1,869,276,016,205,127,000
30.216216
68
0.688312
false