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
jashandeep-sohi/python-blowfish
blowfish.py
1
49719
# vim: filetype=python3 tabstop=2 expandtab fileencoding=utf-8 # blowfish # Copyright (C) 2015 Jashandeep Sohi <jashandeep.s.sohi@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, ei...
gpl-3.0
2,806,202,192,635,136,500
36.923722
80
0.653043
false
2.53728
false
false
false
ahkscript/sjBot
commands/##monsterhunter/help.py
1
1542
#!/usr/bin/env python3 import inspect owner = False aliases = ['helpmeplz'] def help(con, sjBot, commands, trigger, host, channel, command=None): """Shows information about commands.""" if command is None: output = [] output.append('Here is a list of commands: {}.'.format(', '.join( ...
gpl-3.0
-6,210,531,313,193,145,000
32.543478
73
0.500649
false
4.057895
false
false
false
petrvanblokland/Xierpa3
xierpa3/components/logo.py
1
3750
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
mit
-2,568,391,173,460,124,000
44.180723
109
0.6088
false
3.494874
false
false
false
adrn/TwoFace
twoface/data.py
1
1645
# Third-party import astropy.units as u from astropy.time import Time import numpy as np from thejoker.data import RVData def star_to_apogeervdata(star, clean=False): """Return a `twoface.data.APOGEERVData` instance for this star. Parameters ---------- """ jd = [] rv = [] rv_rand_err = [...
mit
-3,166,085,702,231,851,500
25.111111
77
0.54772
false
3.06903
false
false
false
PhloxAR/PhloxAR-dc1394
dc1394/frame.py
1
6790
# ----------------------------------------------------------------------------- # # -*- coding: utf-8 -*- # # phlox-libdc1394/phloxar-dc1394/frame.py # # Copyright (C) 2016, by Matthias Yang Chen <matthias_cy@outlook.com> # All rights reserved. # # phlox-libdc1394 is free software: you can redistribute it and/or modify...
gpl-3.0
-5,535,564,742,537,007,000
37.361582
85
0.584831
false
4.061005
false
false
false
lhotchkiss/mousetrap
src/mousetrap/ocvfw/_ocv.py
1
16960
# # Copyright 2009 Flavio Percoco Premoli # # This file is part of Ocvfw. # # Ocvfw is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License v2 as published # by the Free Software Foundation. # # Ocvfw is distributed in the hope that it will be useful, # but WITHOUT...
gpl-2.0
6,197,836,876,637,046,000
31.243346
109
0.531132
false
3.597794
false
false
false
frejanordsiek/hdf5storage
tests/test_dict_like_storage_methods.py
1
7762
# Copyright (c) 2013-2021, Freja Nordsiek # 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 conditions ...
bsd-2-clause
-1,991,158,301,032,182,500
32.895197
72
0.636047
false
3.630496
true
false
false
greenify/zodiacy
bin/import_to_sql.py
1
1369
#!/usr/bin/env python3 # encoding: utf-8 import argparse import os import sqlite3 import json """import_to_sql.py: Imports the Horoscope database into a SQLite""" __author__ = "Project Zodiacy" __copyright__ = "Copyright 2015, Project Zodiacy" parser = argparse.ArgumentParser(description="Awesome SQLite importer")...
mit
-3,553,664,374,160,074,000
34.102564
117
0.61943
false
3.413965
false
false
false
lovedaybrooke/gender-decoder
db_repository/versions/005_migration.py
1
1581
from sqlalchemy import * from migrate import * import datetime from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() job_ad = Table('job_ad', pre_meta, Column('hash', VARCHAR, primary_key=True, nullable=False), Column('date', TIMESTAMP), Column('jobAdText', TEXT), Column('m...
mit
-7,568,859,038,292,744,000
33.369565
78
0.689437
false
3.529018
false
false
false
henriquegemignani/randovania
randovania/game_connection/connection_base.py
1
1872
from enum import Enum from typing import Optional, Callable, Awaitable, List, NamedTuple, Dict, Tuple from randovania.game_description.resources.item_resource_info import ItemResourceInfo from randovania.game_description.resources.pickup_entry import PickupEntry class GameConnectionStatus(Enum): Disconnected = "...
gpl-3.0
-7,045,308,066,942,127,000
32.428571
100
0.730235
false
4.051948
false
false
false
Cinntax/home-assistant
homeassistant/components/geniushub/sensor.py
1
3755
"""Support for Genius Hub sensor devices.""" from datetime import timedelta from typing import Any, Awaitable, Dict from homeassistant.const import DEVICE_CLASS_BATTERY from homeassistant.util.dt import utc_from_timestamp, utcnow from . import DOMAIN, GeniusEntity GH_HAS_BATTERY = ["Room Thermostat", "Genius Valve",...
apache-2.0
157,621,510,489,957,730
30.033058
88
0.604527
false
3.819939
false
false
false
thorgate/django-esteid
esteid/authentication/views.py
1
3854
import logging from typing import Type, TYPE_CHECKING from django.http import HttpRequest, JsonResponse from esteid.exceptions import ActionInProgress from esteid.mixins import DjangoRestCompatibilityMixin, SessionViewMixin from .authenticator import Authenticator from .types import AuthenticationResult try: f...
bsd-3-clause
-1,586,896,137,301,164,500
31.661017
116
0.677737
false
4.682868
false
false
false
mozilla/firefox-flicks
vendor-local/lib/python/billiard/forking.py
1
20104
# # Module for starting a process object using os.fork() or CreateProcess() # # multiprocessing/forking.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import import os import sys import signal import warnings from ._ext import Connection, ...
bsd-3-clause
-3,203,743,688,771,891,000
29.231579
79
0.557998
false
4.04507
false
false
false
sergmelikyan/murano
murano/utils.py
1
2779
# Copyright (c) 2013 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
-8,519,043,706,058,087,000
36.053333
78
0.631522
false
4.191554
false
false
false
pyprism/Diary
hiren/settings.py
1
4794
""" Django settings for hiren project. Generated by 'django-admin startproject' using Django 1.9.5. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os impo...
mit
2,283,533,890,099,398,700
25.633333
71
0.638089
false
3.55902
false
false
false
parinporecha/backend_gtgonline
GTG/gtk/__init__.py
1
1400
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2012 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
-6,198,741,599,627,684,000
45.666667
79
0.654286
false
3.921569
false
false
false
beni55/djangolint
project/lint/views.py
2
2264
from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.utils import simplejson as json from django.views.decorators.http import require_POST from .forms import ReportForm from .models import Report, STAGES from .tasks import process_report def index(request): repo...
isc
-2,993,274,295,728,508,400
33.30303
75
0.631625
false
3.760797
false
false
false
bgaultier/laboitepro
laboite/apps/weather/migrations/0001_initial.py
1
1855
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-11-21 20:41 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('boites', '__first__'), ] operati...
agpl-3.0
6,369,800,420,185,776,000
50.527778
191
0.616173
false
3.560461
false
false
false
andykimpe/chromium-test-npapi
base/android/jni_generator/jni_generator.py
1
53217
#!/usr/bin/env python # Copyright (c) 2012 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. """Extracts native methods from a Java file and generates the JNI bindings. If you change this, please run and update the tests."""...
bsd-3-clause
3,317,135,672,563,785,000
36.214685
80
0.613281
false
3.697165
false
false
false
vovanec/supervisor_checks
supervisor_checks/bin/xmlrpc_check.py
1
3794
#! /usr/bin/env python3 """Example configuration: [eventlistener:example_check] command=/usr/local/bin/supervisor_xmlrpc_check -g example_service -n example_check -u /ping -r 3 -p 8080 events=TICK_60 """ import argparse import sys from supervisor_checks import check_runner from supervisor_checks.check_modules impor...
mit
-8,783,079,380,630,934,000
41.155556
104
0.524512
false
4.52205
false
false
false
sportorg/pysport
sportorg/modules/live/live.py
1
1390
from functools import partial from threading import Thread import requests from sportorg.models.memory import race from sportorg.modules.live import orgeo class LiveClient: @staticmethod def is_enabled(): obj = race() live_enabled = obj.get_setting('live_enabled', False) urls = obj.g...
gpl-3.0
-7,688,169,801,107,381,000
25.226415
73
0.576978
false
3.926554
false
false
false
jomyhuang/sdwle
SDWLE/ui/game_console.py
1
9331
from SDWLE.constants import CHARACTER_CLASS card_abbreviations = { 'Mark of the Wild': 'Mrk Wild', 'Power of the Wild': 'Pow Wild', 'Wild Growth': 'Wld Grth', 'Healing Touch': 'Hlng Tch', 'Mark of Nature': 'Mrk Ntr', 'Savage Roar': 'Svg Roar', 'Soul of the Forest': 'Sol Frst', 'Force of...
mit
-7,777,511,036,395,406,000
39.04721
129
0.506698
false
3.529123
false
false
false
blissland/devflixx
lib/subliminal/subliminal/providers/opensubtitles.py
1
8161
# -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 import logging import os import re import zlib import babelfish import guessit from . import Provider from .. import __version__ from ..compat import ServerProxy, TimeoutTransport from ..exceptions import ProviderError, AuthenticationError, D...
gpl-2.0
-4,338,821,856,794,192,400
38.425121
139
0.63154
false
4.138438
false
false
false
MarineLasbleis/GrowYourIC
notebooks/Yoshida.py
1
4212
# -*- coding: UTF-8 -*- import numpy as np import matplotlib.pyplot as plt #for figures #from mpl_toolkits.basemap import Basemap #to render maps import math from GrowYourIC import tracers, positions, geodyn, geodyn_trg, geodyn_static, plot_data, data, geodyn_analytical_flows #plt.rcParams['figure.figsize'] = (8.0,...
mit
8,356,120,609,574,831,000
37.3
118
0.69943
false
2.499703
false
false
false
UCRoboticsLab/BaxterTictactoe
src/baxter_tictactoe/scripts/camera_gui.py
1
15093
#!/usr/bin/env python """ A GUI to help user take snapshot with hand camera """ import rospy import struct import Tkinter as tk import tkFileDialog, tkMessageBox import tkSimpleDialog from baxter_interface.camera import CameraController from PIL import Image from PIL import ImageTk, ImageDraw import numpy as np f...
apache-2.0
-7,776,810,201,796,508,000
33.9375
124
0.579673
false
3.627253
false
false
false
djaodjin/drop
src/dlogwatch.py
1
6707
#!/usr/bin/env python # # Copyright (c) 2020, DjaoDjin 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 ...
bsd-2-clause
8,943,113,638,740,521,000
34.675532
168
0.590279
false
3.892629
false
false
false
andreMonkey/camera_processing
filming_test.py
1
1179
#!/usr/bin/python from __future__ import absolute_import, division, print_function, unicode_literals import picamera import time import pi3d W, H = 800, 600 with picamera.PiCamera() as camera: camera.resolution = (W, H) camera.framerate = 24 camera.start_preview() #NB layer argument below, fps as sl...
bsd-2-clause
-3,019,243,204,453,303,000
33.676471
84
0.626802
false
3.070313
false
false
false
mythmon/airmozilla
airmozilla/manage/tests/views/test_tags.py
1
3865
import json from nose.tools import eq_, ok_ from funfactory.urlresolvers import reverse from airmozilla.main.models import Tag, Event from .base import ManageTestCase class TestTags(ManageTestCase): def test_tags(self): """Tag management pages return successfully.""" response = self.client.get(...
bsd-3-clause
-6,290,076,975,803,354,000
33.81982
71
0.580336
false
3.67745
true
false
false
slackhq/python-slackclient
integration_tests/samples/basic_usage/views_2.py
1
3819
import json import logging logging.basicConfig(level=logging.DEBUG) # --------------------- # Slack WebClient # --------------------- import os from slack_sdk.web import WebClient from slack_sdk.errors import SlackApiError from slack_sdk.signature import SignatureVerifier from slack_sdk.models.blocks import InputBl...
mit
-1,292,510,414,588,983,000
34.361111
88
0.488086
false
4.709001
false
false
false
WalrusCow/euler
Solutions/problem61.py
1
2077
from collections import defaultdict def triangle(n): return int((n * (n + 1)) / 2) def square(n): return n * n def pentagon(n): return int((n * (3 * n - 1)) / 2) def hexagon(n): return n * (2 * n - 1) def heptagon(n): return int((n * (5 * n - 3)) / 2) def octagon(n): return n * (3 * ...
mit
-5,259,867,364,386,793,000
27.067568
75
0.539239
false
3.473244
false
false
false
Vilsepi/infinimonkey
backend/ratings-api.py
1
1556
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import json import boto3 table = boto3.resource("dynamodb").Table(os.environ.get("RAMBLINGS_TABLE_NAME")) # def update_item_rating(vote): # table.update_item( # Key={ # 'username': 'janedoe', # 'last_name': 'Doe' # }, # UpdateE...
mit
-1,414,629,655,844,149,200
24.096774
80
0.558483
false
3.268908
false
false
false
gfvandehei/roomlight-6
light_GUI.py
1
3827
import pyaudio import numpy as np import threading import serial from tkinter import * import serial class GUI(Frame): def audio_thread(self): ''' This function is in charge of collecting data from microphone and changing it into usable data. Is meant to be ran as a thread so it do...
mit
183,737,504,966,901,380
31.440678
93
0.585837
false
3.556691
false
false
false
lahwaacz/qutebrowser
qutebrowser/browser/webkit/webkittab.py
1
27974
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
-3,768,238,808,339,824,000
34.864103
79
0.608279
false
3.919574
false
false
false
lsiemens/lsiemens.github.io
theory/fractional_calculus/code/old/FCC2.py
1
1663
""" Ideas about fractional calculus defined on C^2 J^b f(x, a) = f(x, a + b) """ import numpy from matplotlib import pyplot from scipy import special def monomial(x, a, x_0, a_0): return (x - x_0)**(a - a_0)/special.gamma(a - a_0 + 1) def exp(x, a, b): return b**(-a)*numpy.exp(b*x) def projx(f, x, a): n...
mit
-7,503,364,648,748,710,000
24.19697
82
0.5911
false
2.105063
false
false
false
fajoy/nova
nova/tests/api/openstack/compute/contrib/test_hosts.py
1
14601
# Copyright (c) 2011 OpenStack, LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
6,406,965,252,625,038,000
38.040107
78
0.609616
false
3.68526
true
false
false
release-monitoring/anitya
anitya/lib/backends/cpan.py
1
3710
# -*- coding: utf-8 -*- """ (c) 2014-2016 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon <pingou@pingoured.fr> Ralph Bean <rbean@redhat.com> """ import logging from defusedxml import ElementTree as ET from anitya.lib.backends import BaseBackend, get_versions_by_regex, REGEX from anitya.lib.exceptions...
gpl-2.0
-7,440,166,123,449,222,000
31.54386
86
0.628302
false
4.159193
false
false
false
sztosz/neonet
CommercialReturns/views.py
1
4999
#!/usr/bin/python # -*- coding: utf-8 -*- # # Created on 2013-10-11 # # @author: Bartosz Nowak sztosz@gmail.com # # This file is licensed GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 from __future__ import unicode_literals import unicodecsv from django.contrib.auth import logout from django.shortcuts import red...
gpl-3.0
-2,720,274,015,115,004,400
37.674419
116
0.693125
false
3.770975
false
false
false
ElvisLouis/code
work/ML/tensorflow/practice/word2vec.py
1
19527
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
gpl-2.0
-6,679,942,520,566,485,000
35.774011
80
0.623803
false
3.571794
false
false
false
phoebe-project/phoebe2-docs
2.1/tutorials/saving_and_loading.py
1
2914
#!/usr/bin/env python # coding: utf-8 # Saving and Loading # ============================ # # Setup # ----------------------------- # Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the late...
gpl-3.0
8,274,963,877,160,067,000
23.905983
270
0.68291
false
3.288939
false
false
false
ivanamihalek/smallmol
gmx_lib/solvent_equilibration.py
1
2572
import os, subprocess import grompp ######################################### # this is a hack to find all restraint files # we have available def itp_files(params): proc = subprocess.Popen(["bash", "-c", "grep include ../%s/*top | grep -v %s"%(params.rundirs.top_dir,params.physical.forcefield)], stdout=subproc...
gpl-2.0
-847,232,138,338,042,600
37.969697
132
0.670295
false
2.959724
false
false
false
wlof/gameoflife
gameoflife/gamenumpy.py
1
6610
# -*- coding: utf-8 -*- # This file is part of gameoflife. # Copyright 2015, wlof. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the r...
mit
817,127,828,021,938,300
36.134831
78
0.633283
false
3.881386
false
false
false
fasaxc/felix
calico/felix/test/stub_ipsets.py
1
4497
# -*- coding: utf-8 -*- # Copyright 2014 Metaswitch Networks # # 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 applicab...
apache-2.0
-1,392,339,800,992,648,700
30.013793
80
0.599288
false
3.785354
false
false
false
repotvsupertuga/tvsupertuga.repository
script.module.tulip/lib/tulip/url_dispatcher.py
1
4656
# -*- coding: utf-8 -*- ''' Tulip routine libraries, based on lambda's lamlib Url dispatcher module thanks to tknorris Author Twilight0 License summary below, for more details please read license.txt file This program is free software: you can redistribute it and/or modify it unde...
gpl-2.0
-1,699,771,029,992,076,000
33.746269
126
0.587844
false
4.688822
false
false
false
maximinus/wargame
wargame-examples/04_tweens/chained-tweens.py
1
1109
#!/usr/bin/env python import os import pygame import wargame.engine from wargame.scene import Scene from wargame.nodes import ImageNode from wargame.tweens import ChainedTween, MoveTween # example of moving Node2d def game(): resources = os.path.join(os.getcwd(), '../') controller = wargame.engine.init(re...
gpl-3.0
1,494,699,149,781,288,000
29.805556
101
0.620379
false
3.40184
false
false
false
mayuroks/schedulord
server.py
1
1861
from flask import Flask, request, jsonify from werkzeug.utils import secure_filename from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.restless import APIManager import os app = Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/schedulord.db' app.config['UPLOA...
mit
5,530,831,589,241,147,000
25.971014
96
0.639979
false
3.247818
false
false
false
danielquinn/spirithunter
src/aspects/arbiters/celestial.py
1
3517
import ephem from .base import Arbiter from ..models import Facet, Element class CelestialArbiter(Arbiter): WEIGHT_DAY = 5 WEIGHT_NIGHT = 5 WEIGHT_MOON_FULL = 5 WEIGHT_MOON_NEW = 5 WEIGHT_MERCURY = 1 WEIGHT_VENUS = 1 WEIGHT_MARS = 1 WEIGHT_JUPITER = 1 WEIGHT_SATURN = 1 WEIGHT...
agpl-3.0
1,519,041,711,507,979,000
29.059829
78
0.566107
false
3.223648
false
false
false
buddly27/champollion
source/champollion/parser/js_data.py
1
2654
# :coding: utf-8 import re import functools from .helper import collapse_all from .helper import get_docstring #: Regular Expression pattern for data _DATA_PATTERN = re.compile( r"(?P<start_regex>(\n|^)) *(?P<export>export +)?(?P<default>default +)?" r"(?P<type>(const|let|var)) (?P<name>[\w._-]+) *= *(?P<va...
apache-2.0
3,839,338,129,148,397,000
28.820225
79
0.541824
false
3.920236
false
false
false
ooici/marine-integrations
mi/dataset/driver/dofst_k/wfp/test/test_driver.py
1
24458
""" @package mi.dataset.driver.dofst_k.wfp.test.test_driver @file marine-integrations/mi/dataset/driver/dofst_k/wfp/driver.py @author Emily Hahn @brief Test cases for dofst_k_wfp driver USAGE: Make tests verbose and provide stdout * From the IDK $ bin/dsa/test_driver $ bin/dsa/test_driver -i [-t test...
bsd-2-clause
-1,345,409,572,761,028,900
44.973684
122
0.640363
false
3.655358
true
false
false
henjo/pyoa
oaTools/oaExUtl22.py
1
3804
# #******************************************************************** #* Copyright (C) 2004 LSI Logic Corporation. * #* All Rights Reserved. * #******************************************************************** # # Sample Test program to try O...
apache-2.0
2,275,825,721,100,563,200
30.237288
69
0.572818
false
3.578551
false
false
false
mediapop/django-spreedly
tests/run_tasks.py
1
2567
#!/usr/bin/env python import os import sys from argparse import ArgumentParser from path import path from django.conf import settings from django.core.management import call_command from site_conf import DICT_CONF def conf(): settings.configure(**DICT_CONF) def run_tests(): """ Setup the environment ...
mit
-1,977,930,533,753,686,300
26.902174
76
0.620958
false
3.986025
true
false
false
DLance96/ox-dashboard
dashboard/migrations/0022_auto_20160622_0418.py
1
1940
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dashboard', '0021_auto_20160622_0219'), ] operations = [ migrations.CreateModel( name='Excuse', fiel...
mit
-4,569,432,375,841,970,000
37.8
143
0.55567
false
4.199134
false
false
false
bdol/bdol-ml
neural_networks/mlp_dpp_dropout/MLP.py
1
18692
import ConfigParser import ast import cPickle as pickle import dpp import numpy as np import os import shutil import sys import time import uuid def save_state(params, paramsFilename): pickle.dump(params, open(paramsFilename, "wb")) return 0 def rectified_linear(X): return np.maximum(X, 0.0) def d_rectified_l...
lgpl-3.0
-4,639,238,591,484,947,000
33.743494
104
0.626257
false
3.190306
true
false
false
TuinfeesT/TuinWolk
tuinwolk/tests/algorithm_test.py
1
5015
import random, string, sys GROWTH_RATE = 2 # we only place repo's in locations that support at least GROWTH_RATE times the size of the repo CHIP_RATE = 0.9 # if a repo has no locations that support GROWTH_RATE * repo.local_size, we chip off a bit off the desired size to see if we can find a repo anyway MAX_SERVERS = 1...
mit
3,691,421,331,139,144,700
30.34375
185
0.674377
false
2.887162
false
false
false
Brazelton-Lab/bio_utils
bio_utils/blast_tools/filter_b6_evalue.py
1
3410
#! /usr/bin/env python3 from __future__ import print_function """Writes lines from the B6/M8 file under the given E-value to output Usage: b6_evalue_filter.py --b6 <b6 file> --e_value <max e_value> --output <output file> Copyright: filter_b6_evalue.py filter lines of B6/M8 file by ...
gpl-3.0
-8,649,698,607,338,240,000
32.431373
76
0.59912
false
3.946759
false
false
false
ygsun/async
concurrent_thread_taomm.py
1
10435
#!/usr/bin/env python3 """ Python version: > 2.5 Dependence: requests BeautifulSoup 线程版本 爬虫类 从淘女郎网站(https://mm.taobao.com)获取图片链接并下载,按照地区、相册名、姓名分类 """ import contextlib import threading import os import re import requests import time import json import argparse import logging from bs4 import BeautifulSoup # 第一页 FIR...
bsd-3-clause
-3,929,984,699,560,164,400
27.605114
116
0.560036
false
3.340743
false
false
false
toumorokoshi/miura
miura/script.py
1
2256
import os from miura import runner from .utils import get_method_from_module, format_path_to_module from .data import load_data_from_path, filter_data from .template import TemplateSet from .exceptions import MiuraException import logging DEFAULT_DATA_DIRECTORY = os.path.join(os.curdir, 'data') DEFAULT_TEMPLATE_DIRE...
mit
-1,403,787,483,911,548,200
30.774648
83
0.613032
false
3.978836
false
false
false
rochacbruno/dynaconf
dynaconf/validator_conditions.py
1
1384
# pragma: no cover """ Implement basic assertions to be used in assertion action """ def eq(value, other): """Equal""" return value == other def ne(value, other): """Not equal""" return value != other def gt(value, other): """Greater than""" return value > other def lt(value, other): ...
mit
7,479,310,391,228,882,000
15.47619
57
0.614884
false
3.661376
false
false
false
ereOn/loaded
loaded/main.py
1
1773
""" Scripts. """ import click import logging import platform import six from tornado.ioloop import ( IOLoop, PeriodicCallback, ) from .server import agent_application @click.group() @click.option('-d', '--debug/--no-debug', default=False) @click.pass_context def main_loaded(ctx, debug): """ Loaded ...
lgpl-3.0
-7,151,149,945,704,686,000
22.959459
78
0.620981
false
3.837662
false
false
false
github-borat/cinder
cinder/tests/integrated/api/client.py
1
7946
# Copyright (c) 2011 Justin Santa Barbara # # 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 applicab...
apache-2.0
7,889,127,910,024,975,000
35.449541
79
0.595394
false
4.222104
false
false
false
CognitionGuidedSurgery/msml-gui
src/msmlgui/text/xmllexer.py
1
9663
__author__ = 'Alexander Weigl' # From: https://github.com/behnam/python-ply-xml/blob/master/parser.py # # import sys from UserString import UserString from ply import lex, yacc _VERSION = '1.0' ################################ # LEXER class XmlLexer: '''The XML lexer''' # states: # default: The...
gpl-3.0
-3,655,290,592,102,205,000
18.326
112
0.514023
false
3.313786
false
false
false
alfa-jor/addon
plugin.video.alfa/servers/videobb.py
1
1037
# -*- coding: utf-8 -*- # -------------------------------------------------------- # Conector videobb By Alfa development Group # -------------------------------------------------------- from core import httptools from core import scrapertools from platformcode import logger def test_video_exists(page_url): logg...
gpl-3.0
-4,766,601,516,716,246,000
33.566667
76
0.574735
false
3.638596
false
false
false
fgallina/gpycomplete
gpycomplete/helpers.py
1
3526
# This file is part of gpycomplete. # gpycomplete 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. # gpycomplete is distributed in the...
gpl-3.0
617,732,760,837,793,400
33.910891
70
0.636699
false
3.874725
false
false
false
rg3915/spark
spark/courses/migrations/0001_initial.py
1
2869
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-05-30 01:55 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('authentication', '0003_auto_20170512_20...
mit
8,298,399,107,577,769,000
42.409091
171
0.555672
false
4.116379
false
false
false
molguin92/MoulinetteBackend
moulinette/homework/models.py
1
6446
from datetime import datetime from moulinette import db # This file includes all the definitions for the homework model in the # database. Any change here must then be applied to the database using the # migrate.py file in the root folder of this project. class Homework(db.Model): """ Class Homework repres...
bsd-3-clause
-4,329,715,074,409,379,300
33.470588
78
0.634812
false
4.235217
true
false
false
kaushik94/sympy
sympy/functions/elementary/hyperbolic.py
1
48081
from __future__ import print_function, division from sympy.core import S, sympify, cacheit, pi, I, Rational from sympy.core.add import Add from sympy.core.function import Function, ArgumentIndexError, _coeff_isneg from sympy.functions.combinatorial.factorials import factorial, RisingFactorial from sympy.functions.elem...
bsd-3-clause
-5,497,828,646,164,145,000
28.104722
82
0.493542
false
3.534068
false
false
false
flgiordano/netcash
+/google-cloud-sdk/lib/surface/deployment_manager/resources/describe.py
1
3185
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
bsd-3-clause
4,313,468,936,970,704,000
31.5
89
0.693564
false
4.492243
false
false
false
mitodl/micromasters
courses/views.py
1
4278
"""Views for courses""" from django.db import transaction from rest_framework import ( viewsets, mixins, status, ) from rest_framework.views import APIView from rest_framework.authentication import SessionAuthentication, TokenAuthentication from rest_framework.exceptions import ( APIException, NotFo...
bsd-3-clause
-6,548,602,705,406,962,000
30.455882
92
0.677419
false
4.6
false
false
false
ament/ament_lint
ament_clang_format/setup.py
1
1420
from setuptools import find_packages from setuptools import setup package_name = 'ament_clang_format' setup( name=package_name, version='0.11.2', packages=find_packages(exclude=['test']), data_files=[ ('share/' + package_name, ['package.xml']), ('share/ament_index/resource_index/packag...
apache-2.0
-2,429,614,495,850,777,600
31.272727
70
0.63169
false
3.922652
false
true
false
RedHenLab/NLP
MWEtoolkit-interface/web_mwetoolkit/settings.py
1
3009
""" Django settings for gsoc15 project. Generated by 'django-admin startproject' using Django 1.8.2. 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/ """ # Build paths...
gpl-2.0
-5,394,941,526,098,135,000
24.948276
71
0.691592
false
3.339623
false
false
false
johannesu/cnn-cells
network.py
1
1240
import lasagne def setup(input_var, box_size = 29,): # Setup network net = lasagne.layers.InputLayer( shape=(None, 1, box_size, box_size), input_var=input_var) # stage 1 : filter bank -> squashing -> max-pooling net = lasagne.layers.Conv2DLayer( net, n...
mit
-1,638,588,925,993,246,000
29.243902
81
0.601613
false
3.594203
false
false
false
Aeronavics/MissionPlanner
ExtLibs/Mavlink/pymavlink/generator/mavparse.py
1
19826
#!/usr/bin/env python ''' mavlink python parse functions Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' from __future__ import print_function from builtins import range from builtins import object import errno import operator import os import sys import time import xml.parsers.expat PRO...
gpl-3.0
-6,054,809,809,938,774,000
38.811245
207
0.53339
false
3.955706
true
false
false
mgeorgehansen/FIFE_Technomage
demos/shooter/scripts/gui/guis.py
1
10455
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2010 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General ...
lgpl-2.1
-5,830,734,354,764,113,000
25.29765
109
0.605165
false
3.019059
false
false
false
fabiohsmachado/dandelion
dandelion/main.py
1
9787
"""Defines the Dandelion class""" import networkx as nx; class Dandelion: """The Dandelion code""" def __init__(self, N, k, code = None, kTree = None): """Initializes the code.""" self.N = N; self.k = k; self._code = None; self._kTree = None; if code is not Non...
gpl-3.0
-3,828,235,331,552,438,300
31.088525
99
0.547767
false
3.970385
false
false
false
pre-commit/pre-commit
pre_commit/languages/golang.py
1
3152
import contextlib import os.path import sys from typing import Generator from typing import Sequence from typing import Tuple import pre_commit.constants as C from pre_commit import git from pre_commit.envcontext import envcontext from pre_commit.envcontext import PatchesT from pre_commit.envcontext import Var from pr...
mit
-4,932,763,508,583,365,000
31.163265
76
0.638959
false
3.525727
false
false
false
theonion/django-bulbs
tests/instant_articles/test_facebook_api.py
1
6087
import requests_mock from django.utils import timezone from django.test.utils import override_settings from bulbs.content.models import FeatureType, Content from bulbs.utils.test import BaseIndexableTestCase from bulbs.utils.test.mock_vault import mock_vault from example.testcontent.models import TestContentObjThree...
mit
2,943,908,466,205,155,300
33.782857
129
0.497125
false
4.118403
true
false
false
neilLasrado/erpnext
erpnext/config/accounts.py
1
13984
from __future__ import unicode_literals from frappe import _ import frappe def get_data(): config = [ { "label": _("Accounts Receivable"), "items": [ { "type": "doctype", "name": "Sales Invoice", "description": _("Bills raised to Customers."), "onboard": 1, }, { "type": "...
gpl-3.0
-3,213,826,191,887,962,000
20.613601
86
0.505363
false
3.065322
false
false
false
wholeGenomeSequencingAnalysisPipeline/BacPipe
cutadapt-1.12/tests/testmodifiers.py
1
1619
# coding: utf-8 from __future__ import print_function, division, absolute_import from cutadapt.seqio import Sequence from cutadapt.modifiers import (UnconditionalCutter, NEndTrimmer, QualityTrimmer, Shortener) def test_unconditional_cutter(): uc = UnconditionalCutter(length=5) s = 'abcdefg' assert UnconditionalCu...
gpl-3.0
5,599,737,395,486,836,000
29.54717
81
0.684373
false
2.77226
false
false
false
caglar/Arcade-Universe
arcade_universe/data_generator.py
1
2656
from gen import * from pdataset import * import numpy as np import argparse from arcade_universe.fg import Foreground, FGTextureType import time import copy class PentominoGenerator(object): def __init__(self, batch_size, use_patch_centers=False, seed=1321, patc...
bsd-3-clause
-175,090,566,231,164,350
34.891892
117
0.429593
false
4.419301
false
false
false
simvisage/oricreate
docs/howtos/ex08_rigid_facets/sim031miura_ori_psi_cntl.py
1
2750
r''' Fold the Miura ori crease pattern using psi control --------------------------------------------------- ''' import numpy as np from oricreate.api import \ SimulationTask, SimulationConfig, \ FTV, FTA from oricreate.gu import \ GuConstantLength, GuDofConstraints, GuPsiConstraints, fix def create_cp...
gpl-3.0
-5,029,381,296,326,192,000
32.13253
83
0.481818
false
3.382534
true
false
false
CAChemE/stochastic-optimization
ConventionalDistillationColumn/hyInterface.py
1
4985
# -*- coding: utf-8 -*- import os import win32com.client as win32 """ # ------------------------------------------------------------------------- # SIMULATION-BASED OPTIMIZATION OF A SINGLE CONVENTIONAL DISTILLATION # COLUMN USING THE PARTICLE SWARM OPTIMIZATION ALGORITHM #--------------------------------...
bsd-3-clause
-7,658,869,754,585,571,000
37.338462
179
0.596308
false
3.927502
false
false
false
kaedroho/django
django/db/migrations/operations/utils.py
2
3791
from collections import namedtuple from django.db.models.fields.related import RECURSIVE_RELATIONSHIP_CONSTANT def resolve_relation(model, app_label=None, model_name=None): """ Turn a model class or model reference string and return a model tuple. app_label and model_name are used to resolve the scope o...
bsd-3-clause
-7,548,258,845,107,502,000
36.534653
95
0.644157
false
4.347477
false
false
false
RayRuizhiLiao/ITK_4D
Utilities/Doxygen/mcdoc.py
1
5816
#!/usr/bin/env python import sys, os, re, glob try: import io except ImportError: import cStringIO as io def usage(): sys.stdout.write( """usage: mdoc.py set group file [files...] Add the tag "\\ingroup group" to all the doxygen comment with a \\class tag in it. usage: mdoc.py check group ...
apache-2.0
-7,968,986,793,985,863,000
31.045455
113
0.574622
false
3.405152
false
false
false
grschafer/alacrity
alacrity/spritesheets/hero_icons_to_sheet.py
1
1432
import os from PIL import Image import dota_file_parser # data from dota2 files: resource/flash3/images/heroes print 'Expecting hero icons to be in "heroes" (e.g. "heroes/antimage.png")' print 'Expecting hero data to be in current folder (e.g. "npc_heroes.txt")' hero_data = dota_file_parser.parse('npc_heroes.txt') he...
mit
209,185,608,987,492,400
33.926829
188
0.631983
false
2.887097
false
false
false
science-is-the-new-black/bio_stuff
translate/translate.py
1
1635
"""Script for translating given sequence.""" from translate_dicts import translation_code import regex as re def translate_handler(sequence, start=False, Frame='all', code='translation_code', reverse=True) if reverse == True: return translate(sequence, start=start, Frame=Frame, code=code), ...
agpl-3.0
-1,977,540,443,760,361,700
33.0625
96
0.55107
false
3.802326
false
false
false
ktonon/GameSoup
gamesoup/expressions/context.py
1
1688
import UserDict class TemplateContext(UserDict.UserDict): def update_with_bindings(self, queryset): ''' Given a queryset of bindings, update this template context with any bindings that match parameters. ''' from gamesoup.library.models import InterfaceTemplateParamete...
mit
-6,009,353,774,739,607,000
27.627119
77
0.446682
false
4.188586
false
false
false
repotvsupertuga/tvsupertuga.repository
script.vodextende/salts_lib/directstream.py
1
11260
# -*- coding: utf-8 -*- """ VOD TVsupertuga Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Th...
gpl-2.0
-2,586,933,076,372,650,000
38.929078
152
0.493073
false
3.430835
false
false
false
juhnowski/FishingRod
production/pygsl-0.9.5/examples/bspline.py
1
1107
from pygsl import bspline, multifit, rng import pygsl._numobj as numx N = 200 ncoeffs = 8 nbreak = ncoeffs - 2 bspline = bspline.bspline def run(): r = rng.rng() bw = bspline(4, nbreak) # Data to be fitted x = 15. / (N-1) * numx.arange(N) y = numx.cos(x) * numx.exp(0.1 * x) sigma = .1 ...
mit
-2,329,613,397,010,371,600
22.0625
84
0.520325
false
2.629454
false
false
false
frostynova/calico-docker
calico_containers/adapter/docker_restart.py
1
5239
# Copyright 2015 Metaswitch Networks # # 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 w...
apache-2.0
-2,540,494,483,810,345,500
34.646259
77
0.661004
false
3.846549
false
false
false
hahaps/openstack-project-generator
template/<project_name>/tests/unit/api/middleware/test_faults.py
1
11029
# Copyright 2010 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 requ...
apache-2.0
210,631,727,763,691,420
34.236422
79
0.560613
false
4.256658
true
false
false
Ohjel/wood-process
base/hero.py
1
1239
import pygame from entity import Entity from animation import Animation HERO_INERTIA = 0.95 HERO_ACCELERATION = 0.1 HERO_HITBOX = pygame.Rect(0, 50, 64, 64) HERO_ANIMATION = (0, 0) class Hero(Entity): def __init__(self, nb, img): #Call the parent constructor Entity.__init__(self, HERO_HITBOX, Tru...
mit
8,486,146,599,151,767,000
26.533333
71
0.569007
false
3.251969
false
false
false
adoosii/edx-platform
lms/envs/bok_choy.py
1
6517
""" Settings for Bok Choy tests that are used when running LMS. Bok Choy uses two different settings files: 1. test_static_optimized is used when invoking collectstatic 2. bok_choy is used when running the tests Note: it isn't possible to have a single settings file, because Django doesn't support both generating sta...
agpl-3.0
743,758,206,534,447,400
33.481481
91
0.677766
false
3.655076
true
false
false
euphorie/Euphorie
src/euphorie/deployment/commands/xmlimport.py
1
7808
from AccessControl.SecurityManagement import getSecurityManager from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import setSecurityManager from euphorie.client import publish from euphorie.content.upload import SurveyImporter from euphorie.content.user import UserPro...
gpl-2.0
-2,573,733,531,392,966,700
29.030769
88
0.611424
false
4.111638
false
false
false
jelly/calibre
src/calibre/gui2/tweak_book/preview.py
2
23925
#!/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 time, textwrap, json from bisect import bisect_right from base64 impo...
gpl-3.0
8,639,967,148,069,684,000
36.617925
137
0.611285
false
3.883298
false
false
false
sinnwerkstatt/landmatrix
apps/landmatrix/models/activity_changeset.py
1
1373
from django.conf import settings from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ class ReviewDecision(models.Model): name = models.CharField(_("Name"), max_length=255) description = models.TextField(_("Description"), blank=True, null=True)...
agpl-3.0
7,794,494,172,032,026,000
27.604167
75
0.627094
false
4.098507
false
false
false
skrzym/monday-morning-quarterback
Research/report.py
1
13031
from matplotlib import pyplot as plt import matplotlib.ticker as plticker import seaborn as sns import pandas as pd import numpy as np import math import warnings from collections import Counter import nfldatatools as nfltools rs_pbp = nfltools.gather_data(playoffs=False) po_pbp = nfltools.gather_data(playoffs=True) ...
mit
333,576,537,237,967,360
36.338109
157
0.603561
false
2.731293
false
false
false
jnphilipp/FCPM
fcpm.py
1
18629
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 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 any later version. This program is distributed...
gpl-3.0
3,137,651,336,211,697,000
26.931034
246
0.583821
false
2.859401
false
false
false
pdubroy/kurt
build/MacOS/PyInstaller/pyinstaller-svn-r812/buildtests/test1.py
1
1267
# Copyright (C) 2005, Giovanni Bajo # Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc. # # 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...
gpl-2.0
6,073,089,601,012,954,000
36.264706
82
0.701657
false
3.343008
false
false
false
amancevice/stanhope
stanhope/stanhope/tables.py
1
9826
""" StanhopeFramers Tables """ import io import subprocess import pandas from stanhope import utils pandas.set_option('display.max_rows', 999) pandas.set_option('display.width', 999) pandas.set_option('display.max_colwidth', 999) class Table(object): def __init__(self, *tables): self.tables = tables or ...
mit
8,842,586,989,340,331,000
34.092857
79
0.463261
false
4.606657
false
false
false
tensorflow/probability
tensorflow_probability/python/optimizer/linesearch/__init__.py
1
1076
# Copyright 2018 The TensorFlow Probability Authors. # # 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 o...
apache-2.0
1,275,803,619,904,843,800
36.103448
86
0.710967
false
4.23622
false
false
false
noba3/KoTos
addons/plugin.video.screen_yahoo_com/default.py
1
20315
#!/usr/bin/python # -*- coding: utf-8 -*- import socket import urllib import urllib2 import cookielib import xbmcplugin import xbmcaddon import xbmcgui import json import sys import os import re addon = xbmcaddon.Addon() socket.setdefaulttimeout(60) pluginhandle = int(sys.argv[1]) addonID = addon.getAddonInfo('id') cj...
gpl-2.0
336,323,076,424,157,500
49.019704
530
0.654176
false
3.197103
false
false
false