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
spectralpython/spectral
spectral/database/aster.py
1
15620
''' Code for reading and managing ASTER spectral library data. ''' from __future__ import absolute_import, division, print_function, unicode_literals from spectral.utilities.python23 import IS_PYTHON3, tobytes, frombytes from .spectral_database import SpectralDatabase if IS_PYTHON3: readline = lambda fin: fin.r...
gpl-2.0
-1,652,097,644,647,048,200
33.866071
126
0.564277
false
4.237656
false
false
false
ActiveState/code
recipes/Python/436229_RecordJar_Parser/recipe-436229.py
1
2025
#!/usr/bin/env python # recordjar.py - Parse a Record-Jar into a list of dictionaries. # Copyright 2005 Lutz Horn <lutz.horn@gmx.de> # Licensed unter the same terms as Python. def parse_jar(flo): """Parse a Record-Jar from a file like object into a list of dictionaries. This method parses a file like object ...
mit
-8,003,185,806,157,289,000
32.75
80
0.565432
false
3.420608
false
false
false
mbourqui/django-publications-bootstrap
publications_bootstrap/admin_views/import_bibtex.py
1
7261
# -*- coding: utf-8 -*- import re from django.contrib import messages from django.contrib.admin.views.decorators import staff_member_required from django.http import HttpResponseRedirect from django.shortcuts import render from django_countries import countries from ..bibtex import parse from ..models import Publica...
mit
-2,223,934,309,947,411,700
36.235897
112
0.428729
false
5.081176
false
false
false
hbeatty/dell-wsman-client-api-python
setup.py
1
1520
""" Setup file for egg builds @copyright: 2010-2012 @author: Joseph Tallieu <joseph_tallieu@dell.com> @author: Vijay Halaharvi <vijay_halaharvi@dell.com> @organization: Dell Inc. - PG Validation @license: GNU LGLP v2.1 """ # This file is part of WSManAPI. # # WSManAPI is free software: you can redistribute it an...
lgpl-3.0
-7,334,710,254,634,723,000
36.073171
80
0.694079
false
3.486239
false
false
false
dchenaux/Yoda
yoda/flask_debugtoolbar_mongo/panel.py
1
2746
from flask_debugtoolbar.panels import DebugPanel import jinja2 from . import operation_tracker from . import jinja_filters class MongoDebugPanel(DebugPanel): """Panel that shows information about MongoDB operations. """ name = 'Mongo' has_content = True def __init__(self, *args, **kwargs): ...
bsd-3-clause
3,575,773,966,745,471,000
36.616438
78
0.60488
false
3.968208
false
false
false
goniz/plexmyxbmc
plexmyxbmc/__init__.py
1
1359
#!/usr/bin/python2 __version__ = "1.0.0" import plexapi from plexmyxbmc.config import get_config from plexmyxbmc.log import get_logger plexapi.X_PLEX_PROVIDES = 'player,controller,sync-target' plexapi.X_PLEX_PRODUCT = "PlexMyXBMC" plexapi.X_PLEX_VERSION = __version__ plexapi.X_PLEX_IDENTIFIER = get_config().get('uuid'...
gpl-2.0
2,932,022,274,638,289,400
32.975
98
0.701987
false
2.796296
false
false
false
ghorn/debian-casadi
experimental/joris/scp.py
1
2985
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
lgpl-3.0
-7,634,495,534,286,407,000
30.421053
266
0.670352
false
2.733516
false
false
false
qutebrowser/qutebrowser
scripts/dev/ua_fetch.py
1
2287
#!/usr/bin/env python3 # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: """Fetch and print the most common user agents. This script fetches the most common user agents according to https://github.com/Kikobeats/top-user-agents, and prints the most recent Chrome user agent for Windows, macOS and Linux. """ import ma...
gpl-3.0
1,706,314,109,449,327,400
30.328767
104
0.647136
false
3.475684
false
false
false
vauxoo-dev/stoqdrivers
stoqdrivers/printers/bematech/MP20.py
1
4982
# -*- Mode: Python; coding: iso-8859-1 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Stoqdrivers ## Copyright (C) 2009 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as publishe...
lgpl-2.1
2,580,845,285,714,813,400
30.732484
79
0.5833
false
3.459722
false
false
false
KDE/tellico
src/fetch/scripts/dark_horse_comics.py
1
14898
#!/usr/bin/env python # -*- coding: utf-8 -*- # *************************************************************************** # Copyright (C) 2006-2009 Mathias Monnerville <tellico@monnerville.com> # *************************************************************************** # # **************************************...
gpl-2.0
-8,448,121,832,135,674,000
32.254464
137
0.6127
false
3.217711
false
false
false
jonaprieto/agda-pkg
apkg/commands/list.py
1
3039
''' apkg ~~~~ A package manager for Agda. ''' # ---------------------------------------------------------------------------- import click import logging import click_log as clog from operator import attrgetter, itemgetter from pony.orm import db_session, select from natsort ...
mit
-6,497,745,852,845,697,000
24.546218
80
0.471866
false
4.025166
false
false
false
raccoongang/xblock-video
video_xblock/backends/wistia.py
1
11501
# -*- coding: utf-8 -*- """ Wistia Video player plugin. """ import HTMLParser import json import httplib import logging import re import requests import babelfish from video_xblock import BaseVideoPlayer from video_xblock.constants import TranscriptSource from video_xblock.utils import ugettext as _ log = logging.g...
gpl-3.0
-7,618,465,501,326,326,000
36.584967
120
0.589166
false
4.003133
false
false
false
tbttfox/TwistyTools
ttLib/ttRegion.py
1
6597
#!/usr/bin/python from __future__ import division from ttPoint import TINYNUM,Point,cross,matMul,angle,distance2,cart2uv from ttPlane import pointDistPlane from ttTriangle import Triangle from ttSphere import Sphere from ttBase import TTBase from Draw.DrawRegion import DrawRegion class Region(TTBase): def __init...
gpl-3.0
-1,122,696,833,930,972,200
32.658163
97
0.51766
false
3.908175
false
false
false
Fat-Zer/FreeCAD_sf_master
src/Mod/Fem/femexamples/thermomech_spine.py
9
6411
# *************************************************************************** # * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> * # * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com * # * * # * Th...
lgpl-2.1
5,691,031,743,129,874,000
37.160714
91
0.58696
false
3.921101
false
false
false
roscopecoltran/scraper
.staging/meta-engines/xlinkBook/update/update_mergers_and_acquisitions.py
1
10303
#!/usr/bin/env python # -*- coding: utf-8 -*- from spider import * sys.path.append("..") from utils import Utils class MergersAndAcquisitionsSpider(Spider): def __init__(self): Spider.__init__(self) self.school = 'wiki' def processMergers(self): utils = Utils() wiki_dict = {'...
mit
4,579,076,035,847,220,000
49.743842
118
0.404038
false
4.443917
false
false
false
RobinQuetin/CAIRIS-web
cairis/cairis/AssetsDialog.py
1
2963
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
apache-2.0
2,933,360,615,195,132,400
39.589041
146
0.746541
false
3.552758
false
false
false
lhirschfeld/JargonBot
custombot.py
1
3061
import pickle import praw import random from textblob import TextBlob from datetime import datetime from sklearn import linear_model class RedditBot: """A class that performs basic operations, working with Reddit's PRAW API.""" def __init__(self, botName): # Setup the bot and primary variables. ...
mit
3,835,738,549,379,795,000
35.440476
78
0.560928
false
4.065073
false
false
false
toomore/grs
tools/make_twse_list.py
1
3616
# -*- coding: utf-8 -*- import csv import re import urllib2 from datetime import datetime NOW = datetime(2013, 12, 17) SAVEPATH = '../grs/twse_list.csv' INDUSTRYCODE = '../grs/industry_code.csv' TWSEURL = 'http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/MI_INDEX2_print.php?genpage=genpage/Report%(year)s%(mon)02d...
mit
-7,749,647,010,060,471,000
31.55102
225
0.445141
false
2.175989
false
false
false
snakeztc/NeuralDialog-CVAE
config_utils.py
1
1880
# Copyright (C) 2017 Tiancheng Zhao, Carnegie Mellon University class KgCVAEConfig(object): description= None use_hcf = True # use dialog act in training (if turn off kgCVAE -> CVAE) update_limit = 3000 # the number of mini-batch before evaluating the model # how to encode utterance. # bow: ...
apache-2.0
5,411,400,849,462,010,000
34.471698
79
0.66117
false
3.462247
false
false
false
LionelDupuy/ARCHI_PHEN
ImageJ/DatabaseInput_deprecated.py
1
5558
import time from datetime import date import numpy from PIL import Image import zbar import os,sys import wx # GUI # Handle time lapse! scanner = zbar.ImageScanner() # configure the reader scanner.parse_config('enable') #scanner.set_config(0, zbar.Config.ENABLE, 0) #scanner.set_conf...
mit
4,614,048,488,324,428,000
29.412429
150
0.585103
false
3.092933
true
false
false
tato69/myfirstrepo
day3/makeasentece.py
1
1633
import random s_nouns = ["A dude", "My mom", "The king", "Some guy", "A cat with rabies", "A sloth", "Your homie", "This cool guy my gardener met yesterday", "Superman"] p_nouns = ["These dudes", "Both of my moms", "All the kings of the world", "Some guys", "All of a cattery's cats", "The multitude of sloths living un...
apache-2.0
-213,020,807,480,288,740
67.041667
229
0.670545
false
2.781942
false
false
false
catapult-project/catapult
common/py_utils/py_utils/refactor/annotated_symbol/class_definition.py
3
1291
# 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. from __future__ import absolute_import import symbol from py_utils.refactor.annotated_symbol import base_symbol __all__ = [ 'Class', ] class Class(b...
bsd-3-clause
-7,862,515,505,693,531,000
24.82
72
0.701007
false
3.819527
false
false
false
mozilla/kuma
kuma/attachments/tests/test_templates.py
1
1910
import pytest from pyquery import PyQuery as pq from kuma.core.urlresolvers import reverse from kuma.core.utils import to_html from kuma.wiki.models import Revision from . import make_test_file from ..models import Attachment @pytest.mark.security def test_xss_file_attachment_title(admin_client, constance_config, r...
mpl-2.0
6,381,598,535,668,310,000
37.979592
79
0.646073
false
3.694391
false
false
false
aomelchenko/python_koans
python2/koans/about_classes.py
1
4830
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutClasses(Koan): class Dog(object): "Dogs need regular walkies. Never, ever let them drive." def test_instances_of_classes_can_be_created_adding_parentheses(self): fido = self.Dog() self.assertEqual('Dog...
mit
4,466,670,656,665,157,600
29.764331
100
0.540373
false
3.744186
true
false
false
mouthwateringmedia/python-docx
example-makedocument.py
1
3666
#!/usr/bin/env python2.6 ''' This file makes an docx (Office 2007) file from scratch, showing off most of python-docx's features. If you need to make documents from scratch, use this file as a basis for your work. Part of Python's docx module - http://github.com/mikemaccana/python-docx See LICENSE for licensing infor...
mit
3,625,672,895,550,942,700
45.417722
198
0.698036
false
3.958963
false
false
false
juju/python-libjuju
juju/provisioner.py
1
11307
import os import re import shlex import tempfile import uuid from subprocess import CalledProcessError import paramiko from .client import client arches = [ [re.compile(r"amd64|x86_64"), "amd64"], [re.compile(r"i?[3-9]86"), "i386"], [re.compile(r"(arm$)|(armv.*)"), "armhf"], [re.compile(r"aarch64"), ...
apache-2.0
-8,809,007,503,847,249,000
30.761236
79
0.533386
false
4.150881
false
false
false
sanguinariojoe/FreeCAD
src/Mod/Arch/importWebGL.py
9
44100
#*************************************************************************** #* Copyright (c) 2013 Yorik van Havre <yorik@uncreated.net> * #* Copyright (c) 2020 Travis Apple <travisapple@gmail.com> * #* * #* This pr...
lgpl-2.1
5,400,546,240,878,188,000
48.273743
311
0.474444
false
4.505977
false
false
false
glemaitre/UnbalancedDataset
examples/over-sampling/plot_smote.py
2
2231
""" ===== SMOTE ===== An illustration of the SMOTE method and its variant. """ # Authors: Fernando Nogueira # Christos Aridas # Guillaume Lemaitre <g.lemaitre58@gmail.com> # License: MIT import matplotlib.pyplot as plt from sklearn.datasets import make_classification from sklearn.decomposition imp...
mit
2,950,088,382,133,793,000
27.974026
76
0.619005
false
2.771429
false
false
false
bewantbe/eogRichExif
eogRichExif.py
1
12212
''' eogRichExif A eog (Eye of GNOME Image Viewer) plugin which shows many Exif info in side pane. Thanks to the eogMetaEdit plugin. ''' ''' eogRichExif 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...
gpl-3.0
-9,212,282,907,351,276,000
36.453988
121
0.661507
false
2.663613
false
false
false
razz0/DataMining
apriori_sequential.py
1
8210
"""Implementation of the Apriori algorithm for sequential patterns, F(k-1) x F(k-1) variant. Model sequences like ((1, 2, 3), (4, 5), (4, 6)). To get course sequences with empty elements as (0,): course_seqs = [x.course_sequence for x in s.students] course_seqs2 = [tuple([seq or (0,) for seq in x.course_sequence]) fo...
gpl-2.0
133,243,926,120,616,290
32.92562
150
0.487576
false
3.44958
false
false
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/test_json/test_decode.py
1
4355
import decimal from io import StringIO from collections import OrderedDict from test.test_json import PyTest, CTest class TestDecode: def test_decimal(self): rval = self.loads('1.1', parse_float=decimal.Decimal) self.assertTrue(isinstance(rval, decimal.Decimal)) self.assertEqual(rval, deci...
apache-2.0
4,445,666,602,125,950,000
41.281553
77
0.583008
false
3.608119
true
false
false
kishori82/MetaPathways_Python.3.0
utilities/compute_status.py
1
18299
#!/usr/bin/python # File created on 27 Jan 2012. from __future__ import division __author__ = "Kishori M Konwar" __copyright__ = "Copyright 2013, MetaPathways" __credits__ = ["r"] __version__ = "1.0" __maintainer__ = "Kishori M Konwar" __status__ = "Release" try: import sys, os, re, math, gzip from glob imp...
mit
3,113,348,630,334,160,000
25.713869
384
0.539155
false
3.608558
false
false
false
YYKI/blog-webapp
www/apis.py
1
2900
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'syuson' ''' JSON API definition ''' import json, logging, inspect, functools class APIError(Exception): """ the base APIError which contains error(required), data(optional) and message(optional) """ def __init__(self, error, data='', mes...
gpl-3.0
-8,884,925,662,730,124,000
27.712871
105
0.561034
false
3.575832
false
false
false
faylau/oVirt3.3WebAPITest
src/TestData/Host/ITC03010304_CreateHost_NameVerify.py
1
2575
#encoding:utf-8 __authors__ = ['"Liu Fei" <fei.liu@cs2c.com.cn>'] __version__ = "V0.1" ''' # ChangeLog: #--------------------------------------------------------------------------------- # Version Date Desc Author #------------------------------------------------------...
apache-2.0
5,178,600,399,952,293,000
35.608696
276
0.366337
false
4.809524
false
true
false
rabrahm/ceres
utils/FastRotators/spfr.py
1
18831
from pylab import * import pyfits from PyAstronomy import pyasl import scipy from scipy import interpolate from scipy import ndimage from scipy import signal import pickle from matplotlib.backends.backend_pdf import PdfPages import os #from pyevolve import G1DList #from pyevolve import GSimpleGA from multiprocessing i...
mit
-4,745,925,225,003,760,000
24.208835
131
0.602676
false
2.022012
false
false
false
nexcess/r1soft-admin-console
rac/forms.py
1
3719
# -*- coding: utf-8 -*- # Nexcess.net r1soft-admin-console # Copyright (C) 2015 Nexcess.net L.L.C. # # 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 y...
gpl-2.0
8,345,511,016,906,627,000
42.752941
92
0.59317
false
4.666248
false
false
false
teampheenix/StarCraft-Casting-Tool
scctool/matchgrabber/alpha.py
1
6950
"""Provide match grabber for AlphaTL.""" import logging from datetime import datetime, timedelta, timezone from urllib.request import urlopen, urlretrieve import scctool.settings import scctool.settings.translation from scctool.matchgrabber.custom import MatchGrabber as MatchGrabberParent # create logger module_logge...
gpl-3.0
1,358,352,931,005,396,000
37.611111
79
0.501439
false
4.446577
false
false
false
five-elephants/a_game
pygame_hello.py
1
2613
#!/usr/bin/env python import pygame from pygame.locals import * import random class Wandering_text: def __init__(self, text, color, center, bbox): self.font = pygame.font.Font(None, 36) self.surface = self.font.render(text, 1, color) self.pos = self.surface.get_rect(center=center) ...
gpl-3.0
-6,722,202,947,777,309,000
28.693182
83
0.580176
false
3.371613
false
false
false
CitrineInformatics/refkit
lookup/arxiv.py
1
4957
""" Functions for working with the arXiv.org api. """ import urllib import requests from xml.etree import ElementTree from refkit.util import arxivid from refkit.metadata import Metadata from refkit.format import author def search(lookup): """ Search for a reference on arXiv.org given a lookup str...
mit
-8,469,765,585,758,530,000
32.268456
116
0.643938
false
4.240376
false
false
false
xiaoweih/DLV
networks/imageNet.py
1
1666
import os, struct from array import array as pyarray from cvxopt.base import matrix import numpy as np import PIL.Image # FIXME: need actual class names def LABELS(index): ls = labels() if len(ls) > 0: return ls[index] else: return range(1000)[index] def labels(): file = open('networks/ima...
gpl-3.0
3,160,891,197,615,542,300
23.5
73
0.612845
false
3.131579
false
false
false
pidydx/grr
grr/lib/aff4.py
1
100047
#!/usr/bin/env python """AFF4 interface implementation. This contains an AFF4 data model implementation. """ import __builtin__ import abc import itertools import StringIO import threading import time import zlib import logging from grr.lib import access_control from grr.lib import config_lib from grr.lib import d...
apache-2.0
-3,943,746,568,183,437,300
31.335811
80
0.645377
false
4.031552
false
false
false
CranleighAD/isams-tools
settings_example.py
1
2947
# enable or disable the whole program ENABLED = True # if we're in testing mode, output more debug and allow testers to add their own email DEBUG = True # used with above, you can check the output of emails that would have been sent SEND_EMAILS = True # iSAMS Batch API key API_KEY = "11D497FF-A7D9-4646-A6B8-D9D1B871...
gpl-3.0
5,770,833,458,472,531,000
23.773109
112
0.687479
false
3.060228
false
false
false
cliixtech/bigorna
tests/tasks/test_sched.py
1
1892
from unittest import TestCase from unittest.mock import create_autospec from nose.tools import istest from bigorna.commons import Event from bigorna.tasks import TaskScheduler, TaskDefinition, task_status_changed_evt from bigorna.tasks.executor import Executor from bigorna.commons import Config class TaskSchedulerT...
gpl-3.0
3,351,970,099,618,253,000
32.192982
80
0.705603
false
3.610687
true
false
false
Runscope/pysaml2
example/idp2/idp.py
1
35623
#!/usr/bin/env python import argparse import base64 import importlib import logging import os import re import socket import time from Cookie import SimpleCookie from hashlib import sha1 from urlparse import parse_qs from saml2 import BINDING_HTTP_ARTIFACT from saml2 import BINDING_URI from saml2 import BINDING_PAOS ...
bsd-2-clause
900,716,577,187,012,400
34.551896
98
0.528703
false
4.037516
false
false
false
docusign/docusign-python-client
docusign_esign/apis/workspaces_api.py
1
66547
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
mit
-6,547,864,770,429,699,000
47.788123
197
0.578058
false
4.696662
false
false
false
xuweiliang/Codelibrary
openstack_dashboard/dashboards/admin/access_and_security/keypairs/urls.py
1
1463
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
-5,623,635,435,713,008,000
39.638889
78
0.678742
false
3.839895
false
false
false
FlintHill/SUAS-Competition
UpdatedImageProcessing/UpdatedImageProcessing/ShapeDetection/utils/bounding_box.py
1
3445
import cv2 import numpy from alpha_fill import alpha_fill class BoundingBox(object): def __init__(self, pil_img, show_plot=False): self.mask_img = alpha_fill(pil_img) self.set_bounding_box() self.set_side_lengths() self.set_areas() if show_plot: self.show_plot...
mit
5,891,784,764,528,450,000
33.45
108
0.598549
false
3.035242
false
false
false
locuslab/dreaml
dreaml/dataframe/transform.py
1
5833
from abc import ABCMeta, abstractmethod from threading import Thread from time import sleep, time class Transform(object): __metaclass__ = ABCMeta def __init__(self, *args, **kwargs): self.args = args self.kwargs = kwargs @abstractmethod def apply(self,target_df=None): """ Ap...
apache-2.0
-404,568,103,778,613,500
33.116959
81
0.60312
false
3.852708
false
false
false
synclab/radclock
python-module/setup.py
1
2076
# Copyright (C) 2006-2011 Julien Ridoux <julien@synclab.org> # # This file is part of the radclock program. # # 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,...
bsd-2-clause
8,208,464,072,412,713,000
28.657143
86
0.71869
false
3.269291
false
false
false
hsoft/musicguru
core/manualfs.py
1
9237
# Created By: Virgil Dupras # Created On: 2004-12-27 # Copyright 2010 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licens...
bsd-3-clause
-26,157,494,945,306,680
32.835165
88
0.591642
false
4.212038
false
false
false
almarklein/imageio
imageio/plugins/npz.py
1
3389
# -*- coding: utf-8 -*- # Copyright (c) 2014, imageio contributors # imageio is distributed under the terms of the (new) BSD License. """ Storage of image data in npz format. Not a great format, but at least it supports volumetric data. And its less than 100 lines. """ from __future__ import absolute_import, print_fu...
bsd-2-clause
-7,003,940,651,712,403,000
31.902913
77
0.590145
false
4.262893
false
false
false
xelphene/swaf
swaf/wrap.py
1
3089
import types import logging import inspect import pprint import operator import re from operator import isCallable from resp import * import swaf.error import swaf.misc from swaf.misc import isListOfFuncs DEBUG=1 def wrapFilter(f, filter_name, filters): newf = chainWrap(f) newf.__name__ = f.__name__ newf.__modul...
gpl-3.0
8,237,832,620,152,168,000
25.177966
92
0.690838
false
2.978785
false
false
false
skandavivek/tracking-cars-highway
lk_track2.py
1
3415
#!/usr/bin/env python ''' Lucas-Kanade tracker ==================== Lucas-Kanade algorithm to track cars on a highway and save output lk_track2.py [<video_source>] ESC - exit ''' from __future__ import print_function import numpy as np import cv2 #import video from common import anorm2, draw_str from time import...
apache-2.0
-1,440,188,667,553,131,300
32.480392
119
0.489312
false
3.115876
false
false
false
windelbouwman/ppci-mirror
ppci/cli/yacc.py
1
1231
""" Parser generator utility. This script can generate a python script from a grammar description. Invoke the script on a grammar specification file: .. code:: $ ppci-yacc test.x -o test_parser.py And use the generated parser by deriving a user class: .. code:: import test_parser class MyParser(test...
bsd-2-clause
-3,877,802,558,502,337,000
18.854839
74
0.669374
false
3.620588
false
false
false
no-net/gr-winelo
python/channel/models/const_multi_cc.py
1
1510
from gnuradio import gr class const_multi_cc(gr.hier_block2): """ Constant channel model. """ def __init__(self, tx_id, rx_id, k11=0.0, k12=1.0, k13=1.0, k21=1.0, k22=0.0, k23=1.0, k31=1.0, k32=1.0, k33=0.0): gr.hier_block2.__init__( s...
gpl-3.0
-3,393,310,703,416,812,000
34.952381
78
0.368212
false
3.710074
false
false
false
fnp/wolnelektury
src/social/migrations/0012_auto_20210120_1444.py
1
1182
# Generated by Django 2.2.16 on 2021-01-20 13:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('social', '0011_auto_20190807_1056'), ] operations = [ migrations.AlterModelOptions( name='carousel', options={'verb...
agpl-3.0
3,994,508,156,126,134,000
35.3125
284
0.557659
false
3.642633
false
false
false
yeming233/rally
rally/plugins/openstack/verification/tempest/config.py
1
9370
# Copyright 2014: Mirantis 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 b...
apache-2.0
5,861,679,213,484,211,000
43.198113
79
0.594023
false
4.162594
true
false
false
robocomp/robocomp-robolab
components/localization/UWBpublisher/src/genericworker.py
1
4050
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 by YOUR NAME HERE # # This file is part of RoboComp # # RoboComp 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 o...
gpl-3.0
-1,514,458,303,238,705,700
28.136691
106
0.715556
false
3.115385
false
false
false
taiwenko/python
Visa.py
1
3504
#!c:\Python27\python import vxi11Device as vxi11 #import numpy import os,sys, time # FSW #['Rohde&Schwarz', 'FSW-50', '1312.8000K50/100970', '2.10\n'] #inst = rm.open_resource('TCPIP::10.0.0.160::INSTR') #SMW200A #['Rohde&Schwarz', 'SMW200A', '1412.0000K02/101575', '3.1.18.2-3.01.086.171_SP2\n'] #inst...
mit
-6,667,128,671,122,640,000
27.694915
228
0.640982
false
2.26943
false
false
false
anarcher/enso-launcher-continued
enso/commands/suggestions.py
1
18589
# Copyright (c) 2008, Humanized, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditio...
bsd-3-clause
-5,472,798,759,257,362,000
37.97065
132
0.571467
false
4.644928
false
false
false
ffmmjj/desafio-dados-2016
data_preparation_pipeline/outliers_separation.py
1
1185
import luigi import pandas as pd from augment_data import AppendFeaturesAggregatedFromTeachersDatasetToSchool class SplitSchoolOutliersData(luigi.Task): input_task = AppendFeaturesAggregatedFromTeachersDatasetToSchool() def requires(self): return self.input_task def output(self): return...
apache-2.0
-158,811,922,506,397,440
38.533333
92
0.665823
false
3.16
false
false
false
wehlutyk/Watson
scripts/fuzzer.py
1
1043
import arrow import random from watson import Watson watson = Watson(frames=None, current=None) projects = [ ("apollo11", ["reactor", "module", "wheels", "steering", "brakes"]), ("hubble", ["lens", "camera", "transmission"]), ("voyager1", ["probe", "generators", "sensors", "antenna"]), ("voyager2", [...
mit
4,692,943,791,232,215,000
27.972222
75
0.591563
false
3.259375
false
false
false
nedbat/zellij
tests/test_intersection.py
1
1510
from hypothesis import assume, given from hypothesis.strategies import builds, lists, integers, tuples from zellij.defuzz import Defuzzer from zellij.euclid import collinear, Segment, BadGeometry from zellij.intersection import segment_intersections from zellij.postulates import all_pairs nums = integers(min_value=-...
apache-2.0
2,406,871,413,739,147,000
34.116279
92
0.662252
false
3.673966
false
false
false
riscmaster/risc_maap
risc_control/src/circles3_traj.py
2
3789
#!/usr/bin/env python '''====================================================== Created by: D. Spencer Maughan Last updated: July 2015 File name: circles3_traj.py Organization: RISC Lab, Utah State University ======================================================''' import roslib; roslib...
bsd-2-clause
-1,619,490,676,580,143,600
27.704545
75
0.484033
false
2.582822
false
false
false
jeremykid/Algorithm_project
trial_division.py
1
1193
import math import time def primeGenerate(number): largest = number prime_list = largest*[1] if (number<4): return [2,3] prime_list[1] = 0 for i in range(0,largest,2): prime_list[i] = 0 prime_list[2] = 1 for i in range(3,largest,2): if (prime_list[i] == 1): ...
mit
765,561,132,604,464,000
22.392157
66
0.524728
false
3.360563
false
false
false
sgibbes/carbon-budget
gain/utilities.py
1
4640
import subprocess import glob import sys sys.path.append('../') import constants_and_names as cn def s3_folder_download(source, dest): cmd = ['aws', 's3', 'cp', source, dest, '--recursive'] subprocess.check_call(cmd) def s3_file_download(source, dest): cmd = ['aws', 's3', 'cp', source, dest] subproces...
apache-2.0
3,722,346,610,201,929,000
31.222222
213
0.603448
false
3.228949
false
false
false
dwhoman/CVPI
tests/hypothesis/testing_hypothesis.py
1
2209
import subprocess import numpy as np import hypothesis as h import hypothesis.strategies as st import hypothesis.extra.numpy as hnp #h.settings(buffer_size = 819200000) min_img_width = 1 min_img_height = 1 max_img_width = 10 max_img_height = 10 max_uint32 = 2**32 - 1 max_int32 = 2**31 - 1 min_int32 = -(2**31) max_sho...
apache-2.0
-1,831,955,842,194,675,200
29.680556
98
0.583975
false
2.828425
false
false
false
theanalyst/cinder
cinder/db/sqlalchemy/api.py
1
94793
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2014 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you...
apache-2.0
-7,665,454,611,863,467,000
32.830478
79
0.588356
false
4.157223
false
false
false
Azure/azure-sdk-for-python
sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py
1
3246
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-8,604,923,745,926,091,000
47.447761
134
0.684535
false
4.53986
true
false
false
tomkralidis/pywps
pywps/processing/job.py
1
3570
################################################################## # Copyright 2018 Open Source Geospatial Foundation and others # # licensed under MIT, Please consult LICENSE.txt for details # ################################################################## import os import tempfile import pywps.configuratio...
mit
5,095,248,502,263,513,000
31.454545
102
0.582353
false
4.089347
true
false
false
jcmcclurg/serverpower
profiling/defaultGetSetpoints.py
1
1840
#!/usr/bin/python import numpy import re import cPickle as pickle import gzip import time def getSetpointsFromRaw(filename,verbose=False): printEvery = 1 if(verbose): startTime = time.time() print "Opened raw file %s."%(filename) else: startTime = 0 f=open(filename,'rb') data = [] for line in f: if re....
gpl-2.0
-3,381,506,806,175,974,000
25.285714
191
0.66413
false
2.830769
false
false
false
bacher09/gpackages-metadata
tests/test_news.py
1
1144
from .utils import TestCase, TESTDATA_DIR from packages_metadata.generic_metadata import news import os.path class TestNews(TestCase): @classmethod def setUpClass(cls): cls.news_dir = os.path.join(TESTDATA_DIR, 'news') cls.news_titles = [ 'ia64-java-removal', 'glib-228', 'gnustep-...
gpl-2.0
3,034,550,257,392,151,600
34.75
79
0.625
false
3.445783
true
false
false
djolent/WebApp
LifeSciences/AzureBlast/AzureBlast/BatchScripts/AnalysisJobManager.py
1
4604
import os import sys import datetime import time import azure.batch.batch_service_client as batch import azure.batch.batch_auth as batchauth import azure.batch.models as batchmodels from azure.storage.table import TableService, TableBatch from azure.storage.blob import BlockBlobService def get_analysis_state(all_task...
mit
1,266,419,782,913,377,800
35.251969
89
0.597524
false
4.223853
false
false
false
jelly/calibre
src/calibre/gui2/tweak_book/check.py
2
9562
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import sys from PyQt5.Qt import ( QIcon, Qt, QSplitter, QListWidget, Q...
gpl-3.0
6,725,639,900,550,539,000
35.496183
131
0.566409
false
3.684778
false
false
false
alexliew/learn_python_the_hard_way
ex5.py
1
2837
my_name = "Alex Liew" my_age = 25 # this is no lie my_height = 174 # cm my_weight = 65 # kg my_eyes = 'Brown' my_teeth = 'White' my_hair = 'Black' print("Let's talk about {0}.".format(my_name)) print("He's {0} centimeters tall.".format(my_height)) print("He's {0} kilograms heavy.".format(my_weight)) print("Actually th...
mit
7,507,327,738,741,249,000
35.844156
117
0.667607
false
2.709647
false
true
false
maxwward/SCOPEBak
askbot/views/readers.py
1
27155
# encoding:utf-8 """ :synopsis: views "read-only" for main textual content By main textual content is meant - text of Exercises, Problems and Comments. The "read-only" requirement here is not 100% strict, as for example "exercise" view does allow adding new comments via Ajax form post. """ import datetime import loggi...
gpl-3.0
-1,405,857,867,789,381,400
39.409226
153
0.604198
false
4.011078
false
false
false
uptimerobot/uptimerobot-cli
uptimerobot/client.py
1
12485
from __future__ import absolute_import, division, print_function, unicode_literals import re import sys import json import requests from . import APIError, HTTPError from .monitor import Monitor from .alert_contact import AlertContact # Ensure that we can test against the appropriate string types. if sys.version_in...
gpl-3.0
-6,106,212,682,719,807,000
29.678133
124
0.546496
false
4.690083
false
false
false
Grumbel/dirtool
dirtools/cmd_desktop.py
1
2895
# dirtool.py - diff tool for directories # Copyright (C) 2018 Ingo Ruhnke <grumbel@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 opt...
gpl-3.0
4,080,812,269,677,872,000
35.1875
111
0.629016
false
4.048951
false
false
false
quokkaproject/flask-htmlbuilder
setup.py
1
1061
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='quokka-flask-htmlbuilder', version='0.13', url='http://github.com/quokkaproject/flask-htmlbuilder', license='MIT', author='QuokkaProject', author_email='rochacbruno@gmail.com', description='Fork of Flex...
bsd-3-clause
-672,378,022,798,663,400
28.472222
73
0.6164
false
4.080769
false
false
false
Rfam/rfam-production
scripts/support/mirnas/validate_family.py
1
3027
import os import json import argparse import urllib import logging # ------------------------------------------------------------------------------------------ search_dirs = ["/hps/nobackup/production/xfam/rfam/RELEASES/14.3/miRNA_relabelled/batch1_chunk1_searches", "/hps/nobackup/production/xfam/rfam/...
apache-2.0
5,354,791,960,162,409,000
26.27027
106
0.553023
false
3.326374
false
false
false
cmheisel/django-jamsession
jamsession/forms/admin.py
1
1149
from django import forms from jamsession.forms.fields import SchemaField from jamsession.models import Schema class SchemaAdminForm(forms.Form): error_css_class = 'error' required_css_class = 'required' name = forms.CharField(required=True, widget=forms.TextInput( ...
mit
-3,212,703,057,285,607,000
29.236842
67
0.585727
false
4.303371
false
false
false
rbiswas4/SNsims
snsims_previous/snsims/tmp/models.py
1
2804
#!/usr/bin/env python import sncosmo.models import numpy class SEDFileSource(sncosmo.models.TimeSeriesSource): """A TimeSeriesSource stored in a 3-column ASCII file format, for PHASE, LAMBDA, and F_LAMBDA. The hash symbol # is a comment line. The spectral flux density of this model is given by .....
mit
-6,002,426,233,363,240,000
32.783133
78
0.615906
false
3.763758
false
false
false
jendrikseipp/rednotebook-elementary
win/utils.py
1
1582
import logging import os import shutil import sys import subprocess import urllib.request def ensure_path(path): if not os.path.exists(path): os.mkdir(path) def confirm_overwrite(dir): if os.path.exists(dir): answer = input( 'The directory {} exists. Overwrite it? (Y/n): '.format(...
gpl-2.0
8,799,536,457,335,876,000
28.296296
83
0.609355
false
3.39485
false
false
false
shaftoe/home-assistant
homeassistant/const.py
1
12266
# coding: utf-8 """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 46 PATCH_VERSION = '0.dev0' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2) REQUIRED_PYTHON_VER_WIN = (3, 5...
apache-2.0
-7,999,569,583,938,235,000
28.480769
79
0.708741
false
2.953046
false
false
false
kyle-elsalhi/opencv-examples
CalibrationByChessboard/CalibrateCamera.py
1
5055
# System information: # - Linux Mint 18.1 Cinnamon 64-bit # - Python 2.7 with OpenCV 3.2.0 # Resources: # - OpenCV-Python tutorial for calibration: http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html # - Variable names were changed for clarity import num...
mit
-1,366,045,274,275,861,500
42.956522
212
0.712364
false
3.525105
false
false
false
Blackclaws/client
src/client/_clientwindow.py
1
52765
from functools import partial from PyQt4.QtCore import QUrl from PyQt4.QtGui import QLabel, QStyle from PyQt4.QtNetwork import QAbstractSocket import config import connectivity from base import Client from config import Settings import chat from client.player import Player from client.players import Players from clie...
gpl-3.0
6,156,876,616,512,699,000
36.02807
130
0.622458
false
4.063222
false
false
false
DigitalSlideArchive/cdsa_ipython_helpers
dsa_mongo_common_functions.py
1
38290
""" This contains various helper functions for the Digital Slide Archive""" import re, csv, os, sys, optparse import collections from PIL import Image import openslide from openslide.lowlevel import OpenSlideError import hashlib import subprocess import shutil,glob import random from functools import partial def md5su...
apache-2.0
2,299,405,208,769,935,400
39.347734
619
0.688587
false
2.813993
false
false
false
mosra/m.css
plugins/m/dox.py
1
8330
# # This file is part of m.css. # # Copyright © 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz> # # 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, inc...
mit
-2,459,522,413,668,937,700
42.369792
179
0.59169
false
4.108041
false
false
false
lliss/tr-55
tr55/water_quality.py
1
1621
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from tr55.tablelookup import lookup_load, lookup_nlcd def get_volume_of_runoff(runoff, cell_count, cell_resolution): """ Calculate the volume of runoff over the entire modeled...
apache-2.0
-5,661,412,742,735,621,000
29.018519
79
0.679827
false
3.562637
false
false
false
examachine/pisi
pisi/data/component.py
1
7983
# -*- coding: utf-8 -*- # # Copyright (C) 2005, TUBITAK/UEKAE # # 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. # # Plea...
gpl-3.0
-2,851,246,268,599,992,300
37.196172
95
0.629463
false
3.706128
false
false
false
edx/edx-oauth2-provider
edx_oauth2_provider/tests/test_credentials.py
1
2833
""" Test email as username authentication """ from __future__ import absolute_import, division, print_function, unicode_literals import json import ddt from django.core.urlresolvers import reverse from provider.constants import CONFIDENTIAL, PUBLIC from .base import OAuth2TestCase from .factories import ClientFactor...
agpl-3.0
-2,953,483,770,073,217,000
25.476636
87
0.591246
false
3.923823
true
false
false
timmartin/ScanManager
setup.py
1
1198
from setuptools import setup from codecs import open from os import path import glob here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name="scan_manager", version...
mit
-2,133,402,301,166,609,200
21.603774
78
0.606845
false
3.815287
false
false
false
pculture/unisubs
apps/teams/workflows/teamworkflows.py
1
14051
# Amara, universalsubtitles.org # # Copyright (C) 2014 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
agpl-3.0
7,985,709,267,886,165,000
34.1275
90
0.632197
false
4.395058
false
false
false
commonsense/divisi
csc/divisi/recycling_set.py
1
3241
from ordered_set import OrderedSet from priodict import priorityDictionary class RecyclingSet(OrderedSet): __slots__ = ['items', 'indices', 'index', 'indexFor', '__contains__', '__getitem__', '__len__', 'count', 'maxsize', 'drop_listeners', 'priority'] def __init__(self, maxsi...
gpl-3.0
-7,574,904,923,457,729,000
29.28972
78
0.558161
false
4.187339
false
false
false
epuzanov/ZenPacks.community.HPMon
ZenPacks/community/HPMon/modeler/plugins/community/snmp/HPFanMap.py
1
3236
################################################################################ # # This program is part of the HPMon Zenpack for Zenoss. # Copyright (C) 2008, 2009, 2010, 2011 Egor Puzanov. # # This program can be used under the GNU General Public License version 2 # You can find full information here: http://www.zen...
gpl-2.0
-2,512,895,411,321,758,700
33.425532
82
0.439122
false
4.127551
false
false
false
juvvadi/keystone
keystone/logic/types/auth.py
1
5621
# Copyright (c) 2010-2011 OpenStack, 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 agreed to ...
apache-2.0
4,376,412,600,012,934,700
32.064706
76
0.569294
false
4.412088
false
false
false
nickmarton/Paxos-Distributed-Calendar
Classes/Node.py
1
24814
"""Node (User) Class for Paxos Calendar.""" import os import sys import time import thread import pickle import socket import logging from Bully import bully_algorithm from Appointment import Appointment from Calendar import Calendar from Proposer import Proposer from Acceptor import Acceptor class Node(object): ...
mit
-1,191,132,476,585,437,400
37.472868
97
0.503264
false
4.40746
false
false
false
uw-it-aca/course-dashboards
coursedashboards/migrations/0014_auto_20200911_2040.py
1
1189
# Generated by Django 2.1.15 on 2020-09-11 20:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('coursedashboards', '0013_auto_20190108_2238'), ] operations = [ migrations.CreateModel( name='CourseGradeAverage', ...
apache-2.0
5,090,606,726,105,432,000
32.971429
147
0.544996
false
4.216312
false
false
false
kdar/rconsoft
setup.py
1
2919
#!/usr/bin/env python # Read LICENSE for licensing details. import sys import textwrap import glob import shutil import os app_name = 'rconsoft' #----------------------------- # Do some checks if sys.version_info < (2, 4, 0): sys.stderr.write(app_name+' requires Python 2.4 or newer.\n') sys.exit(-1) try: f...
mit
1,058,570,883,171,243,500
28.484848
121
0.564919
false
2.92485
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_disk.py
1
2121
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-2,492,063,701,815,970,000
46.133333
102
0.654408
false
4.2251
false
false
false