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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dbmi-pitt/DIKB-Micropublication | scripts/mp-scripts/Bio/EUtils/setup.py | 1 | 1941 |
import sys
from distutils.core import setup
try:
import EUtils
except ImportError:
import __init__ as EUtils
def _dict(**kwargs):
return kwargs
d = _dict(
name = "EUtils",
version = EUtils.__version__,
description = "Client interface to NCBI's EUtils/Entrez server",
author = "Andrew Dalk... | apache-2.0 | -5,385,044,160,901,089,000 | 30.306452 | 72 | 0.659454 | false | 3.805882 | false | false | false |
igabriel85/dmon-adp | adpformater/adpformater.py | 1 | 1615 | import pandas as pd
class DataFormatter():
def __init__(self, dataloc):
self.dataloc = dataloc
def aggJsonToCsv(self):
return "CSV file"
def expTimestamp(self):
return "Expand metric timestamp"
def window(self):
return "Window metrics"
def pivot(self):
r... | apache-2.0 | -417,859,616,309,990,340 | 24.234375 | 81 | 0.636533 | false | 3.473118 | false | false | false |
simbtrix/screenmix | screenmix/reinforcement/shapeSelection.py | 1 | 5607 | '''
Created on 13.05.2016
@author: mkennert
'''
from kivy.properties import ObjectProperty, StringProperty
from kivy.uix.gridlayout import GridLayout
from kivy.uix.scrollview import ScrollView
from ownComponents.design import Design
from ownComponents.ownButton import OwnButton
from ownComponents.ownGraph ... | gpl-3.0 | 2,719,185,217,942,448,000 | 31.981818 | 80 | 0.522918 | false | 4.356643 | false | false | false |
suryakencana/niimanga | niimanga/ctasks/batoto.py | 1 | 34700 | """
# Copyright (c) 06 2015 | surya
# 26/06/15 nanang.ask@kubuskotak.com
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ve... | lgpl-3.0 | 526,765,185,184,004,100 | 40.656663 | 107 | 0.459597 | false | 3.218625 | false | false | false |
hs634/algorithms | python/company/dropbox.py | 1 | 1392 | __author__ = 'hs634'
class Crawler(Thread):
def __init__(self, q, seen, index, lock, wlock, worker_pool_size):
self.queue = q
self.seen = seen
self.index = index
self.worker_pool_size = worker_pool_size
self.qandslock = lock
self.worker_lock = wlock
def crawl(se... | mit | -4,294,431,164,889,772,000 | 28.617021 | 72 | 0.563218 | false | 3.752022 | false | false | false |
alexbruy/QGIS | python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py | 1 | 12223 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RectanglesOvalsDiamondsVariable.py
---------------------
Date : April 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot... | gpl-2.0 | -3,837,063,368,069,676,000 | 42.810036 | 109 | 0.462161 | false | 4.767161 | false | false | false |
drtuxwang/system-config | bin/fls.py | 1 | 5121 | #!/usr/bin/env python3
"""
Show full list of files.
"""
import argparse
import glob
import os
import signal
import sys
from typing import Iterator, List, Union
import file_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
self... | gpl-2.0 | 926,564,172,749,786,800 | 25.261538 | 78 | 0.486428 | false | 4.176998 | false | false | false |
stelfrich/openmicroscopy | components/tools/OmeroWeb/omeroweb/settings.py | 1 | 40171 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # Django settings for OMERO.web project. # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
# Copyright (c) 2008-2014 University of ... | gpl-2.0 | -3,240,865,960,607,729,000 | 36.648547 | 100 | 0.617435 | false | 3.64793 | true | false | false |
maxalbert/tohu | tohu/v7/derived_generators/fstr.py | 1 | 1341 | import inspect
import re
from .apply import Apply
class fstr(Apply):
"""
Helper function for easy formatting of tohu generators.
Usage example:
>>> g1 = Integer(100, 200)
>>> g2 = Integer(300, 400)
>>> g3 = g1 + g2
>>> h = fstr('{g1} + {g2} = {g3}')
>>> print(nex... | mit | -570,471,785,989,569,700 | 30.186047 | 101 | 0.58091 | false | 3.798867 | false | false | false |
jrwdunham/old | onlinelinguisticdatabase/model/form.py | 1 | 8233 | # Copyright 2016 Joel Dunham
#
# 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 writi... | apache-2.0 | 4,960,836,886,015,914,000 | 47.429412 | 120 | 0.667314 | false | 3.680376 | false | false | false |
pshahzeb/vsphere-storage-for-docker | esx_service/cli/vmdkops_admin.py | 1 | 58143 | #!/usr/bin/env python
# Copyright 2016 VMware, 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 ... | apache-2.0 | 5,735,922,847,194,726,000 | 38.232794 | 147 | 0.519839 | false | 4.405106 | true | false | false |
jusjusjus/pyedf | pyedf/score/score.py | 1 | 6055 | #! /usr/bin/python
from __future__ import with_statement
import logging
from .state import State
import numpy as np
import os
import re
class Score(object):
logger = logging.getLogger(name='Score')
commentSymbol = '#' # used for comments in state.annot
lineSeparator = ',' # used as separators i... | gpl-3.0 | -4,566,100,443,983,400,000 | 27.561321 | 122 | 0.523369 | false | 4.325 | false | false | false |
arongdari/sparse-graph-prior | sgp/GraphUtil.py | 1 | 1649 | import numpy as np
import networkx as nx
from collections import defaultdict
from scipy.sparse import csr_matrix, csc_matrix, triu
def sparse_to_networkx(G):
nnz = G.nonzero()
_G = nx.Graph()
_G.add_edges_from(zip(nnz[0], nnz[1]))
return _G
def compute_growth_rate(G, n_repeat=10):
"""
Compute... | mit | 3,245,779,639,639,733,000 | 24.765625 | 73 | 0.562159 | false | 2.877836 | false | false | false |
Cloudef/mpv | waftools/checks/custom.py | 1 | 4397 | from waftools.inflectors import DependencyInflector
from waftools.checks.generic import *
from waflib import Utils
import os
__all__ = ["check_pthreads", "check_iconv", "check_lua", "check_oss_4front",
"check_cocoa"]
pthreads_program = load_fragment('pthreads.c')
def check_pthread_flag(ctx, dependency_ide... | gpl-2.0 | -9,122,512,931,985,519,000 | 37.911504 | 78 | 0.586764 | false | 3.427124 | false | false | false |
GrognardsFromHell/TemplePlus | tpdatasrc/co8infra/scr/Spell741 - Ice Breath Weapon.py | 1 | 1381 | from toee import *
def OnBeginSpellCast( spell ):
print "Frozen Breath OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
game.particles( "sp-evocation-conjure", spell.caster )
def OnSpellEffect ( spell ):
print "Frozen Breat... | mit | 3,719,872,777,330,492,000 | 25.557692 | 85 | 0.703838 | false | 2.483813 | false | false | false |
fboers/jumeg | examples/do_MLICA.py | 1 | 5891 | """
Compute ICA object based on filtered and downsampled data.
Identify ECG and EOG artifacts using MLICA and compare
results to correlation & ctps analysis.
Apply ICA object to filtered and unfiltered data.
Ahmad Hasasneh, Nikolas Kampel, Praveen Sripad, N. Jon Shah, and Juergen Dammers
"Deep Learning Approach for A... | bsd-3-clause | 3,563,345,213,741,415,000 | 38.013245 | 109 | 0.672382 | false | 2.802569 | false | false | false |
bfaviero/ok | nodisk.py | 1 | 2852 | import os
import subprocess
H_NAME = 'oauth-kerberos-server'
H_FOLDER = os.path.join('/cgroup', H_NAME)
CGROUP_NAME = 'thegroup'
CGROUP_FOLDER = os.path.join(H_FOLDER, CGROUP_NAME)
MOUNT_CMD_PATH = '/bin/mount'
UMOUNT_CMD_PATH = '/bin/umount'
MOUNTPOINT_CMD_PATH = '/bin/mountpoint'
def prevent_swapping():
"""preve... | mit | -668,880,821,226,423,700 | 33.780488 | 84 | 0.728612 | false | 3.251995 | false | false | false |
explosion/thinc | thinc/tests/layers/test_combinators.py | 1 | 7655 | import pytest
import numpy
from numpy.testing import assert_allclose
from thinc.api import clone, concatenate, noop, add, map_list
from thinc.api import Linear, Dropout, Model, NumpyOps
from thinc.layers import chain, tuplify
@pytest.fixture(params=[1, 2, 9])
def nB(request):
return request.param
@pytest.fixtur... | mit | -2,695,263,527,380,039,000 | 25.954225 | 86 | 0.640366 | false | 3.176349 | true | false | false |
matejv/micropython-weatherstation | weatherstation.py | 1 | 4667 | from machine import I2C, Pin, Timer
import socket
import utime as time
import dht
from bmp180 import BMP180 # https://github.com/micropython-IMU/micropython-bmp180
from esp8266_i2c_lcd import I2cLcd # https://github.com/dhylands/python_lcd/
import clock, nethelper
class WeatherStation:
DHTPIN = 14 # DHT data pin
... | mit | 5,597,156,197,824,201,000 | 29.703947 | 238 | 0.552603 | false | 3.4596 | false | false | false |
gangeli/NaturalLI | etc/aristo/turk_51_view-turker.py | 1 | 2410 | #!/usr/bin/env python
#
import argparse
import sys
import os
import csv
import time
import math
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../../lib/')
from naturalli import *
"""
Parse the command line arguments
"""
def parseargs():
parser = argparse.ArgumentParser(description=
'Conve... | mit | 1,502,954,960,020,800,000 | 32.943662 | 106 | 0.606639 | false | 3.602392 | false | false | false |
google-research/google-research | meta_reward_learning/semantic_parsing/nsm/executor_factory.py | 1 | 35727 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 | 6,099,865,762,323,094,000 | 28.550868 | 78 | 0.551628 | false | 3.71151 | false | false | false |
Vladimirek/DPexamples | omronDemo/py/www2plc.py | 1 | 1278 | from dataplicity.client.task import Task, onsignal
from omronTcpFins import OmronPLC
class Www2plc(Task):
"""PLC data writer"""
def pre_startup(self):
"""Called prior to running the project"""
# self.conf contains the data- constants from the conf
self.livecfg = self.conf.get('valsetco... | mit | 1,519,753,353,358,444,300 | 41.6 | 99 | 0.647887 | false | 3.454054 | false | false | false |
deparkes/gds2ecp | seidel.py | 1 | 21210 | #
# Poly2Tri
# Copyright (c) 2009, Mason Green
# http://code.google.com/p/poly2tri/
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above co... | gpl-2.0 | 4,282,428,084,180,353,000 | 32.883387 | 99 | 0.550118 | false | 3.244608 | false | false | false |
nuagenetworks/vspk-python | vspk/v6/nubridgeinterface.py | 1 | 24029 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | bsd-3-clause | -6,466,850,096,367,090,000 | 28.557196 | 296 | 0.574556 | false | 4.610322 | false | false | false |
shubhamdhama/zulip | zproject/default_settings.py | 1 | 16423 | from typing import TYPE_CHECKING, Any, Dict, List, Optional
if TYPE_CHECKING:
from django_auth_ldap.config import LDAPSearch
from typing_extensions import TypedDict
from .config import DEVELOPMENT, PRODUCTION, get_secret
if PRODUCTION:
from .prod_settings import EXTERNAL_HOST, ZULIP_ADMINISTRATOR
else:
... | apache-2.0 | -40,528,629,325,406,360 | 38.383693 | 98 | 0.764294 | false | 3.27347 | true | false | false |
cctaylor/googleads-python-lib | examples/adwords/v201409/advanced_operations/add_ad_customizer.py | 1 | 8099 | #!/usr/bin/python
#
# 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 b... | apache-2.0 | 3,369,931,398,673,007,600 | 31.266932 | 80 | 0.598963 | false | 3.79878 | false | false | false |
ymotongpoo/restroom | 0x7d8/RSSReader/mailto.py | 1 | 2150 | # -*- coding: utf-8; encoding: utf-8; -*-;
"""
mailto.py
http://labs.unoh.net/2007/06/python_2.html
Known issue:
- need some change for exceptions
"""
__author__ = "ymotongpoo <ymotongpoo@gmail.com>"
__date__ = "21 Nov. 2008"
__credits__ = "0x7d8 -- programming training"
__version__ = "$Revision: 0.10"
import... | apache-2.0 | 8,488,926,124,748,680,000 | 24.879518 | 78 | 0.548883 | false | 3.755245 | false | false | false |
dianarg/conlang-util | generator/map/map_gen.py | 1 | 5467 | #!/usr/bin/env python
# Toy Terrain Generator
import sys
# import and init pygame
import pygame
import random
pygame.init()
class PixelGrid:
def __init__(self, size, scale):
self.points = []
self.size = size
self.scale = scale
for i in range(size):
self.points.append([... | mit | -2,995,827,563,402,069,000 | 33.601266 | 78 | 0.454545 | false | 3.880057 | false | false | false |
epidataio/epidata-community | ipython/home/tutorials/sensor_data_query.py | 1 | 5017 | ############################
# Import Required Modules #
############################
import argparse
import base64
from datetime import datetime, timedelta
import httplib
import json
import numpy as np
from pytz import UTC, timezone
import random
from decimal import Decimal
import struct
import time
from time import ... | apache-2.0 | -476,782,074,515,184,700 | 27.027933 | 79 | 0.623281 | false | 4.007188 | false | false | false |
Donkyhotay/MoonPy | zope/app/publisher/browser/tests/testi18nfileresource.py | 1 | 5545 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | gpl-3.0 | 9,132,939,661,171,410,000 | 35.480263 | 80 | 0.62092 | false | 4.153558 | true | false | false |
icic13/IntroductiontoComputerScienceandProgrammingSpring2011 | Problem Set 1: Paying Off Credit Card Debt/Problem Set 1.py | 1 | 1075 | #Rana
principal = float(
raw_input('Enter the outstanding balance on your credit card: '))
print(principal)
interest_rate = float(
raw_input('Enter the annual credit card interest rate as decimal: '))
print(interest_rate)
min_monthly_payment_rate = float(
raw_input('Enter the minimal monthly payment rate as... | gpl-3.0 | -5,964,504,845,811,852,000 | 33.677419 | 73 | 0.698605 | false | 3.559603 | false | false | false |
minzhang28/docker-py | tests/helpers.py | 1 | 3669 | import os
import os.path
import shutil
import tarfile
import tempfile
import unittest
import docker
import six
BUSYBOX = 'busybox:buildroot-2014.02'
EXEC_DRIVER = []
def make_tree(dirs, files):
base = tempfile.mkdtemp()
for path in dirs:
os.makedirs(os.path.join(base, path))
for path in files:... | apache-2.0 | 4,671,999,088,729,891,000 | 27.223077 | 79 | 0.597165 | false | 3.936695 | false | false | false |
iABC2XYZ/abc | DM_RFGAP/GenPartilces.py | 1 | 3025 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 26 12:23:48 2017
@author: A
"""
import tensorflow as tf
import numpy as np
from BetaGammaC import *
from RFCal import *
from ConstPhysics import *
def GenGammaT5Twiss(alphaT2D,betaT2D):
gammaT2D=tf.div(1.+tf.square(alphaT2D),betaT2D)
retur... | gpl-3.0 | -7,566,889,154,862,146,000 | 27.537736 | 103 | 0.715372 | false | 2.179395 | false | false | false |
fmfn/UnbalancedDataset | examples/under-sampling/plot_illustration_tomek_links.py | 2 | 3180 | """
==============================================
Illustration of the definition of a Tomek link
==============================================
This example illustrates what is a Tomek link.
"""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: MIT
# %%
print(__doc__)
import matplotlib.pyplot as pl... | mit | 4,398,294,868,321,620,000 | 22.555556 | 79 | 0.58239 | false | 2.794376 | false | false | false |
aaronr/Quantum-GIS | python/plugins/fTools/tools/doGeoprocessing.py | 1 | 64763 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------
#
# fTools
# Copyright (C) 2008-2011 Carson Farmer
# EMAIL: carson.farmer (at) gmail.com
# WEB : http://www.ftools.ca/fTools.html
#
# A collection of data management and analysis tools for vector data
#
# Geoprocessing functions adap... | gpl-2.0 | 1,633,101,598,576,554,200 | 39.527534 | 243 | 0.579498 | false | 3.996483 | false | false | false |
umayrh/sketchy-polytopes | python/evolvingdag/setup.py | 1 | 5286 | from __future__ import print_function
from glob import glob
from os.path import basename
from os.path import splitext
import os
import sys
import pkg_resources
import platform
from setuptools import setup, find_packages, Command
from setuptools.command.install_egg_info import install_egg_info as _install_egg_info
fr... | gpl-3.0 | 7,137,499,483,451,036,000 | 34.959184 | 93 | 0.63356 | false | 3.983421 | false | false | false |
AdaptivePELE/AdaptivePELE | AdaptivePELE/tests/testAtomset.py | 1 | 29178 | from __future__ import absolute_import, division, print_function, unicode_literals
from io import open
import os
import unittest
import mdtraj
import numpy as np
import AdaptivePELE.atomset.atomset as atomset
from AdaptivePELE.atomset import RMSDCalculator
from AdaptivePELE.atomset import SymmetryContactMapEvaluator as... | mit | -7,984,891,120,677,705,000 | 45.535885 | 119 | 0.601995 | false | 3.040959 | true | false | false |
hoettges/QKan | qkan/tools/dialogs/__init__.py | 1 | 3551 | import logging
import os
from typing import TYPE_CHECKING, Optional
from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QLineEdit, QPushButton, QWidget
from qkan.database.dbfunc import DBConnection
logger = logging.getLogger("QKan.tools.dialogs")
if TYPE_CHECKING:
from qkan.plugin import QKanPlugin
class QKa... | gpl-3.0 | -3,884,028,816,447,008,000 | 28.823529 | 85 | 0.58918 | false | 3.791667 | false | false | false |
Niektory/fifengine | engine/python/fife/extensions/pychan/widgets/widget.py | 1 | 34152 | # -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 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 Public
#... | lgpl-2.1 | -2,859,392,708,080,170,500 | 31.279773 | 154 | 0.705844 | false | 3.491668 | false | false | false |
marczellm/algorimp | weimar/_parser.py | 1 | 3033 | """ A parser for chord progressions in the Weimar Jazzomat CSV format """
import re
from itertools import chain
from typing import Tuple, Optional
from music import ABCNote, ChordType, Chord, ChordProgression, Note
_chordtype_mapping = {
'': ChordType.maj,
'6': ChordType.maj,
'j7': ChordType.maj,
'-7'... | gpl-3.0 | -8,028,558,581,031,779,000 | 31.265957 | 119 | 0.62974 | false | 3.011917 | false | false | false |
dhesse/tree-level-improve | tli.py | 1 | 8135 | # -*- coding: utf-8 -*-
r"""
:mod:`tli` -- Tree level improvement.
=========================================
Calculate tree level improvements for lattice QCD observables in the
spirit of [1]_. Given an observable :math:`{\mathcal O}(a/L)`, one
defines the improved observable
.. math::
{\mathcal O}_\mathrm{I}(a/... | mit | -8,904,274,530,981,629,000 | 37.545024 | 73 | 0.554162 | false | 3.067899 | false | false | false |
HiSPARC/sapphire | scripts/simulations/analyze_shower_front.py | 1 | 5153 | import numpy as np
import tables
from scipy.optimize import curve_fit
from scipy.stats import scoreatpercentile
from artist import GraphArtist
from pylab import *
import matplotlib.pyplot as plt
import utils
USE_TEX = False
# For matplotlib plots
if USE_TEX:
rcParams['font.serif'] = 'Computer Modern'
rcPar... | gpl-3.0 | -7,899,647,974,331,516,000 | 27.949438 | 85 | 0.59674 | false | 3.002914 | false | false | false |
vathpela/pytrace | test.py | 1 | 2157 | #!/usr/bin/python3
import pdb
import sys
from module import *
def print_it(tp, tl, time, s):
print("%s %s.%d: %s" % (time, tp, tl, s))
def print_if_9(tp, tl, time, s):
if tl >= 9:
print("%s %s.%d: %s" % (time, tp, tl, s))
tl = trace.Logger("debug", 9, print_if_9)
loggers = [
{'trace_point':... | gpl-3.0 | -5,831,648,403,946,456,000 | 21.237113 | 83 | 0.552619 | false | 2.995833 | false | false | false |
robios/PyTES | pytes/Util.py | 1 | 32573 | import warnings
import numpy as np
import time
from struct import unpack
from scipy.stats import norm
from scipy.signal import tukey
from Filter import median_filter
import Analysis, Filter, Constants
def savefits(data, filename, vmax=1.0, sps=1e6, bits=14, noise=False, clobber=True):
"""
Save pulse/noise to F... | mit | -7,457,606,929,335,083,000 | 37.053738 | 178 | 0.500414 | false | 3.556393 | false | false | false |
MrSenko/Nitrate | tcms/profiles/views.py | 1 | 5280 | # -*- coding: utf-8 -*-
from django import http
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.shortcuts import render_to_... | gpl-2.0 | 6,507,435,651,455,088,000 | 32.630573 | 84 | 0.631061 | false | 3.848397 | true | false | false |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/kombu-3.0.13-py2.7.egg/kombu/transport/virtual/__init__.py | 1 | 27656 | """
kombu.transport.virtual
=======================
Virtual transport implementation.
Emulates the AMQ API for non-AMQ transports.
"""
from __future__ import absolute_import, unicode_literals
import base64
import socket
import sys
import warnings
from array import array
from itertools import count
from multiproces... | gpl-3.0 | -512,856,187,888,683,650 | 31.384075 | 79 | 0.58631 | false | 4.362833 | false | false | false |
jmontgom10/Mimir_pyPol | oldCode/04b_avgBAABditherHWPimages.py | 1 | 17054 | # -*- coding: utf-8 -*-
"""
Combines all the images for a given (TARGET, FILTER, HWP) combination to
produce a single, average image.
Estimates the sky background level of the on-target position at the time of the
on-target observation using a bracketing pair of off-target observations through
the same HWP polaroid ro... | mit | 8,825,268,214,327,681,000 | 38.93911 | 92 | 0.599977 | false | 3.850531 | false | false | false |
petrushev/txplaya | txplayagui/librarywidget.py | 1 | 4653 | import json
from PyQt5.QtCore import pyqtSlot, pyqtSignal, QModelIndex, Qt
from PyQt5.QtWidgets import QWidget, QSpacerItem, QSizePolicy, QShortcut
from PyQt5.QtGui import QKeySequence
from txplayagui.ui.library import Ui_LibraryWidget
from txplayagui.library import LibraryModel
from txplayagui.utilities import unwra... | gpl-3.0 | 4,239,913,198,082,620,000 | 32.47482 | 89 | 0.675693 | false | 3.976923 | false | false | false |
jldbc/pybaseball | pybaseball/standings.py | 1 | 3820 | from typing import List, Optional
import pandas as pd
import requests
from bs4 import BeautifulSoup, Comment, PageElement, ResultSet
from . import cache
from .utils import most_recent_season
def get_soup(year: int) -> BeautifulSoup:
url = f'http://www.baseball-reference.com/leagues/MLB/{year}-standings.shtml'
... | mit | -5,694,633,745,706,730,000 | 37.585859 | 120 | 0.567801 | false | 3.782178 | false | false | false |
lalanne/SmallServers | py/common/ResponseBuilder.py | 1 | 1947 |
def build_base_message(msisdn, result):
message = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>' + \
'<msg>' + \
'<header action=\"1\" id=\"1111\"/>' + \
'<resp>' + \
'<op>rslt_comp_promo</op>' + \
'<msisdn>' + str(msisdn) + '</msisdn>' + \
'<result>' + str(result... | gpl-3.0 | -1,142,242,387,639,306,000 | 36.442308 | 79 | 0.473549 | false | 3.483005 | false | false | false |
python-security/pyt | pyt/core/module_definitions.py | 1 | 4715 | """This module handles module definitions
which basically is a list of module definition."""
import ast
# Contains all project definitions for a program run
# Only used in framework_adaptor.py, but modified here
project_definitions = dict()
class ModuleDefinition():
"""Handling of a definition."""
module_... | gpl-2.0 | -1,520,086,408,947,189,200 | 32.204225 | 98 | 0.549523 | false | 4.361702 | false | false | false |
BrainTech/openbci | obci/analysis/csp/MLogit.py | 1 | 11792 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""This is a class for Multinomial Logit Regression
Class uses scipy.optimize package for minimalization of a cost function.
The gradient of the cost function is passed to the minimizer.
Piotr Milanowski, November 2011, Warsaw
"""
from scipy.optimize import fmin_ncg, fmin_... | gpl-3.0 | 8,049,711,342,250,478,000 | 33.17971 | 100 | 0.498474 | false | 3.46416 | true | false | false |
jeremiahyan/odoo | odoo/addons/base/populate/res_company.py | 1 | 1638 | import collections
import logging
from odoo import models, Command
from odoo.tools import populate
_logger = logging.getLogger(__name__)
class Partner(models.Model):
_inherit = "res.company"
_populate_sizes = {
'small': 5,
'medium': 10,
'large': 50,
}
def _populate_factorie... | gpl-3.0 | 6,156,147,578,605,164,000 | 39.95 | 148 | 0.608669 | false | 3.881517 | false | false | false |
alperyeg/elephant | elephant/test/test_spike_train_generation.py | 1 | 42885 | # -*- coding: utf-8 -*-
"""
Unit tests for the spike_train_generation module.
:copyright: Copyright 2014-2016 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division
import os
import sys
import unittest
import warnings
import neo
import n... | bsd-3-clause | -8,141,108,870,692,667,000 | 40.434783 | 79 | 0.55938 | false | 3.734001 | true | false | false |
eshook/Forest | test_forest.py | 1 | 1438 | """
Copyright (c) 2017 Eric Shook. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
@author: eshook (Eric Shook, eshook@gmail.edu)
@contributors: <Contribute and add your name here!>
"""
# Begin coverage testing
import coverage
cov = coverage.covera... | bsd-3-clause | 6,569,984,685,676,343,000 | 35.871795 | 124 | 0.752434 | false | 3.507317 | true | false | false |
CiscoSystems/jujucharm-n1k | charms/precise/juju-gui/server/guiserver/auth.py | 1 | 15759 | # This file is part of the Juju GUI, which lets users view and manage Juju
# environments within a graphical interface (https://launchpad.net/juju-gui).
# Copyright (C) 2013 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public Lice... | apache-2.0 | -2,644,264,445,183,722,000 | 35.144495 | 79 | 0.588235 | false | 4.636364 | false | false | false |
chiefspace/udemy-rest-api | udemy_rest_api_section6/resources/item.py | 1 | 2149 | from flask_restful import Resource, reqparse
from flask_jwt import jwt_required
from models.item import ItemModel
class Item(Resource):
parser = reqparse.RequestParser()
parser.add_argument('price',
type=float,
required=True,
help='This field cannot be left blank!'
)
parser.add_... | gpl-2.0 | 4,751,284,133,216,453,000 | 30.617647 | 140 | 0.585854 | false | 4.172816 | false | false | false |
dariansk/python_training | fixture/db.py | 1 | 1487 | #import pymysql.cursors
import mysql.connector
from model.group import Group
from model.contact import Contact
class Dbfixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
#self.connection = py... | apache-2.0 | 1,064,092,637,281,715,000 | 32.818182 | 116 | 0.607935 | false | 4.130556 | false | false | false |
jmlong1027/multiscanner | storage/file.py | 1 | 2965 | import codecs
import gzip
import json
import storage
class File(storage.Storage):
DEFAULTCONF = {
'ENABLED': True,
'path': 'report.json',
'gzip': False,
'files-per-line': 1
}
def setup(self):
if self.config['gzip'] is True:
self.file_handle = gzip.open... | mpl-2.0 | 6,322,562,406,190,201,000 | 38.533333 | 88 | 0.455312 | false | 4.465361 | true | false | false |
thomas-schmid-ubnt/avocado | selftests/functional/test_replay_basic.py | 1 | 8628 | import glob
import os
import tempfile
import shutil
import unittest
from avocado.core import exit_codes
from avocado.utils import process
basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')
basedir = os.path.abspath(basedir)
AVOCADO = os.environ.get("UNITTEST_AVOCADO_CMD", "./scripts/avoc... | gpl-2.0 | -3,376,472,881,774,201,300 | 39.130233 | 86 | 0.55911 | false | 3.60401 | true | false | false |
wengole/nasman | nasman/snapshots/utils/base.py | 1 | 2714 | import pathlib
import abc
import chardet
from django.utils.timezone import get_default_timezone_name, now
def decode_from_filesystem(path):
"""
Decode a given Path object to unicode by detecting its encoding
:param path: The Path object to decode
:type path: pathlib.Path
:return: Tuple of the str... | bsd-3-clause | 1,686,565,572,457,612,000 | 23.232143 | 79 | 0.609064 | false | 4.391586 | false | false | false |
DoWhileGeek/slice | setup.py | 1 | 1915 | import contextlib
import json
import os
import re
import subprocess
from setuptools import setup
VERSION_FILE = os.path.join(os.path.dirname(__file__), "version.json")
def _get_git_description():
try:
return subprocess.check_output(["git", "describe"]).decode("utf-8").strip()
except subprocess.Calle... | mit | -1,291,465,778,683,663,000 | 26.357143 | 98 | 0.571279 | false | 3.892276 | false | false | false |
dreyou/ebstarter | reciever.py | 1 | 3846 | #!/usr/bin/env python
import pika
import sys
import signal
import json
import logging
from optparse import OptionParser
import eblocal
def createApplication(command):
res = eblocal.createApp(command["name"], command["source"])
if res is None:
logging.error("Can't create application")
return
... | mit | 3,224,260,323,385,512,400 | 34.943925 | 144 | 0.687207 | false | 3.838323 | false | false | false |
heynemann/generator-python-package | app/templates/_setup.py | 1 | 2004 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of <%= package.name %>.
# <%= package.url %>
# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.au... | mit | 3,471,423,137,697,981,000 | 29.830769 | 101 | 0.558882 | false | 3.503497 | false | false | false |
philanthropy-u/edx-platform | common/djangoapps/philu_commands/management/commands/sync_users_with_mailchimp.py | 1 | 5558 | """
A command to collect users data and sync with mailchimp learner's list
"""
from logging import getLogger
from django.conf import settings
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.db import connection
from lms.djangoapps.certificates import api as ... | agpl-3.0 | -108,782,005,858,378,560 | 37.867133 | 102 | 0.549478 | false | 4.522376 | false | false | false |
jtackaberry/stagehand | external/metadata/video/ogm.py | 1 | 11299 | # -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# ogm.py - ogm/ogg file parser
# -----------------------------------------------------------------------------
# $Id$
#
# -----------------------------------------------------------------------------
# kaa-Metad... | mit | -2,468,706,676,499,654,000 | 35.214744 | 79 | 0.500044 | false | 4.025294 | false | false | false |
rsheftel/pandas_market_calendars | pandas_market_calendars/exchange_calendars_mirror.py | 1 | 1912 | """
Imported calendars from the exchange_calendars project
GitHub: https://github.com/gerrymanoim/exchange_calendars
"""
from datetime import time
from .market_calendar import MarketCalendar
import exchange_calendars
class TradingCalendar(MarketCalendar):
def __init__(self, open_time=None, close_time=None):
... | mit | -652,348,878,407,477,200 | 25.555556 | 107 | 0.642782 | false | 3.684008 | false | false | false |
algorhythms/LeetCode | 917 Reverse Only Letters.py | 1 | 1071 | #!/usr/bin/python3
"""
Given a string S, return the "reversed" string where all characters that are not
a letter stay in the same place, and all letters reverse their positions.
Example 1:
Input: "ab-cd"
Output: "dc-ba"
Example 2:
Input: "a-bC-dEf-ghIj"
Output: "j-Ih-gfE-dCba"
Example 3:
Input: "Test1ng-Leet=code-Q... | mit | -6,603,716,623,650,046,000 | 20.42 | 90 | 0.518207 | false | 3.016901 | false | false | false |
zpincus/celltool | celltool/numerics/pca.py | 1 | 5436 | # Copyright 2007 Zachary Pincus
# This file is part of CellTool.
#
# CellTool 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 Software Foundation.
import bisect, numpy
from . import utility_tools
def pca(data):
... | gpl-2.0 | -3,262,440,634,524,808,000 | 45.87069 | 124 | 0.666667 | false | 3.475703 | false | false | false |
Vagab0nd/SiCKRAGE | lib3/feedparser/__init__.py | 1 | 2256 | # Copyright 2010-2020 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistribut... | gpl-3.0 | 2,770,024,409,418,123,000 | 43.235294 | 84 | 0.77305 | false | 4.101818 | false | false | false |
chris-statzer/knuckle-python | contrib/knuckle/window.py | 1 | 3176 | import logging
import time
import sdl2
logging.basicConfig(level=logging.INFO)
class Window(sdl2.Window):
def __init__(self, width, height, title):
super(Window, self).__init__(width, height, title)
self.log = logging.getLogger('Windw')
self.log.info('++ Creating new window object ({},{... | mit | -2,090,749,535,695,830,000 | 33.150538 | 79 | 0.505038 | false | 4.005044 | false | false | false |
ufal/neuralmonkey | neuralmonkey/tf_utils.py | 1 | 7163 | """A set of helper functions for TensorFlow."""
from typing import Callable, Iterable, List, Optional, Tuple, Union
import numpy as np
import tensorflow as tf
from neuralmonkey.logging import debug, debug_enabled
# pylint: disable=invalid-name
ShapeSpec = List[int]
# pylint: enable=invalid-name
def _get_current_exp... | bsd-3-clause | 2,182,295,244,979,045,600 | 29.480851 | 78 | 0.62069 | false | 3.966224 | false | false | false |
marcua/qurk_experiments | qurkexp/estimation/models.py | 1 | 3728 | from django.db import models
# The kind of item we are estimating properties of
class Kind(models.Model):
name = models.TextField(unique=True)
def __str__(self):
return self.name
# Items whose properties we are estimating
class Item(models.Model):
kind = models.ForeignKey(Kind, related_name="item... | bsd-3-clause | -2,217,554,870,715,888,600 | 36.656566 | 89 | 0.705204 | false | 3.855222 | false | false | false |
latinproject/booktype-latin | lib/booki/editor/management/commands/reportweekly.py | 1 | 9125 | # This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | agpl-3.0 | -2,722,611,690,856,461,000 | 34.23166 | 258 | 0.558027 | false | 4.037611 | false | false | false |
gdsfactory/gdsfactory | pp/components/spiral_inner_io.py | 1 | 10100 | """ bends with grating couplers inside the spiral
maybe: need to add grating coupler loopback as well
"""
from typing import Optional, Tuple
import numpy as np
import pp
from pp.component import Component
from pp.components.bend_circular import bend_circular, bend_circular180
from pp.components.bend_euler import bend... | mit | 8,192,973,652,620,932,000 | 32.114754 | 99 | 0.606535 | false | 2.857143 | false | false | false |
edx/ecommerce | ecommerce/extensions/analytics/migrations/0001_initial.py | 1 | 3904 | # -*- coding: utf-8 -*-
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | agpl-3.0 | 7,615,743,578,111,717,000 | 46.609756 | 139 | 0.566342 | false | 4.466819 | false | false | false |
JeanMarieMineau/ISN-s-Cube | Bouton.py | 1 | 5185 | '''
Created on 5 mai 2017
Copyright 2017 Jean-Marie Mineau, Maxime Keller
This file is part of "ISN's Cube".
"ISN's Cube" is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the Licen... | gpl-3.0 | 6,007,718,002,931,933,000 | 33.278146 | 83 | 0.479614 | false | 4.180129 | false | false | false |
msimet/Stile | devel/make_simple_catalog.py | 1 | 1417 | import galsim
import numpy
use_noise = True
extent_degrees = 1. # Create galaxies within a box of this side length
n_galaxies_per_sq_arcmin = 20
z_min = 0.1
z_max = 2.0
z_powerlaw_slope = 2.0
z_lens = 0.2
def make_safe_shear(g):
if g[0]>1:
g[0] = 1
if g[1]>1:
g[1] = 1
mag = numpy.sqrt(g[0]... | bsd-3-clause | -3,160,015,060,232,329,000 | 30.488889 | 90 | 0.568102 | false | 2.409864 | false | false | false |
kdart/pycopia | core/pycopia/inet/rfc2822.py | 1 | 15042 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | apache-2.0 | -7,377,451,585,483,826,000 | 25.069324 | 80 | 0.569672 | false | 3.56953 | false | false | false |
alehander42/hatlog | hatlog/prolog.py | 1 | 1202 | def generate_prolog(x, name, file):
header = '''\
:- initialization main.
:- use_module(pythonTypeSystem).
:- use_module(prettyTypes).
'''
fun = generate_fun(x, name)
m = '''main :-
open('%s.txt', write, Stream),
(
f(%s, Z0, Z1),
unvar(Z0, Z1, Z2, Z3, Z4), %% replace free vars wit... | apache-2.0 | -7,209,554,794,224,571,000 | 23.530612 | 111 | 0.476705 | false | 2.834906 | false | false | false |
spl0k/supysonic | supysonic/cli.py | 1 | 15855 | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2013-2021 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
import argparse
import cmd
import getpass
import shlex
import sys
import time
from pony.orm import db_session, sel... | agpl-3.0 | -8,150,175,091,305,038,000 | 33.615721 | 103 | 0.563959 | false | 4.005558 | true | false | false |
laszlokiraly/OffenesParlament | offenesparlament/op_scraper/scraper/parlament/spiders/administrations.py | 2 | 6360 | # -*- coding: utf-8 -*-
import scrapy
from ansicolor import red
from ansicolor import cyan
from ansicolor import green
from ansicolor import blue
from django.db.models import Q
from urllib import urlencode
from parlament.settings import BASE_HOST
from parlament.spiders.persons import PersonsSpider
from parlament.re... | bsd-2-clause | -3,958,473,203,963,082,000 | 33.945055 | 99 | 0.522327 | false | 4.257028 | false | false | false |
Heufneutje/PyHeufyBot | heufybot/modules/util/urlfollow.py | 1 | 6495 | from twisted.plugin import IPlugin
from heufybot.channel import IRCChannel
from heufybot.moduleinterface import BotModule, IBotModule
from heufybot.utils.dummycontextmanager import DummyContextManager
from heufybot.utils.signaltimeout import TimeoutException
from zope.interface import implements
from bs4 import Beautif... | mit | -6,007,415,784,132,476,000 | 40.903226 | 110 | 0.578907 | false | 3.809384 | false | false | false |
bygloam/yapf | yapf/yapflib/format_decision_state.py | 1 | 14929 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | 7,459,060,827,545,288,000 | 35.68059 | 80 | 0.681224 | false | 3.918373 | false | false | false |
alisaifee/djlimiter | djlimiter/middleware.py | 1 | 5065 | import importlib
import logging
from django.conf import settings
from django.core.urlresolvers import resolve
from limits.storage import storage_from_string
from limits.strategies import STRATEGIES
from limits.errors import ConfigurationError
from limits.util import parse_many
import six
from .decorators import DECOR... | mit | 5,413,957,004,182,898,000 | 35.438849 | 110 | 0.604738 | false | 4.035857 | false | false | false |
PROGRAM-IX/pystroke | event_engine.py | 1 | 1542 | import pygame
from pygame.locals import *
class EventEngine:
"""
Reads the event queue and passes events to other engines
@author: James Heslin (PROGRAM_IX)
"""
def __init__(self, i_e):
"""
Takes an InputEngine and passes all relevant events to it
@type i_... | mit | -9,049,769,703,569,404,000 | 26.553571 | 70 | 0.527237 | false | 4.090186 | false | false | false |
yamaneko1212/webpay-python | webpay/model/charge.py | 1 | 1090 | from webpay.model.card import Card
from .model import Model
class Charge(Model):
def __init__(self, client, data):
Model.__init__(self, client, data)
def _instantiate_field(self, key, value):
if key == 'card':
return Card(self._client, value)
else:
return Mode... | mit | 7,699,900,737,573,877,000 | 30.142857 | 78 | 0.6 | false | 4.02214 | false | false | false |
nagisa/Feeds | gdist/gschemas.py | 1 | 2161 | import glob
import os
from distutils.dep_util import newer
from distutils.core import Command
from distutils.spawn import find_executable
from distutils.util import change_root
class build_gschemas(Command):
"""build message catalog files
Build message catalog (.mo) files from .po files using xgettext
... | gpl-2.0 | -1,919,019,431,533,698,800 | 28.60274 | 80 | 0.63628 | false | 3.85205 | false | false | false |
tobspr/LUI | Demos/B_BlockText.py | 1 | 2782 |
from DemoFramework import DemoFramework
from LUILabel import LUILabel
from LUIBlockText import LUIBlockText
from LUIScrollableRegion import LUIScrollableRegion
import random
f = DemoFramework()
f.prepare_demo("LUIBlockText")
# Constructor
f.add_constructor_parameter("text", "u'Label'")
f.add_constructor_parameter... | mit | 2,860,236,933,385,525,000 | 29.23913 | 242 | 0.734723 | false | 2.762661 | false | false | false |
edison7500/dugong | apps/images/migrations/0001_initial.py | 1 | 1994 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-25 06:14
from __future__ import unicode_literals
import apps.images.handlers
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependen... | gpl-3.0 | 708,031,775,955,651,500 | 30.650794 | 78 | 0.427282 | false | 5.360215 | false | false | false |
bawaaaaah/Phoenix | tools/xml2sqlite.py | 1 | 4763 |
'''
This file is used to combine multiple no-intro xml files into one
sqlite file. This is used for checksum lookups to set up the artwork scraper.
'''
import xml.etree.ElementTree as ET
import sqlite3
import os
import sys
import getopt
UNKNOWN_VALUE = ""
TABLE_VALUE = "NOINTRO"
VERSION_FILE = "console_database_vers... | gpl-2.0 | 3,116,799,969,403,964,000 | 31.401361 | 126 | 0.498425 | false | 4.084906 | false | false | false |
codelucas/shorten.tv | bg.py | 1 | 2146 | #!/usr/bin/env python2.7
"""
Here is shorten.tv's main background task to re-load
and cache popular youtube videos so users have less
wait time when using the webapp.
"""
import requests
import string
import backend
import urllib
letters = list(string.lowercase) # a, b, c ... z
popular = ["Rihanna", "Usher", "Katy P... | mit | 6,145,333,782,905,389,000 | 28.805556 | 76 | 0.609972 | false | 3.188707 | false | false | false |
google-research/language | language/xsp/data_preprocessing/compute_asql_coverage_spider.py | 1 | 3106 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | apache-2.0 | 7,636,582,483,069,318,000 | 33.511111 | 79 | 0.720541 | false | 3.447281 | false | false | false |
io7m/jcalcium | io7m-jcalcium-blender/src/main/resources/__init__.py | 1 | 3191 | #
# Copyright © 2016 <code@io7m.com> http://io7m.com
#
# 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 appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTH... | isc | 2,586,711,796,754,689,500 | 32.229167 | 133 | 0.708464 | false | 3.400853 | false | false | false |
joelfrederico/SciSalt | scisalt/qt/mplwidget.py | 1 | 13557 | from PyQt4 import QtGui
from PyQt4 import QtCore
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as _FigureCanvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as _NavigationToolbar
import matplotlib as _mpl
import numpy as _np
from .Rectangle import Rectangle
import pdb
import tra... | mit | 2,374,705,656,295,155,700 | 33.234848 | 119 | 0.570628 | false | 3.915945 | false | false | false |
wangyixiaohuihui/spark2-annotation | python/pyspark/streaming/flume.py | 1 | 6047 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may n... | apache-2.0 | 7,494,810,654,128,690,000 | 41.192857 | 99 | 0.61915 | false | 4.359769 | false | false | false |
Alwnikrotikz/hooke | mfp_igor_scripts/FMjoin.py | 1 | 1503 | #!/usr/bin/env python
'''
FMjoin.py
Copies all .ibw files contained in a folder and its subfolders into a single folder. Useful for force maps.
Usage:
python FMjoin.py origindir destdir
Alberto Gomez-Casado (c) 2010, University of Twente (The Netherlands)
This program is released under the GNU General Public Licen... | lgpl-3.0 | 1,506,326,221,968,323,600 | 24.913793 | 107 | 0.69328 | false | 3.191083 | false | false | false |
vtexier/duniter-python-api | duniterpy/key/encryption_key.py | 1 | 1634 | """
duniter public and private keys
@author: inso
"""
import libnacl.public
from pylibscrypt import scrypt
from .base58 import Base58Encoder
from .signing_key import _ensure_bytes
SEED_LENGTH = 32 # Length of the key
crypto_sign_BYTES = 64
SCRYPT_PARAMS = {'N': 4096,
'r': 16,
'p':... | gpl-3.0 | 311,690,063,143,170,500 | 29.259259 | 100 | 0.626683 | false | 3.62306 | false | false | false |
mr-ice/pipython | InteractiveProgramming/concentration.py | 1 | 7657 | # implementation of card game - Memory
# I originally coded this with timers for hiding the cards instead of hiding them
# on a mouse click. And I removed cards that matched instead of leaving them face up.
# I thought it worked pretty well but it didn't meet the requirements of the grading
# rubrick, so I had to mak... | mit | -5,153,897,072,801,018,000 | 33.031111 | 90 | 0.55113 | false | 3.535088 | false | false | false |
sbates130272/fio-stuff | tools/cpuperf.py | 1 | 3479 | #!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import subprocess as sp
import time
def get_ps_data(options):
try:
data = sp.check_output(["ps", "-C", options.command, "-o" "%cpu=,%mem="])
if options.multithread:
... | apache-2.0 | -2,514,603,688,911,155,000 | 30.342342 | 90 | 0.542685 | false | 3.635319 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.