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
pansapiens/mytardis
tardis/apps/mx_views/views.py
3
2892
from django.conf import settings from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.http import HttpResponse from tardis.tardis_portal.auth import decorators as authz from tardis.tardis_portal.models import Dataset from tardis.tardis_portal.shortcuts import get_experiment_referer from tard...
bsd-3-clause
-8,726,488,663,588,781,000
37.052632
79
0.65491
false
4.011096
false
false
false
jvs/sourcer
tests/test_salesforce.py
1
5119
from sourcer import Grammar # This is work in progress. # See: https://help.salesforce.com/articleView?id=customize_functions.htm&type=5 g = Grammar(r''' ``` import ast ``` start = Expression Expression = OperatorPrecedence( Atom | "(" >> Expression << ")", Postfix(ArgumentList |...
mit
-7,452,110,781,552,088,000
27.126374
83
0.540535
false
3.374423
false
false
false
lsaffre/timtools
timtools/sdoc/feeders.py
1
1705
## Copyright 2003-2009 Luc Saffre ## This file is part of the TimTools project. ## TimTools 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 v...
bsd-2-clause
5,341,080,861,915,417,000
27.416667
71
0.63871
false
3.204887
false
false
false
souravbadami/zulip
zerver/views/home.py
1
17065
from __future__ import absolute_import from typing import Any, List, Dict, Optional, Text from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse, HttpRequest from django.shortcuts import redirect from django.utils import translation from...
apache-2.0
-2,616,524,014,721,912,000
44.75067
113
0.642309
false
4.053444
true
false
false
ZeitOnline/zeit.newsletter
src/zeit/newsletter/browser/edit.py
1
2579
from zeit.cms.i18n import MessageFactory as _ from zope.cachedescriptors.property import Lazy as cachedproperty import os.path import zeit.cms.browser.view import zeit.cms.content.interfaces import zeit.cms.interfaces import zeit.content.image.interfaces import zeit.content.video.interfaces import zeit.edit.browser.for...
bsd-3-clause
-2,014,002,219,757,949,200
27.032609
79
0.67119
false
3.781525
false
false
false
vadyur/script.media.aggregator
anidub.py
1
12586
# coding: utf-8 import log from log import debug from settings import Settings from base import * import feedparser, urllib2, re from bs4 import BeautifulSoup from nfowriter import * from strmwriter import * import requests, filesystem ################################################################################...
gpl-3.0
2,000,693,373,387,839,200
26.610619
118
0.567228
false
3.073892
false
false
false
robdobsn/AmazonEchoShopping
WaitroseService/WaitroseScraper.py
1
20691
# Waitrose web scraper __author__ = 'robdobsn' from selenium import webdriver from selenium.webdriver.common.keys import Keys import selenium.webdriver.support.ui as webdriverui from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By from selenium.common.exceptions import...
isc
-783,531,863,977,082,500
46.895833
169
0.581654
false
4.352335
false
false
false
kidscancode/gamedev
pygame template.py
1
1508
# Pygame Template # Use this to start a new Pygame project # KidsCanCode 2015 import pygame import random # define some colors (R, G, B) WHITE = (255, 255, 255) GREEN = (0, 255, 0) BLUE = (0, 0, 255) BLACK = (0, 0, 0) FUCHSIA = (255, 0, 255) GRAY = (128, 128, 128) LIME = (0, 128, 0) MAROON = (128, 0, 0) NAVYBLU...
mit
3,454,655,415,024,161,000
22.936508
55
0.63992
false
2.998012
false
false
false
hhucn/git-vote
git-vote/__main__.py
1
3022
import argparse import collections import re import subprocess NOTES_REF = 'refs/notes/votes' Vote = collections.namedtuple('Vote', ['commit', 'user']) def vote(args): assert args.user, 'TODO: determine user automatically' vote = 'vote:%s' % args.user subprocess.check_call([ 'git', 'notes', '--ref', NOTES_R...
apache-2.0
2,600,720,082,252,724,000
28.627451
106
0.676704
false
2.869896
false
false
false
kerimlcr/ab2017-dpyo
ornek/lollypop/lollypop-0.9.229/src/web.py
1
7411
# Copyright (c) 2014-2016 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # 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 vers...
gpl-3.0
2,696,436,820,573,915,000
36.619289
79
0.54716
false
4.005946
false
false
false
pybel/pybel
src/pybel/io/nodelink.py
1
7238
# -*- coding: utf-8 -*- """Conversion functions for BEL graphs with node-link JSON.""" import gzip import json from io import BytesIO from itertools import chain, count from operator import methodcaller from typing import Any, Mapping, TextIO, Union from networkx.utils import open_file from .utils import ensure_ver...
mit
2,647,336,991,651,230,700
31.168889
115
0.635811
false
3.235583
false
false
false
Mozu/mozu-python-sdk
mozurestsdk/platform/tenantextensions.py
1
2242
""" This code was generated by Codezu. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from mozurestsdk.mozuclient import default as default_client from mozurestsdk.mozuurl import MozuUrl; from mozurestsdk.urllocation import UrlLocation from mozure...
apache-2.0
-7,380,671,656,172,497,000
32.181818
266
0.727029
false
3.872193
false
false
false
nigelb/SerialGrabber
examples/MQTT/SerialGrabber_Settings.py
1
2043
#!/usr/bin/env python # SerialGrabber reads data from a serial port and processes it with the # configured processor. # Copyright (C) 2012 NigelB # # 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 Foundatio...
gpl-2.0
1,560,382,958,900,706,000
33.05
75
0.751836
false
3.87666
false
false
false
logicabrity/aeon
test/test_measurement.py
1
1229
import time import pytest from aeon.measurement import Measurement from aeon.errors import InvalidMeasurementState def test_cant_start_measurement_twice(): m = Measurement("name", "group") m.start() with pytest.raises(InvalidMeasurementState): m.start() def test_cant_stop_measurement_before_star...
mit
-1,662,716,423,659,156,000
21.345455
58
0.656631
false
3.385675
true
false
false
maas/maas
src/maasserver/middleware.py
1
18463
# Copyright 2012-2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Access middleware.""" import http.client import json import logging from pprint import pformat import sys import traceback import attr from crochet import TimeoutError f...
agpl-3.0
-8,170,894,622,841,870,000
34.505769
96
0.611222
false
4.598506
true
false
false
ivanamihalek/tcga
icgc/60_nextgen_production/65_reactome_tree.py
1
5057
#! /usr/bin/python3 # # This source code is part of icgc, an ICGC processing pipeline. # # Icgc 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
-438,034,926,294,668,700
35.121429
120
0.677477
false
3.053744
false
false
false
soccermetrics/marcotti-mls
marcottimls/models/financial.py
1
5658
from sqlalchemy import Column, Integer, String, Sequence, ForeignKey, ForeignKeyConstraint, Boolean from sqlalchemy.orm import relationship, backref from sqlalchemy.schema import CheckConstraint import enums from common import BaseSchema class AcquisitionPaths(BaseSchema): """ MLS player acquisition data mod...
mit
-645,660,621,350,676,700
42.19084
114
0.59597
false
3.792225
false
false
false
koepferl/FluxCompensator
fluxcompensator/cube.py
1
25142
from copy import deepcopy import os ROOT = os.path.dirname(os.path.abspath(__file__)) + '/' from astropy import log as logger from astropy.io import fits import numpy as np from numpy.random import normal from .psf import GaussianPSF, FilePSF, FunctionPSF from .filter import Filter from .utils.plot import MakePlots ...
bsd-2-clause
-1,980,972,553,126,057,000
31.483204
180
0.532655
false
3.870978
false
false
false
manimaul/MX-Cart
buildLin.py
1
4497
import os, hashlib from shutil import copy2 as copy from Resources import versionNum from subprocess import Popen from shutil import rmtree def md5sum(fd, block_size=2**20): md5 = hashlib.md5() while True: data = fd.read(block_size) if not data: break md5.update(data) re...
bsd-2-clause
551,775,681,851,644,600
38.104348
133
0.632866
false
2.78452
false
false
false
jumoconnect/openjumo
jumodjango/cust_admin/templatetags/ext_admin_list.py
1
5314
import datetime from django.conf import settings from django.contrib.admin.util import lookup_field, display_for_field, label_for_field from django.contrib.admin.views.main import ALL_VAR, EMPTY_CHANGELIST_VALUE from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR from django.cor...
mit
-7,825,369,702,562,516,000
42.917355
153
0.605947
false
3.968633
false
false
false
vhernandez/jwsProcessor
src/jwsprocessor/fc_calculator.py
1
7488
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ To convert from mdeg to molar elipticity (deg*cm2*dmol-1): m.e. = mdeg / (10*l*(C/MW)*Rn) where l = light path in cm C = concentration in mg/ml MW = molecular weight Rn = number of residue of the protein """ import pygtk pygtk.require("2.0") import gtk import gobject...
gpl-2.0
4,273,316,415,626,022,400
38.619048
89
0.581197
false
3.018138
false
false
false
cropleyb/pentai
pentai/db/ai_factory.py
1
2712
#!/usr/bin/env python import pentai.ai.ai_player as aip_m from pentai.ai.priority_filter import * from pentai.ai.priority_filter_2 import * import pentai.db.openings_book as ob_m import pentai.db.games_mgr from pentai.ai.ai_genome import * class AIFactory: # TODO: These are just functions def create_player(sel...
mit
-9,205,106,758,263,038,000
27.547368
88
0.581121
false
3.454777
false
false
false
atbentley/plank
setup.py
1
1311
import os import re from setuptools import setup as setup def read(path): global os with open(os.path.join(os.path.dirname(__file__), path), 'r') as f: data = f.read() return data.strip() def get_version(): global os, re, read _version_re = re.compile(r'\s*__version__\s*=\s*\'(.*)\'\s*')...
mit
8,118,092,918,294,471,000
28.133333
78
0.633105
false
3.459103
false
false
false
d33tah/macd
macd/views.py
1
3323
import datetime import subprocess from macd.models import SeenEvent, Device from django.shortcuts import render from django.utils import timezone def index(request): now = timezone.now() time_threshold = now - datetime.timedelta(minutes=10) items = SeenEvent.objects.filter(date__gte=time_threshold) de...
gpl-3.0
-2,758,185,787,429,000,700
37.195402
81
0.547397
false
3.784738
false
false
false
Esri/raster-functions
functions/BlockStatistics.py
1
4494
import numpy as np from skimage.transform import resize from skimage.util import view_as_blocks class BlockStatistics(): def __init__(self): self.name = "Block Statistics Function" self.description = ("Generates a downsampled output raster by computing a statistical " ...
apache-2.0
-8,694,753,335,761,033,000
37.078261
110
0.491322
false
4.467197
false
false
false
arbor-jjones/idataco
idataco/widgets/calls.py
1
19598
#!/usr/bin/python ######################################################################## # Copyright (c) 2015-2016 # Jason Jones <jason<at>jasonjon<dot>es> # All rights reserved. ######################################################################## # # This file is part of IDA TACO # # IDATACO is free software: ...
gpl-3.0
-1,733,163,824,245,982,000
47.630273
130
0.566027
false
3.746511
false
false
false
ardi69/pyload-0.4.10
pyload/plugin/account/Keep2ShareCc.py
1
2271
# -*- coding: utf-8 -*- import re import time from pyload.plugin.Account import Account class Keep2ShareCc(Account): __name = "Keep2ShareCc" __type = "account" __version = "0.05" __description = """Keep2Share.cc account plugin""" __license = "GPLv3" __authors = [("aeronaut", "...
gpl-3.0
-3,576,954,663,591,912,000
30.109589
101
0.506385
false
3.84264
false
false
false
Earthnuker/Universe
date_time.py
1
2439
from datetime import datetime import datetime as DT import time import calendar class Clock(object): def __init__(self,offset=None): self.timezone=None if offset is not None: self.timezone=DT.timezone(DT.timedelta(hours=offset)) def to_str(self,timestamp=None,with_orig=False): ...
mit
9,209,623,380,115,924,000
35.969697
99
0.522345
false
3.425562
false
false
false
jiaphuan/models
research/lfads/lfads.py
1
87185
# Copyright 2017 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 by applicable law or a...
apache-2.0
7,097,405,529,075,089,000
42.418825
89
0.59828
false
3.372466
false
false
false
ali-abdullah/nlp
lda.py
1
1146
import gensim import logging import os.path class LineCorpus(gensim.corpora.textcorpus.TextCorpus): # Creates the corpus object that reads the document line by line def get_texts(self): with open(self.input) as f: for l in f: yield l.split() logging.basicConfig(format='%(asc...
mit
-7,397,097,240,201,630,000
32.705882
105
0.691972
false
3.039788
false
false
false
lsaffre/djangosite
djangosite/management/commands/run.py
1
1763
# -*- coding: UTF-8 -*- # Copyright 2012-2013 by Luc Saffre. # License: BSD, see LICENSE for more details. """ .. management_command:: run Execute a standalone Python script after having set up the Django environment. Also modify `sys.args`, `__file__` and `__name__` so that the invoked script sees them as if it ha...
bsd-2-clause
-2,832,075,735,557,221,000
31.62963
110
0.674801
false
3.655602
false
false
false
openwisp/netjsonconfig
tests/openwisp/test_backend.py
1
8872
import tarfile import unittest from copy import deepcopy from hashlib import md5 from time import sleep from netjsonconfig import OpenWisp from netjsonconfig.exceptions import ValidationError from netjsonconfig.utils import _TabsMixin class TestBackend(unittest.TestCase, _TabsMixin): """ tests for OpenWisp b...
gpl-3.0
-8,514,143,548,844,402,000
36.277311
173
0.51454
false
3.882713
true
false
false
andyzsf/django
tests/admin_views/tests.py
1
240212
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import re import datetime import unittest from django.conf import settings, global_settings from django.core import mail from django.core.checks import Error from django.core.files import temp as tempfile from django.core.exceptions import Impr...
bsd-3-clause
3,763,679,827,564,121,000
44.677763
251
0.628556
false
3.812342
true
false
false
tpainter/df_everywhere
df_everywhere/util/wamp_local.py
1
5054
# DF Everywhere # Copyright (C) 2014 Travis Painter # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is...
gpl-2.0
6,578,624,898,795,414,000
41.125
118
0.691334
false
4.413974
true
false
false
chouseknecht/galaxy
update-authors.py
1
1234
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import logging logger = logging.getLogger(__name__) import subprocess from collections import defaultdict user_scores = defaultdict(int) git_log = subprocess.check_output("git log --shortstat --n...
apache-2.0
1,582,264,523,541,947,400
32.351351
89
0.635332
false
3.566474
false
false
false
davidfauth/neo4j-pubnub
server/stocktickerneo.py
1
8629
import sys import threading from Queue import Queue import time import datetime import random import json import py2neo from py2neo import Graph, Path NEO_PROTOCOL = 'http' NEO_HOST = 'localhost' NEO_PORT = 7474 NEO_USER = 'neo4j' NEO_PASSWORD = 'password' from Pubnub import Pubnub ''' Global Data - Queue ''' glo...
mit
-6,604,526,154,781,309,000
24.758209
113
0.676208
false
3.156181
false
false
false
theodoregoetz/clas12-dc-wiremap
scratch/dcwiremap.py
1
1201
import time import numpy as np from numpy import random as rand from matplotlib import pyplot, gridspec, animation data = rand.uniform(0,100,(36,6,112)) fig = pyplot.figure(1, (18,8)) axs = [] pts = [] sector_grid = gridspec.GridSpec(2,3,wspace=0.3,hspace=0.3) for sec in range(6): slyr_grid = gridspec.GridSpecFr...
gpl-3.0
-583,575,538,828,056,300
25.688889
72
0.582015
false
2.832547
false
false
false
drnextgis/QGIS
python/plugins/processing/algs/gdal/warp.py
1
9529
# -*- coding: utf-8 -*- """ *************************************************************************** self.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************************...
gpl-2.0
8,993,122,762,215,593,000
44.8125
138
0.559975
false
4.259723
false
false
false
AntoinePrv/hyperNN
problem/runnee.py
1
2008
import sys import os dir = "/".join(sys.argv[0].split("/")[:-2]) if dir != "": os.chdir(dir) sys.path.append(".") import argparse from load_data import load_data_bis from train_MINST import train_model from logger import custom_logger def run(**kwargs): data = load_data_bis() acc, _ = train_model(data, *...
mit
-6,205,068,182,693,240,000
34.22807
79
0.590637
false
3.618018
false
false
false
Lrcezimbra/google-python-exercises
logpuzzle/logpuzzle.py
1
2212
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import os import re import sys from urllib.request import urlretrieve from pathlib import Pat...
apache-2.0
3,068,062,891,926,408,000
27
192
0.639241
false
3.33635
false
false
false
DigitalCampus/django-oppia
api/resources/category.py
1
4631
import json from django.conf.urls import url from django.db.models import Q from django.http import HttpResponse, Http404 from tastypie import fields from tastypie.authentication import ApiKeyAuthentication from tastypie.authorization import ReadOnlyAuthorization from tastypie.resources import ModelResource from tasty...
gpl-3.0
2,553,082,281,161,417,700
36.346774
79
0.521054
false
4.549116
false
false
false
evazyin/Capstoneproject
seedwords.py
1
2459
'''version1 seed words algorithm''' '''------------ input: a IR corpus, a expanding corpus(the candidate wordlist), a seed wordlist output: a expanded seed wordlist --------------''' import math file = open('D:/uw course/capstone/mypersonality/IRtest2.txt')#IR corpus file1 = open('D:/uw course/capstone/mypersonality/E...
agpl-3.0
-5,441,539,671,506,725,000
29.7375
86
0.611631
false
3.066085
false
false
false
bintlabs/python-sync-db
dbsync/server/conflicts.py
1
2225
""" .. module:: server.conflicts :synopsis: Conflict detection for the centralized push operation. """ from sqlalchemy.schema import UniqueConstraint from dbsync.lang import * from dbsync.utils import get_pk, class_mapper, query_model, column_properties def find_unique_conflicts(push_message, session): """ ...
mit
-572,390,988,439,292,000
38.035088
80
0.586067
false
4.616183
false
false
false
embedly/embedly-python
embedly/client.py
1
4750
""" Client ====== The embedly object that interacts with the service """ from __future__ import absolute_import, unicode_literals import re import httplib2 import json from urllib import quote, urlencode from .models import Url def get_user_agent(): from . import __version__ return 'Mozilla/5.0 (compatible;...
mit
-4,047,278,784,260,133,000
26.616279
80
0.533053
false
3.964942
false
false
false
lilchurro/vent
vent/menus/ntap.py
1
9189
import ast import npyscreen from vent.api.actions import Action class CreateNTap(npyscreen.ActionForm): """ For creating a new network tap container """ def create(self): self.add_handlers({"^T": self.quit, "^Q": self.quit}) self.add(npyscreen.Textfield, value='Create a netw...
apache-2.0
-5,499,286,685,946,207,000
34.342308
79
0.536293
false
4.073138
false
false
false
janusnic/21v-python
unit_17/1.py
1
1114
#!/usr/bin/python # -*- coding: utf-8 -*- import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): self.text = u'\u041b\u0435\u0432 \u041d\u0438\u043a\u043e...
mit
-4,442,118,358,656,477,000
23.23913
78
0.568223
false
2.94709
false
false
false
wiki2014/Learning-Summary
alps/cts/apps/CameraITS/tests/inprog/test_rawstats.py
2
1620
# Copyright 2015 The Android Open Source Project # # 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...
gpl-3.0
-7,820,512,805,679,995,000
32.75
82
0.612963
false
3.56044
false
false
false
gnomex/analysis
src/arpspoof.py
1
5528
#!/usr/bin/python # src from https://github.com/rusec/scapy-arpspoof-demo from scapy.all import * from argparse import ArgumentParser import os IP_FORWARD = '/proc/sys/net/ipv4/ip_forward' TIMEOUT = 2 RETRY = 10 # This function uses argparse to parse command line # arguments passed to the script. def set_configs()...
gpl-3.0
-362,603,220,197,692,000
23.034783
107
0.611433
false
3.58961
true
false
false
js850/PyGMIN
pygmin/gui/double_ended_connect_runner.py
1
10710
""" tools to run the double ended connect in a separte process and make sure the the minima and transition states found are incorporated back into the master database """ import multiprocessing as mp import sys import signal import logging import numpy as np from PyQt4 import QtCore, QtGui from pygmin.utils.events...
gpl-3.0
-897,367,410,067,978,000
33.111465
103
0.585528
false
3.978455
false
false
false
Yelp/pyramid_zipkin
pyramid_zipkin/tween.py
1
8038
# -*- coding: utf-8 -*- import functools import warnings from collections import namedtuple from py_zipkin import Encoding from py_zipkin import Kind from py_zipkin.exception import ZipkinError from py_zipkin.storage import get_default_tracer from py_zipkin.transport import BaseTransportHandler from pyramid_zipkin.re...
apache-2.0
5,364,765,440,840,491,000
38.596059
82
0.673177
false
3.999005
false
false
false
alejob/mdanalysis
package/MDAnalysis/auxiliary/XVG.py
1
11423
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- http://www.mdanalysis.org # Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under th...
gpl-2.0
-4,506,006,415,492,942,300
30.46832
82
0.565263
false
4.164419
false
false
false
Cobaltians-Fonts/fontToCobalt
parsers/css.py
1
1486
# # Created by Roxane P. on 15/01/2016 # Parse fonts styles.css from fontastic or icomoon # import tinycss names = [] glyphs = [] prefix = '' fontName = '' def parseCSS(file): parser = tinycss.make_parser('page3') stylesheet = parser.parse_stylesheet_file(file); global prefix global fontName firs...
mit
1,897,860,228,959,300,000
30.617021
96
0.541723
false
3.900262
false
false
false
rosedu/I.GameBot
snake_maze/game_bots/random_bot_02_python/snakemaze_play_turn.py
1
1318
import random from copy import deepcopy DIRECTIONS = ['right', 'left', 'up', 'down'] def locate_free_square(width, height, obstacles): square = {'x': 0, 'y': 0} while square in obstacles: square['x'] = random.choice( range(0,width) ) square['y'] = random.choice( range(0,height) ) retur...
agpl-3.0
-324,057,517,764,576,450
22.963636
74
0.54173
false
3.681564
false
false
false
opevolution/pycrackcaptcha
pycrackcaptcha/data.py
1
1273
# -*- coding: utf-8 -*- # vim: set expandtab tabstop=4 shiftwidth=4: ############################################################### # # # Alexandre Defendi - 01/04/2014 # # ...
bsd-3-clause
-5,452,015,869,434,828,000
37.484848
63
0.289204
false
5.158537
false
false
false
mariusbaumann/pyload
module/plugins/hoster/ZeveraCom.py
1
1124
# -*- coding: utf-8 -*- from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" __type__ = "hoster" __version__ = "0.25" __pattern__ = r'http://(?:www\.)?zevera\.com/.+' __description__ = """Zevera.com hoster plugin"...
gpl-3.0
-2,630,775,124,068,375,600
30.222222
121
0.617438
false
3.406061
false
false
false
joemicro/Manufacturing
findform.py
1
31523
import os import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from sqlalchemy import * from sqlalchemy.orm import * from databaseschema import * from genericdelegates import * from functions import * import modelsandviews import ui_forms.ui_findform import receiveform import batchform import productionfor...
mit
5,236,492,352,790,907,000
44.886463
146
0.586207
false
4.046079
false
false
false
sharmaking/PairTradeBTS
multipleStrategy/statisticalArbitrageMultiple.py
1
4640
#!/usr/bin/python # -*- coding: utf-8 -*- #statisticalArbitrageMultiple.py import baseMultiple import numpy, copy, csv class CStatisticalArbitrageMultiple(baseMultiple.CBaseMultiple): #------------------------------ #继承重载函数 #------------------------------ #自定义初始化函数 def customInit(self): self.name = "statistical...
mit
-3,109,636,028,187,212,000
36.371901
97
0.622512
false
2.720818
false
false
false
unsystemizer/counterparty-cli
counterpartycli/console.py
1
3966
import os from prettytable import PrettyTable from counterpartycli import wallet, util # TODO: inelegant def get_view(view_name, args): if view_name == 'balances': return wallet.balances(args.address) elif view_name == 'asset': return wallet.asset(args.asset) elif view_name == 'wallet': ...
mit
-7,392,429,104,027,358,000
32.294118
96
0.585815
false
3.813282
false
false
false
Julian/home-assistant
homeassistant/components/media_player/demo.py
1
11274
""" Demo implementation of the media player. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ from homeassistant.components.media_player import ( MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPO...
mit
8,502,807,707,185,662,000
30.480447
79
0.61189
false
3.924095
false
false
false
harigov/newsalyzer
crawler/YahooMailParser.py
1
1198
import urlparse import os from bs4 import BeautifulSoup import re from article_parser import ArticleParser class YahooMailParser(ArticleParser): def parse(self, url, article_text): ArticleParser.parse(self,url,article_text) def _get_title(self): head = self._soup.find('header', {'class' : 'can...
mit
5,628,196,657,293,056,000
31.378378
82
0.530885
false
4.047297
false
false
false
livoras/feifanote-server
apis/_helpers.py
1
1938
# -*- coding: utf-8 -*- from functools import wraps from flask import session, request from common.utils import message from models.notebook import Notebook from models.page import Page from common import db def require_login(route_fn): """ Decorator for router functions that need user to login first. """ ...
mit
-2,775,173,960,715,875,300
34.907407
70
0.610939
false
3.748549
false
false
false
sarwojowo/KerasProject
resnetcustom.py
1
3281
#python resnetcustom.py --file images/office.png from __future__ import print_function import numpy as np import json import os import time from keras import backend as K from keras.preprocessing import image from keras.applications import ResNet50 from keras.utils.data_utils import get_file CLASS_INDEX = None CLAS...
mit
4,369,614,500,541,529,600
30.548077
79
0.537031
false
3.719955
false
false
false
datascopeanalytics/scrubadub
scrubadub/post_processors/text_replacers/prefix_suffix.py
1
1176
from typing import Optional, Sequence from ...filth import Filth from ..base import PostProcessor class PrefixSuffixReplacer(PostProcessor): name = 'prefix_suffix_replacer' # type: str def __init__(self, prefix: Optional[str] = '{{', suffix: Optional[str] = '}}', name: Optional[str] = None): super(...
mit
-9,170,214,622,333,614,000
36.935484
111
0.64881
false
3.830619
false
false
false
vgrem/SharePointOnline-REST-Python-Client
office365/sharepoint/folder.py
1
2600
from office365.runtime.client_object import ClientObject from office365.runtime.client_query import UpdateEntityQuery, DeleteEntityQuery from office365.runtime.resource_path import ResourcePath from office365.runtime.resource_path_service_operation import ResourcePathServiceOperation from office365.sharepoint.listitem ...
mit
-3,152,273,541,855,555,000
40.269841
128
0.673846
false
4.326123
false
false
false
rth/PyAbel
examples/example_linbasex_hansenlaw.py
1
3092
# -*- coding: utf-8 -*- import numpy as np import abel import matplotlib.pyplot as plt IM = np.loadtxt("data/VMI_art1.txt.bz2") legendre_orders = [0, 2, 4] # Legendre polynomial orders proj_angles = range(0, 180, 10) # projection angles in 10 degree steps radial_step = 1 # pixel grid smoothing = 1 # smoothing 1/e...
mit
-238,230,129,545,215,360
41.944444
77
0.67044
false
2.884328
false
false
false
b1-systems/kiwi
kiwi/utils/size.py
1
1696
# 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
-5,083,597,701,060,993,000
33.612245
80
0.647995
false
3.785714
false
false
false
umitproject/network-admin
netadmin/users/forms.py
1
2410
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Adriano Monteiro Marques # # Author: Amit Pal <amix.pal@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, ei...
agpl-3.0
-4,128,243,789,339,901,000
34.970149
105
0.692116
false
4.036851
false
false
false
lehmannro/pootle
pootle/auth/ldap_backend.py
1
3490
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 Mozilla Corporation, Zuza Software Foundation # # This file is part of Pootle. # # Pootle 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; eith...
gpl-2.0
-7,947,188,402,403,043,000
38.659091
188
0.638968
false
4.044032
false
false
false
westernmagic/NumPDE
series4/2d-rad-cooling/plot_on_mesh.py
1
1202
from numpy import * from pylab import * import matplotlib.tri from math import atan2 vertices = loadtxt("vertices.txt") indices = loadtxt("triangles.txt") uImplicit = loadtxt("u_implicit.txt") energyImplicit = loadtxt("energy_implicit.txt") uExplicitNoCfl = loadtxt("u_explicit_no_cfl.txt") energyExplicitNoCfl = loa...
mit
7,751,457,936,035,289,000
22.568627
75
0.748752
false
2.917476
false
true
false
DiamondLightSource/diffcalc
diffcalc/ub/reflections.py
1
5528
### # Copyright 2008-2011 Diamond Light Source Ltd. # This file is part of Diffcalc. # # Diffcalc 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 late...
gpl-3.0
-8,610,430,123,077,464,000
37.388889
89
0.571274
false
3.532268
false
false
false
redhatrises/classification-banner
classification-banner.py
1
14507
#!/usr/bin/python # Classification Banner # # Last update was 02 July 2018 # # Script: classification-banner.py # Description: Displays a Classification for an Xwindows session # Copyright: Frank Caviggia, 2017 # Author: Frank Caviggia <fcaviggia (at) gmail.com> # Version: 1.6.6 # License: GPLv2 import sys,os,optparse...
gpl-2.0
1,204,417,468,584,060,200
38.52861
136
0.559799
false
3.937839
true
false
false
jelly/calibre
src/calibre/db/cli/cmd_show_metadata.py
2
1416
#!/usr/bin/env python2 # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net> from __future__ import absolute_import, division, print_function, unicode_literals import os import sys from calibre import prints from calibre.ebooks.metadata.opf2 import OPFCreator readonly = Tr...
gpl-3.0
-4,527,065,528,993,158,000
23.842105
82
0.636299
false
3.513648
false
false
false
grimoirelab/sortinghat
sortinghat/parsing/gitdm.py
1
12677
# -*- coding: utf-8 -*- # # Copyright (C) 2014-2021 Bitergia # # 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 ...
gpl-3.0
2,135,665,549,278,258,700
32.623342
124
0.580625
false
3.953837
false
false
false
niphlod/ssis_dash
models/menu.py
1
2114
# -*- coding: utf-8 -*- # Copyright 2017 Niphlod <niphlod@gmail.com> # # This file is part of ssis_dash. # # ssis_dash is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of the License, or...
gpl-3.0
-8,550,410,080,521,734,000
31.030303
76
0.690161
false
2.998582
false
false
false
Heikman/picongpu
src/tools/bin/observer.py
1
1286
#!/usr/bin/env python2.7 # # Copyright 2013 Richard Pausch # # This file is part of PIConGPU. # # PIConGPU 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)...
gpl-3.0
3,014,636,239,808,558,600
25.791667
70
0.664075
false
3.280612
false
false
false
GregorCH/ipet
ipet/parsing/StatisticReader_CustomReader.py
1
6339
""" The MIT License (MIT) Copyright (c) 2018 Zuse Institute Berlin, www.zib.de Permissions are granted as stated in the license file you have obtained with this software. If you find the library useful for your purpose, please refer to README.md for how to cite IPET. @author: Gregor Hendel """ from .StatisticReader ...
mit
-7,036,275,254,161,661,000
31.84456
151
0.581953
false
4.271563
false
false
false
jackfirth/flask-negotiate
setup.py
1
1312
""" flask-negotiate2 =============== Content negotiation utility for Flask apps. Fork of Flask-Negotiate by Matt Wright (github.com/mattupstate) Resources --------- - `Documentation <http://packages.python.org/flask-negotiate2/>`_ - `Issue Tracker <http://github.com/jackfirth/flask-negotiate/issues>`_ - `Code <http...
mit
-3,190,932,591,787,335,000
28.155556
71
0.645579
false
3.813953
false
false
false
NoneGroupTeam/Let-s-Go
webapp/app/views.py
1
18587
from django.contrib.auth import authenticate, logout, login from django.contrib.auth import get_user_model from django.http import HttpResponse from app.models import Label, Place, Guide, Question, Answer from hashlib import md5 import json import re LOGIN_OK_CODE = 200 LOGIN_OK = 'Login success' LOGOUT_OK_CODE = 201...
gpl-3.0
-4,711,005,114,202,626,000
38.63113
111
0.555334
false
3.742098
false
false
false
p-montero/py-ans
class8/ex7.py
1
1695
#!/usr/bin/env python ''' Use processes and Netmiko to connect to each of the devices in the database. Execute 'show version' on each device. Record the amount of time required to do this. DISCLAIMER NOTE: Solution is limited to the exercise's scope ''' from net_system.models import NetworkDevice import django from mu...
apache-2.0
5,557,594,805,842,516,000
35.06383
116
0.676106
false
3.896552
false
false
false
NiloFreitas/Deep-Reinforcement-Learning
tensorblock/recipe/recipe_input.py
1
3410
import tensorflow as tf import tensorblock as tb import numpy as np class recipe_input: ####### Add Input def addInput( self , **args ): pars = { **self.defs_input , **args } pars['name'] = self.add_label( self.inputs , 'Input' , pars['name'] , add_order = True ) pars = s...
mit
-6,245,500,325,249,844,000
36.888889
98
0.482405
false
3.937644
false
false
false
DmitryFillo/berserker_resolver
setup.py
1
1337
import os, sys from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def dep_dnspython(): name = 'dnspython' if sys.version_info[0] == 3: name += '3' return name setup( name='berserker_resolver', version='2.0.1', author='D...
bsd-2-clause
917,970,695,018,627,100
30.833333
74
0.618549
false
3.776836
false
false
false
Adamssss/projectEuler
Problem 001-150 Python/pb103.py
1
1978
import math import time t1 = time.time() # using all the numbers # the sub pairs cover the exact original set def exactsub(oset): l = len(oset) if l == 2: return [[[oset[0]],[oset[1]]]] result = [] f = oset[0] rest = oset[1:] result.append([[f],rest]) for i in exactsub(rest): ...
mit
849,634,466,316,029,700
18.979798
74
0.505561
false
2.875
false
false
false
tangyaohua/dl4mt
session2/lm/deepy/trainers/optimize.py
1
4684
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging as loggers import numpy as np import theano import theano.tensor as T from theano.ifelse import ifelse from ..utils import FLOATX, dim_to_var, EPSILON from .util import wrap_core, multiple_l2_norm from ..conf import TrainerConfig logging = loggers.getLog...
bsd-3-clause
-5,147,573,832,780,105,000
33.696296
123
0.609308
false
3.979609
true
false
false
TeamHG-Memex/hgprofiler
lib/cli/run_server.py
1
1340
import app import cli class RunServerCli(cli.BaseCli): """ A tool for running a development server. """ def _get_args(self, arg_parser): """ Customize arguments. """ arg_parser.add_argument( '--debug', action='store_true', help='Enable debug mode: errors p...
apache-2.0
466,433,427,109,874,750
26.346939
76
0.526866
false
4.28115
false
false
false
TwoBitAlchemist/NeoAlchemy
neoalchemy/cypher/verbs.py
1
4169
from __future__ import unicode_literals import six from ..shared.objects import Property from .operations import CypherExpression, ComparisonExpression, QueryParams class CypherQuery(list): def __init__(self, graph_obj, use_full_pattern=False): self.params = QueryParams() try: verb ...
mit
-7,028,930,501,125,680,000
28.992806
75
0.550971
false
3.824771
false
false
false
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnspolicy_dnspolicylabel_binding.py
1
6004
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
-9,121,447,943,516,050,000
26.167421
134
0.698368
false
3.378728
false
false
false
hexpl0it/plugin.video.genesi-ita
resources/lib/libraries/js2py/prototypes/jsarray.py
1
14657
def to_arr(this): """Returns Python array from Js array""" return [this.get(str(e)) for e in xrange(len(this))] ARR_STACK = set({}) class ArrayPrototype: def toString(): # this function is wrong but I will leave it here fore debugging purposes. func = this.get('join') if not func....
gpl-3.0
2,274,216,971,756,242,200
32.011261
116
0.492324
false
3.824896
false
false
false
Battleroid/yanker
yanker/yanker.py
1
2508
""" Yanker Usage: yanker [--threads=<tnum>] """ __version__ = '1.0.1' import Queue import threading import youtube_dl as ydl import pyperclip as clip import time from docopt import docopt class ErrLogger(object): def debug(self, msg): pass def warning(self, msg): pass def error(sel...
mit
-6,076,938,484,919,029,000
24.08
101
0.539474
false
3.987281
false
false
false
Traumflug/Teacup_Firmware
configtool/calcscrew.py
1
9429
import wx from configtool.data import BSIZESMALL, reFloat, offsetChLabel, offsetTcLabel class CalcScrew(wx.Dialog): def __init__(self, parent, font, cbUse): wx.Dialog.__init__( self, parent, wx.ID_ANY, "Steps calculator for screw driven axes", si...
gpl-2.0
-6,171,746,121,561,787,000
26.814159
88
0.509492
false
3.183322
false
false
false
BadWizard/Inflation
SPF/source/get_clean_GDP.py
1
3646
def get_clean_HICP(data_dir="../data/", output_dir="../clean_data/", year=2016, quarter=1): ''' This function takes a raw csv file from SPF and creates a new csv file with forecasts only for HICP ''' import pandas as pd ...
mit
8,939,961,401,442,536,000
36.204082
91
0.472024
false
2.870866
false
false
false
alphagov/digitalmarketplace-admin-frontend
tests/app/main/views/test_outcomes.py
1
9064
import csv import mock import pytest from dmtestutils.api_model_stubs import FrameworkStub from ...helpers import LoggedInApplicationTest class TestDirectAwardView(LoggedInApplicationTest): def setup_method(self, method): super().setup_method(method) self.data_api_client_patch = mock.patch('app...
mit
-5,713,912,630,763,795,000
36.924686
107
0.492056
false
4.092099
true
false
false
georgeouzou/survgr
transform/migrations/0001_initial.py
1
1205
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-01-22 14:55 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateMo...
mit
4,114,823,400,723,477,000
33.428571
116
0.561826
false
4.334532
false
false
false
fazalmajid/temboz
tembozapp/normalize.py
1
32692
# -*- coding: iso-8859-1 -*- from __future__ import print_function import sys, time, re, codecs, string, traceback, socket, hashlib import unicodedata, requests, feedparser from . import param, transform, util, porter2 import bleach try: import html.entities as htmlentitydefs except ImportError: import htmlentityd...
mit
-4,501,585,619,127,446,500
43.844993
173
0.580693
false
2.935704
false
false
false
a-krebs/finances
finances/finances/urls.py
1
1583
# Copyright (C) 2012 Aaron Krebs akrebs@ualberta.ca # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is...
gpl-3.0
1,204,365,858,756,522,800
40.657895
86
0.749842
false
4.069409
false
false
false
sjdv1982/seamless
docs/plans/big-data/testing.py
1
12459
""" Performance tests based on tests/highlevel/high-in-low6-memory.py See also auth-*py. - Data overhead is now at ~6.5 ms / MB. A lot of the data overhead comes from json.dumps. This is to build mixed cells. The rest is from get_hash. Pure Python version (with get_hash and dumps) is at 6.3 ms / MB, so the res...
mit
-8,654,298,033,990,642,000
34.804598
151
0.662332
false
3.157375
false
false
false
PuzzleboxIO/jigsaw-python
Puzzlebox/Jigsaw/Design_Plugin_Eeg.py
1
34778
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'interface/puzzlebox_jigsaw_interface_design-plugin_eeg.ui' # # Created: Sun May 10 18:28:33 2015 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui ...
agpl-3.0
-5,169,383,353,182,562,000
77.328829
289
0.807637
false
3.339864
false
false
false
pcaro90/Python-AES
ProgressBar.py
1
1773
#!/usr/bin/env python # -*- coding: utf-8 -*- # --------------------------------------------------- # Copyright (c) 2013 Pablo Caro. All Rights Reserved. # Pablo Caro <me@pcaro.es> - http://pcaro.es/ # ProgressBar.py # --------------------------------------------------- import sys class ProgressBar: ...
bsd-3-clause
3,480,556,556,003,482,000
24.462687
79
0.478285
false
3.780384
false
false
false
kefatong/ops
app/models.py
1
24843
# -*- coding:utf-8 -*- __author__ = 'eric' import hashlib from datetime import datetime from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from werkzeug.security import generate_password_hash, check_password_hash from flask.ext.login import UserMixin from flask import current_app, request...
apache-2.0
-4,587,166,439,716,651,500
34.864823
133
0.588358
false
3.240481
false
false
false
gbjuno/coreprogramming
chapter7/7-6.py
1
1400
#!/usr/bin/env python def stockDataSort(stockData,userInput): stockDataAfterSort = {} if userInput == None: print "input wrong items" exit(1) else: for i in stockData: stockDataAfterSort[i[userInput]] = i print "-----------------------------------" for dataItem i...
mit
1,574,336,147,322,682,400
32.333333
92
0.604286
false
3.473945
false
false
false
dhermes/ncaa-bracket-scenarios
run_all_scenarios.py
1
1579
from __future__ import print_function import itertools import json import pickle from game_tree_classes import WinnerOf import utils with open(utils.SWEET16_PICKLE, 'r') as fh: SLOTS_BEFORE = pickle.load(fh) def complete_bracket(game_slots, choice_slots, choices): result = game_slots.copy() for slot_i...
apache-2.0
-6,612,150,762,153,403,000
28.240741
74
0.639012
false
3.47033
false
false
false