repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
flgiordano/netcash | +/google-cloud-sdk/lib/surface/bigquery/jobs/show_rows.py | 1 | 2134 | # 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 ag... | bsd-3-clause | -6,707,530,095,116,616,000 | 32.34375 | 79 | 0.695876 | false | 4.095969 | false | false | false |
snowdreamist/wfpy | src/wfpy/internal.py | 1 | 10137 | # encoding=utf8
# wfpy internal implementation
# snowdreamist@live.cn
from contextlib import contextmanager
from threading import Thread, Lock, Semaphore
@contextmanager
def lock(lock):
try:
lock.acquire(True)
yield
finally:
lock.release()
class InternalLogger(object):
"""
Int... | gpl-3.0 | -8,564,515,949,999,352,000 | 25.539267 | 115 | 0.511788 | false | 4.570334 | false | false | false |
j4321/MyNotes | mynoteslib/mytext.py | 1 | 28096 | #! /usr/bin/python3
# -*- coding:Utf-8 -*-
"""
MyNotes - Sticky notes/post-it
Copyright 2016-2019 Juliette Monsel <j_4321@protonmail.com>
MyNotes is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 o... | gpl-3.0 | 8,432,323,397,572,255,000 | 44.091493 | 108 | 0.504592 | false | 3.782416 | true | false | false |
ideascf/octopus | proto/service_proto.py | 1 | 3222 | # coding=utf-8
import traceback
import etcd
import logging
import json
from octopus import err
from octopus import constant
from octopus.util import tools
log = logging.getLogger(constant.LOGGER_NAME)
def register(ec, service_name, service_info):
"""
:param ec: etcd的客户端对象
:param service_name:
:para... | mit | 889,545,740,744,177,000 | 20.066667 | 94 | 0.601582 | false | 3.326316 | false | false | false |
LCAS/spqrel_tools | slu4p/speech_to_text/asr.py | 1 | 8115 | #http://doc.aldebaran.com/2-5/naoqi/audio/alspeechrecognition-api.html
import signal
import qi
import argparse
import sys
from os.path import expanduser
import os
import time
from conditions import set_condition
class SpeechRecognition(object):
USE_GOOGLE = True
CHANNELS = [0, 0, 1, 0]
audio_recorder = N... | mit | 2,345,651,052,511,214,000 | 37.278302 | 120 | 0.60345 | false | 3.899568 | false | false | false |
vgonisanz/wpm | examples/toggle_table_sample.py | 1 | 1652 | # -*- coding: utf-8 -*-
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'src'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'src/elements'))
from curses import wrapper # Use my own wrapper
from wpm import Wpm
from toggle_table import ToggleTable
# Configuration
togglet... | lgpl-3.0 | 7,595,882,164,654,035,000 | 24.030303 | 100 | 0.688862 | false | 3.434511 | false | false | false |
drawquest/drawquest-web | website/drawquest/apps/palettes/forms.py | 1 | 3323 | from itertools import chain
from django import forms
from django.forms.util import flatatt
from django.utils.encoding import force_text
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from drawquest.apps.palettes.models import Color, ColorPack
# Widget rendering code forked f... | bsd-3-clause | -7,076,176,437,245,281,000 | 39.036145 | 246 | 0.609991 | false | 3.832757 | false | false | false |
elbeardmorez/quodlibet | quodlibet/quodlibet/ext/gstreamer/karaoke.py | 1 | 4312 | # -*- coding: utf-8 -*-
# Copyright 2012 Christoph Reiter
#
# 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 version.
from gi.rep... | gpl-2.0 | -7,045,133,110,099,888,000 | 32.426357 | 78 | 0.590445 | false | 3.531532 | false | false | false |
jiadaizhao/LeetCode | 0501-0600/0567-Permutation in String/0567-Permutation in String.py | 1 | 1393 | import collections
class Solution:
def checkInclusion(self, s1: str, s2: str) -> bool:
if len(s2) < len(s1):
return False
table = collections.Counter(s1)
count = len(table)
start = 0
for i in range(len(s2)):
table[s2[i]] -= 1
if table[s2[i]... | mit | -1,377,102,481,941,461,800 | 28.638298 | 59 | 0.38191 | false | 4.183183 | false | false | false |
rspavel/spack | lib/spack/spack/cmd/debug.py | 3 | 2974 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os
import platform
import re
from datetime import datetime
from glob import ... | lgpl-2.1 | 4,554,121,192,927,436,000 | 29.040404 | 79 | 0.619704 | false | 3.540476 | false | false | false |
cupen/django-xadmin | xadmin/compatibility.py | 1 | 1402 | # coding:utf-8
__author__ = 'cupen@foxmail.com'
import sys
from django.utils import six
from django.utils.encoding import smart_str, force_str
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
smart_unicode = smart_str
force_unicode = force_str
if PY2:
from django.utils.... | bsd-3-clause | -5,009,678,236,210,596,000 | 23.071429 | 66 | 0.600571 | false | 3.215596 | false | false | false |
timwaizenegger/raspberrypi-examples | sensor-thumb-joystick/ky023.py | 2 | 1703 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
reads position from thumb-joystick
needs spidev installed
http://www.raspberrypi-spy.co.uk/2014/08/enabling-the-spi-interface-on-the-raspberry-pi/
"""
import RPi.GPIO as GPIO
import time
import spidev
xPin = 0 # joystick x connected to A0
yPin = 1 # joystick y connecte... | mit | -5,053,283,674,795,448,000 | 21.394737 | 88 | 0.670782 | false | 2.569486 | false | false | false |
google/shaka-streamer | streamer/pipeline_configuration.py | 1 | 10668 | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | -4,969,859,681,184,087,000 | 32.759494 | 94 | 0.695819 | false | 3.873638 | true | false | false |
KmolYuan/Pyslvs-PyQt5 | pyslvs_ui/graphics/canvas.py | 1 | 24144 | # -*- coding: utf-8 -*-
"""All color options in Pyslvs."""
__author__ = "Yuan Chang"
__copyright__ = "Copyright (C) 2016-2019"
__license__ = "AGPL"
__email__ = "pyslvs@gmail.com"
from typing import (
Tuple,
List,
Sequence,
Set,
Dict,
Iterator,
Any,
Union,
Optional,
ClassVar,
)... | agpl-3.0 | 549,380,833,281,812,030 | 30.936508 | 87 | 0.508159 | false | 3.613289 | false | false | false |
qitta/libhugin | hugin/harvest/provider/ofdb/ofdbcommon.py | 1 | 4205 | #!/usr/bin/env python
# encoding: utf-8
""" Common ofdb provider stuff for parsing and extracting values. """
# stdlib
import json
import re
from collections import deque
class OFDBCommon:
def __init__(self):
self._urls = [
# seems to be currently the only correct working mirror, other
... | gpl-3.0 | -8,164,336,351,595,135,000 | 34.327731 | 79 | 0.570409 | false | 3.917987 | false | false | false |
pombredanne/MOG | nova/tests/virt/vmwareapi/test_vmwareapi_vif.py | 3 | 7424 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Canonical Corp.
# 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.or... | apache-2.0 | 2,194,094,830,972,222,000 | 45.4 | 78 | 0.582705 | false | 4.067945 | true | false | false |
hiidef/hiitrack-api | hiitrack/controllers/funnel.py | 1 | 9192 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Funnels are a collection of events within a bucket.
"""
from itertools import chain
from twisted.internet.defer import inlineCallbacks, returnValue, DeferredList
from telephus.cassandra.c08.ttypes import NotFoundException
from ..models import bucket_check, user_author... | mit | 2,922,717,380,705,292,000 | 35.188976 | 84 | 0.591057 | false | 3.735067 | false | false | false |
ponl/knnFlow | converters/npy2xyz.py | 1 | 1525 | #!/usr/bin/python2
"""
xyz2npy
Author: Patrick A. O'Neil
License:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versi... | gpl-2.0 | -2,676,461,989,288,240,000 | 20.785714 | 73 | 0.620984 | false | 3.426966 | false | false | false |
SwankSwashbucklers/bottle-builder | bottle-builder/overrides.py | 1 | 2811 | """
Overrides of standard python classes and functions to provide customized
behavior and windows/mac compatibility.
"""
__all__ = [ "Template", "sCall", "sPopen" ]
##### Template #################################################################
from string import Template
from re import compile
class Temp... | mit | -1,803,700,425,412,556,500 | 30.58427 | 80 | 0.499822 | false | 4.170623 | false | false | false |
IZSVenezie/VetEpiGIS-Group | plugin/dbconnection.py | 1 | 3204 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
VetEpiGIS-Group
A QGIS plugin
Spatial functions for vet epidemiology
-------------------
begin : 2016-05-06
git sha : $Format:%H$
... | gpl-3.0 | -7,122,294,016,489,848,000 | 34.208791 | 119 | 0.556492 | false | 4.395062 | false | false | false |
tadejpetric/neuralsound | read.py | 1 | 2323 | '''
reads wav file
http://soundfile.sapp.org/doc/WaveFormat/
https://blogs.msdn.microsoft.com/dawate/2009/06/23/intro-to-audio-programming-part-2-demystifying-the-wav-format/
'''
import numpy as np #for 2d array
def read_data(name):
with open(name, "rb") as f:
sGroupID1 = f.read(4).decode('ascii') #... | mit | -5,286,009,402,355,119,000 | 66.323529 | 126 | 0.65734 | false | 3.401171 | false | false | false |
dougwig/acos-client | acos_client/v30/slb/service_group.py | 1 | 3898 | # Copyright 2014, Jeff Buttars, A10 Networks.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 | -3,985,094,053,644,181,500 | 34.117117 | 84 | 0.628271 | false | 3.680831 | false | false | false |
pombredanne/dGit | setup.py | 1 | 1762 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
APP_NAME = 'legit'
APP_SCRIPT = './legit_r'
VERSION = '0.1.0'
# Grab requirments.
with open('reqs.txt') as f:
required = f.readlines()
settings = ... | bsd-3-clause | 1,204,772,857,594,329,300 | 20.753086 | 60 | 0.575482 | false | 3.640496 | false | false | false |
liorvh/Empire | lib/modules/situational_awareness/host/computerdetails.py | 19 | 4385 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-ComputerDetails',
'Author': ['@JosephBialek'],
'Description': ('Enumerates useful information on the system. By default, all checks are run.'),
... | bsd-3-clause | -70,047,547,855,070,470 | 38.151786 | 174 | 0.489852 | false | 4.50668 | false | false | false |
jnishi/chainer | tests/chainerx_tests/unit_tests/routines_tests/test_math.py | 2 | 21599 | import numpy
import pytest
import chainerx
import chainerx.testing
from chainerx_tests import array_utils
@chainerx.testing.numpy_chainerx_array_equal()
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
def test_negative(xp, device, shape, dtype, is_module):
if dtype == 'bool_': # Checked in test_invalid... | mit | 2,352,796,551,604,239,000 | 35.732993 | 79 | 0.638965 | false | 3.094413 | true | false | false |
briancurtin/rackspace-sdk-plugin | rackspace/monitoring/v1/notification.py | 2 | 1784 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | 7,101,806,672,857,766,000 | 34.68 | 75 | 0.704036 | false | 4.415842 | false | false | false |
thomasvs/pychecker | pychecker/function.py | 4 | 8717 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (c) 2001-2002, MetaSlash Inc. All rights reserved.
"""
Object to hold information about functions.
Also contain a pseudo Python function object
"""
import string
_ARGS_ARGS_FLAG = 4
_KW_ARGS_FLAG = 8
_CO_FLAGS_MASK = _ARGS_ARGS_FLAG + _KW_ARGS_FLAG
cla... | bsd-3-clause | 1,329,208,620,123,719,700 | 34.008032 | 79 | 0.601354 | false | 4.048769 | false | false | false |
drougge/wellpapp-pyclient | wellpapp/shell/replace.py | 1 | 2031 | from __future__ import print_function
from os.path import lexists, realpath
from os import unlink, rename, symlink, stat
from optparse import OptionParser
from hashlib import md5
from PIL import Image, PngImagePlugin
from wellpapp import Client, make_pdirs
def main(arg0, argv):
p = OptionParser(usage="Usage: %prog [... | mit | 4,836,119,202,779,208,000 | 28.014286 | 77 | 0.670606 | false | 2.748309 | false | false | false |
fresskarma/tinyos-1.x | contrib/handhelds/tools/scripts/common.py | 2 | 4032 | #!/usr/bin/python
'''
Copyright (c) 2005 Hewlett-Packard Company
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 copyright
notice, this li... | bsd-3-clause | -6,222,359,631,060,490,000 | 29.545455 | 75 | 0.618056 | false | 4.003972 | false | false | false |
jonjesbuzz/cards | python/cards.py | 1 | 1613 | from enum import Enum
from typing import List
from random import randint
class Suit(Enum):
SPADE = 0
CLUB = 1
HEART = 2
DIAMOND = 3
def __str__(self) -> str:
return str(self.name).capitalize()
class Rank(Enum):
ACE = 1
TWO = 2
THREE = 3
FOUR = 4
FIVE = 5
SIX = 6
... | mit | 5,687,092,305,539,702,000 | 21.402778 | 67 | 0.463112 | false | 3.446581 | false | false | false |
zahari/samba | selftest/run.py | 13 | 4305 | #!/usr/bin/python -u
# Bootstrap Samba and run a number of tests against it.
# Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org>
# 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 versi... | gpl-3.0 | 3,631,319,685,478,454,000 | 31.126866 | 86 | 0.648084 | false | 3.72083 | true | false | false |
neuronalX/workshop_cellular_automaton | gray_scott.py | 1 | 2448 | # -----------------------------------------------------------------------------
# From Numpy to Python
# Copyright (2017) Nicolas P. Rougier - BSD license
# More information at https://github.com/rougier/numpy-book
# -----------------------------------------------------------------------------
import numpy as np
import... | mit | 4,542,996,697,094,777,000 | 36.661538 | 81 | 0.454657 | false | 2.374394 | false | false | false |
listen1/listen1 | listen1/handlers/playlist.py | 1 | 5556 | # coding=utf8
import logging
from handlers.base import BaseHandler
from models.playlist import PlaylistManager
from replay import get_provider, get_provider_list
logger = logging.getLogger('listenone.' + __name__)
class ShowPlaylistHandler(BaseHandler):
def get(self):
source = self.get_argument('source'... | mit | 2,191,440,012,835,903,200 | 31.87574 | 79 | 0.561375 | false | 3.901685 | false | false | false |
npetrenko/recurrent_frcnn | rcnn/MOT_parser.py | 1 | 4081 | import cv2
import numpy as np
import os
def read_ini(fpath):
ret = {}
with open(fpath, 'r') as f:
for line in f:
if '=' in line:
k, v = line.split('=')
v = v.rstrip()
try:
v = int(v)
except:
... | apache-2.0 | -6,515,110,188,819,180,000 | 27.943262 | 131 | 0.432002 | false | 4.109768 | false | false | false |
xiaohan2012/capitalization-restoration-train | tests/test_eval_rule_based.py | 1 | 1526 | import numpy as np
from numpy.testing import assert_array_equal
import os
from capitalization_train.evaluate import (eval_rule_based,
is_consistent_prediction,
eval_stat)
from nose.tools import (assert_equal,
a... | mit | 8,785,436,546,239,153,000 | 33.681818 | 93 | 0.534076 | false | 3.912821 | false | false | false |
rmdfnc/amazonHistory | hist.py | 1 | 1276 | '''
Take Amazon csv and visualize your spending
'''
import pdb
import csv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
#pdb.set_trace()
from datetime import datetime
#Initialize variables
date = []
total = []
rownum = 0
# Import the csv file
with open ('sampleHistory.csv') as csvf... | mit | -496,072,831,152,706,400 | 25.040816 | 80 | 0.652038 | false | 3.375661 | false | false | false |
hanguokai/youku | youku/youku_videos.py | 1 | 9104 | """Youku Open API V2 Python Client
doc: http://open.youku.com/docs/tech_doc.html
"""
import requests
from .util import check_error, remove_none_value
class YoukuVideos(object):
"""Youku Videos API.
doc:http://open.youku.com/docs/api_videos.html
"""
def __init__(self, client_id):
super(You... | apache-2.0 | -5,377,121,332,355,707,000 | 31.630824 | 79 | 0.49967 | false | 3.536908 | false | false | false |
citrix-openstack-build/ironic | ironic/db/sqlalchemy/migrate_repo/versions/001_init.py | 1 | 3242 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#... | apache-2.0 | -6,940,069,309,110,839,000 | 32.770833 | 78 | 0.628007 | false | 4.103797 | false | false | false |
UTNkar/moore | src/home/migrations/0040_manual_imageicons_data.py | 1 | 2662 | # Generated by Django 2.2.10 on 2020-04-04 13:36
from django.db import migrations
from itertools import chain
from utils.data_migrations import stream_field_filter_map
def imageicon_to_columns(block):
image = {
'type': 'image',
'value':{
'image': block['value']['image'],
'h... | agpl-3.0 | -2,287,619,571,841,572,600 | 25.62 | 116 | 0.411721 | false | 4.511864 | false | false | false |
matthewoliver/swift | test/unit/common/test_storage_policy.py | 2 | 57607 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 | 3,921,339,471,042,839,000 | 38.565247 | 79 | 0.522315 | false | 4.123327 | true | false | false |
bkochendorfer/reviewboard | reviewboard/webapi/tests/test_review_reply.py | 3 | 12139 | from __future__ import unicode_literals
from django.core import mail
from django.utils import six
from reviewboard.reviews.models import Review
from reviewboard.webapi.resources import resources
from reviewboard.webapi.tests.base import BaseWebAPITestCase
from reviewboard.webapi.tests.mimetypes import (review_reply_i... | mit | -2,576,674,679,771,962,000 | 34.914201 | 78 | 0.598484 | false | 3.914544 | true | false | false |
OCA/connector-telephony | connector_voicent/models/backend_voicent_call_line.py | 1 | 4618 | # Copyright (C) 2019 Open Source Integrators
# <https://www.opensourceintegrators.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
VOICENT_CONTACT_COLUMNS = [('Assigned To', 'Assigned To'),
('Business', 'Business'),
... | agpl-3.0 | 9,036,391,513,208,413,000 | 41.366972 | 79 | 0.508012 | false | 4.287837 | false | false | false |
ingvagabund/gofed | cmd/goapidiff/goapidiff.py | 2 | 5372 | # Check difference of APIs of two commits
# Output is number of symbols added and removed.
# You can list of those symbols as well
# Projects that change exported symbols with each commit should not be used
# as a built or install time dependency until they stabilize.
import logging
import os
from gofedlib.utils im... | gpl-2.0 | 3,897,696,865,895,849,500 | 25.994975 | 88 | 0.671072 | false | 3.279609 | false | false | false |
redhat-openstack/python-openstackclient | openstackclient/compute/v2/floatingip.py | 1 | 2315 | # Copyright 2013 OpenStack Foundation
#
# 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,583,730,177,318,009,000 | 31.605634 | 77 | 0.642333 | false | 4.239927 | false | false | false |
better-dem/portal | legislators/management/commands/legislators_update.py | 1 | 1860 | from django.core.management.base import BaseCommand, CommandError
from legislators.models import LegislatorsProject, LegislatorsItem, BillsProject, BillsItem
import core.models as cm
import core.tasks as ct
from django.db import transaction
from django.utils import timezone
import argparse
import sys
import pyopenstat... | agpl-3.0 | -1,296,061,344,677,371,600 | 36.959184 | 145 | 0.626882 | false | 4.034707 | false | false | false |
renoirb/browsercompat | webplatformcompat/view_serializers.py | 1 | 31413 | # -*- coding: utf-8 -*-
"""API Serializers"""
from collections import OrderedDict
from itertools import chain
from json import dumps
from django.conf import settings
from django.core.paginator import Paginator
from drf_cached_instances.models import CachedQueryset
from rest_framework.reverse import reverse
from rest_... | mpl-2.0 | -3,760,999,422,597,768,700 | 39.067602 | 79 | 0.587496 | false | 4.408223 | false | false | false |
DiamondLightSource/auto_tomo_calibration-experimental | old_code_scripts/blob_circles.py | 1 | 2064 | def detect_circles(np_image):
"""
Uses Hough transform to detect the radii and the
centres of the "blobs" indicating the point of
contact between the spheres
"""
import numpy as np
import pylab as pl
from skimage.transform import hough_circle
from skimage.feature import peak_local_ma... | apache-2.0 | -4,499,408,939,068,151,300 | 32.836066 | 207 | 0.573159 | false | 3 | false | false | false |
kawamon/hue | desktop/core/ext-py/defusedxml-0.5.0/setup.py | 2 | 1784 | #!/usr/bin/env python
from __future__ import absolute_import
import sys
from distutils.core import Command
import subprocess
from setuptools import setup
import defusedxml
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
... | apache-2.0 | -5,821,807,950,419,019,000 | 27.31746 | 72 | 0.641256 | false | 4.018018 | false | false | false |
torymur/python-hubstorage | tests/test_batchuploader.py | 2 | 2377 | """
Test Project
"""
import time
from collections import defaultdict
from hstestcase import HSTestCase
from hubstorage import ValueTooLarge
class BatchUploaderTest(HSTestCase):
def _job_and_writer(self, **writerargs):
self.project.push_job(self.spidername)
job = self.start_job()
bu = self... | bsd-3-clause | 5,465,130,919,629,342,000 | 32.013889 | 78 | 0.543122 | false | 3.791069 | true | false | false |
robintw/Py6S | doc/source/conf.py | 1 | 8291 | # -*- coding: utf-8 -*-
#
# Py6S documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 16 12:07:44 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | lgpl-3.0 | 8,862,743,489,198,015,000 | 30.645038 | 84 | 0.693402 | false | 3.724618 | true | false | false |
codervikash/algorithms | Python/Graphs/kosaraju_strongly_connected_components.py | 1 | 2142 | """
A directed graph is strongly connected if there is a path between all pairs of vertices. A strongly connected component (SCC) of a directed graph is a maximal strongly connected subgraph.
Time Complexity: The above algorithm calls DFS, fins reverse of the graph and again calls DFS. DFS takes O(V+E) for a graph rep... | mit | 6,052,473,931,468,073,000 | 25.444444 | 264 | 0.598506 | false | 3.59396 | false | false | false |
PrincessTeruko/MHAGr | tools_(bakaneko)/transfer.py | 1 | 1492 | """
Copies names (value 1 in 1:2:3) from source file to target file
Requires manual use
"""
import os, sys
verbose = True # If True, print every replacement
pretend = False # If True, don't actually write
# The two files to be worked with
#source = "../../../mhag-read-only/src/org/mhag/model/data/mh3g/armor.dat... | gpl-3.0 | -4,383,449,597,194,457,600 | 23.866667 | 74 | 0.664879 | false | 2.880309 | false | false | false |
ARISE-Initiative/robosuite | robosuite/models/arenas/wipe_arena.py | 1 | 7468 | import numpy as np
from robosuite.models.arenas import TableArena
from robosuite.utils.mjcf_utils import CustomMaterial, find_elements
from robosuite.models.objects import CylinderObject
class WipeArena(TableArena):
"""
Workspace that contains an empty table with visual markers on its surface.
Args:
... | mit | 4,546,666,403,218,665,000 | 40.032967 | 117 | 0.588645 | false | 3.92021 | false | false | false |
abinit/abinit | scripts/post_processing/ElectronPhononCoupling/ElectronPhononCoupling/tests/test_LiF_g4.py | 2 | 2946 | from __future__ import print_function
from os.path import join as pjoin
from copy import copy
from . import SETest
from ..data.LiF_g4 import nqpt, wtq, fnames, refdir
class Test_LiF_g4(SETest):
common = dict(
temperature = False,
renormalization = False,
broadening = False,
self_... | gpl-3.0 | -3,998,620,104,432,975,400 | 25.540541 | 76 | 0.535642 | false | 3.494662 | true | false | false |
Applied-GeoSolutions/geokit | account/models.py | 1 | 1368 | from django.contrib.gis.db import models
from tenant_schemas.models import TenantMixin
from django.contrib.auth.models import User
import re
ACCESS_TYPES = (
('read', 'Read',),
('write', 'Write'),
('admin', 'Admin'),
)
SITE_STATUS = (
('active', 'Active'),
('disabled', 'Disabled'),
)
class Mem... | gpl-2.0 | 8,578,746,440,716,939,000 | 24.333333 | 83 | 0.630848 | false | 3.553247 | false | false | false |
simvisage/oricreate | apps/sandbox/rch/ex005_triang2.py | 1 | 6880 | r'''
Calculate the derivatives of a dihedral angle.
'''
import numpy as np
from oricreate.api import CreasePatternState, CustomCPFactory
from oricreate.util.einsum_utils import \
DELTA, EPS
z_e = 0.5
def create_cp_factory():
cp = CreasePatternState(X=[[0, 0, 0],
[1, 1, 0],... | gpl-3.0 | 5,509,409,985,829,546,000 | 31.91866 | 77 | 0.467151 | false | 2.877457 | false | false | false |
namiszh/fba | Toolkit/yahoo_import_pre_draft_ranks.py | 1 | 7692 | #!/usr/bin/python
from pandas import DataFrame
from selenium import webdriver
from selenium.webdriver import PhantomJS
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from seleniu... | mit | 2,991,500,479,918,677,500 | 46.190184 | 226 | 0.655486 | false | 3.354557 | false | false | false |
ooici/marine-integrations | mi/dataset/parser/dosta_abcdjm_mmp_cds.py | 1 | 3302 | #!/usr/bin/env python
"""
@package mi.dataset.parser.dosta_abcdjm_mmp_cds
@file marine-integrations/mi/dataset/parser/dosta_abcdjm_mmp_cds.py
@author Mark Worden
@brief Parser for the DostaAbcdjmMmpCds dataset driver
Release notes:
initial release
"""
__author__ = 'Mark Worden'
__license__ = 'Apache 2.0'
from mi.co... | bsd-2-clause | 7,201,116,402,367,147,000 | 37.406977 | 117 | 0.633858 | false | 3.978313 | false | false | false |
TraurigeNarr/ThirdParties | assimp-3.2/port/PyAssimp/gen/structsgen.py | 44 | 9543 | #!/usr/bin/env python
# -*- Coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# Open Asset Import Library (ASSIMP)
# ---------------------------------------------------------------------------
#
# Copyright (c) 2006-2010, ASSIMP Development Team
#
# All rights reserved.
#
... | gpl-2.0 | -8,412,571,633,829,338,000 | 31.906897 | 122 | 0.488421 | false | 3.933636 | false | false | false |
jakobzhao/wbcrawler3 | generate_sematic_network.py | 1 | 1468 | # !/usr/bin/python
# -*- coding: utf-8 -*-
#
# Created on Oct 16, 2015
# @author: Bo Zhao
# @email: bo_zhao@hks.harvard.edu
# @website: http://yenching.org
# @organization: Harvard Kennedy School
from wbcrawler.sna import generate_sematic_network
# generate_sematic_network(keywords=[u'社保', u'社会保险'],... | mit | -343,822,011,936,169,540 | 66.6 | 152 | 0.686391 | false | 2.011905 | false | true | false |
Rademade/taiga-back | taiga/events/apps.py | 3 | 1618 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 | 4,559,636,659,529,954,300 | 38.414634 | 91 | 0.755569 | false | 3.607143 | false | false | false |
radical-cybertools/ExTASY | examples/coam-on-archer/kernel_defs/tleap.py | 1 | 4163 | #!/usr/bin/env python
"""A kernel that creates a new ASCII file with a given size and name.
"""
__author__ = "The ExTASY project <vivek.balasubramanian@rutgers.edu>"
__copyright__ = "Copyright 2015, http://www.extasy-project.org/"
__license__ = "MIT"
from copy import deepcopy
from radical.ensemblemd.exceptions... | mit | 5,601,111,011,044,209,000 | 34.581197 | 124 | 0.444871 | false | 4.49568 | true | false | false |
soarpenguin/ansible | lib/ansible/modules/storage/purestorage/purefa_hg.py | 7 | 5209 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Simon Dodsley (simon@purestorage.com)
#
# This file is part of Ansible
#
# Ansible 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... | gpl-3.0 | -3,106,317,457,866,757,000 | 26.560847 | 88 | 0.650989 | false | 3.728704 | false | false | false |
kav2k/AoC | 2015/03/solver.py | 1 | 2120 | """AoC 2015.03 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
def chars(file, chunkSize=4096):
"""
Take a file object, read it in chuncks and iterate over it one character at a time.
Keyword arguments:
file --- a file object to iterate over
chunkSize ---... | mit | 162,078,325,013,108,350 | 25.5 | 95 | 0.654245 | false | 3.617747 | false | false | false |
pizzathief/scipy | scipy/signal/tests/test_spectral.py | 9 | 53294 | import numpy as np
from numpy.testing import (assert_, assert_approx_equal,
assert_allclose, assert_array_equal, assert_equal,
assert_array_almost_equal_nulp, suppress_warnings)
import pytest
from pytest import raises as assert_raises
from scipy import signal
from ... | bsd-3-clause | 3,733,224,388,705,972,000 | 35.477755 | 105 | 0.519346 | false | 2.962424 | true | false | false |
eustislab/horton | data/examples/ap1rog/h2_cholesky_aug-cc-pvdz.py | 1 | 3689 | #!/usr/bin/env python
from horton import *
import numpy as np
###############################################################################
## Set up molecule, define basis set ##########################################
###############################################################################
# get the XYZ fi... | gpl-3.0 | -2,095,701,366,258,300,700 | 50.957746 | 283 | 0.412307 | false | 4.140292 | false | true | false |
futurecoin1/futurecoin1 | contrib/linearize/linearize-hashes.py | 105 | 2762 | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import struct
impor... | mit | 7,122,426,798,255,612,000 | 25.056604 | 78 | 0.661839 | false | 2.957173 | false | false | false |
sanaldavis/Google-Python-Exercies | basic/mimic.py | 1 | 2511 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | apache-2.0 | -6,352,672,385,858,135,000 | 28.197674 | 78 | 0.709677 | false | 3.444444 | false | false | false |
UstadMobile/exelearning-ustadmobile-work | exe/webui/readabilitypresetspage.py | 1 | 3166 | '''
Created on Sep 30, 2014
@author: mike
'''
import logging
import json
from twisted.web.resource import Resource
from exe.webui.renderable import RenderableResource
from exe.engine.readabilityutil import ReadabilityUtil
from exe.engine.path import Path
import os.path
from exe import globals as G
import re... | gpl-2.0 | 1,791,234,677,561,414,400 | 33.423913 | 95 | 0.570752 | false | 4.106355 | false | false | false |
annarev/tensorflow | tensorflow/python/keras/utils/version_utils.py | 3 | 5247 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | 3,143,262,255,125,004,300 | 37.29927 | 111 | 0.682295 | false | 3.574251 | false | false | false |
mondalaci/twitter-backup.py | twitter-backup.py | 1 | 5347 | #!/usr/bin/env python
import os
import os.path
from sys import exit, argv
import json
import oauth2 as oauth
from StringIO import StringIO
from urlparse import parse_qsl
# Please don't use this key and secret if you create a new version of this script.
# You can request your own API key at https://dev.twitter.com/app... | gpl-3.0 | -7,132,872,576,028,077,000 | 34.410596 | 99 | 0.680943 | false | 3.423175 | false | false | false |
SanPen/GridCal | src/GridCal/Engine/Simulations/NTC/net_transfer_capacity_driver.py | 1 | 15405 | # This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... | gpl-3.0 | 2,920,079,811,810,432,000 | 37.803526 | 123 | 0.487958 | false | 4.204421 | false | false | false |
arsfeld/conduit | conduit/modules/UNSUPPORTED/PicasaDesktopModule/PicasaDesktopModule.py | 1 | 7689 | import os
import csv
import logging
import xml.dom.minidom
log = logging.getLogger("modules.Picasa")
import conduit
import conduit.utils as Utils
import conduit.Vfs as Vfs
import conduit.Exceptions as Exceptions
import conduit.dataproviders.DataProvider as DataProvider
import conduit.datatypes.Photo as Photo
from ge... | gpl-2.0 | -1,755,366,651,194,574,800 | 35.098592 | 99 | 0.528027 | false | 4.213151 | true | false | false |
OutOfOrder/sshproxy | sshproxy/server.py | 1 | 25905 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (C) 2005-2007 David Guerizec <david@guerizec.net>
#
# Last modified: 2008 Jan 22, 14:19:03 by david
#
# 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 Softw... | gpl-2.0 | -4,614,761,050,825,762,000 | 35.029207 | 80 | 0.525922 | false | 4.290328 | false | false | false |
Plurk/Solace | solace/utils/admin.py | 2 | 1492 | # -*- coding: utf-8 -*-
"""
solace.utils.admin
~~~~~~~~~~~~~~~~~~
Admin helpers.
:copyright: (c) 2009 by Plurk Inc., see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from solace import settings
from solace.i18n import _
from solace.application import url_for
from sola... | bsd-3-clause | 5,443,603,702,995,309,000 | 29.44898 | 69 | 0.632038 | false | 3.647922 | false | false | false |
mcyprian/pyp2rpm | pyp2rpm/command/extract_dist.py | 1 | 3373 | import sys
import json
from distutils.core import Command
class extract_dist(Command):
"""Custom distutils command to extract metadata form setup function."""
description = ("Assigns self.distribution to class attribute to make "
"it accessible from outside a class.")
user_options = [('... | mit | 3,313,173,511,970,343,400 | 34.882979 | 79 | 0.584939 | false | 4.595368 | false | false | false |
piskvorky/pattern | pattern/text/en/parser/brill.py | 1 | 9514 | #### PATTERN | EN | PARSER | BRILL LEXICON #########################################################
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
####################################... | bsd-3-clause | 5,150,956,330,610,113,000 | 44.745192 | 103 | 0.487387 | false | 3.395432 | false | false | false |
sunfishcode/cretonne | lib/cretonne/meta/semantics/__init__.py | 1 | 3019 | """Definitions for the semantics segment of the Cretonne language."""
from cdsl.ti import TypeEnv, ti_rtl, get_type_env
from cdsl.operands import ImmediateKind
from cdsl.ast import Var
try:
from typing import List, Dict, Tuple # noqa
from cdsl.ast import VarAtomMap # noqa
from cdsl.xform import XForm, Rtl... | apache-2.0 | -6,198,810,019,702,982,000 | 38.207792 | 79 | 0.595893 | false | 3.704294 | false | false | false |
emsrc/daeso-framework | lib/daeso/pair.py | 1 | 1875 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2013 by Erwin Marsi and TST-Centrale
#
# This file is part of the DAESO Framework.
#
# The DAESO Framework is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ... | gpl-3.0 | -5,680,566,909,070,398,000 | 28.296875 | 77 | 0.6368 | false | 3.90625 | false | false | false |
emulienfou/docker-stack | setup.py | 1 | 1666 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import os
import re
from setuptools import find_packages
from setuptools import setup
def read(*parts):
path = os.path.join(os.path.dirname(__file__), *parts)
with codecs.op... | mit | 1,364,647,457,032,078,000 | 25.444444 | 96 | 0.620648 | false | 3.661538 | false | false | false |
dstufft/warehouse | warehouse/migrations/versions/0864352e2168_drop_duplicate_indexes.py | 1 | 1869 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 | 1,130,926,108,418,970,900 | 36.38 | 88 | 0.718566 | false | 3.526415 | false | false | false |
JudTown17/solutions-geoprocessing-toolbox | operational_graphics/toolboxes/scripts/RangeFanByBearingAndTraversal.py | 1 | 8907 |
#------------------------------------------------------------------------------
# Copyright 2014 Esri
# 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... | apache-2.0 | -6,732,843,962,256,462,000 | 38.941704 | 157 | 0.629168 | false | 3.69892 | false | false | false |
alephdata/aleph | aleph/model/event.py | 1 | 3778 | from flask_babel import lazy_gettext
from aleph.model.role import Role
from aleph.model.alert import Alert
from aleph.model.entity import Entity
from aleph.model.entityset import EntitySet
from aleph.model.collection import Collection
from aleph.model.export import Export
class Event(object):
def __init__(self, ... | mit | -196,276,075,847,943,100 | 29.715447 | 85 | 0.5937 | false | 4.106522 | false | false | false |
katakumpo/nicedjango | nicedjango/utils/queries.py | 1 | 1448 | from operator import itemgetter
from nicedjango.utils.py import sliceable_as_chunks
from nicedjango.utils.py.chunk import as_chunks
from nicedjango.utils.py.iter import partition
from nicedjango.utils.py.operator import item_in
__all__ = ['partition_existing_pks', 'get_pks_queryset', 'queryset_as_chunks']
def parti... | mit | -5,210,880,107,361,234,000 | 32.674419 | 83 | 0.713398 | false | 3.480769 | false | false | false |
AWilliams17/WebLair | WebLair/settings.py | 1 | 3820 | """
Django settings for WebLair project.
Generated by 'django-admin startproject' using Django 1.10.5.
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... | gpl-3.0 | -2,623,914,492,151,416,300 | 26.681159 | 116 | 0.694241 | false | 3.540315 | false | false | false |
cogniteev/docido-python-sdk | docido_sdk/toolbox/date_ext.py | 1 | 5758 |
from datetime import datetime
import re
import sys
from dateutil import parser
import pytz
import six
from . text import levenshtein
UTC_EPOCH = datetime(1970, 1, 1).replace(tzinfo=pytz.utc)
MAX_POSIX_TIMESTAMP = pow(2, 32) - 1
DAYS = {
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
... | apache-2.0 | -3,380,683,506,579,261,000 | 31.348315 | 79 | 0.547586 | false | 3.984775 | false | false | false |
allo-/django-bingo-tweet | setup.py | 1 | 1212 | import os
import sys
from setuptools import setup
from setuptools.command.install_lib import install_lib as _install_lib
with open('requirements.txt') as f:
required = f.read().splitlines()
class install_lib(_install_lib):
def run(self):
from django.core.management.commands.compilemessages \
... | agpl-3.0 | 3,360,659,025,379,820,500 | 30.894737 | 76 | 0.629538 | false | 3.823344 | false | false | false |
total-impact/total-impact-core | test/unit_tests/test_backend.py | 2 | 18627 | import json, os, Queue, datetime
from totalimpact import tiredis, backend, default_settings
from totalimpact import db, app
from totalimpact import item as item_module
from totalimpact.providers.provider import Provider, ProviderTimeout, ProviderFactory
from totalimpact import REDIS_UNITTEST_DATABASE_NUMBER
from nose... | mit | -208,706,792,003,346,430 | 47.76178 | 182 | 0.603801 | false | 3.6951 | true | false | false |
gotlium/django-geoip-redis | geoip/migrations/0001_initial.py | 1 | 8484 | # -*- 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 'Country'
db.create_table('geoip_country', (
('code', self.gf('django.db.models.f... | gpl-3.0 | -467,225,565,146,595,000 | 51.701863 | 147 | 0.565535 | false | 3.653747 | false | false | false |
neweagle/ns-3_multisim | pybindgen/wutils.py | 2 | 3389 | import os.path
import sys
import subprocess
import re
def _get_version_from_bzr_lib(path):
import bzrlib.tag, bzrlib.branch
fullpath = os.path.abspath(path)
if sys.platform == 'win32':
fullpath = fullpath.replace('\\', '/')
fullpath = '/' + fullpath
branch = bzrlib.branch.Branch.open('... | gpl-2.0 | 1,645,114,885,946,724,600 | 32.22549 | 96 | 0.581292 | false | 3.695747 | false | false | false |
nerzhul/Z-Eye | service/Collectors/zNetdisco.py | 1 | 3330 | # -*- Coding: utf-8 -*-
"""
* Copyright (C) 2010-2014 Loic BLOT, CNRS <http://www.unix-experience.fr/>
*
* 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... | gpl-2.0 | 6,357,073,503,739,357,000 | 30.714286 | 127 | 0.708408 | false | 3.1209 | false | false | false |
halfak/python-para | setup.py | 1 | 1232 | import os
from distutils.core import setup
from setuptools import find_packages
about_path = os.path.join(os.path.dirname(__file__), "para/about.py")
exec(compile(open(about_path).read(), about_path, "exec"))
def requirements(fname):
return [line.strip()
for line in open(os.path.join(os.path.dirname... | mit | 6,124,903,700,830,610,000 | 29.8 | 77 | 0.607955 | false | 4.134228 | false | false | false |
skorokithakis/django-brake | brake/decorators.py | 2 | 2649 | import re
from functools import wraps
from django.conf import settings
from django.http import HttpResponse
class HttpResponseTooManyRequests(HttpResponse):
status_code = getattr(settings, 'RATELIMIT_STATUS_CODE', 403)
def _method_match(request, method=None):
if method is None:
method = ['GET', 'POST... | bsd-3-clause | -6,449,535,197,222,197,000 | 27.483871 | 101 | 0.562099 | false | 4.069124 | false | false | false |
trong-nguyen/algorithms | leet/contest_74.py | 1 | 2834 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import sys
from utils.templates import fail_string
import bisect
class Solution(object):
def is_subsequence(self, word, lookup):
# print lookup
if not word:
return True
left = -1
for c in word:
if c... | gpl-3.0 | -521,955,089,127,808,640 | 24.772727 | 109 | 0.498941 | false | 3.385902 | false | false | false |
Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/mesh/generation/grid.py | 1 | 1992 | import bpy
from bpy.props import *
from mathutils import Vector
from .... base_types.node import AnimationNode
from .... algorithms.mesh_generation.indices_utils import GridMeshIndices
from .... algorithms.mesh_generation.basic_shapes import gridVertices
from .... events import executionCodeChanged
class GridMeshNode(... | gpl-3.0 | -2,165,053,050,149,164,300 | 47.585366 | 121 | 0.689759 | false | 3.688889 | false | false | false |
addition-it-solutions/project-all | addons/website_crm_score/models/sales_team.py | 6 | 9841 | # -*- coding: utf-8 -*-
from openerp import fields, api, models
from openerp.osv import osv
from openerp.tools.safe_eval import safe_eval
from random import randint, shuffle
import datetime
import logging
import math
_logger = logging.getLogger(__name__)
evaluation_context = {
'datetime': datetime,
'context_to... | agpl-3.0 | 7,818,359,904,374,259,000 | 37.291829 | 149 | 0.553297 | false | 3.795218 | false | false | false |
lakshmi-kannan/st2 | st2common/st2common/util/reference.py | 13 | 2953 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 | -5,545,722,002,064,985,000 | 32.942529 | 94 | 0.691162 | false | 3.900925 | false | false | false |
mdl29/tidutyzef | serveur/playerws.py | 1 | 2544 | """Contain the socket handler for players"""
from utils import check_types
from player import Player
from game import Game
from websocket import WebSocketHandler
import errcode
class PlayerWs(WebSocketHandler):
"""The socket handler for websocket"""
def __init__(self, *args, **kwargs):
super().__in... | lgpl-3.0 | -6,687,239,132,226,760,000 | 32.473684 | 95 | 0.551494 | false | 4.076923 | false | false | false |
hirvola/bsa | 1MB/pat-gen.py | 1 | 2495 | #!/usr/bin/env python3
# -*- coding: utf8 -*-
import sys, argparse, random
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Pattern generator")
parser.add_argument("infile", nargs='?', type=argparse.FileType('rb'), default=sys.stdin.buffer)
parser.add_argument("-p", type=int, defaul... | mit | 8,204,699,868,084,737,000 | 37.984375 | 100 | 0.595591 | false | 3.465278 | false | false | false |
MehdiSfr/tensor-flow | tensorflow/python/training/saver.py | 1 | 35528 | # 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 | 8,151,407,964,540,449,000 | 38.041758 | 80 | 0.669022 | false | 4.052932 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.