repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
asm0dey/Flexget
tests/test_import_series_betaseries_list.py
1
4220
from __future__ import unicode_literals, division, absolute_import from mock import patch, call from tests import FlexGetBase import flexget.plugins.input.betaseries_list def assert_mock_calls(expected_calls, mock_object): assert expected_calls == mock_object.mock_calls, "expecting calls %r, got %r instead" % \ ...
mit
-1,775,541,269,650,433,300
38.074074
104
0.557109
false
3.857404
true
false
false
bmcfee/gordon
gordon/web/gordonweb/autocode2.py
1
4603
# autocode.py # # Author(s): Christophe de Vienne <cdevienne@gmail.com> # Paul Johnson # # Based on autocode.py by Paul Johnson # (http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode) # # Improvements over the original autocode.py: # * Takes arguments on the command line to select the dburl and # t...
gpl-3.0
-1,114,520,356,102,453,100
30.744828
79
0.636976
false
3.471342
false
false
false
PeterWangIntel/chromium-crosswalk
third_party/mojo/src/mojo/public/tools/dart_list_packages_contents.py
4
1113
#!/usr/bin/python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This script outputs the filenames of the files that are in the "packages/" subdir of the given directory, relative to that directory."""...
bsd-3-clause
5,526,486,606,323,830,000
34.903226
78
0.624438
false
4.46988
false
false
false
schwehr/gdal-autotest2
python/gcore/geoloc_test.py
1
2973
#!/usr/bin/env python # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
-6,382,233,387,539,526,000
34.392857
80
0.75143
false
3.684015
true
false
false
jpalladino84/Python-Roguelike-Framework
components/game_object.py
2
2642
from components.component import valid_components class GameObject(object): def __init__(self): self.components = {} self.observers = {} self.responders = {} def copy_to(self, new_game_object): for component in self.components.values(): new_game_object.register_com...
mit
-4,211,882,567,242,188,000
31.617284
91
0.618092
false
4.381426
false
false
false
MattDerry/pendulum_3d
src/plot_scripts/plot.py
1
2915
#!/usr/bin/env python import numpy as np import pylab import yaml stream = file('time.yaml', 'r') TIME_LOG = yaml.load(stream) stream.close() time2 = TIME_LOG[1] time4 = TIME_LOG[2] time6 = TIME_LOG[3] time8 = TIME_LOG[4] time10 = TIME_LOG[5] stream = file('config.yaml', 'r') CONFIG_LOG = yaml.load(stream) stream.cl...
gpl-2.0
5,684,757,395,999,922,000
35.898734
117
0.66964
false
2.669414
true
false
false
bitex-coin/backend
mailer/mandrill.py
12
203026
import requests, os.path, logging, sys, time try: import ujson as json except ImportError: try: import simplejson as json except ImportError: import json class Error(Exception): pass class ValidationError(Error): pass class InvalidKeyError(Error): pass class PaymentRequiredError...
gpl-2.0
7,916,167,334,964,486,000
63.208096
452
0.644558
false
4.67285
false
false
false
atris/gpdb
gpMgmt/bin/gppylib/test/behave/mgmt_utils/steps/recoverseg_mgmt_utils.py
6
2601
from gppylib.commands.base import Command, ExecutionError, REMOTE, WorkerPool from gppylib.db import dbconn from gppylib.gparray import GpArray from gppylib.test.behave_utils.utils import run_gpcommand, getRows import platform @given('the information of a "{seg}" segment on a remote host is saved') @when('the informat...
apache-2.0
-1,428,855,693,660,359,200
58.113636
175
0.720108
false
3.592541
false
false
false
kurji/lojban_website_mockup
jbobau/jbobau/settings.py
1
3110
""" Django settings for jbobau project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
gpl-3.0
7,384,730,629,264,512,000
24.284553
91
0.683923
false
3.463252
false
false
false
montyly/manticore
manticore/core/smtlib/expression.py
1
36789
from functools import reduce from ...exceptions import SmtlibError import uuid import re import copy from typing import Union, Type, Optional, Dict, Any class ExpressionException(SmtlibError): """ Expression exception """ pass class Expression: """ Abstract taintable Expression. """ def _...
apache-2.0
5,668,414,571,755,638,000
29.555648
133
0.578651
false
3.842595
false
false
false
optima-ict/odoo
addons/web_editor/models/ir_ui_view.py
40
4947
# -*- coding: utf-8 -*- import copy import openerp from openerp.exceptions import AccessError from openerp.osv import osv from lxml import etree, html from openerp import api class view(osv.osv): _inherit = 'ir.ui.view' @api.cr_uid_ids_context def render(self, cr, uid, id_or_xml_id, values=None, engine='...
agpl-3.0
-3,438,966,866,468,648,000
38.576
109
0.585203
false
3.837859
false
false
false
necula01/bond
pybond/setup.py
1
1281
from distutils.core import setup import os here_dir = os.path.abspath(os.path.dirname(__file__)) def readme(): with open(os.path.join(here_dir, 'README.rst')) as f: return f.read() setup( name='bond', packages=['bond', 'bond.bond_helpers'], version='1.1.0', description='Testing with Spies...
bsd-2-clause
3,115,033,225,373,236,700
30.243902
71
0.594848
false
3.789941
false
false
false
kbussell/pydocusign
demo/embeddedsigning.py
1
5150
#!/usr/bin/env python # coding=utf-8 """Sample script that demonstrates `pydocusign` usage for embedded signing. See also http://iodocs.docusign.com/APIWalkthrough/embeddedSigning """ from __future__ import print_function import hashlib import os import uuid import pydocusign from pydocusign.test import fixtures_dir...
bsd-3-clause
5,006,633,623,284,871,000
28.936047
79
0.655661
false
3.688395
false
false
false
elky/django
tests/update/models.py
79
1083
""" Tests for the update() queryset method that allows in-place, multi-object updates. """ from django.db import models class DataPoint(models.Model): name = models.CharField(max_length=20) value = models.CharField(max_length=20) another_value = models.CharField(max_length=20, blank=True) def __str_...
bsd-3-clause
8,444,251,057,236,665,000
21.102041
73
0.692521
false
3.40566
false
false
false
mvaled/sentry
tests/sentry/api/serializers/test_alert_rule.py
1
1670
# -*- coding: utf-8 -*- from __future__ import absolute_import import six from sentry.api.serializers import serialize from sentry.incidents.logic import create_alert_rule from sentry.incidents.models import AlertRuleThresholdType from sentry.snuba.models import QueryAggregations from sentry.testutils import TestCas...
bsd-3-clause
8,378,937,955,324,917,000
36.111111
73
0.645509
false
4.348958
false
false
false
aam-at/tensorflow
tensorflow/python/keras/engine/node.py
5
11372
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-5,113,593,819,068,058,000
37.945205
80
0.66268
false
3.901201
false
false
false
mikf/gallery-dl
gallery_dl/extractor/shopify.py
1
4365
# -*- coding: utf-8 -*- # Copyright 2019-2021 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. """Extractors for Shopify instances""" from .common import BaseExtracto...
gpl-2.0
6,708,945,724,042,438,000
31.325926
76
0.541934
false
3.952899
false
false
false
sdispater/eloquent
tests/migrations/test_migrator.py
1
8071
# -*- coding: utf-8 -*- import os import glob from flexmock import flexmock, flexmock_teardown from .. import EloquentTestCase from eloquent.migrations import Migrator, DatabaseMigrationRepository, Migration from eloquent import DatabaseManager from eloquent.connections import Connection class MigratorTestCase(Eloqu...
mit
5,210,899,352,711,786,000
35.192825
103
0.566844
false
4.147482
true
false
false
Superzer0/pyRiverRaid
objects/mobs/generators/powerup_generators.py
1
2120
import random from objects.globals.gamesettings import GameSettings from objects.powerup import PowerUp class PowerUpGenerator: """Base class for power ups generators""" def __init__(self, player, imgResources, all_sprites, powerups): self.player = player self.imgResources = imgResources ...
mit
-8,526,851,652,054,712,000
39.769231
109
0.64717
false
3.918669
false
false
false
sein-tao/StockAnalysis
dump_flow.py
1
2209
# -*- coding: utf-8 -*- """ Dump tdx_flow files to pickle Created on Sun Jul 26 18:51:24 2015 @author: Sein Tao @email: sein.tao@gmail.com """ # import sys # sys.path.append("..") import os import pickle import datetime import dateutil.relativedelta from parse_flow import parse_tdx_flow, FlowRecord datadir="D:\Perso...
gpl-2.0
-5,176,967,298,923,372,000
29.694444
70
0.6134
false
3.215429
true
false
false
codeforamerica/mdc-feedback
feedback/reports/models.py
1
2121
# -*- coding: utf-8 -*- import arrow from flask import ( render_template, current_app, url_for ) from feedback.database import ( Column, db, Model ) from feedback.utils import send_email class Monthly(Model): ''' The monthly report model - this only contains one field: a string of e-mails separa...
mit
11,070,799,657,152,250
33.209677
76
0.554455
false
4.2
false
false
false
mathemage/h2o-3
h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2oinit.py
2
2140
from __future__ import print_function import sys sys.path.insert(1,"../../../") from tests import pyunit_utils import h2o from h2o.utils.typechecks import assert_is_type from h2o.exceptions import H2OConnectionError def h2oinit(): """ Python API test: h2o.init(url=None, ip=None, port=None, https=None, insecure...
apache-2.0
6,204,695,707,061,553,000
40.960784
116
0.662617
false
3.092486
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/resources/types/ad_schedule_view.py
1
1328
# -*- 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
372,957,407,092,470,800
27.869565
84
0.683735
false
4
false
false
false
Seko34/Kodi-Development
script.module.core.ultrastream/resources/lib/unshortenurl.py
1
6570
# -*- coding: utf-8 -*- #--------------------------------------------------------------------- ''' Created on 02 Jan 2016 @author: Seko @summary: Class for unshorten link ''' #--------------------------------------------------------------------- # ____________________ I M P O R T _____________...
gpl-3.0
-4,804,087,580,398,559,000
36.887574
154
0.4586
false
4.503084
false
false
false
JohnDMcMaster/uvscada
uvscada/dc1100.py
1
4669
''' uvscada Copyright 2012 John McMaster <JohnDMcMaster@gmail.com> Licensed under the terms of the LGPL V3 or later, see COPYING for details ''' ''' I suspect all DC1100 units have the PC interface internally and just aren't brought outside Not sure how hard that is to do yourself though Also the manual hints that th...
bsd-2-clause
-6,698,238,722,773,940,000
23.703704
158
0.674877
false
3.0181
true
false
false
matterkkila/kestrelweb
kestrelweb/main.py
1
4019
import logging.config import local_settings; logging.config.fileConfig(local_settings.logging_config) import dream import kestrel_actions import util App = dream.App() @App.expose('/') def home(request): return dream.Response(body=util.template('index.html'), content_type='text/html') @App.expose('/ajax/ac...
mit
-1,459,676,298,214,296,800
34.263158
134
0.611346
false
3.940196
false
false
false
nofdev/playback
playback/templates/manila_conf.py
2
27513
conf_manila_conf = """[DEFAULT] default_share_type = default_share_type rootwrap_config = /etc/manila/rootwrap.conf auth_strategy = keystone my_ip = {{ my_ip }} # # From oslo.messaging # # Size of RPC connection pool. (integer value) # Deprecated group/name - [DEFAULT]/rpc_conn_pool_size #rpc_conn_pool_size = 30 # Ze...
mit
6,409,555,381,335,465,000
31.793802
90
0.75368
false
3.569408
true
false
false
NARO-41605/pix2pix_map_tiles
DataSetMake_tfwiter.py
1
9657
# -*- coding: utf-8 -* import scipy.io from PIL import Image import numpy as np import random import scipy.ndimage from skimage.transform import rotate import os import argparse import requests from cStringIO import StringIO import glob import math import tensorflow as tf import json parser = argparse....
mit
542,470,002,385,008,260
39.521552
145
0.554656
false
3.121517
false
false
false
iandees/all-the-places
locations/spiders/thebarrecode.py
1
1853
# -*- coding: utf-8 -*- import scrapy import json from locations.items import GeojsonPointItem class TheBarreCodeSpider(scrapy.Spider): name = "thebarrecode" allowed_domains = ["thebarrecode.com"] start_urls = ( 'http://www.thebarrecode.com/', ) def parse(self, response): for locat...
mit
1,295,321,280,042,472,000
40.177778
129
0.572045
false
3.876569
false
false
false
dreikanter/favesdump
setup.py
1
1925
import codecs import os from setuptools import setup, find_packages import subprocess LOCAL_PATH = os.path.dirname(os.path.abspath(__file__)) def get_desc(): """Get long description by converting README file to reStructuredText.""" file_name = os.path.join(LOCAL_PATH, 'README.md') if not os.path.exists(f...
mit
2,421,500,761,861,540,000
30.557377
78
0.611948
false
3.819444
false
false
false
ski7777/ftcommunity-TXT
board/fischertechnik/TXT/rootfs/var/www/applog.py
2
1596
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # import sys, string, os, time import asyncio import websockets import subprocess import socket FILE = "/tmp/app.log" def notify_launcher(str): # Create a socket (SOCK_STREAM means a TCP socket) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: ...
gpl-3.0
241,455,470,784,367,900
22.470588
60
0.625313
false
3.447084
false
false
false
paulfurley/encryptit
encryptit/hash_algorithms.py
1
2368
#!/usr/bin/env python3 import hashlib from .compat import OrderedDict, bytearray_or_str from .length import Length def decode_hash_algorithm(octet): if not isinstance(octet, int) or not 0 <= octet < 256: raise TypeError('Bad octet value: `{0}` of type `{1}`'.format( octet, type(octet))) ...
agpl-3.0
-8,021,793,408,460,084,000
20.925926
75
0.622889
false
3.52381
false
false
false
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/prompt_toolkit/filters/cli.py
20
9224
""" Filters that accept a `CommandLineInterface` as argument. """ from __future__ import unicode_literals from .base import Filter from prompt_toolkit.enums import EditingMode from prompt_toolkit.key_binding.vi_state import InputMode as ViInputMode from prompt_toolkit.cache import memoized __all__ = ( 'HasArg', ...
bsd-3-clause
5,422,360,678,701,781,000
22.351899
78
0.602125
false
3.830565
false
false
false
GitExl/DoomPath
src/nav/area.py
1
2673
from util.rectangle import Rectangle class Area(object): """ A navigation area. This describes a rectangle in which movement is freely possible. Connections to other navigation areas allow pathfinding throughout a map. """ __slots__ = ( 'rect', 'z', '...
bsd-2-clause
-7,160,699,094,409,025,000
29.386364
232
0.555556
false
3.995516
false
false
false
Gato-X/NotYourData
gameowfication/sprites.py
1
12620
""" The MIT License (MIT) Copyright (c) 2015 Guillermo Romero Franco (AKA Gato) 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...
mit
520,867,695,182,356,860
28.280742
131
0.57916
false
3.425624
false
false
false
shyamalschandra/scikit-learn
benchmarks/bench_sample_without_replacement.py
397
8008
""" Benchmarks for sampling without replacement of integer. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import operator import matplotlib.pyplot as plt import numpy as np import random from sklearn.externals.six.moves i...
bsd-3-clause
8,383,169,419,905,794,000
37.68599
80
0.476523
false
4.906863
false
false
false
mlgill/mfoutparser
mfoutparser/examples.py
1
1339
import os from sys import modules from shutil import copytree def copy_examples(dest_path='.'): """Copy mfoutparser example files to a specified directory. Input: destination path for mfoutparser example files, default directory is the current path. If the destination directory ...
bsd-3-clause
-8,326,535,327,619,962,000
30.162791
70
0.637043
false
4.478261
false
false
false
halfak/mysqltsv
mysqltsv/writer.py
1
1278
""" This module provides a set of utilities for writing TSV files. .. autoclass:: mysqltsv.writer.Writer :members: .. autofunction:: mysqltsv.functions.write """ import logging from .util import write_row logger = logging.getLogger(__name__) class Writer: """ Constructs a new TSV row writer. :Pa...
mit
2,299,175,198,851,908,400
24.56
75
0.580595
false
3.968944
false
false
false
takahashiminoru/ryu
ryu/services/protocols/bgp/info_base/vpnv4.py
52
1825
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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
8,415,084,465,292,393,000
29.932203
74
0.729315
false
3.360958
false
false
false
metakirby5/dotfiles
base/.weechat/python/vimode.py
5
50659
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 Germain Z. <germanosz@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any ...
mit
6,677,825,719,635,397,000
34.017289
79
0.56929
false
3.530294
false
false
false
sinner/testing-djrf
tutorial/snippets/views/SnippetDetail.py
1
1959
from snippets.models import Snippet from snippets.serializers import SnippetSerializer from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status class SnippetDetail(APIView): """ Retrieve, update or delete a snippet ...
mit
-3,647,904,103,707,750,400
33.982143
72
0.58244
false
4.587822
false
false
false
hammerlab/varcode
setup.py
1
2683
# Copyright (c) 2014-2019. Mount Sinai School of Medicine # # 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 ...
apache-2.0
7,290,187,730,248,771,000
33.397436
74
0.598211
false
3.747207
false
false
false
ubuntunux/GuineaPig
PyEngine3D/Utilities/Utility.py
2
2490
import time import sys import gc import os import datetime class Profiler: profile_map = {} start_time = 0.0 section_start_time = 0.0 @staticmethod def start(profile_name=''): if profile_name not in Profiler.profile_map: Profiler.profile_map[profile_name] = time.perf_counter()...
bsd-2-clause
-4,164,883,789,592,392,000
28.294118
109
0.582731
false
3.733133
false
false
false
snipperrifle/Router-Telnet-BadDay
telnetbruteforce.py
1
3132
import threading import telnetlib import sys import socket import random import thread import time print "|","-"*61, "|" print "|\tAll of cisco routers , switches with default\t\t|\n|\tusername and passwords are will have a bad day today\t|" print "|","-"*61, "|" def bruteForce(ip): dict={"Administrator":"adm...
gpl-2.0
-9,115,303,984,904,878,000
31.968421
345
0.462005
false
3.810219
false
false
false
hsab/UMOG
umog_addon/sockets/boolean.py
1
1147
import bpy import sys from bpy.props import * from .. base_types import UMOGSocket from .. utils.events import propUpdate class BooleanSocket(bpy.types.NodeSocket, UMOGSocket): # Description string '''Custom Boolean socket type''' # Optional identifier string. If not explicitly defined, the python class n...
gpl-3.0
7,742,348,119,109,303,000
25.674419
91
0.658239
false
3.83612
false
false
false
WebSciences/searcular-old
pinry/settings/__init__.py
1
2867
import os # import djcelery from django.contrib.messages import constants as messages # djcelery.setup_loader() SITE_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '../../') # Changes the naming on the front-end of the website. SITE_NAME = 'Searcular v2' # Set to False to disable people from creat...
agpl-3.0
8,192,452,103,675,637,000
26.04717
79
0.697942
false
3.329849
false
true
false
kagklis/timeseries-summary
Prediction.py
1
4455
''' The MIT License (MIT) Copyright (c) 2016 kagklis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publ...
mit
3,701,691,037,603,330,600
32.246269
146
0.642649
false
3.080913
false
false
false
gtest-org/test14
jenkins_jobs/modules/general.py
9
4236
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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...
apache-2.0
-6,258,473,018,899,836,000
36.821429
79
0.613787
false
3.925857
false
false
false
davegardnerisme/nsq
pynsq/nsq/async.py
15
3260
import socket import struct import logging import tornado.iostream import nsq class AsyncConn(object): def __init__(self, host, port, connect_callback, data_callback, close_callback, timeout=1.0): assert isinstance(host, (str, unicode)) assert isinstance(port, int) assert callable(connec...
mit
-2,042,503,924,097,074,000
29.185185
97
0.589571
false
3.980464
false
false
false
soldag/home-assistant
tests/components/tasmota/test_light.py
2
35443
"""The tests for the Tasmota light platform.""" import copy import json from hatasmota.const import CONF_MAC from hatasmota.utils import ( get_topic_stat_result, get_topic_tele_state, get_topic_tele_will, ) from homeassistant.components import light from homeassistant.components.light import ( SUPPORT...
apache-2.0
7,148,501,709,029,894,000
33.178399
88
0.642186
false
3.285714
true
false
false
asghaier/pynorcio
pynorcio.py
1
2508
#!/usr/bin/python import sys import socket import string import datetime import config as config class Pynorcio: readbuffer = "" s = "" conf = "" def __init__(self): self.conf = config.Config() self.connect() def connect(self): self.s = socket.socket() self.s.conne...
gpl-3.0
6,023,239,255,092,199,000
30.746835
101
0.480861
false
3.366443
false
false
false
mathDR/reading-text-in-the-wild
CHAR2/mjsynth_charnet.py
1
4056
# coding=utf-8 ## Modified from https://github.com/tommasolevato/CNN-Classification/blob/master/mjsynth.py from os.path import isfile import logging import numpy as np import os.path import matplotlib.image as mpimg from skimage.transform import resize np.random.seed(1) class MJSYNTH_CHARNET(): classes = [] ...
gpl-3.0
2,037,932,847,618,101,800
34.269565
93
0.548077
false
3.773023
false
false
false
numerology/QQbot
main.py
1
13776
# -*- coding: utf-8 -*- __author__ = 'Nilk' from qqbot import QQBotSlot as qqbotslot, RunBot import csv import tweepy import datetime import os import json import urllib2 import sys import re as regex import time import logging from bs4 import BeautifulSoup as BS reload(sys) sys.setdefaultencoding('utf-8') CONSUMER_...
gpl-3.0
2,575,763,928,472,989,000
30.479714
148
0.65815
false
2.562658
true
false
false
cmdunkers/DeeperMind
PythonEnv/lib/python2.7/site-packages/theano/tensor/nnet/abstract_conv2d.py
1
21815
""" Define abstract conv2d interface """ import logging import theano from theano.tensor import (as_tensor_variable, patternbroadcast) from theano.tensor import TensorType from theano.gof import Apply, Op from theano.gof import local_optimizer from theano.tensor.opt import register_specialize_device # Cpu implementat...
bsd-3-clause
-4,049,349,733,614,876,000
39.174954
95
0.576392
false
3.936305
false
false
false
mrf345/FQM
app/forms/customize.py
1
13933
import os from functools import reduce from wtforms.validators import InputRequired, Length, Optional from flask_wtf.file import FileAllowed from wtforms import StringField, SelectField, SubmitField, BooleanField, TextAreaField, FileField from wtforms_components import TimeField from app.forms.base import LocalizedFor...
mpl-2.0
-1,921,860,395,263,956,500
46.879725
104
0.556162
false
4.596833
false
false
false
bburan/psiexperiment
psi/controller/queue.py
1
10732
import logging log = logging.getLogger(__name__) import itertools import copy import uuid from collections import deque import numpy as np from enaml.core.api import Declarative class QueueEmptyError(Exception): pass class QueueBufferEmptyError(Exception): pass def as_iterator(x): if x is None: ...
mit
-7,834,932,730,603,202,000
29.750716
80
0.573891
false
4.093059
false
false
false
jacopodl/TbotPy
src/Object/Video.py
1
2539
""" <This library provides a Python interface for the Telegram Bot API> Copyright (C) <2015> <Jacopo De Luca> 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 t...
gpl-3.0
-2,514,527,228,052,287,500
35.797101
116
0.629382
false
4.182867
false
false
false
guymakam/Kodi-Israel
plugin.video.israelive/resources/lib/livestreamer/plugins/connectcast.py
2
2066
import re from livestreamer.plugin import Plugin from livestreamer.plugin.api import http, validate from livestreamer.stream import HTTPStream, RTMPStream from livestreamer.plugin.api.support_plugin import common_jwplayer as jwplayer BASE_VOD_URL = "https://www.connectcast.tv" SWF_URL = "https://www.connectcast.tv/j...
gpl-2.0
439,076,412,555,663,100
29.382353
78
0.547919
false
3.927757
false
false
false
harmsm/rpyBot
rpyBot/manager.py
2
7209
__description__ = \ """ """ __author__ = "Michael J. Harms" __date__ = "2014-06-18" import multiprocessing, time, random, copy from rpyBot.messages import RobotMessage class DeviceManager: """ Class for aynchronous communication and integration between all of the devices attached to the robot. It runs ...
mit
-6,191,918,146,514,756,000
31.917808
107
0.545152
false
4.565548
false
false
false
se4u/pylearn2
pylearn2/scripts/tutorials/gae_demo/make_random_dataset.py
39
4281
""" This script creates a preprocessed dataset of image pairs related by the defined transformation. The content of the images is generated with a uniform distribution, this to to show that the gating models do not depend on the content but only on the relations. """ import itertools import numpy from pylearn2.dataset...
bsd-3-clause
-1,117,137,382,878,355,200
33.804878
77
0.58818
false
3.310905
false
false
false
PatrickKennedy/pygab
plugins/plugin_search.py
1
2865
#!/usr/bin/env python # # PyGab - Python Jabber Framework # Copyright (c) 2008, Patrick Kennedy # 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 r...
bsd-2-clause
7,516,865,461,557,719,000
31.931034
76
0.72356
false
3.506732
false
false
false
stdweird/aquilon
upgrade/1.4.5/aquilon/aqdb/model/user_principal.py
4
4174
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2013 Contributor # # 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 Li...
apache-2.0
-2,977,128,603,027,531,300
34.982759
78
0.597269
false
3.733453
false
false
false
yusufb/file-manager
modules/bookmark.py
1
2022
''' Created on May 13, 2014 @author: utku, yusuf ''' import json import pprint from src import jsonFile def addToBookmarks2(jsonfile, path, name): j = jsonFile.jsonFile() toAdd = {'path' : path, 'name' : name} readFromFile = j.fileToJson(jsonfile) #pprint(readFromFile) fo...
gpl-3.0
-3,408,347,511,843,042,300
26.478873
71
0.626113
false
3.663043
false
false
false
FCP-INDI/nipype
nipype/pipeline/plugins/slurmgraph.py
5
7236
"""Parallel workflow execution via SLURM """ import os import sys from .base import (GraphPluginBase, logger) from ...interfaces.base import CommandLine def node_completed_status(checknode): """ A function to determine if a node has previously completed it's work :param checknode: The node to check the...
bsd-3-clause
758,317,311,789,076,100
47.24
189
0.526534
false
4.45841
false
false
false
rgieseke/pySartorius
sartorius.py
1
1654
# -*- coding: utf-8 -*- """ Python Interface for Sartorius Serial Interface for EA, EB, GD, GE, TE scales. 2010-2011 Robert Gieseke - robert.gieseke@gmail.com See LICENSE. """ import serial class Sartorius(serial.Serial): def __init__(self, com_port): """ Initialise Sartorius dev...
mit
-6,888,341,060,729,988,000
20.972222
61
0.450423
false
3.900943
false
false
false
Lancea12/sudoku_solver
sudoku/models/board.py
1
2616
from ..main import db import math import logging class Board(db.Model): #user = models.ForeignKey(User) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) user = db.relationship('User', backref=db.backref('boards', lazy=True)) name = models.CharField(max_length=255) anchored = models.B...
mit
-6,964,963,407,222,402,000
31.296296
98
0.638761
false
3.388601
false
false
false
Poorchop/hexchat-scripts
twitch-autoemote.py
2
8205
# coding=utf-8 import hexchat import os import sys if sys.version_info[0] == 2: import urllib2 as urllib_error import urllib as urllib_request else: import urllib.error as urllib_error import urllib.request as urllib_request __module_name__ = "Twitch Emote Autoformat" __module_author__ = "Poorchop" _...
mit
-3,323,768,482,977,047,600
32.871369
117
0.503246
false
3.253487
false
false
false
mosimos/sr_data_generator
feeder/simple_feeder.py
1
1456
#!/usr/bin/python # Copyright 2015 Andreas Mosburger # # 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 app...
apache-2.0
-6,265,478,465,321,076,000
29.978723
95
0.684753
false
3.862069
false
false
false
kirbyfan64/shedskin
examples/stereo_main.py
6
4284
# James M. Coughlan # Simple Belief Propagation stereo implementation using Shed Skin. # Use speed-up technique from: # J. Coughlan and H. Shen. "An Embarrassingly Simple Speed-Up of Belief Propagation with Robust Potentials." arXiv. 2010. http://arxiv.org/abs/1010.0012 import numpy as np import pylab as pl ...
gpl-3.0
161,251,538,424,213,600
32.829268
203
0.619981
false
2.464902
false
false
false
ellisonbg/altair
altair/_magics.py
1
5226
""" Magic functions for rendering vega/vega-lite specifications """ __all__ = ['vega', 'vegalite'] import json import warnings import IPython from IPython.core import magic_arguments import pandas as pd import six from toolz import pipe from altair.vegalite import v1 as vegalite_v1 from altair.vegalite import v2 as ...
bsd-3-clause
8,783,827,984,406,396,000
28.693182
79
0.626674
false
3.589286
false
false
false
cc1-cloud/cc1
src/wi/forms/cm.py
1
1670
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
apache-2.0
2,417,444,015,431,224,300
31.72549
91
0.648292
false
3.810502
false
false
false
joelcan/tools-eth-contract-dev
pyethereum/pyethereum/tester.py
1
7747
import shutil import tempfile import time import logging import sys import spv import pyethereum import pyethereum.db as db import pyethereum.opcodes as opcodes from pyethereum.slogging import get_logger, LogRecorder, configure_logging serpent = None u = pyethereum.utils t = pyethereum.transactions b = pyethereum.blo...
mit
3,399,322,480,247,476,700
33.431111
84
0.553763
false
3.377071
false
false
false
TheLartians/PyPropagate
pypropagate/presets/boundaries.py
1
2618
def set_1D_boundary_condition(settings): from expresso.pycas import exp s = settings.simulation_box pe = settings.partial_differential_equation pe.u_boundary = pe.u0.subs(s.z,s.zmin) * exp(pe.F.subs(s.z,s.zmin)*s.z) def set_plane_wave_initial_conditions(settings): """Sets the boundary conditio...
gpl-3.0
7,768,564,459,612,533,000
32.564103
75
0.641329
false
3.431193
false
false
false
danmichaelo/wm_metrics
wm_metrics/cat2cohort.py
2
2568
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Export a Wiki category into a cohort. The aim of this script is to allow program leaders to export a category filled with User pages into a WikiMetrics cohort CSV file in order to perform their evaluation analysis. Test: python cat2cohort.py -l fr -c "Utilisateur ...
mit
-4,253,803,989,498,470,400
28.848837
79
0.586677
false
3.88351
false
false
false
lamontu/data-analysis
pandas/reindexing.py
1
1202
# -*- coding: utf-8 -*- import numpy as np from pandas import DataFrame, Series print("## Redesignate index and order:") obj = Series([4.5, 7.2, -5.3, 3.6], index=['d', 'b', 'a', 'c']) print(obj) obj2 = obj.reindex(['a', 'b', 'd', 'c', 'e']) print(obj2) print("### fill with specified value if the index not exist:") o...
gpl-3.0
3,242,217,310,844,328,000
29.05
63
0.578203
false
2.889423
false
true
false
adam111316/SickGear
sickbeard/search_queue.py
3
17877
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # # SickGear is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
3,014,968,864,450,407,000
37.611231
179
0.578565
false
4.336972
false
false
false
MERegistro/meregistro
meregistro/apps/registro/forms/ExtensionAulicaModificarCueForm.py
1
1137
# -*- coding: utf-8 -*- from django.forms import ModelForm from apps.registro.models import ExtensionAulica, Establecimiento from apps.registro.forms import ExtensionAulicaCreateForm from django.core.exceptions import ValidationError from django import forms class ExtensionAulicaModificarCueForm(ExtensionAulicaCreate...
bsd-3-clause
2,083,545,406,543,251,000
34.53125
105
0.672823
false
3.520124
false
false
false
svarnypetr/focusWebCrawler
parser.py
1
5517
from HTMLParser import HTMLParser from htmlentitydefs import name2codepoint class Tag(object): name = '' text = '' first_child = 0 parent = 0 next_sibling = 0 closed = 0 depth = 0 def get_tag_info_str(self): c, p, s = 'none', 'none', 'none' if self.first_child != 0: ...
mit
821,630,544,457,962,000
30.525714
177
0.496828
false
3.707661
false
false
false
1N50MN14/rethinkdb
test/memcached_workloads/rget_no_blocking.py
4
4069
#!/usr/bin/python # Copyright 2010-2012 RethinkDB, all rights reserved. import os, sys, socket, random, time sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, "common"))) import memcached_workload_common from line import * key_padding = ''.zfill(20) def gen_key(prefix, num): r...
agpl-3.0
7,748,596,986,973,659,000
34.692982
132
0.609978
false
3.368377
false
false
false
MrSprigster/script.module.python.twitch
resources/lib/twitch/log.py
1
3253
# -*- coding: utf-8 -*- """ Copyright (C) 2016-2018 script.module.python.twitch This file is part of script.module.python.twitch SPDX-License-Identifier: GPL-3.0-only See LICENSES/GPL-3.0-only for more information. """ import re import logging import copy try: from logging import NullHandler ex...
gpl-3.0
-9,018,918,745,666,006,000
28.572727
117
0.571165
false
3.456961
false
false
false
Mchakravartula/rockstor-core
src/rockstor/storageadmin/models/pool_balance.py
4
1243
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
5,840,038,939,599,115,000
34.514286
68
0.752212
false
3.824615
false
false
false
kingsdigitallab/kdl-django
cms/templatetags/cms_tags.py
1
2265
from django import template import random register = template.Library() @register.filter def shuffle(arg): aux = list(arg)[:] random.shuffle(aux) return aux @register.assignment_tag(takes_context=True) def get_request_parameters(context, exclude=None): """Returns a string with all the request param...
mit
-278,838,461,996,839,740
31.826087
78
0.660927
false
3.878425
false
false
false
mozts2005/OuterSpace
client-pygame/lib/osci/dialog/ChangeQtyDlg.py
1
2682
# # Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/] # # This file is part of IGE - Outer Space. # # IGE - Outer Space is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of t...
gpl-2.0
-9,214,543,163,955,698,000
28.157303
90
0.64877
false
3.02027
false
false
false
crossbario/crossbar-examples
xbr/teststack1/python/seller.py
3
2590
import binascii import os from uuid import UUID import txaio txaio.use_twisted() from autobahn.twisted.component import Component, run from autobahn.twisted.util import sleep from autobahn.twisted.xbr import SimpleSeller from autobahn.wamp.types import PublishOptions market_maker_adr = os.environ.get('XBR_MARKET_MAK...
apache-2.0
-5,349,200,474,632,949,000
29.833333
124
0.654054
false
3.112981
false
false
false
khchine5/lino-welfare
lino_welfare/modlib/badges/models.py
1
2307
# -*- coding: UTF-8 -*- # Copyright 2014-2015 Luc Saffre # This file is part of Lino Welfare. # # Lino Welfare 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 y...
agpl-3.0
3,762,063,786,132,441,000
25.517241
70
0.680971
false
3.582298
false
false
false
BGS/Rogentos-Irc-Bot
bot.py
1
6177
''' Rogentos IrcBot: Irc Bot Copyright (C) Blaga Florentin Gabriel 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 progra...
gpl-3.0
1,544,610,265,993,985,300
41.020408
151
0.54363
false
3.648553
false
false
false
yasir1brahim/OLiMS
lims/controlpanel/bika_containertypes.py
2
3299
from dependencies.dependency import ClassSecurityInfo from dependencies.dependency import schemata from dependencies import atapi from dependencies.dependency import registerType from dependencies.dependency import getToolByName from lims.browser.bika_listing import BikaListingView from lims.config import PROJECTNAME f...
agpl-3.0
1,310,875,499,270,571,800
37.360465
87
0.588057
false
4.43414
false
false
false
LuisAlejandro/tribus
tribus/common/charms/tests/test_directory.py
2
9024
# import gc # import os # import hashlib # import inspect # import shutil # import zipfile # from juju.errors import CharmError, FileNotFound # from juju.charm.errors import InvalidCharmFile # from juju.charm.metadata import MetaData # from juju.charm.directory import CharmDirectory # from juju.charm.bundle import Cha...
gpl-3.0
4,949,863,388,452,353,000
38.578947
81
0.607602
false
3.403998
true
false
false
ecreall/nova-ideo
novaideo/connectors/google/views/create.py
1
1201
# Copyright (c) 2014 by Ecreall under licence AGPL terms # avalaible on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi from pyramid.view import view_config from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS from pontus.default_behavior import Cancel from pontus.form impo...
agpl-3.0
4,830,485,414,524,612,000
31.459459
82
0.777685
false
3.788644
false
false
false
devurandom/portage
pym/_emerge/SpawnProcess.py
1
6588
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.SubProcess import SubProcess import sys from portage.cache.mappings import slot_dict_class import portage from portage import _encodings from portage import _unicode_encode from portage import os fro...
gpl-2.0
-7,758,191,856,039,773,000
25.457831
69
0.656952
false
3.181072
false
false
false
markusd/rocket
rocket/player.py
1
4137
import math import copy import json from OpenGL.GL import * from Box2D import * from utils.opengl import * from utils import * from rocket.object import Missile class Player(): def __init__(self, keyAdapter, mouse, world, level, position): self.keyAdapter = keyAdapter self.world = world ...
bsd-2-clause
4,728,756,581,301,402,000
32.918033
112
0.510273
false
3.427506
false
false
false
jstoja/TsinghuaMailSystem
src/com/mailsystem/services/AddressService.py
1
1110
''' Created on 8 juin 2014 @author: Romain ''' from src.com.mailsystem.orm import Address class AddressService: @staticmethod def listAll(db_users): s = db_users.session() ret = s.query(Address).all() s.close() return ret @staticmethod def selectById(db_users, ida...
mit
-988,518,705,082,188,700
27.487179
83
0.552252
false
4.157303
false
false
false
ssdi-drive/nuxeo-drive
nuxeo-drive-client/nxdrive/client/remote_document_client.py
1
19921
# coding: utf-8 """ API to access remote Nuxeo documents for synchronization. """ import os import unicodedata import urllib2 from collections import namedtuple from datetime import datetime from dateutil import parser from nxdrive.client.base_automation_client import BaseAutomationClient from nxdrive.client.common ...
lgpl-2.1
4,518,358,538,497,191,000
37.606589
93
0.571809
false
4.103193
false
false
false
vardis/pano
src/pano/actions/GameActions.py
1
2254
''' Copyright (c) 2008 Georgios Giannoudovardis, <vardis.g@gmail.com> 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,...
mit
4,303,235,491,351,281,000
33.809524
84
0.669476
false
4.428291
false
false
false
nuclear-wizard/moose
python/peacock/tests/input_tab/InputFile/test_InputFile.py
12
2790
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
-5,546,552,538,365,725,000
38.295775
116
0.651254
false
3.414933
true
false
false
unicefuganda/mics
survey/ussd/ussd_register_household.py
1
11204
from calendar import monthrange import datetime from django.core.exceptions import ObjectDoesNotExist from survey.models import Question, HouseholdHead, UnknownDOBAttribute from survey.models.households import HouseholdMember from survey.ussd.ussd import USSD class USSDRegisterHousehold(USSD): HEAD_ANSWER = { ...
bsd-3-clause
-4,769,370,553,601,594,000
41.283019
121
0.632453
false
3.855471
false
false
false
dgeorgievd/ovirtctl
api/api/settings.py
1
3179
""" Django settings for api project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # Bui...
apache-2.0
-3,422,961,035,196,886,500
25.057377
91
0.68921
false
3.520487
false
false
false
GladeRom/android_external_chromium_org
mojo/public/tools/bindings/generators/mojom_cpp_generator.py
25
12218
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generates C++ source files from a mojom.Module.""" import mojom.generate.generator as generator import mojom.generate.module as mojom import mojom.genera...
bsd-3-clause
-2,157,970,695,015,137,000
35.363095
80
0.704207
false
3.287944
false
false
false
SetBased/py-stratum
pystratum/command/PyStratumCommand.py
1
1572
""" PyStratum """ from cleo import Command, Input, Output from pystratum.style.PyStratumStyle import PyStratumStyle class PyStratumCommand(Command): """ Loads stored routines and generates a wrapper class stratum {config_file : The stratum configuration file} {file_names?* : Sources with...
mit
4,108,116,907,794,490,400
29.230769
120
0.465649
false
5.154098
false
false
false
twistsys/basic-project
fabfile.py
1
5267
import os import deploy as deploy_conf from fabric.api import env, task, roles, run, execute, sudo from fabric import colors from fabric.utils import abort import inspect ################################################################################ # Tasks for managing Deploy Targets #############################...
bsd-3-clause
-6,034,000,824,672,719,000
27.781421
80
0.562369
false
4.240741
false
false
false