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
yiwen-luo/LeetCode
Python/design-log-storage-system.py
1
1067
# Time: put: O(1) # retrieve: O(n + dlogd), n is the size of the total logs # , d is the size of the found logs # Space: O(n) class LogSystem(object): def __init__(self): self.__logs = [] self.__granularity = {'Year': 4, 'Month': 7, 'Day': 10, \ ...
mit
8,674,042,364,039,677,000
25.675
69
0.469541
false
3.60473
false
false
false
lutris/website
scripts/import_steam_linux_games.py
1
2485
# pylint: disable=missing-docstring import logging import requests from games.models import Game, Genre from games.util.steam import get_store_info, create_steam_installer from platforms.models import Platform from common.util import slugify LOGGER = logging.getLogger(__name__) def run(): response = requests.get...
agpl-3.0
2,682,142,902,040,070,000
36.651515
98
0.57666
false
4.047231
false
false
false
pelme/vasa
vasa/http/endpoints.py
1
1052
import asyncio import mimetypes from pathlib import Path from .response import DataResponse, ResponseNotFound @asyncio.coroutine def index(request, writer, settings): full_path = (Path(settings.webapp_root) / 'index.html').resolve() with full_path.open('rb') as f: return DataResponse(writer, data=f....
mit
-6,921,504,578,001,710,000
28.222222
77
0.689163
false
3.954887
false
false
false
ezralanglois/arachnid
arachnid/core/parallel/process_tasks.py
1
12031
''' Common parallel/serial design patterns This module defines a set of common tasks that can be performed in parallel or serial. .. Created on Jun 23, 2012 .. codeauthor:: Robert Langlois <rl2528@columbia.edu> ''' import process_queue import logging import numpy.ctypeslib import multiprocessing.sharedctypes _logge...
gpl-2.0
7,339,000,769,296,700,000
36.596875
134
0.555232
false
4.118795
false
false
false
penguintutor/networking-quiz
src/quizstrings.py
1
2597
# Text has been moved to this class, potential to add different languages in future # Note that this is not complete, some text (eg. buttons) has not been changed # The corresponding json file, must be consistant by having all entries for all pages # If an entry is not required (or is updated using a different method ...
gpl-3.0
1,300,464,390,233,187,300
42.3
199
0.562187
false
4.342809
false
false
false
RoboJackets/robocup-software
soccer/gameplay/tactics/positions/celebration.py
1
2691
import behavior import robocup import constants import single_robot_composite_behavior import main import enum import skills import random import time class Celebration( single_robot_composite_behavior.SingleRobotCompositeBehavior): MaxSpinAngle = 360 SpinPerTick = 1 class State(enum.Enum): ...
apache-2.0
-893,343,985,385,578,400
31.421687
77
0.586771
false
3.701513
false
false
false
ncadou/proctor
proctor/tor.py
1
10805
from datetime import datetime from itertools import chain, cycle from os import path from threading import Event, Lock, Thread from time import sleep import socks from desub import desub from proctor.socket import InstrumentedSocket import logging log = logging.getLogger(__name__) class TorProcess(Thread): """...
bsd-3-clause
-6,406,841,245,967,044,000
38.870849
79
0.537436
false
4.287698
false
false
false
qiyuangong/Basic_Mondrian
basic_mondrain_test.py
1
1879
import unittest from mondrian import mondrian # from utils.read_data import read_data, read_tree from models.gentree import GenTree from models.numrange import NumRange import random import pdb # Build a GenTree object ATT_TREE = [] def init(): global ATT_TREE ATT_TREE = [] tree_temp = {} tree = Gen...
mit
86,076,437,654,644,900
26.632353
59
0.432145
false
3.10066
true
false
false
KanoComputing/terminal-quest
linux_story/story/challenges/challenge_10.py
1
6406
# challenge_10.py # # Copyright (C) 2014-2016 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2 # # A chapter of the story from linux_story.StepTemplate import StepTemplate from linux_story.step_helper_functions import unblock_commands_with_cd_hint from linux_story.story.terminals.termin...
gpl-2.0
7,936,211,760,984,238,000
28.657407
96
0.503278
false
3.468327
false
false
false
GoteoFoundation/goteo-api
goteoapi/ratelimit.py
1
1974
# -*- coding: utf-8 -*- import time from functools import update_wrapper from flask import request, g from flask_redis import FlaskRedis from .helpers import bad_request from . import app # # REDIS RATE LIMITER # ================== redis = False if app.config['REDIS_URL']: redis = FlaskRedis(app) class RateLi...
agpl-3.0
721,773,584,731,300,600
28.462687
71
0.581054
false
3.724528
false
false
false
pombredanne/openaire
bibsched/lib/bibsched_tasklets/bst_openaire_check_rights.py
1
2572
#!/usr/bin/env python ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your op...
gpl-2.0
5,037,854,944,358,963,000
36.823529
123
0.641135
false
3.885196
false
false
false
chetan/cherokee
admin/consts.py
1
7437
# -*- coding: utf-8 -*- # # Cherokee-admin # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2001-2010 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free S...
gpl-2.0
-8,224,613,567,037,564,000
26.544444
67
0.477746
false
3.430351
false
false
false
hassy/informatics-explorer
utils.py
1
1514
# author: Hasan Veldstra <hasan.veldstra@gmail.com> # license: MIT import os import fnmatch try: import simplejson as json except: import json def locate(pattern, root=os.getcwd()): """ Generate of all files in a directory that match the pattern. """ for path, dirs, files in os.walk(root): ...
mit
741,321,748,822,468,600
21.954545
132
0.599736
false
3.570755
false
false
false
rchuppala/usc_agent
src/usc-agent-dev/common/source/pyang/pyang/translators/schemanode.py
1
10232
# Copyright (c) 2013 by Ladislav Lhotka, CZ.NIC <lhotka@nic.cz> # # Python class representing a node in a RELAX NG schema. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice a...
gpl-2.0
3,778,500,691,622,639,600
35.412811
89
0.57672
false
4.026761
false
false
false
spotify/crtauth
test/roundtrip_test.py
1
14010
# Copyright (c) 2011-2017 Spotify AB # # 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
1,554,741,149,084,993,500
47.310345
82
0.635261
false
3.176871
true
false
false
kosklain/CausalityCompetition
CausalityTrainer.py
1
2257
import data_io import CausalityFeatureFunctions as f from sklearn.ensemble import RandomForestRegressor from sklearn.pipeline import Pipeline class CausalityTrainer: def __init__(self, directionForward=True): self.directionForward = directionForward def getFeatureExtractor(self, features): com...
gpl-2.0
6,256,355,404,492,569,000
38.614035
96
0.594152
false
4.340385
false
false
false
dgnorth/DriftUe4Plugin
Scripts/publish.py
1
13837
"""Build and upload script to make UE4 client and server builds available on S3. """ import sys import os import threading import time import json from datetime import datetime import mimetypes import argparse import re import getpass import operator from dateutil.parser import parse from tabulate import tabulate impo...
mit
7,270,144,388,517,457,000
36.702997
170
0.610176
false
3.811846
true
false
false
brianloveswords/django-badger
setup.py
1
1111
from setuptools import setup setup( name='django-badger', version='0.0.1', description='Django app for managing and awarding badgers', long_description=open('README.rst').read(), author='Leslie Michael Orchard', author_email='me@lmorchard.com', url='http://github.com/lmorchard/django-badge...
bsd-3-clause
3,426,159,240,017,291,300
41.730769
202
0.656166
false
3.844291
false
false
false
paulsbrookes/cqed_sims_qutip
spectroscopy/spec_anim.py
1
6723
import numpy as np from qutip import * from pylab import * from scipy.fftpack import fft import matplotlib.pyplot as plt import yaml from scipy.interpolate import interp1d class parameters: def __init__(self, wc, wq, eps, g, chi, kappa, gamma, t_levels, c_levels): self.wc = wc self.wq = wq ...
apache-2.0
1,119,140,199,306,191,900
37.861272
118
0.638554
false
3.171226
false
false
false
marpaia/chef-osx
cookbooks/python/files/default/ipython/profile_default/ipython_config.py
1
16895
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # # ...
apache-2.0
5,318,918,276,306,134,000
35.333333
418
0.671974
false
3.89555
true
false
false
sevazhidkov/leonard
jobs/return_messages.py
1
3006
import os import random import logging import arrow import telegram from telegram.error import Unauthorized from leonard import Leonard from modules.menu import GREETING_PHRASES from libs.timezone import local_time from libs.utils import FakeMessage telegram_client = telegram.Bot(os.environ['BOT_TOKEN']) bot = Leona...
mit
8,447,620,987,240,022,000
31.956044
103
0.592197
false
3.604567
false
false
false
espdev/readthedocs.org
readthedocs/projects/signals.py
1
1499
"""Project signals""" import logging import django.dispatch from django.contrib import messages from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ from readthedocs.oauth.services import registry before_vcs = django.dispatch.Signal(providing_args=["version"]) after_vcs = dj...
mit
8,835,816,446,431,787,000
30.893617
95
0.651768
false
4.258523
false
false
false
alexis-roche/niseg
examples/partial_volume_estimation.py
1
1753
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Script example of partial volume estimation """ from argparse import ArgumentParser import numpy as np import nibabel as nb from niseg import BrainT1PVE # Parse command line de...
bsd-3-clause
9,000,726,666,906,467,000
28.711864
88
0.697661
false
3.187273
false
false
false
ShrimpingIt/tableaux
depictions/umbrella/main.py
1
2106
from os import urandom from time import sleep from neopixel import NeoPixel from machine import Pin from math import floor dataPin = Pin(13) ledCount = 27 np = NeoPixel(dataPin, ledCount) def blank(): for pos in range(ledCount): np[pos]=(0,0,0) np.write(); def visitAll(): for pos in range(ledCount): blank() ...
agpl-3.0
2,675,218,914,456,920,600
16.697479
91
0.625356
false
2.603214
false
false
false
fullphat/redsquare
support/blink1.py
1
8924
#!/usr/bin/env python import sys import time import re import sys import uuid debugimport=False use_pyusb=False try: print "[blink1]: trying blink1_pyusb..." from blink1_pyusb import Blink1 as Blink1_pyusb print "[blink1]: using blink1_pyusb" use_pyusb = True #sys.modules['Blink1'] = blink1_pyus...
mit
-756,769,589,801,679,400
32.051852
146
0.532721
false
3.42572
false
false
false
AddonScriptorDE/plugin.video.trailerseite_de
default.py
1
11540
#!/usr/bin/python # -*- coding: utf-8 -*- import urllib import urllib2 import socket import re import sys import xbmcplugin import xbmcaddon import xbmcgui socket.setdefaulttimeout(30) pluginhandle = int(sys.argv[1]) addonId = 'plugin.video.trailerseite_de' addon = xbmcaddon.Addon(id=addonId) translation = addon.getLo...
gpl-2.0
-1,058,085,944,360,981,600
39.911348
166
0.623039
false
3.307626
false
false
false
bmmalone/as-auto-sklearn
as_asl/train_oasc_models.py
1
2559
#! /usr/bin/env python3 import argparse import misc.automl_utils as automl_utils import misc.parallel as parallel import as_asl.as_asl_command_line_utils as clu import as_asl.as_asl_filenames as filenames import as_asl.as_asl_utils as as_asl_utils from as_asl.as_asl_ensemble import ASaslPipeline import logging impo...
mit
-4,272,369,325,987,425,300
27.433333
92
0.66823
false
3.421123
true
false
false
moshthepitt/afya360
health_facilities/sitemaps.py
1
1083
from django.contrib.sitemaps import Sitemap, GenericSitemap from django.core.paginator import Paginator from .models import HealthFacility class HealthFacilitySitemap(Sitemap): changefreq = "monthly" priority = 0.6 def items(self): return HealthFacility.objects.all() def lastmod(self, obj):...
mit
-7,888,297,912,088,862,000
32.84375
100
0.698984
false
3.734483
false
false
false
datapythonista/pandas
scripts/sync_flake8_versions.py
3
5144
""" Check that the flake8 (and pandas-dev-flaker) pins are the same in: - environment.yml - .pre-commit-config.yaml, in the flake8 hook - .pre-commit-config.yaml, in the additional dependencies of the yesqa hook The flake8 hook revision in .pre-commit-config.yaml is taken as the reference revision. Usage: either - ...
bsd-3-clause
-1,023,367,306,878,247,000
29.43787
88
0.625
false
3.743814
true
false
false
atakan/Fractal-Trails
trail_analyze.py
1
6139
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2011 Mehmet Atakan Gürkan # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed i...
gpl-3.0
-4,184,026,960,048,453,000
34.894737
152
0.558977
false
3.213613
false
false
false
googleads/google-ads-python
google/ads/googleads/v8/services/types/topic_view_service.py
1
1202
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
5,047,127,096,734,223,000
29.820513
100
0.710483
false
3.915309
false
false
false
bsmedberg/socorro
socorro/external/crash_data_base.py
1
3506
# 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/. from socorro.external import ( MissingArgumentError, ResourceNotFound, ResourceUnavailable, ServiceUnava...
mpl-2.0
8,774,703,158,655,654,000
37.108696
78
0.595836
false
4.776567
false
false
false
EarToEarOak/RTLSDR-Scanner
rtlsdr_scanner/plot_spect.py
1
16014
# # rtlsdr_scan # # http://eartoearoak.com/software/rtlsdr-scanner # # Copyright 2012 - 2015 Al Brown # # A frequency scanning GUI for the OsmoSDR rtl-sdr library at # http://sdr.osmocom.org/trac/wiki/rtl-sdr # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
gpl-3.0
6,269,624,982,629,573,000
36.415888
87
0.513301
false
4.025641
false
false
false
jasongrout/jupyterlab-extension
setup.py
1
5340
# -*- coding: utf-8 -*- # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function from setuptools import setup, find_packages, Command from setuptools.command.sdist import sdist from setuptools.command.build_py import build_py from setup...
bsd-3-clause
-5,766,849,120,819,335,000
32.797468
124
0.603371
false
3.739496
false
false
false
ox-it/talks.ox
talks/users/forms.py
1
3163
from __future__ import absolute_import from django import forms from django.core.exceptions import ValidationError from django.db.models.query_utils import Q from talks.events import typeahead, datasources from django.contrib.auth.models import User from talks.users.models import Collection, TalksUser, TalksUserCollec...
apache-2.0
9,132,082,129,076,920,000
42.328767
172
0.653494
false
4.411437
false
false
false
sanguinariojoe/FreeCAD
src/Mod/Draft/draftguitools/gui_mirror.py
9
9314
# *************************************************************************** # * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * (c) 2009, 2010 Ken Cline <cline@frii.com> * # * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> * # * ...
lgpl-2.1
-7,578,842,251,887,063,000
42.12037
129
0.492914
false
4.362529
false
false
false
nicodv/bgg
bgg/util/retry.py
1
3841
""" Module that implements a retry decorator. You can, for example, do this: @retry(5) def my_function(): ... And 'my_function', upon an exception, will be retried 4 more times until a final exception is raised. 'retry' will wait a little bit longer after each failure before retrying. Very useful fo...
mit
5,816,004,726,221,605,000
36.656863
79
0.634731
false
4.736128
false
false
false
mifumagalli/mypython
redshifts/zfit.py
1
48275
""" Gui to inspect spectra in 1/2D """ try: import Tkinter as tkinter import tkFont as tkfont from Tkinter import Tk import tkFileDialog as filedialog except: import tkinter from tkinter import font as tkfont from tkinter import Tk from tkinter import filedialog from astropy.io import fits import matplot...
gpl-2.0
7,933,736,069,385,149,000
36.833072
139
0.588938
false
3.568525
false
false
false
airbnb/streamalert
streamalert_cli/terraform/monitoring.py
1
3570
""" Copyright 2017-present Airbnb, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
apache-2.0
-359,748,981,042,700,000
40.034483
97
0.685154
false
4.136732
true
false
false
sarisabban/ProtVR
FlaskApp/ProtVR.py
1
1848
# Author: Sari Sabban # Email: sari.sabban@gmail.com # URL: https://github.com/sarisabban # # Created By: Sari Sabban # Created Date: 20 March 2017 import urllib def ProtVR(x): lis=list() filename='HELLO C ' filename=urllib.urlopen('http://files.rcsb.org/view/'+x+'.pdb') lis.append('<script src="/static/...
mit
2,022,517,550,096,471,300
39.173913
119
0.653139
false
2.812785
false
false
false
Einsteinish/PyTune3
apps/reader/views.py
1
103912
import datetime import time import boto import redis import requests import random import zlib from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.template.loader import render_to_string from django.db import IntegrityE...
mit
-6,293,551,005,867,734,000
42.350855
137
0.595985
false
3.733947
false
false
false
clchiou/garage
py/garage/examples/asyncs/supervisors.py
1
1115
"""Supervisor tree example.""" import logging import curio from garage.asyncs import TaskStack from garage.asyncs.queues import Closed, Queue async def supervisor(): print('supervisor start') async with TaskStack() as stack: queue = Queue() await stack.spawn(consumer(queue)), await ...
mit
3,136,778,452,220,943,400
20.037736
53
0.620628
false
3.996416
false
false
false
PostRockFTW/ExcitingBike
src/screenscrolltest/__init__.py
1
2317
import sys import pygame from pygame.locals import * def main(): pygame.init() gameWidth = 460 gameHeight = 230 miniMapFactor = 8 mainSurface = pygame.display.set_mode((gameWidth, gameHeight)) mainClock = pygame.time.Clock() FPS = 30 pygame.display.set_caption('Screen Scroll Test') ...
gpl-2.0
-1,759,312,278,505,376,500
30.739726
128
0.630988
false
4.029565
false
false
false
NaPs/Kolekto
kolekto/commands/edit.py
1
1031
import json from kolekto.printer import printer from kolekto.commands import Command from kolekto.helpers import get_hash class Edit(Command): """ Edit a movie. """ help = 'edit a movie' def prepare(self): self.add_arg('input', metavar='movie-hash-or-file') def run(self, args, config)...
mit
4,217,550,169,612,711,400
22.976744
92
0.534433
false
4.124
false
false
false
synthesio/infra-ovh-ansible-module
plugins/modules/public_cloud_instance.py
1
3577
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from ansible.module_utils.basic import AnsibleModule __metaclass__ = type DOCUMENTATION = ''' --- module: public_cloud_instance short_description: Manage OVH API for public cloud instance creatikon descripti...
mit
4,153,331,261,659,755,000
27.846774
105
0.609729
false
3.992188
false
false
false
smlacombe/sageo
app/model/filters/filter_host_state.py
1
2263
# # Copyright (C) 2013 Savoir-Faire Linux Inc. # # This file is part of Sageo # # Sageo 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 optio...
gpl-3.0
-3,413,612,498,410,856,400
40.145455
151
0.604949
false
3.809764
false
false
false
JDevlieghere/InTeXration
intexration/task.py
1
4809
import logging import os import shutil import subprocess import tempfile from intexration.tools import create_dir, cd from intexration.build import Identifier, Build from intexration.document import Document from intexration.parser import BuildParser class Task(): def run(self): pass class CloneTask(Ta...
apache-2.0
7,176,475,637,325,700,000
35.157895
110
0.550842
false
4.456905
false
false
false
maoy/zknova
nova/api/openstack/compute/contrib/extended_status.py
1
4009
# Copyright 2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
3,888,264,689,838,659,000
38.693069
79
0.65777
false
4.041331
false
false
false
Makeystreet/makeystreet
woot/apps/catalog/migrations/0020_auto__add_image__chg_field_documentation_url.py
1
21689
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Image' db.create_table(u'catalog_image', ( (u'id', self.gf('django.db.models.fie...
apache-2.0
7,494,500,861,876,699,000
74.051903
260
0.55867
false
3.66864
false
false
false
afaheem88/tempest
tempest/thirdparty/boto/base.py
1
14745
# Copyright 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 requ...
apache-2.0
-9,187,748,402,305,624,000
37.498695
78
0.571448
false
4.275152
true
false
false
pberkes/persistent_locals
test_deco.py
1
2351
import unittest import deco class _TestException(Exception): pass @deco.persistent_locals def _globalfunc(x): z = 2*x return z _a = 2 @deco.persistent_locals def _globaldependent(x): z = x + _a return z @deco.persistent_locals def _toberemoved(x): z = 2*x return z class TestPersistLocal...
gpl-3.0
4,609,870,817,239,272,400
24.27957
71
0.535517
false
3.417151
true
false
false
Ecotrust/TEKDB
TEKDB/TEKDB/settings.py
1
5770
""" Django settings for TEKDB project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
mit
-8,495,687,464,848,662,000
24.418502
140
0.64922
false
3.316092
false
false
false
gautelinga/BERNAISE
problems/porous.py
1
10258
import dolfin as df import os from . import * from common.io import mpi_is_root, load_mesh from common.bcs import Fixed, Pressure, Charged from ufl import sign import numpy as np __author__ = "Gaute Linga" class PeriodicBoundary(df.SubDomain): # Left boundary is target domain def __init__(self, Ly, grid_spaci...
mit
7,689,344,559,994,583,000
32.854785
113
0.540456
false
3.359974
false
false
false
passy/glashammer-rdrei
glashammer/bundles/csrf.py
1
3865
# -*- coding: utf-8 -*- """ glashammer.bundles.middleware.csrf_protection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides a simple middleware to secure against Cross Site Remote Forgery attacks by setting cookies on every request and validate them on post requests. :copyright: 2010, The Glashammer Authors :license: MIT ...
mit
3,107,017,994,892,241,400
32.034188
78
0.615783
false
4.392045
false
false
false
coderb0t/CouchPotatoServer
couchpotato/core/media/movie/providers/info/couchpotatoapi.py
1
4212
import base64 import time from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import tryUrlencode, ss from couchpotato.core.logger import CPLog from couchpotato.core.media.movie.providers.base import MovieProvider from couchpotato.environment import Env log = CPLog(__name__)...
gpl-3.0
2,660,003,703,913,347,000
32.967742
154
0.616809
false
3.618557
false
false
false
timothyclemansinsea/smc
src/scripts/gce/pricing.py
1
1971
# https://cloud.google.com/compute/pricing # all storage prices are per GB per month. PRICING = { 'gcs-standard' : 0.026, 'gcs-reduced' : 0.02, 'gcs-nearline' : 0.01, 'snapshot' : 0.026, 'local-ssd' : 0.218, 'pd-ssd' : 0.17, 'pd-standard' : 0.04, ...
gpl-3.0
4,755,622,627,190,812,000
27.565217
107
0.515982
false
2.469925
false
false
false
rdevon/cortex
demos/demo_classifier.py
1
2354
'''Simple classifier model ''' from cortex.main import run from cortex.plugins import ModelPlugin import torch import torch.nn as nn import torch.nn.functional as F from cortex.built_ins.models.utils import update_encoder_args class MyClassifier(ModelPlugin): '''Basic image classifier. Classifies images ...
bsd-3-clause
-8,868,400,450,535,550,000
26.057471
76
0.623195
false
4.037736
false
false
false
phborba/dsgtoolsop
auxiliar/geopy/geocoders/dot_us.py
1
5485
""" :class:`GeocoderDotUS` geocoder. """ import csv from base64 import b64encode from geopy.compat import urlencode, py3k, Request from geopy.geocoders.base import ( Geocoder, DEFAULT_FORMAT_STRING, DEFAULT_TIMEOUT, ) from geopy.location import Location from geopy.exc import ConfigurationError from geopy.u...
gpl-2.0
2,699,461,029,512,830,000
31.64881
100
0.558067
false
4.248644
false
false
false
anergictcell/SonosBar
sonosBar.py
1
13759
#!/usr/bin/env python -W ignore # -*- coding: utf-8 -*- """ Control you Sonos system from you Mac Menu Bar """ # <bitbar.title>SonosBar</bitbar.title> # <bitbar.version>v1.0</bitbar.version> # <bitbar.author>Jonas Marcello</bitbar.author> # <bitbar.author.github>anergictcell</bitbar.author.github> # <bitbar.desc>Contr...
mit
-7,581,023,862,845,307,000
28.941176
116
0.612821
false
3.681489
false
false
false
altair-viz/altair
altair/sphinxext/utils.py
1
5859
import ast import hashlib import itertools import json import re def create_thumbnail(image_filename, thumb_filename, window_size=(280, 160)): """Create a thumbnail whose shortest dimension matches the window""" from PIL import Image im = Image.open(image_filename) im_width, im_height = im.size w...
bsd-3-clause
2,410,201,326,460,441,600
28.442211
84
0.604028
false
4.20603
false
false
false
jajberni/pcse_web
main/model/simulation.py
1
7917
# coding: utf-8 """Provides implementation of Simulation model and Simulation""" from __future__ import absolute_import from google.appengine.ext import ndb from google.appengine.ext.ndb.model import GeoPt import model import time from pcse.db import NASAPowerWeatherDataProvider from pcse.fileinput import CABOFileRea...
apache-2.0
3,805,909,013,444,385,000
34.186667
119
0.674119
false
3.41987
false
false
false
gnmathur/aMAZEd
solution_grid.py
1
3092
""" Solution-Grid definition MIT License Copyright (c) 2017 Gaurav Mathur 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 rights to use, cop...
mit
1,898,911,336,600,446,000
35.376471
82
0.645213
false
4.60119
false
false
false
leaprovenzano/kutils
kutils/metrics.py
1
1376
from keras import backend as K def d_precision(y_true, y_pred): '''this is basically precision metric from keras 1. but I've attempted to make it differentiable ''' true_positives = K.sum(K.clip(y_true * y_pred, 0, 1)) predicted_positives = K.sum(K.clip(y_pred, 0, 1)) precision = true_positiv...
mit
163,005,164,945,517,700
30.272727
86
0.613372
false
2.92766
false
false
false
eri-trabiccolo/exaile
plugins/daapclient/__init__.py
1
25181
# Copyright (C) 2006-2007 Aren Olson # 2011 Brian Parma # # 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, or (at your option) # any later version. # # This p...
gpl-2.0
-3,843,772,557,405,208,000
31.533592
118
0.547079
false
3.981186
false
false
false
MRN-Code/pl2mind
models/nice_mlp.py
1
1883
""" Module for classes to simplify MLPs for NICE training. """ import pylearn2 import pylearn2.models import nice import nice.pylearn2.models.mlp from pylearn2.models.mlp import MLP from pylearn2.models.mlp import Linear from pylearn2.models.mlp import RectifiedLinear from nice.pylearn2.models.mlp import CouplingLayer...
gpl-2.0
9,018,267,773,866,419,000
35.211538
81
0.553372
false
3.827236
false
false
false
mouradmourafiq/django-subways
subways/views.py
1
2167
# -*- coding: utf-8 -*- from django.shortcuts import render_to_response from django.template import RequestContext, Context, loader from subways.models import Map, Line, Stop from subways.utilis import ride_path, longest_ride_path def map(request, map_name, template_name=None): """ view a map """ map = Map...
bsd-2-clause
7,201,897,100,008,982,000
45.106383
91
0.53761
false
4.073308
false
false
false
joyhchen/zulip
zerver/views/messages.py
1
44785
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.utils.timezone import now from django.conf import settings from django.core import validators from django.core.exceptions import ValidationError from django.db import connection from django.db.models import Q from dja...
apache-2.0
8,876,619,067,596,775,000
43.919759
183
0.604488
false
4.130314
false
false
false
ebrian/dispenserd
tests/test.py
1
7171
import unittest import requests import sys import random import json class TestDispenserd(unittest.TestCase): base_url = 'http://127.0.0.1:8282' def test010_is_running(self): res = requests.get(self.base_url + '/') json = res.json() self.assertEqual(res.status_code, 200) self....
mit
5,116,270,982,148,051,000
39.514124
104
0.569516
false
3.786167
true
false
false
chop-dbhi/brptoolkit-demo-harvest
brp_demo/formatters.py
1
36221
from django.core.urlresolvers import reverse from avocado.formatters import registry from serrano.formatters import HTMLFormatter from brp_demo.models import * from django.template import Context from django.template.loader import get_template from django.conf import settings try: from collections import OrderedDic...
bsd-2-clause
5,607,928,141,524,938,000
36.690947
256
0.574032
false
4.045231
false
false
false
budurli/python-paytrail
paytrail/base.py
1
2679
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime import hmac import base64 import hashlib from requests import Request from paytrail.settings import BASE_API_URL, PAYTRAIL_AUTH_KEY, PAYTRAIL_ID, PAYTRAIL_SECRET class PaytrailConnectAPIRequest(Request): def __init__(s...
mit
-6,063,210,949,374,005,000
29.804598
104
0.605077
false
3.933921
false
false
false
jazzband/site
jazzband/projects/models.py
1
5929
import os from datetime import datetime from uuid import uuid4 from flask import current_app, safe_join from flask_login import current_user from sqlalchemy import func, orm from sqlalchemy.dialects.postgresql import UUID, JSONB from sqlalchemy_utils import aggregated, generic_repr from ..auth import current_user_is_...
mit
7,964,328,019,318,782,000
34.933333
88
0.661326
false
3.42321
false
false
false
olof/svtplay-dl
lib/svtplay_dl/service/raw.py
1
1082
from __future__ import absolute_import import os import re from svtplay_dl.fetcher.dash import dashparse from svtplay_dl.fetcher.hds import hdsparse from svtplay_dl.fetcher.hls import hlsparse from svtplay_dl.service import Service class Raw(Service): def get(self): filename = os.path.basename(self.url[...
mit
-1,032,772,615,640,684,500
33.903226
143
0.624769
false
3.456869
false
false
false
redhat-cip/dci-ansible
callback/dci.py
1
9044
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ansible import constants as C from ansible.plugins.callback.default import CallbackModule as CM_default from ansible.release import __version__ as ansible_version from dciauth.version...
apache-2.0
2,457,845,636,947,778,000
34.466667
92
0.555617
false
4.08676
false
false
false
BetaNYC/tree-one-one
app.py
1
1276
from flask import Flask from flask import jsonify, render_template #from flask_cors import CORS import math import pandas as pd import os import datetime import json app = Flask(__name__) @app.route("/") def default(): return render_template('index.html') @app.route('/test') @app.route('/test/<metric>') de...
gpl-3.0
3,023,585,623,126,684,000
26.148936
92
0.552508
false
3.340314
false
false
false
deepakgupta1313/models
video_prediction/prediction_train.py
1
8670
# Copyright 2016 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
3,539,439,255,335,017,500
33.819277
80
0.633218
false
3.59751
false
false
false
JavierGarciaD/banking
banking/credit/forecast.py
1
8013
# -*- coding: utf-8 -*- import pandas as pd from rates.models import InterestRateModel from credit.prepayment import PrepaymentModel from common.db_manager import DB from sqlalchemy import select from sqlalchemy import and_ from sqlalchemy import asc def vintage_sett_manual(name, forecast, nper, sdate, repricing, rat...
mit
512,306,728,074,246,300
31.840164
79
0.527393
false
3.893586
false
false
false
eirannejad/pyRevit
pyrevitlib/pyrevit/revit/selection.py
1
9893
from pyrevit import HOST_APP, DOCS, PyRevitException from pyrevit import framework, DB, UI from pyrevit.coreutils.logger import get_logger from pyrevit.revit import ensure from pyrevit.revit import query __all__ = ('pick_element', 'pick_element_by_category', 'pick_elements', 'pick_elements_by_category', ...
gpl-3.0
-2,571,831,693,091,678,700
28.978788
85
0.570403
false
4.206207
false
false
false
pontikos/uclex_browser
lookups.py
1
17567
import re from utils import * import itertools import pysam import csv #hpo lookup import phizz import random import pickle import hashlib import pprint import utils import orm SEARCH_LIMIT = 10000 # massive genes? #UNSUPPORTED_QUERIES = ['TTN', 'ENSG00000155657', 'CMD1G', 'CMH9', 'CMPD4', 'FLJ32040', 'LGMD2J', 'MYLK5...
mit
-3,338,054,858,156,872,700
33.51277
233
0.599989
false
3.060986
false
false
false
partofthething/home-assistant
homeassistant/components/tado/binary_sensor.py
1
7734
"""Support for Tado sensors for each zone.""" import logging from homeassistant.components.binary_sensor import ( DEVICE_CLASS_BATTERY, DEVICE_CLASS_CONNECTIVITY, DEVICE_CLASS_POWER, DEVICE_CLASS_WINDOW, BinarySensorEntity, ) from homeassistant.config_entries import ConfigEntry from homeassistant.c...
mit
-1,611,426,186,836,054,300
27.32967
80
0.571115
false
4.023933
false
false
false
whiler/a-walk-in-python
spider/spider.py
1
10172
#!/usr/bin/env python # -*- coding: utf-8 -*- # # file: spider.py # author: whiler # license: BSD # 引入 http.cookiejar 模块,提供 Cookie 支持 import http.cookiejar # 引入模块 logging 模块,记录运行日志 import logging # 引入 socket 模块,用于捕获 HTTP 超时错误 import socket # 引入 urllib.request 模块,处理 HTTP 连接,创建 HTTP 请求 import urllib.request # 引入 url...
cc0-1.0
5,744,109,774,003,198,000
24.326923
111
0.51468
false
2.255781
false
false
false
karulont/combopt
project5/draw.py
1
1977
import turtle OFFSET=200 MULTIPLE=10 def draw(n,paths): cords=[(0,0),(n,0),(n,n),(0,n),(0,0)] turtle.penup() for c in cords: turtle.setpos(getCoord(c[0]),getCoord(c[1])) turtle.pendown() ## turtle.left(90) ## turtle.penup() ## turtle.goto(-OFFSET,-OFFSET) ## turtle.pen...
mit
3,498,382,939,808,764,000
38.54
579
0.438543
false
2.359189
false
false
false
joaks1/PyMsBayes
pymsbayes/utils/functions.py
1
4664
#! /usr/bin/env python import sys import os import errno import random import string from pymsbayes.utils import GLOBAL_RNG from pymsbayes.fileio import process_file_arg def mkdr(path): """ Creates directory `path`, but suppresses error if `path` already exists. """ try: os.makedirs(path) ...
gpl-3.0
-502,087,976,988,867,900
26.116279
88
0.566681
false
3.424376
false
false
false
minlexx/skype_movie_bot
classes/yandex_translate.py
1
2217
# -*- coding: utf-8 -*- import sys import collections # external libraries import requests import requests.exceptions class YandexTranslate: def __init__(self, yandex_api_key: str): self._apikey = yandex_api_key self._yt_url = 'https://translate.yandex.net/api/v1.5/tr.json/translate' ...
gpl-3.0
-2,401,171,451,816,979,500
29.779412
112
0.576122
false
3.122832
false
false
false
azizmb/django-activity-stream
actstream/templatetags/activity_tags.py
1
6757
from django.template import Variable, Library, Node, TemplateSyntaxError,\ VariableDoesNotExist from django.template.loader import render_to_string from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from actstream.mode...
bsd-3-clause
-565,753,785,344,135,000
31.485577
125
0.641261
false
3.965376
false
false
false
vsfs/vsfs-bench
vsbench/slurm.py
1
10482
#!/usr/bin/env python #SBATCH --time=12:00:00 #SBATCH --mem-per-cpu=1024 #SBATCH --partition=guest #SBATCH --error=job.%J.err #SBATCH --output=job.%J.out #SBATCH --cpus-per-task=1 # # Author: Lei Xu <eddyxu@gmail.com> # # TODO(eddyxu): generalize this to all drivers from __future__ import print_function from subproces...
apache-2.0
4,452,980,237,569,532,400
35.778947
78
0.60103
false
3.499833
true
false
false
dgisser/mapio
calendar_sample.py
1
1577
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 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/LICEN...
mit
-1,054,553,263,972,978,800
32.553191
81
0.710843
false
3.9425
false
false
false
abeconnelly/untap
scripts/collect_samples_from_profile_data.py
1
2707
#!/usr/bin/python import subprocess as sp import sys import json import re import csv import os debug=False header=False URL="https://my.pgp-hms.org" if len(sys.argv)<2: print "provide HTML file to parse" sys.exit(1) fn = sys.argv[1] if debug: print "# processing:", fn if len(sys.argv)<3: print "provid...
agpl-3.0
6,023,896,672,139,526,000
23.169643
133
0.531954
false
3.30122
false
false
false
edeposit/marcxml2mods
setup.py
1
1723
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== from setuptools import setup, find_packages from docs import getVersion # Variables =================================================================== ...
mit
-1,199,779,438,846,476,800
23.971014
79
0.506674
false
4.202439
false
true
false
buffer/thug
thug/Classifier/URLClassifier.py
1
2222
#!/usr/bin/env python # # URLClassifier.py # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRA...
gpl-2.0
-949,605,761,486,316,300
31.676471
78
0.653015
false
3.864348
false
false
false
ntim/g4sipm
sample/run/luigi/dynamic_range_simulation_bretz.py
1
2691
#!/usr/bin/env python # -*- coding: utf-8 -*- import luigi import sqlite3 import glob import numpy as np import json from simulation_meta_task import * class DynamicRangeSimulation(SimulationDynamicMetaTask, luigi.Task): name = luigi.Parameter("dynamic-range-simulation-bretz") n_repititions = luigi.IntParamete...
gpl-3.0
-3,709,466,599,450,708,000
46.210526
151
0.599034
false
3.384906
false
false
false
klahnakoski/esReplicate
pyLibrary/queries/expression_compiler.py
1
1182
# encoding: utf-8 # # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
mpl-2.0
-7,833,379,894,178,711,000
21.730769
122
0.652284
false
3.466276
false
false
false
ywangd/stash
bin/grep.py
1
2282
# -*- coding: utf-8 -*- """Search a regular expression pattern in one or more files""" from __future__ import print_function import argparse import collections import fileinput import os import re import sys def main(args): global _stash ap = argparse.ArgumentParser() ap.add_argument('pattern', help='th...
mit
-3,807,069,574,870,944,300
34.65625
122
0.574934
false
4.024691
false
false
false
wkoszek/puzzles
pattern_search/woogle_index.py
1
1936
#!/usr/bin/env python3 import getopt import sys import re import random import sqlite3 def main(): g_input_fn = False g_do_search = False g_dict_fn = False g_words = [] try: opts, args = getopt.getopt(sys.argv[1:], "hi:d:s:v", ["help", "input=", "dict=", "search="]) except getopt.GetoptError as err: ...
bsd-2-clause
6,192,522,204,303,101,000
21.776471
88
0.594008
false
2.700139
false
false
false
tengqm/senlin-container
senlin/engine/service.py
1
95655
# 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 unde...
apache-2.0
-2,164,811,942,441,370,400
41.933124
79
0.569212
false
4.507563
false
false
false
Joacchim/Comix
src/archive.py
1
20550
# coding=utf-8 """archive.py - Archive handling (extract/create) for Comix.""" from __future__ import absolute_import import cStringIO import os import re import sys import tarfile import threading import zipfile import gtk try: from py7zlib import Archive7z except ImportError: Archive7z = None # ignore it....
gpl-2.0
2,014,588,338,973,242,000
37.555347
107
0.522238
false
4.377929
false
false
false
debjyoti385/dartnews
crawling/newsParser.py
1
2286
from HTMLParser import HTMLParser import sys, re,os from os import listdir import Levenshtein class MLStripper(HTMLParser): def __init__(self): self.reset() self.fed = [] def handle_data(self, d): self.fed.append(d) def get_data(self): return ''.join(self.fed) def strip_tag...
bsd-2-clause
-7,346,165,303,894,431,000
25.581395
93
0.628171
false
2.695755
false
false
false
ExaScience/smurff
data/jaak/make.py
1
3536
#!/usr/bin/env python import smurff.matrix_io as mio import urllib.request import scipy.io as sio import os from hashlib import sha256 import smurff urls = [ ( "http://homes.esat.kuleuven.be/~jsimm/chembl-IC50-346targets.mm", "10c3e1f989a7a415a585a175ed59eeaa33eff66272d47580374f26342cd...
mit
2,601,276,451,595,209,000
41.095238
145
0.680147
false
2.413652
false
false
false
liorsion/django-backlinks
src/backlinks/pingback/client.py
1
4452
import re import xmlrpclib import urllib from backlinks.exceptions import fault_code_to_client_error, \ BacklinkClientError, BacklinkClientRemoteError, \ BacklinkClientConnectionError, BacklinkClientServerDoesNotExist,\ BacklinkClientAccessDenied, BacklinkClientInvalidResponse from backlinks.conf import se...
bsd-3-clause
-388,211,051,411,919,940
33.511628
85
0.621968
false
4.313953
false
false
false
haystack/eyebrowse-server
notifications/views.py
1
6176
import datetime from django.http import HttpResponseRedirect from django.utils.decorators import method_decorator from django.views.generic import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 from dja...
mit
3,723,686,512,894,883,300
31.505263
82
0.622733
false
4.106383
false
false
false
vanossj/pyAtlasBoneSegmentation
src/ICP.py
1
22312
''' Created on Feb 15, 2012 @author: Jeff ''' import numpy import numpyTransform from scipy.spatial import cKDTree as KDTree # from scipy.spatial import Delaunay from scipy.spatial.distance import cdist import scipy.optimize import time from math import pi from MatlabFunctions import MatlabFmincon import...
mit
-712,446,531,366,426,000
37.842857
176
0.551273
false
3.491159
false
false
false