repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
tommy-u/enable
examples/kiva/pyglet_gl.py
1
1319
from __future__ import with_statement from numpy import array from pyglet.window import key, Window try: from kiva.gl import GraphicsContext except ImportError, e: raise Exception(e) from kiva.constants import FILL, STROKE, FILL_STROKE class TestWindow(Window): """ Press Q or Escape to exit """ d...
bsd-3-clause
-925,883,367,172,672,600
22.553571
66
0.542077
false
3.408269
false
false
false
halmd-org/h5md-tools
h5mdtools/_plot/pdf.py
1
8436
# -*- coding: utf-8 -*- # # pdf - compute and plot pair distribution function # # Copyright © 2008-2012 Felix Höfling and Peter Colberg # # 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 ...
gpl-3.0
-7,613,585,320,662,006,000
37.674312
124
0.580002
false
3.613802
false
false
false
w0rp/w0rpzone
w0rplib/templatetags/markdown.py
1
1374
from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe import bleach import markdown2 register = template.Library() # Not really safe, but Django needs to think it is. @register.filter(is_safe=True) @stringfilter def unsafe_markdown(value): ...
bsd-2-clause
4,200,208,242,134,314,000
19.507463
55
0.437409
false
4.240741
false
false
false
dhruvbaldawa/fitbit
plot_sleep.py
1
2126
import os import logging import itertools import json import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import pylab from datetime import datetime from utils import gen_next_day, setup_logging sns.set() plt.switch_backend('Qt4Agg') ROOT = os.getcwd() CONFIG_FILE = os.path.join(ROOT, 'config....
mit
-6,007,969,226,944,758,000
26.25641
78
0.645343
false
3.250765
false
false
false
Karajlug/karajlug
books/views.py
1
2202
# ----------------------------------------------------------------------------- # Karajlug.org # Copyright (C) 2010 Karajlug community # # 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 Found...
gpl-2.0
6,594,413,010,891,017,000
33.40625
79
0.631698
false
4.284047
false
false
false
kursitet/edx-ora2
openassessment/assessment/serializers/base.py
2
10587
# coding=utf-8 """ Serializers common to all assessment types. """ from copy import deepcopy import logging from django.core.cache import cache from rest_framework import serializers from openassessment.assessment.models import ( Assessment, AssessmentPart, Criterion, CriterionOption, Rubric, ) logger = logging....
agpl-3.0
4,205,798,340,659,545,000
34.874576
99
0.631768
false
4.248495
false
false
false
bitmovin/bitmovin-python
bitmovin/services/manifests/generic_media_service.py
1
2056
from bitmovin.errors import MissingArgumentError, FunctionalityNotAvailableError from bitmovin.services.manifests.media_custom_tag_service import MediaCustomTag from bitmovin.services.rest_service import RestService class GenericMediaService(RestService): BASE_ENDPOINT_URL = 'encoding/manifests/hls/{manifest_id}/...
unlicense
-556,082,224,711,346,800
45.727273
114
0.692121
false
3.821561
false
false
false
rossant/spiky
experimental/_correlation/loader.py
1
7874
"""This module provides utility classes and functions to load spike sorting data sets.""" # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- import os.path import re import numpy as np from iotools ...
bsd-3-clause
-5,610,675,824,701,268,000
33.23913
79
0.546355
false
4.359911
false
false
false
Clyde-fare/scikit-learn
sklearn/manifold/mds.py
257
15138
""" Multi-dimensional Scaling (MDS) """ # author: Nelle Varoquaux <nelle.varoquaux@gmail.com> # Licence: BSD import numpy as np import warnings from ..base import BaseEstimator from ..metrics import euclidean_distances from ..utils import check_random_state, check_array, check_symmetric from ..externals.joblib impo...
bsd-3-clause
2,097,884,011,881,603,800
35.389423
79
0.625512
false
4.124796
true
false
false
pw31/GGchem
data/SUPCRT92/make_SH90.py
1
1725
import numpy as np import matplotlib.pyplot as plt import sys #========================================================================== # read Sharp & Huebner data #========================================================================== SHnam = np.loadtxt('SharpHuebner.dat',skiprows=0,usecols=[0],dtype='str') S...
gpl-3.0
-6,609,831,724,567,343,000
29.803571
85
0.456812
false
2.928693
false
false
false
rjferrier/fluidity
mayavi/mayavi_amcg/filters/data_set_clipper.py
7
3812
"""This filter enables one to select a portion of an input dataset using a plane and clip it so only one side remains. Many thanks to Prabhu for ScalarCutPlane and TransformData. Wouldn't have been able to code this otherwise. """ # Author: Samir Talwar <samir.talwar06@imperial.ac.uk> # License: BSD Style. # Enthoug...
lgpl-2.1
908,296,905,546,060,200
33.035714
76
0.536201
false
4.741294
false
false
false
pvital/patchew
api/migrations/0021_fix_recipients_utf8.py
2
1084
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations import json import email.header def _parse_header(header): r = "" for h, c in email.header.decode_header(header): if isinstance(h, bytes): h = h.decode(c or "utf-8", "replace") r += h ...
mit
-1,629,429,450,629,336,000
26.794872
73
0.632841
false
3.737931
false
false
false
palfrey/book-blog
bofh.py
1
2431
from common import * from re import compile, DOTALL, MULTILINE from urlgrab import Cache from urlparse import urljoin linkPattern = compile("<h3><a href=\"(/[^\"]+)\">(.+?)</a></h3>") earlierPattern = compile("<a href='([^\']+)'>.+?Earlier Stories.+?</a>", DOTALL | MULTILINE) titlePattern = compile("<h2>(.+?)</h2>") s...
agpl-3.0
-3,325,928,608,387,939,300
28.646341
329
0.647059
false
2.897497
false
false
false
Ektorus/bohrium
test/cil/Unittest/Benchmarks/IronPython/cphhpc/signal/convolution.py
1
3399
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # convolution - http://www.songho.ca/dsp/convolution/convolution.html # Copyright (C) 2011-2012 The CPHHPC Project lead by Brian Vinter # # This file is part of CPHHPC Toolbox. # # CPHHPC Toolbox is free software: you can redistribute it and/or modif...
lgpl-3.0
9,024,390,674,542,501,000
33.333333
104
0.624595
false
3.658773
false
false
false
avasilevich/spolks
icmp/utils/ip_packet.py
1
1482
import struct import socket from collections import namedtuple IPv4Header = namedtuple('IPv4Header', [ 'version', 'ihl', 'tos', 'total_length', 'id', 'flags', 'fragment_offset', 'ttl', 'proto', 'checksum', 'src', 'dest', ]) class IpHeader(IPv4Header): _format = '!B...
mit
4,343,442,371,421,247,000
22.15625
76
0.527665
false
3.32287
false
false
false
PKRoma/python-for-android
pythonforandroid/recipes/liblzma/__init__.py
4
2591
import sh from multiprocessing import cpu_count from os.path import exists, join from pythonforandroid.archs import Arch from pythonforandroid.logger import shprint from pythonforandroid.recipe import Recipe from pythonforandroid.util import current_directory, ensure_dir class LibLzmaRecipe(Recipe): version = ...
mit
-3,836,365,355,632,390,000
32.217949
78
0.545735
false
4.054773
false
false
false
peak6/st2
st2common/tests/unit/test_jinja_render_crypto_filters.py
3
2246
# 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
-2,793,195,057,411,800,000
44.836735
96
0.705254
false
4.083636
false
false
false
trojjer/romaine
src/romaine/core.py
1
1344
import os class Core(object): """ The core of the Romaine, provides BDD test API. """ # All located features feature_file_paths = set() instance = None def __init__(self): """ Initialise Romaine core. """ self.steps = {} Core.instance = self...
mit
5,296,890,157,354,747,000
27
74
0.541667
false
4.887273
false
false
false
Darrel12/FFAudX
MyListWidget.py
1
6481
from PyQt5.QtWidgets import QAbstractItemView, QFrame, QListWidget, QListWidgetItem from PyQt5.QtCore import Qt import os from mimetypes import MimeTypes from urllib import request from PyQt5 import QtGui, QtCore import savedData as sd from pytube import YouTube from pprint import pprint # Customized list widget item...
mit
-9,006,226,964,796,633,000
40.280255
120
0.613486
false
4.263816
false
false
false
kgizdov/EasyClangComplete
plugin/completion/base_complete.py
1
3073
"""Contains base class for completers. Attributes: log (logging.Logger): logger for this module """ import logging from ..tools import Tools log = logging.getLogger("ECC") class BaseCompleter: """A base class for clang based completions. Attributes: compiler_variant (CompilerVariant): compile...
mit
-550,637,532,913,715,000
29.425743
79
0.634884
false
4.94847
false
false
false
ssorj/haystack
python/haystack.py
1
15893
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
1,053,662,476,856,937,300
27.129204
81
0.569118
false
3.950534
false
false
false
yuyuz/FLASH
tests/unittests/test_benchmark_util.py
5
2920
## # wrapping: A program making it easy to use hyperparameter # optimization software. # Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer # # 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 Found...
gpl-3.0
-8,210,264,829,300,046,000
41.955882
99
0.612671
false
4.118477
true
false
false
paris-ci/CloudBot
plugins/core_misc.py
1
3369
import asyncio import socket from cloudbot import hook socket.setdefaulttimeout(10) # Auto-join on Invite (Configurable, defaults to True) @asyncio.coroutine @hook.irc_raw('INVITE') def invite(irc_paramlist, conn, event): """ :type irc_paramlist: list[str] :type conn: cloudbot.client.Client """ ...
gpl-3.0
-2,460,782,346,248,535,600
38.635294
133
0.61027
false
3.614807
true
false
false
gjr80/weewx
bin/weewx/drivers/wmr100.py
3
17667
# # Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com> # # See the file LICENSE.txt for your full rights. # """Classees and functions for interfacing with an Oregon Scientific WMR100 station. The WMRS200 reportedly works with this driver (NOT the WMR200, which is a different beast). The wind sensor reports ...
gpl-3.0
4,452,557,909,837,226,000
39.243736
98
0.54299
false
3.907764
true
false
false
alexsavio/aizkolari
aizkolari_measure.py
1
16654
#!/usr/bin/python #------------------------------------------------------------------------------- #License GPL v3.0 #Author: Alexandre Manhaes Savio <alexsavio@gmail.com> #Grupo de Inteligencia Computational <www.ehu.es/ccwintco> #Universidad del Pais Vasco UPV/EHU #Use this at your own risk! #-----------------------...
bsd-3-clause
636,419,978,259,120,100
37.461894
565
0.584064
false
3.642607
true
false
false
jegger/kivy
kivy/uix/recycleview/views.py
7
13895
''' RecycleView Views ================= .. versionadded:: 1.10.0 The adapter part of the RecycleView which together with the layout is the view part of the model-view-controller pattern. The view module handles converting the data to a view using the adapter class which is then displayed by the layout. A view can be...
mit
-7,012,238,564,549,061,000
36.352151
79
0.611227
false
4.339475
false
false
false
douban/tfmesos
tfmesos/scheduler.py
1
16913
import os import sys import math import select import socket import getpass import logging import textwrap from addict import Dict from six import iteritems from six.moves import urllib from pymesos import Scheduler, MesosSchedulerDriver from tfmesos.utils import send, recv, setup_logger import uuid FOREVER = 0xFFFFF...
bsd-3-clause
-6,295,978,636,634,129,000
34.162162
79
0.482765
false
4.307947
false
false
false
jasontbradshaw/plinth
util.py
1
2215
import collections import threading import errors import tokens def ensure_type(required_class, item, *rest): ''' Raises a WrongArgumentTypeError if all the items aren't instances of the required class/classes tuple. ''' if not isinstance(item, required_class): raise errors.WrongArgumentT...
mit
2,962,825,229,518,733,000
30.642857
82
0.669074
false
4.109462
false
false
false
anandology/pyjamas
pyjs/src/pyjs/options.py
1
10069
debug_options={} speed_options={} pythonic_options={} all_compile_options = dict( internal_ast = False, debug = False, print_statements=True, function_argument_checking=False, attribute_checking=False, getattr_support=True, bound_methods=True, descriptors=False, source_tracking=Fals...
apache-2.0
-3,915,245,851,955,995,000
38.178988
86
0.478399
false
5.155658
false
false
false
ebmscruff/studsup
matches.py
1
1877
#!/usr/bin/python3 import random from humans import Human from cities import City from clubs import Club class Match(): def __init__(self, teamHome, teamAway): self.teamHome = teamHome self.teamAway = teamAway self.homeScore = 0 self.awayScore = 0 self.result = 0 # 0 = unp...
gpl-3.0
5,004,726,597,598,686,000
31.929825
198
0.572722
false
3.568441
false
false
false
nzjrs/conduit
conduit/DBus.py
2
21538
""" DBus related functionality including the DBus interface and utility functions Copyright: John Stowers, 2006 License: GPLv2 """ import os.path import dbus import dbus.service import logging log = logging.getLogger("DBus") import conduit import conduit.utils as Utils import conduit.Conduit as Conduit import condui...
gpl-2.0
-548,939,383,247,523,200
35.505085
111
0.640124
false
3.520432
true
false
false
mufaddalq/cloudstack-datera-driver
tools/cli/cloudmonkey/cachemaker.py
2
5977
# -*- coding: utf-8 -*- # 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 # "...
apache-2.0
-8,580,099,564,586,530,000
32.022099
79
0.650661
false
3.963528
false
false
false
Leopardob/dice-dev
dice/dice_extras/scheduler.py
1
4324
from sys import stderr from dice.app import BasicApp from threading import _start_new_thread def debug(msg): stderr.write(msg+"\n") stderr.flush() class Scheduler: def __init__(self, project): self.__project = project self.__run_stack = [] self.__prepare_stack = [] def schedu...
gpl-3.0
-5,139,901,510,796,492,000
35.336134
107
0.533302
false
4.49948
false
false
false
mothsART/linkmanager
linkmserver/__init__.py
1
5077
import os import subprocess import json import arrow from flask import ( Flask, render_template, abort, request, jsonify, g ) from flask.ext.assets import Environment # from werkzeug.debug import get_current_traceback from werkzeug.contrib.cache import SimpleCache cache = SimpleCache() from linkmanager impor...
bsd-2-clause
3,865,095,246,136,694,300
25.862434
62
0.609218
false
3.600709
false
false
false
bfagundez/apex_paperboy
apex_executor.py
1
4129
# -*- coding: utf-8 -*- # unicode color codes OKGREEN = '\033[92m' NOTOKRED = '\033[91m' OKBLUE = '\033[94m' WARNING = '\033[93m' HEADER = '\033[95m' ENDC = '\033[0m' from lib.sforce.base import SforceBaseClient from suds import WebFault from lib.sforce.partner import SforcePartnerClient from lib.sforce.metadata impo...
mit
-8,470,200,002,246,769,000
30.083333
111
0.660736
false
3.393714
false
false
false
garbear/EventGhost
plugins/PS3/__init__.py
1
55108
README = """\ <u><b>1) Bluetooth</b></u> Tested succesfully working with Bluetooth Software : WIDCOMM Bluetooth Software 5.1.0.1100. 5.1.0.1100 is not the last version, but it's the most versatile version and works with most of Bluetooth adapter in a patched version. See <a href"http://forum.gsmhosting.com/v...
gpl-2.0
3,992,069,199,257,997,000
32.55047
126
0.562804
false
4.023069
false
false
false
rocky/python2-trepan
trepan/bwprocessor/msg.py
1
1030
# -*- coding: utf-8 -*- ''' Common I/O routines''' # Note for errmsg, msg, and msg_nocr we don't want to simply make # an assignment of method names like self.msg = self.debugger.intf.msg, # because we want to allow the interface (intf) to change # dynamically. That is, the value of self.debugger may change # in the ...
gpl-3.0
-3,844,177,047,269,908,500
28.428571
71
0.618447
false
3.691756
false
false
false
Scalr/scalr-ctl
scalrctl/commands/farm.py
2
6362
__author__ = 'Dmitriy Korsakov' __doc__ = 'Farm management' import json import copy from scalrctl import commands from scalrctl import click from scalrctl import request, settings class FarmTerminate(commands.SimplifiedAction): epilog = "Example: scalr-ctl farms terminate --farmId <ID> --force" post_temp...
apache-2.0
738,455,535,190,341,600
31.793814
117
0.584565
false
3.929586
false
false
false
dusteye/greasemonkey-scripts
autologin.py
1
1930
#!/usr/bin/python3 #coding:utf-8 import urllib.request import urllib.parse import http.cookiejar import smtplib from email.mime.text import MIMEText from email.header import Header user = 'footoo.notifications@gmail.com' passwd = '202,118,239,46' to = 'cliffwoo@gmail.com' def autologin(url, params, req_encoding, re...
gpl-2.0
511,054,629,723,975,300
25.388889
92
0.680526
false
2.698864
false
false
false
huaweiswitch/neutron
neutron/agent/ovs_cleanup_util.py
8
3836
# Copyright (c) 2012 OpenStack Foundation. # 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...
apache-2.0
-5,369,221,548,570,687,000
33.872727
78
0.671794
false
4.033649
true
false
false
GoogleCloudPlatform/appengine-gcs-client
python/test/rest_api_test.py
2
10917
# Copyright 2012 Google Inc. All Rights Reserved. import httplib import pickle import unittest import mock from google.appengine.ext import ndb from google.appengine.api import app_identity from google.appengine.api import memcache from google.appengine.api import urlfetch from google.appengine.ext import testbed ...
apache-2.0
-69,337,176,130,697,900
32.798762
79
0.633599
false
3.38932
true
false
false
blackpioter/sendgrid-python
sendgrid/helpers/mail/mail.py
1
10679
"""v3/mail/send response body builder""" from .personalization import Personalization from .header import Header class Mail(object): """A request to be sent with the SendGrid v3 Mail Send API (v3/mail/send). Use get() to get the request body. """ def __init__( self, from_email=None, subje...
mit
-4,177,295,920,119,920,000
26.665803
110
0.575709
false
4.371265
false
false
false
Philippe-Lawrence/pyBar
classDialog.py
1
3451
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2007 Philippe LAWRENCE # # This file is part of pyBar. # pyBar 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 Licen...
gpl-3.0
-4,579,491,287,271,453,000
28.228814
101
0.641635
false
3.371457
false
false
false
ContinuumIO/blaze
blaze/expr/expressions.py
3
29015
from __future__ import absolute_import, division, print_function from collections import Mapping from keyword import iskeyword import re import datashape from datashape import ( dshape, DataShape, Record, Var, Fixed, promote, Option, Null, ) from datashape.predicates import ( issca...
bsd-3-clause
5,986,935,608,387,100,000
26.015829
80
0.56781
false
3.825818
false
false
false
jireh-father/tensorflow-alexnet
ops.py
1
1864
import tensorflow as tf def conv(inputs, kernel_size, output_num, stride_size=1, init_bias=0.0, conv_padding='SAME', stddev=0.01, activation_func=tf.nn.relu): input_size = inputs.get_shape().as_list()[-1] conv_weights = tf.Variable( tf.random_normal([kernel_size, kernel_size, input_size, outp...
mit
5,898,839,375,387,653,000
46.794872
115
0.645386
false
3.180887
false
false
false
virtualsciences/egg.releaser
egg/releaser/git.py
1
3721
import logging import ConfigParser import io import sys import utils from zest.releaser.git import Git as OGGit logger = logging.getLogger(__name__) class Git(OGGit): """ Command proxy for Git enhanced with gitflow commands. """ def cmd_gitflow_release_start(self, version, base=''): return 'git...
gpl-2.0
-6,212,874,634,522,170,000
33.453704
79
0.586133
false
3.98821
true
false
false
piyushmaurya23/twitter-clone
config/settings/local.py
1
2021
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default...
mit
233,340,992,603,222,370
29.164179
99
0.492825
false
4.099391
false
false
false
pandreetto/info-glue-provider
src/GLUEInfoProvider/GLUE2ServiceHandler.py
1
2292
# Copyright (c) Members of the EGEE Collaboration. 2004. # See http://www.eu-egee.org/partners/ for details on the copyright # holders. # # 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 #...
apache-2.0
-8,300,528,381,849,291,000
39.210526
94
0.72993
false
3.293103
false
false
false
thomastweets/PythonRSA
rsa.py
1
15107
# -*- coding: utf-8 -*- ################################################################################ ################# Representational Similarity Analysis ######################### ################################################################################ # Amelie Haugg # Julia Brehm # Pia Schröder import...
gpl-2.0
192,519,840,704,321,060
33.174208
135
0.601721
false
3.594717
false
false
false
mamrhein/identifiers
src/identifiers/isbnutils.py
1
2204
# -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # Name: isbnutils # Purpose: Utility functions for checking ISBNs # # Author: Michael Amrhein (mamrhein@users.sourceforge.net) # # Copyright: (c) 2016 Michael Amrhein # License: This program is pa...
bsd-2-clause
7,380,924,420,951,742,000
35.131148
77
0.577586
false
4.02925
false
false
false
nddsg/SimpleDBMS
simple_dbms/insert_row.py
1
1183
from data_output_stream import DataOutputStream from column import Column class InsertRow: # Constants for special offsets # The field with this offset is a primary key. IS_PKEY = -1 # The field with this offset has a null value. IS_NULL = -2 def __init__(self, table, values): """ ...
gpl-3.0
-3,515,780,267,484,842,000
24.717391
73
0.578191
false
4.39777
false
false
false
toirl/ringo
ringo/lib/history.py
1
1556
import urlparse class History: def __init__(self, history): self.history = history def push(self, url): """Adds an url to the history if the url is not already the most recent entry. The scheme and network location (host, port, username, password), if present, are removed fro...
gpl-2.0
-5,592,376,716,367,176,000
34.363636
72
0.607969
false
4.471264
false
false
false
KSG-IT/ksg-nett
economy/admin.py
1
1195
from django.contrib import admin from economy.models import Deposit, SociBankAccount, SociProduct, SociSession, ProductOrder @admin.register(SociBankAccount) class SociBankAccountAdmin(admin.ModelAdmin): list_display = ['user', 'card_uuid', 'balance'] readonly_fields = ['balance'] @admin.register(SociProdu...
gpl-3.0
-4,060,153,103,539,028,000
24.425532
91
0.704603
false
3.556548
false
false
false
nickhand/nbodykit
nbodykit/extern/docrep.py
1
34200
import types import six import inspect import re from warnings import warn __version__ = '0.2.5' __author__ = 'Philipp Sommer' try: from matplotlib.cbook import dedent as dedents except ImportError: from textwrap import dedent as _dedents def dedents(s): return '\n'.join(_dedents(s or '').spli...
gpl-3.0
-3,629,700,325,544,615,000
32.595285
84
0.522485
false
4.495859
false
false
false
wcmckee/moejobs-site
cache/.mako.tmp/comments_helper_googleplus.tmpl.py
1
2430
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED STOP_RENDERING = runtime.STOP_RENDERING __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1443802885.4031692 _enable_loop = True _template_filename = '/usr/local/lib/python3.4/dist-package...
mit
-6,546,587,520,571,600,000
35.268657
348
0.617695
false
3.079848
false
false
false
tomkuba/vRAAPIClient
examples/reservation/createReservationsJinja2/createReservation-AllBusinessGroups.py
2
1557
#!/usr/bin/python import getpass import json import os from globalconfig import passwd, url, usr from jinja2 import Environment, FileSystemLoader from vraapiclient import reservation #Get the current directory currentDirectory = os.path.dirname(os.path.abspath(__file__)) client = reservation.ReservationClient(url, u...
mit
699,249,831,173,375,500
31.4375
91
0.69878
false
4.373596
false
false
false
OCA/sale-workflow
sale_automatic_workflow/tests/test_automatic_workflow_base.py
1
2654
# Copyright 2014 Camptocamp SA (author: Guewen Baconnier) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.tests import common class TestAutomaticWorkflowBase(common.TransactionCase): def create_sale_order(self, workflow, override=None): sale_obj = self.env['sale.order'] ...
agpl-3.0
5,893,069,417,804,947,000
39.212121
72
0.529766
false
4.076805
false
false
false
glibin/tortik
tortik/util/__init__.py
1
3283
# -*- encoding: utf-8 -*- from types import FunctionType import tornado.web from tornado.util import unicode_type try: import urlparse # py2 except ImportError: import urllib.parse as urlparse # py3 try: from urllib import urlencode # py2 except ImportError: from urllib.parse import urlencode # py...
mit
-2,950,805,595,275,233,300
31.186275
111
0.598843
false
3.643729
false
false
false
Facenapalm/NapalmBot
scripts/tow.py
1
3430
""" Script updates russian {{Перевод недели}} template according to Translate of the Week project. Usage: python tow.py """ import re import pywikibot META_TEMPLATE = "Template:TOWThisweek" LOCAL_TEMPLATE = "Шаблон:Перевод недели" ORIGINAL_ID = "original" LOCAL_ID = "russian" ARCHIVE_PAGE = "П...
mit
-6,701,825,818,206,077,000
28.504673
90
0.585784
false
3.117479
false
false
false
meeb/txhttprelay
txhttprelay/transport.py
1
5773
''' Copyright 2012 Joe Harris 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
1,102,819,096,241,351,200
29.871658
113
0.618916
false
4.444188
false
false
false
vollov/django-blog
image/migrations/0001_initial.py
1
1822
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-11-08 19:18 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import image.models import image.storage import uuid class Migration(migrations.Migration): initial = True dependencies = ...
mit
-1,071,830,020,456,034,800
40.409091
142
0.598244
false
4.140909
false
false
false
hradec/gaffer
python/GafferUITest/GadgetTest.py
6
9854
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
bsd-3-clause
-6,002,373,824,026,318,000
27.897361
85
0.66298
false
3.203511
true
false
false
InspectorIncognito/visualization
AndroidRequests/migrations/0023_auto_20170310_1529.py
1
1247
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db.models import F from django.db import models, migrations """ PROCEDURE - Delete aux column """ class Migration(migrations.Migration): dependencies = [ ('AndroidRequests', '0022_auto_20170310_1525'), ] operations = [ ...
gpl-3.0
-268,970,102,853,448,700
24.44898
55
0.55012
false
4.227119
false
false
false
flippym/toolbox
yum-package.py
1
1083
# Yum package checker and installer __author__ = "Frederico Martins" __license__ = "GPLv3" __version__ = 1.2 from os import system from output_handler import OutputWaiting class Package(object): def __init__(self, packages): if type(packages) is list or type(packages) is tuple or...
gpl-3.0
-9,131,135,238,154,205,000
25.414634
90
0.555863
false
4.314741
false
false
false
iulian787/spack
var/spack/repos/builtin/packages/libvdwxc/package.py
2
1769
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libvdwxc(AutotoolsPackage): """Portable C library of density functionals with van der Waa...
lgpl-2.1
2,800,756,667,424,239,600
32.377358
95
0.6026
false
3.552209
false
false
false
jhpyle/docassemble
docassemble_base/docassemble/base/ocr.py
1
18129
import tempfile import subprocess from PIL import Image, ImageEnhance from docassemble.base.functions import get_config, get_language, ReturnValue from docassemble.base.core import DAFile, DAFileList, DAFileCollection, DAStaticFile import PyPDF2 from docassemble.base.logger import logmessage from docassemble.base.error...
mit
-5,302,447,009,926,579,000
46.960317
227
0.579072
false
3.631611
false
false
false
XcomConvent/xcom40k-shades
xcom40k/app/migrations/0026_auto_20120106_2212.py
1
1819
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('app', '0025_auto_20150923_0843'), ] operations = [ migrations.CreateMo...
apache-2.0
-3,998,331,126,975,175,700
31.482143
114
0.523364
false
4.53616
false
false
false
asceth/devsyn
devsyn/cameras/firstperson.py
1
3702
import __builtin__ from direct.showbase.DirectObject import DirectObject from direct.task.Task import Task from devsyn.entities import Entity base = __builtin__.base class FirstPersonCamera(Entity): # TODO: Make speed configurable # constants speed = 50 def __init__(self, parent = base.render): # basic ...
mit
-5,657,496,182,112,678,000
31.761062
72
0.640194
false
3.329137
false
false
false
MKuranowski/WarsawGTFS
static/shapes/helpers.py
1
3586
from pyroutelib3 import distHaversine from contextlib import contextmanager from typing import IO, Optional, List, Union, Tuple from time import time import signal import math import os from ..const import DIR_SHAPE_CACHE, SHAPE_CACHE_TTL from ..util import ensure_dir_exists _Pt = Tuple[float, float] @contextmanage...
mit
4,947,337,439,888,656,000
30.45614
94
0.64222
false
3.210385
false
false
false
priomsrb/vimswitch
vimswitch/test/FileSystemSandbox.py
1
3987
import os import shutil import vimswitch.six.moves.builtins as builtins class FileSystemSandbox: """ This static class sets up a global sandbox where all disk modification is disabled except inside the sandbox directory. If an operation outside the sandbox directory occurs, a FileSystemSandboxError is...
gpl-2.0
7,276,454,648,368,458,000
34.598214
83
0.637823
false
3.901174
false
false
false
moses-rolston/err
errbot/backends/base.py
1
44212
import difflib import inspect import io import logging import traceback import warnings from collections import deque, defaultdict from xml.etree import cElementTree as ET from xml.etree.cElementTree import ParseError from errbot import botcmd, PY2 from errbot.utils import get_sender_username, xhtml2txt, parse_jid, s...
gpl-3.0
-6,755,025,033,461,585,000
34.200637
115
0.580815
false
4.331962
true
false
false
Nokorbis/unodp
src/main/resources/scripts/dataset_profiler/main.py
1
1870
""" Script that tries to parse a dataset to profile its variables""" import os import sys from databasehelper import DatabaseHelper from profiler import Profiler def main(): """ Main function of the program Arguments should be: 1) path of the file to analyse 2) format of the file 3) id of the...
apache-2.0
-5,158,722,433,175,688,000
25.338028
73
0.596257
false
3.456562
false
false
false
guglielmino/pushetta-api-django
pushetta/api/subscriber_sl.py
1
3851
# coding=utf-8 # Progetto: Pushetta API # Service layer con le funzionalità per la gestione Subscribers from rest_framework import generics, permissions from rest_framework.response import Response from rest_framework import status from django.conf import settings from core.models import Subscriber, Channel, Channe...
gpl-3.0
3,609,743,969,598,237,700
38.27551
117
0.651078
false
4.699634
false
false
false
hammadi123/CF_Algorithms
baseline.py
1
3368
from __future__ import division import numpy as np import matplotlib.pyplot as plt import math import operator import time import operator def readratings(f): ratings = {} index=0 somme=0 for row in f: line = row.split("\t") userid, movieid, rating = int(line[0]), int(line[1]), ...
gpl-3.0
3,464,100,723,694,914,600
23.23741
85
0.597981
false
2.772016
false
false
false
codysmithd/PyGPS
NMEA.py
1
4501
''' NMEA.py Defines NMEA sentence and other useful classes ''' class Point: ''' Point: Simple coordinate point Attributes: lat: Latutude (decimal) lng: Longitude (decimal) alt: Altitude (meters) ''' def __init__(self, lat=0, lng=0, alt=0): self.lat = lat sel...
apache-2.0
5,130,355,820,602,922,000
31.615942
106
0.504999
false
3.791912
false
false
false
Panda3D-google-code-repositories/panda3d-beast
rttcache/beast/Color.py
2
5605
#!/usr/bin/python #encoding: utf-8 ''' This file is part of the Panda3D user interface library, Beast. See included "License.txt" ''' class Color(object): ''' Converts a full color eg, 255 color, (255, 255, 255) OR (255, 255, 255, 255) to a float color (1.0, 1.0, 1.0, 1.0) Also accepts a fl...
bsd-2-clause
6,329,967,598,123,207,000
34.251572
122
0.548439
false
3.322466
false
false
false
kwoodhouse93/astro-bomber
source/weapon.py
1
4940
import pygame import pymunk from pymunk.vec2d import Vec2d from source import game from source.constants import * from source.utilities import * class Projectile: def __init__(self, position, velocity, impulse): self.radius = BULLET_RADIUS mass = BULLET_MASS moment = pymunk.moment_for_circ...
mit
8,768,513,573,241,920,000
31.077922
81
0.62915
false
3.416321
false
false
false
ksmaheshkumar/gitfs
tests/views/test_read_only.py
3
1735
# Copyright 2014 PressLabs SRL # # 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,...
apache-2.0
7,316,076,637,565,921,000
27.916667
74
0.633429
false
3.821586
true
false
false
klpdotorg/disereports
handlers/Demographics.py
1
5855
import web import psycopg2 import traceback import sys, os,traceback from operator import itemgetter import db.KLPDB import db.Queries_dise from utils.CommonUtil import CommonUtil #connection = db.KLPDB.getConnection() #cursor = connection.cursor() cursor = db.KLPDB.getWebDbConnection1() class Demographics: def ge...
mit
-8,367,429,558,039,493,000
34.484848
135
0.614518
false
3.236595
false
false
false
tBaxter/tango-contact-manager
setup.py
1
1109
# -*- coding: utf-8 -*- from distutils.core import setup from setuptools import find_packages with open('docs/requirements.txt') as f: required = f.read().splitlines() setup( name='tango-contact-manager', version='0.10.0', author=u'Tim Baxter', author_email='mail.baxter@gmail.com', url='https:...
mit
5,236,171,838,286,252,000
32.606061
92
0.639315
false
4.092251
false
true
false
mesosphere/dcos-cli
cli/tests/integrations/helpers/job.py
1
3171
import contextlib import json from .common import assert_command, exec_command from .marathon import watch_deployment def remove_job(job_id): """ Remove a job :param job_id: id of job to remove :type job_id: str :rtype: None """ assert_command(['dcos', 'job', 'remove', '...
apache-2.0
-8,802,720,673,048,894,000
21.65
72
0.62157
false
3.583051
false
false
false
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
tests/test_forms.py
1
7889
# -*- coding: utf-8 -*- """Tests for forms and WTForms extensions.""" # noqa: D103 import itertools from unittest.mock import MagicMock import pytest from wtforms import Form, StringField from orcid_hub.forms import validate_orcid_id_field # noqa: E128 from orcid_hub.forms import BitmapMultipleValueField, CountrySe...
mit
-951,219,314,364,749,000
31.870833
119
0.593611
false
3.247839
true
false
false
walchko/pyxl320
bin/set_angle.py
1
1405
#!/usr/bin/env python ############################################## # The MIT License (MIT) # Copyright (c) 2016 Kevin Walchko # see LICENSE for full details ############################################## from pyxl320 import Packet # from pyxl320 import DummySerial from pyxl320 import ServoSerial import argparse D...
mit
5,071,201,303,506,127,000
24.089286
105
0.641993
false
3.164414
false
false
false
prathapsridharan/health_project
health_project/questions/forms.py
1
2744
"""Contains form class defintions for form for the questions app. Classes: [ SurveyQuestionForm ] """ from django import forms from django.core.urlresolvers import reverse from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout fro...
bsd-3-clause
8,239,022,131,864,577,000
32.876543
95
0.601676
false
4.469055
false
false
false
jcorrius/go-oo-mingw32-soc
scratch/mso-dumper/src/ole.py
1
22475
######################################################################## # # OpenOffice.org - a multi-platform office productivity suite # # Author: # Kohei Yoshida <kyoshida@novell.com> # # The Contents of this file are made available subject to the terms # of GNU Lesser General Public License Version ...
lgpl-3.0
-4,926,262,211,372,972,000
29.248991
90
0.542158
false
3.967343
false
false
false
ADicksonLab/wepy
src/wepy/hdf5.py
1
206591
# -*- coding: utf-8 -*- """Primary wepy simulation database driver and access API using the HDF5 format. The HDF5 Format Specification ============================= As part of the wepy framework this module provides a fully-featured API for creating and accessing data generated in weighted ensemble simulations run w...
mit
-871,012,172,022,830,700
33.068437
119
0.58065
false
4.334865
false
false
false
cerivera/crossfire
bin/firefox/addon-sdk-1.15/python-lib/cuddlefish/docs/generate.py
1
9935
# 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/. import os import sys import shutil import hashlib import tarfile import StringIO from cuddlefish._version import get_ve...
mit
2,806,518,507,816,887,300
49.176768
119
0.688576
false
3.241436
false
false
false
rhnvrm/mini-projects
bioinformatics/Motifs.py
1
3302
#! /usr/bin/python3.4 # -*-coding:utf-8 -* def Count(Motifs): """ Returns the count matrix of a list of sequences. The count matrix is the number of times a nucleotid appears at a position in the pool of sequences (Motifs). :param Motifs: The sequences to make the count matrix of. :type Motifs: list of string...
mit
-4,212,984,857,459,504,000
25
109
0.608419
false
3.298701
false
false
false
aileisun/bubbleimg
bubbleimg/imgdownload/hsc/hscimgloader.py
1
12117
# hscimgloader.py # ALS 2017/05/02 import numpy as np import os import requests import astropy.units as u from astropy.io import fits import re from ..loader import imgLoader from ...filters import surveysetup from ..get_credential import getCrendential from . import hscurl nanomaggy = u.def_unit('nanomaggy', 3.631...
mit
-9,032,188,369,782,719,000
29.444724
185
0.68276
false
2.941019
false
false
false
kgullikson88/HET-Scripts
Smooth.py
1
6217
import numpy as np # import FitsUtils import FittingUtilities import HelperFunctions import matplotlib.pyplot as plt import sys import os from astropy import units from astropy.io import fits, ascii import DataStructures from scipy.interpolate import InterpolatedUnivariateSpline as interp import MakeModel import Helper...
gpl-3.0
4,576,857,145,479,174,000
37.141104
119
0.564098
false
3.770164
false
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/job/models/resource_usage_statistics.py
2
1414
# 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
1,628,343,292,106,821,000
30.422222
76
0.5686
false
4.666667
false
false
false
juliarizza/web2courses
controllers/default.py
1
7458
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a sample controller ## - index is the default action of any application ## - user is required for authentication and authorization...
mit
2,963,647,003,533,820,400
35.920792
124
0.593134
false
3.700744
false
false
false
jbaayen/sympy
sympy/thirdparty/__init__.py
10
1047
"""Thirdparty Packages for internal use. """ import sys import os def import_thirdparty(lib): """ Imports a thirdparty package "lib" by setting all paths correctly. At the moment, there is only the "pyglet" library, so we just put pyglet to sys.path temporarily, then import "lib" and then restore the...
bsd-3-clause
2,119,548,506,643,350,000
28.083333
80
0.588348
false
3.892193
false
false
false
bigartm/visartm
algo/tools/vkloader.py
1
1609
import os import json def download_wall(domain, dataset_folder, cut=1000000, access_token=None): import vk session = vk.Session(access_token=access_token) api = vk.API(session) info = dict() docs_folder = os.path.join(dataset_folder, "documents") os.makedirs(docs_folder, exist_ok=True) os....
bsd-3-clause
5,083,216,247,126,751,000
31.18
76
0.50404
false
3.460215
false
false
false
yeongseon/django_beautifulseodang
django_beautifulseodang/settings.py
1
8083
""" Django settings for django_beautifulseodang project. Generated by 'django-admin startproject' using Django 1.8.14. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ ...
mit
1,824,213,679,889,360,100
26.172297
85
0.674748
false
3.184086
false
false
false
ArcheProject/arche_pas
arche_pas/registration_cases.py
1
8840
# -*- coding: utf-8 -*- from __future__ import unicode_literals from uuid import uuid4 from arche.interfaces import IFlashMessages from pyramid.httpexceptions import HTTPFound from arche_pas import _ from arche_pas.models import register_case def callback_case_1(provider, user, data): provider.store(user, data...
gpl-2.0
4,128,858,310,187,192,000
36.617021
107
0.648982
false
4.266409
true
false
false
Diego999/Sudoku-Recognition
Training/Sets/create_sets.py
1
2220
from os import listdir, path from random import shuffle SEPARATOR = '_' class Attrib: def __init__(self, number, id, path): self.number, self.id, self.path = number, id, path def __str__(self): return 'Number : ' + str(self.number) + ', Id : ' + str(self.id) + ', Path : ' + self.path def...
mit
-4,436,189,453,462,923,300
24.238636
98
0.584685
false
3.457944
false
false
false
ggreg/presto-python-client
prestodb/client.py
1
18954
# 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 # distributed under th...
apache-2.0
7,682,619,366,289,095,000
32.846429
101
0.59101
false
4.309686
false
false
false
BrainComputationLab/ncs
applications/simulator/simulator.py
1
1304
#!/usr/bin/python import sys import json_model import pyncs def Run(argv): if len(argv) < 2: print "Usage: %s <model_file>" % argv[0] model = json_model.JSONModel(argv[1]) if not model.valid: print "Failed to load model" return model_specification = model.model_specification simulation_paramete...
bsd-2-clause
-4,326,328,763,696,087,600
28.636364
58
0.680982
false
3.422572
false
false
false
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/dask/store/core.py
2
2913
from __future__ import absolute_import, division, print_function from collections import defaultdict from operator import getitem from datetime import datetime from time import time from ..compatibility import MutableMapping from ..core import istask, ishashable from ..utils_test import add # noqa: F401 class Stor...
gpl-3.0
-8,787,493,078,674,475,000
24.330435
76
0.565396
false
4.040222
false
false
false