repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
Vayel/WAMPLab
transaction/v1/locator.py
1
1589
from twisted.internet.defer import inlineCallbacks from autobahn import wamp from autobahn.twisted.wamp import ApplicationSession from autobahn.twisted.wamp import ApplicationRunner class Locator(ApplicationSession): @inlineCallbacks def onJoin(self, details): yield self.register(self)...
gpl-2.0
-6,945,406,505,201,642,000
28.981132
80
0.563247
false
4.34153
false
false
false
iiitv/algos
breadth_first_traversal/breadth_first_traversal.py
1
2410
""" Breadth-first-traversal is an algorithm for traversing a tree or graph data structure. Starting at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key'[1]) and explores the neighbor nodes at that level first, before moving to the next level. """ from collections import deque ...
mit
-3,733,688,494,333,147,000
25.195652
77
0.544813
false
3.580981
false
false
false
Kortemme-Lab/protein_feature_analysis
ProteinFeatureAnalyzer/features/data_loading.py
1
3308
import os import io import Bio.PDB as PDB from . import topology from . import secondary_structures def structure_from_pdb_file(file_path, name=''): '''Read the structure stored in a PDB file.''' parser = PDB.PDBParser() return parser.get_structure(name, file_path) def structure_from_pdb_string(pdb_string, n...
mit
-2,651,815,429,011,390,500
29.62963
102
0.637848
false
3.406797
false
false
false
jralls/gramps
gramps/plugins/webreport/person.py
1
75620
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com> # Copyright (C) 2007-2009 Gary Burton <gary.burton@zen.co.uk> # Copyright (C) 2007-2009 Stephane Charet...
gpl-2.0
-1,617,659,728,472,627,700
41.24581
80
0.463608
false
4.611538
false
false
false
faddai/newfies-dialer
newfies/user_profile/views.py
1
11084
# # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2012 Star2Billing S.L. # # The Init...
mpl-2.0
5,991,948,951,880,823,000
37.352941
111
0.603934
false
4.117385
false
false
false
jiasir/pycs
vulpo/pyami/scriptbase.py
1
1430
import os import sys from vulpo.utils import ShellCommand, get_ts import vulpo import vulpo.utils class ScriptBase(object): def __init__(self, config_file=None): self.instance_id = vulpo.config.get('Instance', 'instance-id', 'default') self.name = self.__class__.__name__ self.ts = get_ts()...
mit
-3,219,314,286,743,809,500
31.5
110
0.565734
false
3.620253
false
false
false
platipy/spyral
examples/collisions.py
1
1514
try: import _path except NameError: pass import spyral SIZE = (640, 480) BG_COLOR = (0, 0, 0) class Square(spyral.Sprite): def __init__(self, scene, direction, color=(255, 0,0)): spyral.Sprite.__init__(self, scene) self.image = spyral.Image(size=(16, 16)).fill(color) self.direction...
lgpl-2.1
-6,099,856,198,345,127,000
30.541667
84
0.612285
false
3.334802
false
false
false
DOAJ/doaj
portality/formcontext/formcontext.py
1
82183
import json import uuid from datetime import datetime from flask import render_template, url_for, request from flask_login import current_user import portality.formcontext.forms from portality.crosswalks.journal_form import JournalFormXWalk from portality.crosswalks.article_form import ArticleFormXWalk from portality...
apache-2.0
-3,858,372,472,115,063,000
43.59197
398
0.630581
false
4.252018
false
false
false
mushtaqak/edx-platform
openedx/core/djangoapps/credit/api.py
1
28489
""" Contains the APIs for course credit requirements. """ import logging import uuid import datetime import pytz from django.db import transaction from util.date_utils import to_timestamp from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from student.models import User from .except...
agpl-3.0
8,880,496,703,872,569,000
35.062025
114
0.614097
false
4.482222
false
false
false
jonashaag/django-autocomplete-light
autocomplete_light/widgets.py
1
6373
""" ChoiceWidget is intended to work as a replacement for django's Select widget, and MultipleChoiceWidget for django's SelectMultiple. Constructing a widget needs an Autocomplete class or registered autocomplete name. The choice autocomplete widget renders from autocomplete_light/widget.html template. """ from djan...
mit
1,981,258,003,177,358,000
34.405556
79
0.630943
false
4.332427
false
false
false
hearsaycorp/normalize
normalize/property/types.py
1
5422
# # This file is a part of the normalize python library # # normalize is free software: you can redistribute it and/or modify # it under the terms of the MIT License. # # normalize is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FI...
mit
-1,562,669,226,994,970,400
30.16092
76
0.601254
false
3.781032
false
false
false
kewljedi/octoprint-pushbullet
setup.py
1
1047
# coding=utf-8 import setuptools def package_data_dirs(source, sub_folders): import os dirs = [] for d in sub_folders: for dirname, _, files in os.walk(os.path.join(source, d)): dirname = os.path.relpath(dirname, source) for f in files: dirs.append(os.path.join(dirname, f)) return dir...
gpl-3.0
8,190,900,412,091,826,000
23.952381
109
0.671442
false
3.271875
false
false
false
mateoqac/unqTip
language/vxgbs/lang/gbs_compiler.py
1
29369
# # Copyright (C) 2011, 2012 Pablo Barenbaum <foones@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 later version. # # Th...
gpl-3.0
-6,050,560,207,559,410,000
37.899338
110
0.548367
false
3.871984
false
false
false
altair-viz/altair
altair/utils/core.py
1
20886
""" Utility routines """ from collections.abc import Mapping from copy import deepcopy import json import itertools import re import sys import traceback import warnings import jsonschema import pandas as pd import numpy as np from .schemapi import SchemaBase, Undefined try: from pandas.api.types import infer_dt...
bsd-3-clause
6,587,024,043,765,292,000
29.269565
114
0.584123
false
3.893736
false
false
false
seanbell/opensurfaces
server/photos/migrations/0011_auto__del_field_flickruser_displayname__del_field_flickruser_subname__.py
1
29209
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'FlickrUser.displayname' db.delete_column(u'photos_flick...
mit
2,888,323,342,558,164,000
86.717718
209
0.561471
false
3.642474
true
false
false
sacharya/nova
nova/api/openstack/compute/schemas/v3/flavor_access_schema.py
1
1776
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 NEC Corporation. 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.or...
apache-2.0
-7,900,809,347,432,931,000
31.888889
78
0.560248
false
4.238663
false
false
false
msg/g2ools
nord/g2/file.py
1
33799
#!/usr/bin/env python2 # # Copyright (c) 2006,2007 Matt Gerassimoff # # This file is part of g2ools. # # g2ools 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 op...
gpl-2.0
-1,795,341,959,768,795,100
32.564052
80
0.641912
false
3.29425
false
false
false
rossant/spiky
spiky/colors.py
1
2971
import numpy as np # from matplotlib.colors import hsv_to_rgb, rgb_to_hsv __all__ = ['COLORMAP', 'HIGHLIGHT_COLORMAP', 'COLORS', 'COLORS_COUNT', 'generate_colors'] # Color creation routines # ----------------------- def hue(H): H = H.reshape((-1, 1)) R = np.abs(H * 6 - 3) - 1; G = 2 - np.abs(H * 6 - 2);...
bsd-3-clause
-7,645,004,919,115,126,000
23.97479
89
0.499159
false
2.534983
false
false
false
foxmask/django-th
django_th/management/commands/read.py
1
1331
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals from concurrent.futures import ThreadPoolExecutor # django from django.conf import settings from django.core.management.base import BaseCommand from django.db.models import Q # trigger happy from django_th.models import TriggerService from dj...
bsd-3-clause
6,266,242,189,755,051,000
31.463415
93
0.6574
false
4.185535
false
false
false
jmesteve/saas3
openerp/addons_extra/l10n_es_payment_order/wizard/converter.py
1
5200
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved. # Pedro Tarrafeta <pedro@acysos.com> # Copyright (c) 2008 Pablo Roc...
agpl-3.0
-6,711,844,283,154,323,000
44.59292
214
0.542508
false
3.492881
false
false
false
veblush/PyAuParser
sample/tutorial2.py
1
1053
import os import sys import pyauparser def main(): g = pyauparser.Grammar.load_file("data/operator.egt") # every production has a lambda handler which evaluates value from childs. # Because LALR is a bottom-up parser, handler would be called from bottom. h = pyauparser.ProductionHandler({ ...
mit
3,278,430,495,155,954,700
30.90625
78
0.449193
false
2.877049
false
false
false
mattcaldwell/djangopypi
userpypi/migrations/0001_initial.py
1
10447
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Classifier' db.create_table('userpypi_classifier', ( ('id', self.gf('djang...
bsd-3-clause
-2,172,781,878,352,863,500
67.281046
139
0.577965
false
3.740422
false
false
false
tecan/xchat-rt
plugins/scripts/ss-autoaway.py
1
2072
#!/usr/bin/env python # # screensaverAutoAway.py - X-Chat script to monitor for the DBUS message # emitted when the screensaver is activated and de-activated and set the user # away. # # To install: # o Copy this file to your ~/.xchat2/ directory and it will be loaded on startup. # o To load without restart, run: /p...
gpl-2.0
1,878,460,759,486,318,300
27.383562
82
0.615347
false
3.482353
false
false
false
Bajoo/client-pc
bajoo/filesync/task_builder.py
1
5313
# -*- coding: utf-8 -*- from ..index.folder_node import FolderNode from ..index.hints import DeletedHint, DestMoveHint, SourceMoveHint from ..index.hint_builder import HintBuilder from .added_local_files_task import AddedLocalFilesTask from .added_remote_files_task import AddedRemoteFilesTask from .folder_task import ...
gpl-3.0
-5,430,126,019,375,362,000
41.166667
78
0.576699
false
4.664618
false
false
false
maximz/cooperate-without-looking
src/cwl.py
1
24981
# -*- coding: utf-8 -*- """Module cwl. Produces simulation calculation and figures for the Cooperate With/Without Looking project. Usage: python cwl.py {recalculate?} Examples: python cwl.py run using pre-calculated saved data python cwl.py recalculate run with freshly calculated data @...
mit
-9,027,010,238,727,414,000
38.818627
332
0.616148
false
2.931698
false
false
false
walkr/cryex
cryex/coins/poloniex.py
1
2638
POLONIEX_REPAIRS = { "1cr": "1CR", "aby": "ABY", "adn": "ADN", "amp": "AMP", "arch": "ARCH", "bbr": "BBR", "bcn": "BCN", "bcy": "BCY", "bela": "BELA", "bitcny": "BITCNY", "bits": "BITS", "bitusd": "BITUSD", "blk": "BLK", "block": "BLOCK", "btcd": "BTCD", "...
mit
6,310,330,788,044,527,000
18.686567
74
0.392722
false
2.278066
false
false
false
Droriel/python_training
generator/contact.py
1
7547
# -*- coding: utf-8 -*- import random import string from model.contact import PersonalData, PhoneNumbers, Emails, Www, AdditionalData, Notes, ContactBaseData, \ ContactAllData, BirthDate, AnniversaryDate import jsonpickle import os.path import sys import getopt try: opts, args=getopt.getopt(sys.argv[1:], 'n:f:...
apache-2.0
-4,843,098,957,106,365,000
50.69863
119
0.481118
false
4.476275
false
false
false
asoliveira/NumShip
source/Navio-back.py
1
56391
# -*- coding: utf-8 -*- # #This file is part of a program called NumShip #Copyright (C) 2011,2012 Alex Sandro Oliveira #NumShip 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
-2,103,145,341,740,217,300
33.131995
79
0.426835
false
3.087203
false
false
false
CCS-Lab/hBayesDM
Python/hbayesdm/models/_dd_hyperbolic_single.py
1
9923
from typing import Sequence, Union, Any from collections import OrderedDict from numpy import Inf, exp import pandas as pd from hbayesdm.base import TaskModel from hbayesdm.preprocess_funcs import dd_single_preprocess_func __all__ = ['dd_hyperbolic_single'] class DdHyperbolicSingle(TaskModel): def __init__(sel...
gpl-3.0
7,724,618,514,999,984,000
40.518828
145
0.640331
false
4.244226
false
false
false
kashev/pysc
util/anagram_dict_builder.py
1
1580
#!/usr/bin/env python3 # pysc # Kashev Dalmia | @kashev | kashev.dalmia@gmail.com # anagram_dict_builder.py """ A script which builds an anagram dictionary from a dictionary. """ # Credit: Jeff Knupp # https://github.com/jeffknupp/presser/blob/master/make_anagrams.py import collections import os import string def b...
mit
3,450,408,199,887,984,000
31.244898
73
0.605063
false
3.487859
false
false
false
guillaume-havard/testdjango
sitetest/stats/middleware.py
1
1123
from django.db.models import F from stats.models import Page class StatsMiddleware(object): def process_view(self, request, view_func, view_args, view_kwargs): """ Incrémente le nombre de page vues à chaque appel de vues """ try: # Le compteur lié à la page est récupéré et incrémenté ...
mit
-3,092,915,929,755,777,500
39.925926
92
0.631341
false
3.275964
false
false
false
priyom/priyomdb
Schema/Patches/patch_3.py
1
1691
""" File name: patch_3.py This file is part of: priyomdb LICENSE The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/ Software distributed u...
gpl-3.0
-6,247,857,135,208,938,000
34.978723
78
0.735068
false
3.782998
false
false
false
pedrohml/smartbot
smartbot/joke_behaviour.py
1
2199
# coding: utf-8 from smartbot import Behaviour from smartbot import Utils from smartbot import ExternalAPI import re import os import random class JokeBehaviour(Behaviour): def __init__(self, bot): super(JokeBehaviour, self).__init__(bot) self.language = self.bot.config.get('main', 'language') if...
mit
4,034,820,672,840,083,500
44.770833
126
0.622667
false
3.288922
false
false
false
mhubig/intelhex
scripts/hex2dump.py
1
3960
#!/usr/bin/python # Copyright (c) 2008,2010,2011,2012,2013 Alexander Belchenko # 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 cop...
bsd-3-clause
-4,853,036,239,676,083,000
31.727273
92
0.603283
false
4.120708
false
false
false
oliver-sanders/cylc
cylc/flow/network/schema.py
1
52672
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2019 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 th...
gpl-3.0
7,159,439,198,366,642,000
30.371054
79
0.621867
false
4.039264
false
false
false
yuanming-hu/taichi
examples/mgpcg_advanced.py
1
9080
import math import time import numpy as np import taichi as ti @ti.data_oriented class MGPCG: ''' Grid-based MGPCG solver for the possion equation. See `examples/stable_fluid.py <https://github.com/taichi-dev/taichi/blob/master/examples/stable_fluid.py>`_ for a usage example. .. note:: This solver only r...
mit
2,937,493,401,941,731,300
30.527778
128
0.508921
false
3.21075
false
false
false
Brunel-Visualization/Brunel
python/brunel/brunel_util.py
1
1472
# Copyright (c) 2015 IBM Corporation and others. # # 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...
apache-2.0
7,878,519,849,403,592,000
39.888889
137
0.69769
false
3.213974
false
false
false
scenarios/tensorflow
tensorflow/contrib/distributions/python/ops/bijector.py
2
92884
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-2,422,548,313,249,080,300
36.574434
145
0.632617
false
3.590414
false
false
false
byronrau/tweepyScripts
twitterUserTimeline/twitterUserTimeline.py
1
3599
#!/usr/bin/python import tweepy import sys import os import codecs import unicodecsv as csv # API and ACCESS KEYS API_KEY = 'jz3feMK2gN0kaN377FsTXY7uY' API_SECRET = 'sGfCEayfwORloC9SvHy6BmDjifUsUEIF0EF51SgiYUgs054n7H' # Don't buffer stdout, so we can tail the log output redirected to a file sys.stdout = os.fdopen(sys...
mit
5,696,373,822,382,111,000
30.578947
311
0.639066
false
3.039696
false
false
false
djfroofy/beatlounge
tutor/song5.py
1
2172
from itertools import cycle from bl.ugen import W from bl.arp import ChordPatternArp, OrderedArp, RandomArp, ArpMap from bl.scheduler import clock from bl.orchestra.midi import ChordPlayer from tutor.complib import piano_f pattern = [3, 3, [3, 1], 1, 2, 1, 2, 1, [3, 2, 1, 0, 4], 0, 1, 2, 3, 4, 3, 2, [3, ...
mit
760,528,155,715,385,200
36.448276
78
0.422652
false
2.721805
false
false
false
MathGen/oppgavegenerator
oppgavegen/views/game_views.py
1
8226
from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response, redirect from django.http import HttpResponseForbidden from django.template import RequestContext from oppgavegen.generation_folder.generation import generate_level from oppgavegen.view_logic.rating import * from...
bsd-3-clause
-671,454,598,317,702,500
44.181319
119
0.60501
false
3.899004
false
false
false
mtommasi/pygiftparser
setup.py
1
1462
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os from setuptools import setup try: long_description = open("README.rst").read() except IOError: long_description = "" LOCALEDIR = os.path.join('share', 'locale') setup( name="pygiftparser", version="1.1", url="https://github.com/mtommasi/pygiftp...
mit
-5,657,474,728,144,140,000
33
147
0.53078
false
4.11831
false
false
false
agartland/utils
custom_legends.py
1
2291
import matplotlib.pyplot as plt import numpy as np __all__ = ['colorLegend', 'symbolLegend'] def colorLegend(colors, labels, alphas=None, edgecolor='black',loc='best', axh=None, **legendKwargs): """Custom matplotlib legend with colors and labels etc. Useful in cases where it is a...
mit
6,611,612,067,164,619,000
34.951613
186
0.61196
false
4.1883
false
false
false
radez/packstack
packstack/installer/utils/shell.py
1
4512
# -*- coding: utf-8 -*- import re import types import logging import subprocess from ..exceptions import (ExecuteRuntimeError, ScriptRuntimeError, NetworkError) from .strings import mask_string block_fmt = ("\n============= %(title)s ==========\n%(content)s\n" "======== END OF...
apache-2.0
-8,818,339,688,155,416,000
33.707692
77
0.526596
false
3.750623
false
false
false
hivesolutions/netius
src/netius/clients/mjpg.py
1
4936
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Netius System # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foun...
apache-2.0
5,063,929,398,906,030,000
32.263889
85
0.625659
false
3.612006
false
false
false
gameduell/pysupplies
tests/test_params.py
1
3109
import pytest from supplies.annotate import delay from supplies.params import param, Params __author__ = 'dwae' class Foo(Params): @param def bar(self, val: (1, 42)=23): return val @delay def bla(self): return ... class Bar(Foo, Params): @param def baz(self, val: str='f00')...
mit
-5,483,111,285,384,543,000
15.537234
41
0.525893
false
3.248694
true
false
false
ddico/odoo
addons/fleet/models/fleet_vehicle_cost.py
1
9422
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.exceptions import UserError from dateutil.relativedelta import relativedelta class FleetVehicleLogContract(models.Model): _inherit = ['mail.thread', 'mail.activity....
agpl-3.0
1,315,773,969,023,667,500
48.335079
156
0.641159
false
3.737406
false
false
false
bird-house/bird-feeder
birdfeeder/walker.py
1
5030
import os from netCDF4 import Dataset as NCDataset from dateutil import parser as dateparser from datetime import datetime from birdfeeder.utils import humanize_filesize import logging logger = logging.getLogger(__name__) SPATIAL_VARIABLES = [ 'longitude', 'lon', 'latitude', 'lat', 'altitude', 'alt', 'l...
apache-2.0
-8,682,199,717,071,598,000
28.763314
102
0.56501
false
4.273577
false
false
false
dvcolgan/ludumdare27
game/management/commands/generate_map_pngs.py
1
2676
from django.core.management.base import BaseCommand, CommandError from game.models import * from settings import MIN_COL, MAX_COL, MIN_ROW, MAX_ROW, GRID_SIZE from PIL import Image from PIL import ImageDraw def hex_to_rgb(value): value = value.lstrip('#') lv = len(value) if lv == 1: v = int(value,...
mit
-4,220,150,537,329,599,500
36.690141
94
0.501495
false
3.111628
false
false
false
petr-kalinin/progrobot
tools/import_python3.py
1
9519
#!/usr/bin/python3 from pymongo import MongoClient import os import os.path import re import bs4 import itertools from bs4 import BeautifulSoup import utils class ReferenceItem: def __init__(self): self.name = "" self.module = "" self.usage = "" self.short = "" self.full = ...
agpl-3.0
1,616,040,906,343,496,200
30.916107
138
0.551887
false
3.639878
true
false
false
vitobasso/audio-ml
src/train_raw.py
1
2372
__author__ = 'victor' from pybrain.datasets import SupervisedDataSet from pybrain.supervised.trainers import RPropMinusTrainer from pybrain import FeedForwardNetwork, FullConnection, IdentityConnection, TanhLayer from datasource import * # dataset timeWidth = 5140 # num of samples to input to the net mixer = Mix...
gpl-2.0
-8,458,553,163,728,513,000
28.296296
118
0.670742
false
3.308229
false
false
false
olivierverdier/sfepy
sfepy/postprocess/dataset_manager.py
1
9486
""" Code to help with managing a TVTK data set in Pythonic ways. """ # Author: Prabhu Ramachandran <prabhu@aero.iitb.ac.in> # Copyright (c) 2008, Enthought, Inc. # License: BSD Style. from enthought.traits.api import (HasTraits, Instance, Array, Str, Property, Dict) from enthought.tvtk.api im...
bsd-3-clause
-8,936,205,743,073,525,000
35.767442
81
0.519713
false
4.127937
false
false
false
iproduct/course-social-robotics
11-dnn-keras/venv/Lib/site-packages/matplotlib/sphinxext/mathmpl.py
1
3759
import hashlib from pathlib import Path from docutils import nodes from docutils.parsers.rst import Directive, directives import sphinx import matplotlib as mpl from matplotlib import cbook from matplotlib.mathtext import MathTextParser mathtext_parser = MathTextParser("Bitmap") # Define LaTeX math node: class late...
gpl-2.0
8,906,122,994,853,540,000
28.833333
73
0.611865
false
3.721782
false
false
false
mitodl/bootcamp-ecommerce
profiles/utils_test.py
1
2363
"""User utils tests""" import pytest from profiles.utils import ensure_active_user, is_duplicate_username_error, usernameify @pytest.mark.parametrize( "full_name,email,expected_username", [ [" John Doe ", None, "john-doe"], ["Tabby Tabberson", None, "tabby-tabberson"], ["Àccèntèd Ñame...
bsd-3-clause
-5,640,492,194,927,244,000
35.809524
118
0.660198
false
3.420354
true
false
false
akshayms/eho
eho/server/storage/models.py
1
8401
# Copyright (c) 2013 Mirantis 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 writ...
apache-2.0
8,855,471,069,699,424,000
34.901709
79
0.578145
false
3.767265
true
false
false
VJftw/invoke-tools
invoke_tools/lxc/docker.py
1
5987
""" invoke_tools.lxc.docker """ from __future__ import print_function import os import json import getpass class Docker: """ Docker """ @staticmethod def __print_line(line): """ """ try: line = line.decode('utf-8') except: print("Could not d...
mit
3,646,104,151,735,492,000
28.063107
176
0.496743
false
4.258179
true
false
false
msoula/cosmicbox
board/cosmicbox/cosmicboxfs/lib/psogen.py
1
4151
#!/usr/bin/python # Modificated ShoutBox Library # enables further modifications for the ShoutBox # Run without to generate htmlfile # Run the following to enter a new line from command line # psogen.py input Anonymous default "Text" import os, re import messages, broadcast datafilename = os.environ["SHOU...
gpl-2.0
-128,107,883,562,125,100
28.65
158
0.611419
false
3.593939
false
false
false
geosim/QAD
qad_joindisjoin_cmd.py
1
25015
# -*- coding: utf-8 -*- """ /*************************************************************************** QAD Quantum Aided Design plugin comando JOIN e DISJOIN per aggregare e disgregare le geometrie (multipoint, multilinestring, poligon e multipoligon) ------------------- be...
gpl-3.0
-2,137,112,879,578,955,000
39.693811
139
0.577587
false
4.073199
false
false
false
SUSE/kiwi
kiwi/utils/sysconfig.py
1
2856
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
gpl-3.0
-2,067,535,882,005,381,400
33
70
0.572129
false
4.243685
false
false
false
lucadealfaro/crowdranker
controllers/feedback.py
1
10966
# -*- coding: utf-8 -*- import access import util @auth.requires_login() def index(): """Produces a list of the feedback obtained for a given venue, or for all venues.""" venue_id = request.args(0) if venue_id == 'all': q = (db.submission.user == get_user_email()) else: q = ((db.su...
bsd-3-clause
-9,091,172,184,251,331,000
45.66383
138
0.621922
false
3.551166
false
false
false
gabrielmagno/nano-dlna
nanodlna/dlna.py
1
1582
#!/usr/bin/env python3 # encoding: UTF-8 import os import pkgutil import sys from xml.sax.saxutils import escape as xmlescape if sys.version_info.major == 3: import urllib.request as urllibreq else: import urllib2 as urllibreq def send_dlna_action(device, data, action): action_data = pkgutil.get_data( ...
mit
4,625,877,574,989,528,000
27.763636
78
0.616941
false
3.358811
false
false
false
morevnaproject/RenderChan
renderchan/contrib/pencil2d.py
1
5111
__author__ = 'Konstantin Dmitriev' from renderchan.module import RenderChanModule from renderchan.utils import is_true_string from distutils.version import StrictVersion import subprocess import tempfile import os from xml.etree import ElementTree class RenderChanPencil2dModule(RenderChanModule): def __init__(s...
bsd-3-clause
-8,211,885,996,274,041,000
43.443478
285
0.576208
false
4.294958
false
false
false
eggplantbren/NSwMCMC
python/straightline2.py
1
2303
import copy import numpy as np import numpy.random as rng import scipy.special from utils import randh from numba import jit # How many parameters are there? num_params = 4 # Some data data = np.loadtxt("road.txt") N = data.shape[0] # Number of data points # Plot the data import matplotlib.pyplot as plt plt.plot(dat...
gpl-2.0
5,760,810,357,822,276,000
22.989583
87
0.6231
false
3.058433
false
false
false
ActiveState/code
recipes/Python/286240_Python_portscanners/recipe-286240.py
1
3523
# a simple portscanner with multithreading import socket as sk import sys import threading MAX_THREADS = 50 def usage(): print "\npyScan 0.1" print "usage: pyScan <host> [start port] [end port]" class Scanner(threading.Thread): def __init__(self, host, port): threading.Thread.__init__(self) ...
mit
749,350,839,647,121,400
26.523438
74
0.518024
false
3.884234
false
false
false
bacaldwell/ironic
ironic/tests/unit/common/test_image_service.py
1
16700
# 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 # d...
apache-2.0
4,742,086,651,356,532,000
47.688047
78
0.627365
false
3.671137
true
false
false
CommonsCloud/Core-API
CommonsCloudAPI/models/user.py
1
8946
""" For CommonsCloud copyright information please see the LICENSE document (the "License") included with this software package. This file may not be used in any manner except in compliance with the License Unless required by applicable law or agreed to in writing, software distributed under the License is distributed ...
agpl-3.0
2,422,971,609,378,438,700
28.331148
145
0.705455
false
3.927129
false
false
false
mjschultz/redlock
tests/test_lock.py
1
1801
from redlock import RedLock import time def test_default_connection_details_value(): """ Test that RedLock instance could be created with default value of `connection_details` argument. """ lock = RedLock("test_simple_lock") def test_simple_lock(): """ Test a RedLock can be acquired. ...
mit
3,412,506,755,901,172,000
26.707692
84
0.62965
false
3.573413
true
false
false
chme/plugin.audio.mpdclient2
mpdclient/Navigation.py
1
19566
# # Copyright (c) chme # # This file is part of the mpdclient kodi plugin # # This plugin 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 ...
gpl-3.0
-9,181,020,625,052,426,000
39.342268
163
0.525759
false
3.828214
false
false
false
Psycojoker/hackeragenda
hackeragenda/settings.py
1
5897
# Django settings for hackeragenda project. import os from collections import OrderedDict PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0]) SUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0] BASE_DIR = PROJECT_PATH # to avoid stupid warning from django 1.6 DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ...
gpl-3.0
-9,104,221,644,388,092,000
21.76834
72
0.575886
false
3.381307
false
false
false
lizardsystem/lizard-map
lizard_map/daterange.py
1
2259
"""Handle the date range setting and remembering """ import datetime import logging from django.conf import settings import pytz # NOTE: this module is obsolete as date ranges are entirely handled in # javascript and should be passed as request parameter logger = logging.getLogger(__name__) # Session data postfix...
lgpl-3.0
-1,085,294,113,683,170,700
29.527027
78
0.698539
false
3.815878
false
false
false
ajaygarg84/sugar
src/jarabe/frame/activitiestray.py
1
30803
# Copyright (C) 2006-2007 Red Hat, Inc. # Copyright (C) 2008 One Laptop Per Child # Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/> # # 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 Foundati...
gpl-2.0
-8,059,462,500,647,446,000
36.610501
79
0.610103
false
3.875079
false
false
false
0xbc/pyvex
setup.py
1
5029
# pylint: disable=no-name-in-module,import-error import os import urllib2 import subprocess import sys import shutil import glob import tarfile import multiprocessing import platform try: from setuptools import setup from setuptools import find_packages packages = find_packages() except ImportError: fr...
bsd-2-clause
5,826,168,124,604,355,000
32.751678
140
0.616624
false
3.302035
false
false
false
eonpatapon/contrail-controller
src/config/fabric-ansible/job_manager/job_messages.py
1
9479
class MsgBundle(object): JOB_TEMPLATE_MISSING = 1, JOB_EXECUTION_ID_MISSING = 2, JOB_SUMMARY_MESSAGE_HDR = 3, JOB_RESULT_STATUS_NONE = 4, JOB_MULTI_DEVICE_FAILED_MESSAGE_HDR = 5, JOB_SINGLE_DEVICE_FAILED_MESSAGE_HDR = 6, PLAYBOOK_RESULTS_MESSAGE = 7, PLAYBOOK_EXIT_WITH_ERROR = 8, PL...
apache-2.0
-8,469,327,516,854,512,000
51.661111
78
0.450364
false
4.648847
false
false
false
vitchyr/rlkit
rlkit/torch/sac/sac.py
1
8191
from collections import OrderedDict, namedtuple from typing import Tuple import numpy as np import torch import torch.optim as optim from rlkit.core.loss import LossFunction, LossStatistics from torch import nn as nn import rlkit.torch.pytorch_util as ptu from rlkit.core.eval_util import create_stats_ordered_dict fro...
mit
-7,586,187,944,391,447,000
30.026515
99
0.553534
false
3.718112
false
false
false
medularis/py-star
py_star/astemu.py
1
4712
from __future__ import absolute_import, print_function, unicode_literals from os import fork, kill, waitpid from signal import SIGTERM import socket from time import sleep from . import compat_six as six class Event(dict): """ Events are encoded as dicts with a header fieldname to content-list map. Norm...
bsd-3-clause
8,920,116,669,416,906,000
32.41844
73
0.493633
false
4.436911
false
false
false
cherokee/pyscgi
CTK/ProgressBar.py
1
1975
# CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010-2011 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Software Foundation....
bsd-3-clause
-5,721,624,957,532,368,000
28.924242
90
0.620759
false
3.440767
false
false
false
jabaier/iic1103.20152.s5
strings_listas_ej0.py
1
1320
# defina una función que dado una lista de numeros # retorne la suma de ellos def sumalista(l): # calcula l[0] + l[1] + l[2] + ... + l[??] # el largo de la lista l se obtiene con len(l) suma = 0 i = 0 while i < len(l): suma = suma + l[i] i = i + 1 return suma def sumalista_cool(l): ...
unlicense
-7,947,223,740,876,585,000
19.292308
62
0.541319
false
2.730849
false
false
false
jalavik/plotextractor
plotextractor/converter.py
1
7853
# -*- coding: utf-8 -*- # # This file is part of plotextractor. # Copyright (C) 2010, 2011, 2015 CERN. # # plotextractor 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 (a...
gpl-2.0
7,425,665,071,529,268,000
36.754808
84
0.605246
false
3.847624
false
false
false
jminuscula/dixit-online
server/src/dixit/api/game/views/player.py
1
2333
from django.db import IntegrityError from django.shortcuts import get_object_or_404 from rest_framework.permissions import IsAuthenticated from rest_framework.exceptions import NotFound from rest_framework.response import Response from rest_framework import generics, status from dixit.game.models import Player from ...
mit
-6,770,100,734,929,883,000
32.811594
100
0.675954
false
4.352612
false
false
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/backends/database/session.py
1
1896
# -*- coding: utf-8 -*- """SQLAlchemy session.""" from __future__ import absolute_import, unicode_literals from kombu.utils.compat import register_after_fork from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.pool import ...
apache-2.0
277,522,112,381,838,560
30.6
78
0.634494
false
4.034043
false
false
false
tensorflow/compression
tensorflow_compression/python/util/packed_tensors.py
1
3070
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-766,657,654,993,320,700
30.979167
80
0.657003
false
4.066225
false
false
false
wzin/interactivespaces-python-api
tests/test_master.py
1
13234
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from mock import MagicMock import json import urllib import urllib2 import sys import os sys.path.append(os.getcwd()) import interactivespaces TEST_ACTIVITY_DATA = { "id":"53", "bundleContentHash":"hjkl", ...
apache-2.0
-5,224,145,098,743,237,000
36.174157
102
0.504458
false
4.481544
true
false
false
yollamttam/WordPrediction
EntropyBenchmarkUnigram.py
1
1302
import nltk import glob import pickle import numpy as np from fann2 import libfann ### Unigram perplexity # obvious alpha = 0.5 nExamples = 0 fileToEntropy = {} # load pickle wordsInOrder = pickle.load( open( "wordsInOrder.p", "rb" ) ) wordProb = pickle.load( open( "wordProbability.p", "rb" ) ) # load neural netwo...
apache-2.0
2,327,401,023,340,730,000
21.448276
62
0.659754
false
3.296203
false
false
false
sfjuocekr/PokeIV
setup.py
1
1764
#!/usr/bin/env python #-- Setup file for py2exe from distutils.core import setup import py2exe import sys, os import Cryptodome import requests #find POGOProtos sys.path.append("pgoapi\protos") mydata = list() path = Cryptodome.__path__[0] root_end = path.find('Cryptodome') for folder,folder_name,files in os.walk(p...
mit
1,747,010,191,501,326,800
29.413793
78
0.560091
false
3.458824
false
false
false
Matla/Python_Logging
logging/logging.py
1
6683
__author__ = "Mats Larsen" __copyright__ = "Mats Larsen2014" __credits__ = ["Morten Lind"] __license__ = "GPL" __maintainer__ = "Mats Larsen" __email__ = "matsla@{ntnu.no}" __status__ = "Development" #-------------------------------------------------------------------- #File: logging.py #Module Description """ This mod...
gpl-3.0
-5,752,381,826,589,844,000
38.081871
102
0.540326
false
4.050303
false
false
false
emedvedev/st2
st2actions/st2actions/runners/windows_command_runner.py
1
4081
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
apache-2.0
-9,076,009,354,234,646,000
38.621359
92
0.627542
false
4.416667
false
false
false
adityahase/frappe
frappe/core/doctype/navbar_settings/navbar_settings.py
1
1160
# -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ class NavbarSettings(Document): def validate(self): self.validat...
mit
5,117,916,987,784,409,000
28
89
0.735345
false
3.267606
false
false
false
Julian/home-assistant
homeassistant/components/notify/pushbullet.py
1
4409
""" PushBullet platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.pushbullet/ """ import logging from homeassistant.components.notify import ( ATTR_TARGET, ATTR_TITLE, BaseNotificationService) from homeassistant.con...
mit
-4,096,327,190,134,021,000
33.992063
78
0.604445
false
4.517418
false
false
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/django/contrib/gis/db/models/functions.py
1
16962
from decimal import Decimal from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField from django.contrib.gis.db.models.sql import AreaField, DistanceField from django.contrib.gis.geos import GEOSGeometry from django.core.exceptions import FieldError from django.db.models import ( BooleanFiel...
apache-2.0
7,931,150,428,917,694,000
35.24359
117
0.635538
false
4.020384
false
false
false
himaaaatti/qtile
libqtile/widget/backlight.py
1
3044
# Copyright (c) 2012 Tim Neumann # Copyright (c) 2012, 2014 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 Sean Vig # # 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 wit...
mit
7,803,237,369,298,870,000
32.822222
79
0.638962
false
4.130258
false
false
false
raphaelrubino/nid
nn/mono/run.py
1
1143
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import import numpy as np np.random.seed( 1337 ) import data_utils from nid import Neural_information_density import sys if __name__ == '__main__': if len( sys.argv ) != 9: print( "\nUsage: ", sys.argv[ 0 ], "<context> <target> <voc...
mit
8,807,348,404,547,177,000
26.878049
138
0.677165
false
3.05615
false
true
false
komuW/sewer
sewer/catalog.py
1
2472
import codecs, importlib, json, os from typing import Dict, List, Sequence from .auth import ProviderBase class ProviderDescriptor: def __init__( self, *, name: str, desc: str, chals: Sequence[str], args: Sequence[Dict[str, str]], deps: Sequence[str], ...
mit
-5,405,137,072,739,433,000
30.692308
91
0.59021
false
4.059113
false
false
false
wienerschnitzel/schnitzelserver
schnitzelserver/session/session.py
1
4940
import logging import enum from sqlalchemy import or_ from sqlalchemy import inspect from schnitzelserver.moduleindex import ModuleIndex from schnitzelserver.session.grant_access import SessionGrant from schnitzelserver.pool import ModelPool, ViewPool logger = logging.getLogger(__name__) class AccessTypes(enum.Enum...
lgpl-3.0
7,753,447,680,131,350,000
38.846774
114
0.591498
false
3.917526
false
false
false
cprakashagr/PythonClass
src/maths/Haversine.py
1
1450
from math import radians, cos, sin, asin, sqrt import time current_milli_time = lambda: int(round(time.time() * 1000)) def haversine(point1, point2, miles = False): AVG_EARTH_RADIUS = 6371 lat1, lng1 = point1 lat2, lng2 = point2 # convert all latitudes/longitudes from decimal degrees to radians ...
mit
-8,202,962,493,890,972,000
22.015873
73
0.570345
false
2.832031
false
false
false
dedupeio/dedupe-examples
pgsql_big_dedupe_example/pgsql_big_dedupe_example_init_db.py
1
10090
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a setup script for mysql_example. It downloads a zip file of Illinois campaign contributions and loads them in t aMySQL database named 'contributions'. __Note:__ You will need to run this script first before execuing [mysql_example.py](http://datamade.github.c...
mit
-596,923,599,316,805,100
39.522088
87
0.615461
false
3.434309
false
false
false
xncbf/authome
log/views.py
1
3426
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.contrib.staticfiles.templatetags.staticfiles import static from django.urls import reverse from django.db import connection from django.shortcuts import render, HttpResponse from django.utils import timezon...
mit
8,670,323,591,795,827,000
43.763158
118
0.496179
false
4.241895
false
false
false
LabD/wagtail-personalisation
tests/factories/rule.py
1
1032
from __future__ import absolute_import, unicode_literals import datetime import factory from wagtail_personalisation import rules class DayRuleFactory(factory.DjangoModelFactory): class Meta: model = rules.DayRule class DeviceRuleFactory(factory.DjangoModelFactory): class Meta: model = ...
mit
6,287,791,869,828,322,000
18.471698
59
0.719961
false
4
false
false
false
jfrfonseca/IndexadorDidaticoPython
fileIO.py
1
11925
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' José F. R. Fonseca See Attached License file Controls the access to the disk. Defines the class DIskAccessControl, an object to control the disk files. Multithread-writes the files ''' import ast import os import time from linecache import getline from threading impor...
gpl-2.0
-3,419,447,673,354,494,500
49.312236
126
0.617243
false
4.301587
false
false
false
uberVU/elasticboard
data_processor/api.py
1
7727
from functools import partial, wraps import datetime import queries from utils import crossdomain from flask import Flask, jsonify, request from werkzeug.contrib.cache import MemcachedCache cache = MemcachedCache(['127.0.0.1:11211']) CACHE_TIMEOUT = 5 * 60 app = Flask(__name__) # app.debug = True CHART_INTERVALS = 6...
mit
-6,479,771,487,385,263,000
31.330544
116
0.671541
false
3.319158
false
false
false
elhe/bread_diary_web
application/views.py
1
1189
from application import application, utils from application.urls import DIARY_ADD_URL, DIARY_ALL_URL from dateutil.parser import parser from flask import render_template, request, url_for from werkzeug.utils import redirect __author__ = 'elhe' @application.route('/', methods=['GET', ]) def index(): response = ...
gpl-2.0
5,933,237,861,314,215,000
35.030303
71
0.637511
false
3.658462
false
false
false