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
firecracker-microvm/firecracker
tests/framework/jailer.py
1
11430
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Define a class for creating the jailed context.""" import os import shutil import stat from pathlib import Path from retry.api import retry_call import framework.utils as utils import framework.defs as de...
apache-2.0
-2,613,292,446,649,239,600
35.170886
79
0.563517
false
3.925137
false
false
false
cbelth/pyMusic
pydub/utils.py
1
5547
from __future__ import division from math import log, ceil, floor import os import re from subprocess import Popen, PIPE import sys from tempfile import TemporaryFile from warnings import warn try: import audioop except ImportError: import pyaudioop as audioop if sys.version_info >= (3, 0): basestring =...
mit
-1,184,726,411,691,576,600
23.436123
106
0.602308
false
3.695536
false
false
false
eayunstack/neutron
neutron/db/models/l3.py
1
5434
# 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 # d...
apache-2.0
-4,676,968,498,798,957,000
43.540984
79
0.645565
false
3.954876
false
false
false
jasonrbriggs/stomp.py
tests/test_s12.py
1
4813
import stomp from stomp import exception from stomp.listener import TestListener from .testutils import * @pytest.fixture() def conn(): conn = stomp.Connection12(get_default_host()) listener = TestListener("123", print_to_log=True) conn.set_listener("testlistener", listener) conn.connect(get_default_u...
apache-2.0
632,173,546,992,395,300
34.651852
107
0.623935
false
3.75429
true
false
false
fras2560/mlsb-platform
api/validators.py
1
5523
''' Name: Dallas Fraser Date: 2016-04-12 Project: MLSB API Purpose: Holds data validators ''' import time import datetime from datetime import date from api.variables import BATS, FIELDS def boolean_validator(value): ''' boolean_validator a general function to validate boolean parameter Parame...
apache-2.0
1,624,862,961,786,013,200
21.635246
74
0.556219
false
4.806789
false
false
false
zerothi/sisl
sisl/io/siesta/orb_indx.py
1
3481
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. from .sile import SileSiesta from ..sile import add_sile, sile_fh_open from sisl._internal import set_module from sisl ...
lgpl-3.0
3,194,727,338,471,812,000
29.008621
87
0.525136
false
3.379612
false
false
false
Perlence/porcupy
tests/test_if.py
1
7155
from porcupy.compiler import compile as compile_ def test_optimized_if(): assert compile_('if 0: x = 11') == '' assert compile_('if 1: x = 11') == 'p1z 11' assert compile_("if '': x = 11") == '' assert compile_("if 'beep': x = 11") == 'p1z 11' assert compile_('if None: x = 11') == '' assert ...
bsd-3-clause
7,381,887,588,531,012,000
31.22973
98
0.318099
false
2.959057
true
false
false
diarized/LunchTime
app/views.py
1
4508
# vim: set fileencoding=utf-8 : from flask import render_template, flash, redirect, session, url_for, request, g from flask.ext.login import login_user, logout_user, current_user, login_required from app import app, db, lm, oid from forms import LoginForm, NewEventForm from models import User, Event, Place import dat...
gpl-2.0
-1,856,096,359,801,858,800
27.858974
87
0.605509
false
3.495342
false
false
false
CylanceSPEAR/IntroductionToMachineLearningForSecurityPros
IDPanel/extract_features_from_prevectors.py
1
1058
import json from idpanel.training.features import reduce_prevector_datapoints_to_features from idpanel.blacklist import labels_to_ignore if __name__ == "__main__": data_points = [] with open("prevectors.json", "r") as f: for line in f: line = line.strip() if len(line) == 0: ...
gpl-3.0
-3,094,761,594,298,447,400
35.482759
77
0.615312
false
3.673611
false
false
false
wildux/tfg
codi/harris.py
1
1582
import cv2 import numpy as np import MORAS as vc from timeit import default_timer as timer '''********************** IMAGES **********************''' img = cv2.imread('images/all.ppm') # Image img = cv2.resize(img, (0,0), fx=0.5, fy=0.5) imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) imgRobot = cv2.imread('scene.jpg...
gpl-3.0
3,282,721,800,261,458,000
24.516129
106
0.647914
false
2.430108
false
false
false
srp33/ShinyLearner
scripts/AssignUnbalancedClasses.py
1
4723
import random, sys, os, re if len(sys.argv) != 6: print "Invalid number or arguments for %s." % sys.argv[0] sys.exit(1) IDFilePath = sys.argv[1] ClassFilePath = sys.argv[2] Prefix = sys.argv[3] OutFilePath = sys.argv[4] NumPermutations = sys.argv[5] Method = sys.argv[6] if not os.path.exists(IDFilePath): ...
mit
6,100,316,593,862,811,000
32.735714
152
0.630531
false
3.772364
true
false
false
djurodrljaca/salamander-alm
server/rest_api/usermanagement/logout.py
1
2002
from database.database import DatabaseInterface from flask_restful import abort from rest_api.restricted_resource import RestrictedResource from usermanagement.user_management import UserManagementInterface class Logout(RestrictedResource): """ REST API for logging out """ def __init__(self): ...
gpl-2.0
7,286,823,383,924,435,000
28.014493
93
0.559441
false
5.296296
false
false
false
Wei1234c/Elastic_Network_of_Things_with_MicroPython
codes/micropython/led.py
1
1069
# coding: utf-8 import time # noinspection PyUnresolvedReferences import machine # noinspection PyUnresolvedReferences import hardware on_board_led = machine.Pin(hardware.ON_BOARD_LED_PIN_NO, machine.Pin.OUT) on_board_led.value(0 if hardware.ON_BOARD_LED_HIGH_IS_ON else 1) # LED off def blink_on_board_led(times =...
gpl-3.0
8,106,493,225,291,124,000
29.571429
100
0.61927
false
2.994398
false
false
false
mooster311/Gigabot
cogs/events.py
1
4025
import discord import injector import database import pymongo class Events: """Events""" def __init__(self, bot): self.bot = bot async def on_connect(self): try: await database.client.server_info() except pymongo.errors.ServerSelectionTimeoutError as error: ...
mit
-6,553,606,878,064,655,000
44.224719
120
0.584845
false
4.136691
false
false
false
hilgroth/fiware-IoTAgent-Cplusplus
tests/e2e_tests/component/iot_manager_api/manager_devices/delete/setup.py
1
3583
from lettuce import step, world from iotqautils.gtwRest import Rest_Utils_SBC from common.user_steps import UserSteps, URLTypes, ProtocolTypes from common.gw_configuration import IOT_SERVER_ROOT,CBROKER_HEADER,CBROKER_PATH_HEADER,MANAGER_SERVER_ROOT api = Rest_Utils_SBC(server_root=IOT_SERVER_ROOT+'/iot') api2 = Rest...
agpl-3.0
-1,139,328,932,769,815,900
47.432432
142
0.655875
false
3.405894
false
false
false
rouault/Quantum-GIS
python/plugins/processing/gui/FixedTableDialog.py
1
4384
# -*- coding: utf-8 -*- """ *************************************************************************** FixedTableDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
gpl-2.0
3,034,024,119,814,898,000
36.152542
89
0.564781
false
4.207294
false
false
false
lishnih/tkrequest
scripts/run_tkrequest.py
1
3334
#!/usr/bin/env python # coding=utf-8 # Stan 2013-04-24 from __future__ import ( division, absolute_import, print_function, unicode_literals ) import importlib, multiprocessing, logging from tkrequest.lib.info import __pkgname__, __description__, __version__ from tkrequest.lib.backwardcompat ...
unlicense
5,383,001,014,225,017,000
23.696296
80
0.568086
false
3.663736
false
false
false
kastnerkyle/pylearn2
pylearn2/rbm_tools.py
1
20671
"""Tools for estimating the partition function of an RBM""" import numpy import theano from theano import tensor, config from theano.tensor import nnet from pylearn2.utils.exc import reraise_as from pylearn2.utils.rng import make_np_rng, make_theano_rng from pylearn2.utils.mem import improve_memory_error_message def ...
bsd-3-clause
8,842,477,859,076,746,000
36.789762
81
0.586764
false
3.437718
true
false
false
qingfeng/mikoto
mikoto/libs/text.py
1
3064
# -*- coding: utf-8 -*- from __future__ import absolute_import import re from mikoto.htmlrenderer import RE_USER_MENTION from mikoto.markdown import render_markdown from mikoto.checklist import get_checkbox_count from mikoto.libs.consts import (SOURCE_FILE, NOT_GENERATED, IGNORE_FILE_E...
bsd-3-clause
5,484,203,769,008,002,000
30.587629
79
0.583877
false
3.113821
false
false
false
SwordYoung/cutprob
leetcode/word-search/sol.py
1
1729
#!/usr/bin/env python class Solution: # @param board, a list of lists of 1 length string # @param word, a string # @return a boolean def exist(self, board, word): def valid(board, mark, i, j, dir, c): i1 = i j1 = j if dir == 0: i1 += 1 ...
artistic-2.0
589,862,752,705,570,400
31.018519
135
0.420474
false
3.521385
false
false
false
bluezed/repository.bluezed
script.epg.direct/gui.py
1
58536
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Tommy Winther # http://tommy.winther.nu # # Modified for FTV Guide (09/2014 onwards) # by Thomas Geppert [bluezed] - bluezed.apps@gmail.com # # Modified for EPG-Direct (08/2016 onwards) # by Thomas Geppert [bluezed] - bluezed.apps@gmail.com # ...
gpl-2.0
7,948,439,155,411,583,000
37.459921
103
0.593139
false
3.987194
false
false
false
xmichael/pcapi
src/pcapi/cobweb_parser.py
1
3535
import json import os from bs4 import BeautifulSoup class COBWEBFormParser: def __init__(self, content): self.content = content def extract(self): """ convert HTML editor form to JSON""" return json.dumps(self._get_dict_from_html()) def get_survey(self): """ return surve...
bsd-3-clause
-8,634,716,190,262,368,000
34
107
0.543423
false
3.888889
false
false
false
lsaffre/lino
lino/management/commands/dump2py.py
1
20114
# -*- coding: UTF-8 -*- # Copyright 2013-2018 by Rumma & Ko Ltd. # License: BSD, see file LICENSE for more details. """ This defines the :manage:`dump2py` management command. .. management_command:: dump2py Write a dump of your database to a set of Python modules. This dump is useful for creating a daily backup or ...
bsd-2-clause
-5,401,852,700,243,567,000
36.317254
134
0.552799
false
3.979031
false
false
false
IAmUser4574/zeromq-ros
zmqros/agent/heartbeat.py
1
1096
import urllib import urllib2 import json import time import threading class Heartbeat(object): def __init__(self, name, ns_host, ns_port): self.beat_url = self.get_beat_url(ns_host, ns_port) self.name = name self.delay = 1 # second self.beating = False def get_beat_url(self...
apache-2.0
7,324,676,564,642,737,000
22.826087
59
0.54562
false
3.653333
false
false
false
joshuajonah/feincms_grid
feincms_grid/models.py
1
1759
from django.db import models from django.utils.safestring import mark_safe from settings import FEINCMS_GRID_TOTAL_COLUMNS class GridContent(models.Model): grid_columns = models.PositiveSmallIntegerField('Columns', blank=True, null=True, help_text='How many columns of the total (%s) this content will span.' % FE...
bsd-3-clause
-395,674,941,633,685,760
50.764706
186
0.669699
false
3.961712
false
false
false
cuauv/software
build/ninja_common.py
1
18299
#!/usr/bin/env python3 """ Common build class for generating ninjafiles. """ import os import subprocess from build import ninja_syntax PLATFORM = "linux_amd64" GOSRC = "gocode/src/cuauv.org" GOPKG = "gocode/pkg/%s/cuauv.org" % PLATFORM def strip_ext(filename): """ Remove the extension from a filename. """ ...
bsd-3-clause
-7,692,648,746,612,847,000
47.155263
170
0.587846
false
3.470979
true
false
false
NZRS/wavetrace
wavetrace/constants.py
2
3170
import os from pathlib import Path PROJECT_ROOT = Path(os.path.abspath(os.path.join( os.path.dirname(__file__), '../'))) SECRETS_PATH = PROJECT_ROOT/'secrets.json' #: SRTM tiles that cover New Zealand; for a visual, see http://geojson.io/#id=gist:anonymous/81b4cb465f1c78941f665c9038494f0f&map=5/-41.360/172.463 SRT...
agpl-3.0
875,339,059,275,069,200
22.488889
147
0.669716
false
2.425402
false
false
false
markuz/Christine
libchristine/Events.py
1
3863
# -*- coding: utf-8 -*- # # This file is part of the Christine project # # Copyright (c) 2006-2008 Marco Antonio Islas Cruz # # Christine is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the...
gpl-2.0
4,605,160,902,515,809,000
34.768519
79
0.646648
false
4.036573
false
false
false
tectronics/ohs-gdc-roy
src/buildings.py
1
1648
""" Contains classes and functions pertaining to buildings. """ import os, pygame from qnd import * ####CONSTANTS#### #Calculating file paths BASEPATH = os.path.abspath(__file__) BASEPATH = BASEPATH[:BASEPATH.index('src')] #Images to use for buildings SPRITES = [ load_image('building1.png'), load_image('building2.p...
mit
-6,208,869,090,315,666,000
28.428571
93
0.710558
false
3.018315
false
false
false
py-in-the-sky/challenges
intermediate_words_search_python/utils.py
1
2520
# 3rd-party imports from itertools import chain def memo(f): """memoization decorator, taken from Peter Norvig's Design of Computer Programs course on Udacity.com""" cache = {} def _f(*args): try: return cache[args] except KeyError: result = cache[args] = f(*arg...
mit
1,724,173,421,396,764,400
25.808511
81
0.61746
false
3.695015
false
false
false
it-projects-llc/website-addons
website_event_attendee_fields/tests/common.py
1
1648
from datetime import datetime, timedelta from odoo import fields from odoo.tests.common import TransactionCase class TestCase(TransactionCase): at_install = True post_install = True def setUp(self): super(TestCase, self).setUp() self.event = self.env["event.event"].create( { ...
mit
437,087,426,570,496,600
32.632653
89
0.387743
false
5.368078
false
false
false
GRArmstrong/invenio-inspire-ops
modules/bibauthorid/lib/bibauthorid_config.py
1
8074
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
gpl-2.0
3,317,022,246,936,529,000
35.533937
164
0.753778
false
3.198891
true
false
false
stoneflyop1/fluent_py
ch06/strategyclass.py
1
2690
from abc import ABC, abstractmethod from collections import namedtuple Customer = namedtuple('Customer', 'name fidelity') class LineItem: def __init__(self, product, quantity, price): self.product = product self.quantity = quantity self.price = price def total(self): return s...
mit
3,005,273,580,074,330,600
31.035714
78
0.60855
false
3.762238
false
false
false
laanwj/deluge
deluge/core/core.py
1
28716
# # core.py # # Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may 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 ver...
gpl-3.0
5,313,709,354,081,874,000
34.583643
122
0.622545
false
4.139542
true
false
false
OpenDrift/opendrift
examples/example_seed_demonstration.py
1
4894
#!/usr/bin/env python """ Seed demonstration ================== """ from datetime import datetime, timedelta import numpy as np from opendrift.models.oceandrift import OceanDrift from opendrift.models.openoil import OpenOil o = OceanDrift(loglevel=50) #%% # We do not care about landmask or current for this seeding d...
gpl-2.0
-8,029,791,751,036,169,000
38.788618
170
0.705966
false
2.738668
true
false
false
tupolev/plugin.video.mitele
lib/youtube_dl/extractor/vk.py
1
13877
# encoding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, orderedSet, sanitized_Request, str_to_int, unescapeHTML, unified_strdate, urlencode_postd...
gpl-3.0
7,973,171,025,875,902,000
35.69437
132
0.47936
false
3.439809
false
false
false
talon-one/talon_one.py
test/test_new_account_sign_up.py
1
2107
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
mit
-4,040,305,625,127,681,500
35.964912
647
0.654485
false
3.982987
true
false
false
sudaraka/ospi-monitor
ospim/gpio.py
1
4475
# gpio.py: Implements the GPIO calls to operate OpenSprinkler zones # # Copyright 2013 Sudaraka Wijesinghe <sudaraka.wijesinghe@gmail.com> # # This file is part of OpenSprinkler Pi Monitor (OSPi Monitor) # # OSPi Monitor is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pub...
gpl-3.0
8,010,018,777,546,520,000
30.737589
77
0.605363
false
3.871107
false
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_result.py
1
3798
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
7,851,137,946,535,151,000
44.214286
265
0.64297
false
4.036132
false
false
false
NextThought/pypy-numpy
numpy/core/tests/test_indexing.py
1
38541
from __future__ import division, absolute_import, print_function import sys import warnings import functools import numpy as np from numpy.core.multiarray_tests import array_indexing from itertools import product from numpy.testing import * try: cdll = np.ctypeslib.load_library('multiarray', np.core.multiarray....
bsd-3-clause
1,797,187,305,173,113,000
36.822375
95
0.525544
false
3.796395
true
false
false
TheBlackDude/eHealth_learning
server/authentication/migrations/0001_initial.py
1
1046
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Account', fields=[ ('id', models.AutoField(seri...
mit
-822,496,853,696,039,700
35.068966
114
0.557361
false
4.413502
false
false
false
david-abel/simple_rl
simple_rl/tasks/grid_world/grid_visualizer.py
1
6553
# Python imports. from __future__ import print_function from collections import defaultdict try: import pygame except ImportError: print("Warning: pygame not installed (needed for visuals).") import random import sys # Other imports. from simple_rl.planning import ValueIteration from simple_rl.tasks import Fou...
apache-2.0
8,365,728,509,620,451,000
41.00641
126
0.556844
false
3.311268
false
false
false
inhumanundead/getjams
main.py
1
1924
# GetJams - get some new jams for ya mental # Released for Github on Oct 21 2014 import musicbrainzngs as jams import random,sys,os,wx jams.set_useragent("GetJams","1.0","inhumanundead@gmail.com") def GetArtist(genre): x = jams.search_artists(tag=genre)['artist-list'] y = [] y.append(x[random.randint(0,len(x)-1)]['s...
bsd-3-clause
-2,698,450,810,492,377,600
43.744186
112
0.672037
false
2.378245
false
false
false
venicegeo/eventkit-cloud
eventkit_cloud/utils/pcf.py
1
8815
import requests import os import logging from enum import Enum import json logger = logging.getLogger(__file__) logging.basicConfig(level=logging.DEBUG) class PcfTaskStates(Enum): SUCCEEDED = "SUCCEEDED" # Used for runs when all tasks were successful RUNNING = "RUNNING" # Used for runs when one or more tas...
bsd-3-clause
-2,521,439,692,571,906,000
38.352679
118
0.544526
false
3.903897
false
false
false
renatopp/ratslam-python
ratslam/_globals.py
1
5951
# ============================================================================= # Federal University of Rio Grande do Sul (UFRGS) # Connectionist Artificial Intelligence Laboratory (LIAC) # Renato de Pontes Pereira - rppereira@inf.ufrgs.br # ============================================================================= ...
mit
-8,465,632,473,039,705,000
38.417219
125
0.568476
false
2.911448
false
false
false
kevinjalbert/github_explorer
src/report_handler.py
1
2273
import logging import csv class ReportHandler(): """This class handles the reporting of the gathered repository information The report generated consists of the information of the gather repository information. The reports can be generated in the implemented formates which is currently only CSV. The reports...
mit
-2,154,487,000,404,547,300
26.719512
78
0.706995
false
4.396518
false
false
false
aboyett/blockdiag
src/blockdiag/noderenderer/roundedbox.py
1
5293
# -*- coding: utf-8 -*- # Copyright 2011 Takeshi KOMIYA # # 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
7,033,124,814,098,550,000
39.098485
78
0.523522
false
3.295766
false
false
false
EduardoMolina/SU2
SU2_PY/SU2/run/adaptation.py
1
1992
#!/usr/bin/env python ## \file adjoint.py # \brief python package for running adjoint problems # \author T. Lukaczyk, F. Palacios # \version 7.0.3 "Blackbird" # # SU2 Project Website: https://su2code.github.io # # The SU2 Project is maintained by the SU2 Foundation # (http://su2foundation.org) # # Copyright 2012-...
lgpl-2.1
-5,372,416,808,136,056,000
26.666667
71
0.667169
false
3.464348
false
false
false
goniz/buildscript
build_system/parallel_builder.py
1
2294
#!/usr/bin/python2 from builder import Builder from toolchain import CToolchain from build_exceptions import BuildError from multiprocessing import cpu_count from Queue import Queue from thread_pool import ThreadPool from termcolor import colored SINGLE_OBJECT_TIMEOUT = 25 class ParallelBuilder(Builder): def __...
mit
-6,417,798,401,333,373,000
34.84375
99
0.581517
false
4.193784
false
false
false
harshadbhatia/locusteffect
locusteffect/aws.py
1
5746
""" The scripts implements functionality fo AWS usage for locust :TODO: Security group authorize checks :ssh-add for windows machines :When creating new slaves the range should begin from last of existing slaves """ import subprocess import time import itertools import boto.ec2 AWS_ACCESS_KEY_ID = '' AWS_SECRET_ACCES...
mit
2,369,619,936,189,768,700
30.571429
110
0.648103
false
3.484536
false
false
false
mozilla/firefox-flicks
vendor-local/lib/python/oauthlib/oauth2/draft25/__init__.py
1
30698
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals """ oauthlib.oauth2.draft_25 ~~~~~~~~~~~~~~ This module is an implementation of various logic needed for signing and checking OAuth 2.0 draft 25 requests. """ from oauthlib.common import Request from oauthlib.oauth2.draft25 import tokens...
bsd-3-clause
5,226,163,626,736,819,000
42.854286
122
0.663268
false
4.460622
false
false
false
xzzy/statdev
applications/migrations/0002_auto_20190808_1609.py
1
1284
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-08-08 08:09 from __future__ import unicode_literals import django.core.files.storage from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('applications', '0001_initial'), ] operations = [ ...
apache-2.0
-451,309,722,585,182,900
40.419355
374
0.60514
false
3.566667
false
false
false
amolenaar/gaphor
gaphor/UML/usecases/tests/test_include.py
1
2247
""" Test include item connections. """ from gaphor import UML from gaphor.tests import TestCase from gaphor.UML.usecases.include import IncludeItem from gaphor.UML.usecases.usecase import UseCaseItem class IncludeItemTestCase(TestCase): def test_use_case_glue(self): """Test "include" gluing to use cases....
lgpl-2.1
5,435,188,214,166,975,000
31.565217
59
0.655096
false
3.544164
true
false
false
noxer-org/noxer
noxer/sequences.py
1
11540
""" Sequence preprocessing functionality. Extends sklearn transformers to sequences. """ import numpy as np from sklearn.base import ClassifierMixin, BaseEstimator, TransformerMixin, clone from sklearn.model_selection import GridSearchCV, train_test_split from sklearn.pipeline import make_pipeline from sklearn.prepro...
mit
-3,107,871,960,176,155,600
26.216981
121
0.583362
false
3.910539
false
false
false
baroquebobcat/pants
contrib/go/src/python/pants/contrib/go/targets/go_local_source.py
1
3550
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
apache-2.0
-1,786,211,179,735,485,000
45.103896
100
0.639155
false
4.22619
false
false
false
topliceanu/learn
interview/leetcode/longest_substr_no_repeating_chars.py
1
1596
# -*- coding: utf-8 -*- # Source: https://leetcode.com/problems/longest-substring-without-repeating-characters class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ length_of_longest_substr(s) def contract_left(s, left, right, coun...
mit
-4,233,491,873,803,033,000
33.695652
88
0.615288
false
3.447084
false
false
false
yrobla/nova
nova/virt/hyperv/driver.py
1
8452
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Cloud.com, Inc # Copyright (c) 2012 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
8,976,299,235,940,058,000
42.122449
79
0.57797
false
4.541644
false
false
false
nglrt/virtual_energy_sensor
pc_data_collector/benchmark/network.py
1
1183
import socket import time import datetime #sock = socket.create_connection(("10.0.19.4", 30001)) sock = socket.create_connection(("10.0.19.4", 30002)) data = 13000* "0" def benchmark_send(conn, sleep_time = 0.001,duration_in_sec=15): start = datetime.datetime.now() while (datetime.datetime.now()-start).t...
mit
5,804,130,412,947,116,000
28.575
76
0.60355
false
3.163102
false
false
false
MMunibas/FittingWizard
scripts/lj-fit/src/fit.lj/charmm_diintE_inpmaker.py
1
8206
#!/usr/bin/env python # # This skript generates the inputs and carries out the calculations # of charmm dimer interaction energies. # At the moment this skript only works for uncharged dimers # The skript assumes that both monomers are the same and # that all atoms of the two monomers appear in the same order in the ...
bsd-3-clause
4,720,974,684,624,357,000
30.201521
89
0.616256
false
2.511785
false
false
false
probml/pyprobml
scripts/splines_piecewise.py
1
2758
# Plot piecewise spline curves # Code is from Osvaldo Martin et al, # "Bayesian Modeling and Comptuation In Python" # https://github.com/aloctavodia/BMCP/blob/master/Code/chp_3_5/splines.py import numpy as np import matplotlib.pyplot as plt # Convenience function to compute the β cofficients def ols(X, y): """Co...
mit
-6,528,088,998,253,068,000
29.274725
76
0.593829
false
2.468638
false
false
false
metzzo/Paraphrase_Identification
sentenceFeatures.py
1
9094
from __future__ import division from itertools import product from nltk.tokenize import RegexpTokenizer from nltk.translate.bleu_score import sentence_bleu from nltk.util import skipgrams from nltk.corpus import wordnet from treetagger import TreeTagger import numpy as np import text2int as t2i import copy import sys i...
gpl-3.0
-5,718,133,614,721,751,000
33.44697
185
0.605894
false
3.275937
false
false
false
sanja7s/SR_Twitter
src_graph/degree_assort_study.py
1
1406
import networkx as nx from scipy import stats from operator import mul # or mul=lambda x,y:x*y from fractions import Fraction import sys # Calculates binomial coefficient (n over k) def nCk(n,k): return int( reduce(mul, (Fraction(n-i, i+1) for i in range(k)), 1) ) # Read the network in form of edge list, unweight...
mit
628,720,276,494,182,900
28.3125
98
0.704836
false
2.647834
false
false
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/registry/interfaces/productrelease.py
1
14080
# Copyright 2009-2012 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Product release interfaces.""" __metaclass__ = type __all__ = [ 'IProductRelease', 'IProductReleaseEditRestricted', 'IProductReleaseFile', 'IProductReleas...
agpl-3.0
6,758,399,903,945,905,000
32.286052
78
0.638068
false
4.683965
false
false
false
Flamacue/pretix
src/pretix/presale/signals.py
1
4512
from pretix.base.signals import EventPluginSignal html_head = EventPluginSignal( providing_args=["request"] ) """ This signal allows you to put code inside the HTML ``<head>`` tag of every page in the frontend. You will get the request as the keyword argument ``request`` and are expected to return plain HTML. As ...
apache-2.0
3,064,520,904,798,156,000
35.682927
110
0.766179
false
4.252592
false
false
false
jlucangelio/fj-pypy
method.py
1
1997
# Copyright 2011 Jorge Lucangeli Obes # # This file is part of fj-pypy. # # fj-pypy 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. # #...
gpl-3.0
-6,798,650,144,074,775,000
30.203125
70
0.676014
false
3.698148
false
false
false
PeterSR/DM548
scripts/latex.py
1
3090
import textwrap import re import subprocess import os import errno class LatexDocument: def __init__(self, filename): self.filename = filename self.ext = "tex" self.preambleTemplate = self.prepareLatex(r""" \documentclass[12pt, a4paper]{article} % Font ...
mit
-5,970,189,910,959,604,000
26.345133
74
0.517152
false
3.877039
false
false
false
jrichte43/ProjectEuler
Problem-0177/solutions.py
1
1637
__problem_title__ = "Integer angled Quadrilaterals" __problem_url___ = "https://projecteuler.net/problem=177" __problem_description__ = "Let ABCD be a convex quadrilateral, with diagonals AC and BD. At each " \ "vertex the diagonal makes an angle with each of the two sides, " \ ...
gpl-3.0
2,515,522,481,364,668,000
44.222222
100
0.557125
false
3.990196
false
false
false
Joneyviana/todolist-django-angular
todolist/contrib/sites/migrations/0002_set_site_domain_and_name.py
1
1131
""" To understand why this file is here, please read: http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import migrations...
mit
-2,249,146,283,327,169,300
23.586957
129
0.619805
false
3.590476
false
false
false
OrderFromChaos/csgo_market
Requests_v3.py
1
3728
#The best of them yet. Still in progress, but very functional as is. #This one uses Selenium's Chromedriver to automate browser searching for prices. #Note that depending on your account's status, it may return USD or local prices. from selenium import webdriver import sys import time #Initial conditions #Here, you s...
mit
-4,017,102,143,419,405,000
33.201835
286
0.663358
false
3.250218
false
false
false
HybridF5/jacket
jacket/tests/compute/unit/api/openstack/compute/test_flavor_rxtx.py
1
3610
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
-6,211,091,062,910,850,000
30.12069
78
0.595845
false
3.441373
true
false
false
PlamenHristov/ds-and-algo-thinking
MyTake/src/chapter7/BinHeap.py
1
1782
class BinHeap: def __init__(self): self.heapList = [0] self.currentSize = 0 def percUp(self, i): while i // 2 > 0: if self.heapList[i] < self.heapList[i // 2]: tmp = self.heapList[i // 2] self.heapList[i // 2] = self.heapList[i] ...
gpl-3.0
-9,212,481,838,168,690,000
26
63
0.489899
false
3.337079
false
false
false
Strangemother/python-state-machine
scatter/weak.py
1
1114
import weakref _weaks = {} # weakref.WeakValueDictionary() class ExtendedRef(weakref.ref): def __init__(self, ob, callback=None, **annotations): super(ExtendedRef, self).__init__(ob, callback) self.__counter = 0 for k, v in annotations.iteritems(): setattr(self, k, v) def...
mit
-2,868,229,606,584,355,000
24.906977
66
0.543986
false
3.514196
false
false
false
librallu/cohorte-herald
python/herald/transports/http/servlet.py
1
12509
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Herald HTTP transport servlet :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.0.3 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); yo...
apache-2.0
-4,880,834,042,568,456,000
33.084469
119
0.545287
false
4.509373
false
false
false
dumengnanbuaa/awesome-python-webapp
www/transwarp/web.py
1
43912
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' A simple, lightweight, WSGI-compatible web framework. ''' __author__ = 'Michael Liao' import types, os, re, cgi, sys, time, datetime, functools, mimetypes, threading, logging, urllib, traceback try: from cStringIO import StringIO except ImportError: from Str...
gpl-2.0
5,894,816,097,040,568,000
28.67027
402
0.520837
false
3.666054
true
false
false
stuart-warren/django-s3-proxy
proxy/models.py
1
2427
from django.db import models from django.conf import settings from django.core.validators import validate_slug, RegexValidator from django_boto.s3 import upload, remove, get_url from django.core.files.base import ContentFile import re validate_path = RegexValidator(re.compile(r'^/[-a-zA-Z0-9_/.]+$'), ...
apache-2.0
5,715,286,130,557,966,000
37.52381
89
0.588793
false
4.00495
false
false
false
jblupus/PyLoyaltyProject
old/project/cassandra_helpers/twitter_resumed.py
1
10821
from cassandra.cluster import Cluster from cassandra.query import BatchStatement from old.project import PagedResultHandler class CassandraInsert: def __init__(self, cluster=None, session=None, cluster_name=None): self.cluster_name = cluster_name or 'twitter_resumed' self.cluster = cluster or Clu...
bsd-2-clause
2,768,662,025,145,423,400
43.900415
118
0.609648
false
3.695697
false
false
false
yagop/AGMail
AGMail.py
1
3345
#!/usr/bin/python # -*- coding: utf-8 -*- import cookielib import urllib, urllib2 import sys, os import argparse from bs4 import BeautifulSoup import re import getpass courses = [] alumnos = [] roleid = '8' #Default role for students emails = [] todos = False class Course: def __init__(self, name, link, number): ...
gpl-2.0
4,369,678,709,625,368,000
23.580882
120
0.664972
false
2.947972
false
false
false
Chaffelson/whoville
whoville/cloudbreak/models/stack_descriptor.py
1
6498
# coding: utf-8 """ Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud...
apache-2.0
-1,801,132,122,957,088,800
27.625551
984
0.577562
false
4.18416
false
false
false
vmalloc/pyforge
tests/test__hybrid_mock.py
1
2875
from .ut_utils import ForgeTestCase from forge import InvalidEntryPoint class TestedClass(object): def entry_point(self): self.f() self.g(1, 2, 3) self.h(a=1, b=2) self.class_method() self.static_method() def set_value(self): self.value = 2 def f(self): ...
bsd-3-clause
-4,675,566,289,699,708,000
32.045977
105
0.622261
false
3.562577
true
false
false
gpg/gpgme
lang/python/examples/howto/pmkey-import-hkp-alt.py
1
5984
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals import gpg import hkp4py import os.path import sys del absolute_import, division, unicode_literals # Copyright (C) 2018 Ben McGinnes <ben@gnupg.org> # # This program is free software; you can redistribu...
lgpl-2.1
-8,715,527,280,633,180,000
32.80791
79
0.640541
false
3.452972
false
false
false
stockminer/storm
test/server.py
1
1124
import socket, traceback host = '' port = 51423 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((host, port)) s.listen(1) print "done" while 1: #when connect error happen, skip the error print '===========' try: ClientSock, Clie...
apache-2.0
8,013,921,481,329,629,000
23.977778
59
0.608541
false
3.797297
false
false
false
castelao/maud
maud/maud.py
1
7421
""" """ # Gui, 27-06-2012 # Just an idea. Create a class of filtered data. A fake Masked Array object # which gives the output on demand, filtered. try: import multiprocessing as mp except: print "I couldn't import multiprocessing" import numpy as N import numpy import numpy as np from numpy import ma fro...
bsd-3-clause
-9,002,129,658,544,900,000
33.198157
223
0.606253
false
3.14316
false
false
false
eyolfson/site-eyl
eyl/views.py
1
1925
# Copyright 2014 Jon Eyolfson # # This file is part of Eyl Site. # # Eyl Site 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. # # Eyl S...
gpl-3.0
5,077,767,284,734,215,000
34
80
0.692987
false
3.804348
false
false
false
byteweaver/django-skrill
skrill/models.py
1
22022
import hashlib import urllib import urllib2 from django.conf import settings from django.db import models import django.dispatch from multiselectfield import MultiSelectField from skrill.settings import * try: user_model = settings.AUTH_USER_MODEL except AttributeError: from django.contrib.auth.models impor...
bsd-3-clause
973,866,451,062,523,300
68.034483
330
0.701934
false
3.957233
false
false
false
rht/zulip
zerver/webhooks/groove/tests.py
1
4751
# -*- coding: utf-8 -*- from zerver.lib.test_classes import WebhookTestCase class GrooveHookTests(WebhookTestCase): STREAM_NAME = 'groove' URL_TEMPLATE = '/api/v1/external/groove?stream={stream}&api_key={api_key}' FIXTURE_DIR_NAME = 'groove' # This test simulates the condition when a new ticket comes...
apache-2.0
-5,721,424,999,247,385,000
46.039604
159
0.654389
false
3.685803
true
false
false
usc-isi/nova
nova/db/sqlalchemy/migrate_repo/versions/082_essex.py
1
43970
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
apache-2.0
-1,560,693,694,835,224,600
40.520302
80
0.591312
false
3.859387
false
false
false
naojsoft/qplan
qplan/promsdb.py
1
4942
#!/usr/bin/env python # Connect to the ProMS MySQL user database. Includes queries for ProMS # ID and ProMS ID/password. import os, sys import mysql.connector import sqlalchemy import logging from sqlsoup import SQLSoup as SqlSoup from ginga.misc import log class ProMSdbError(Exception): pass class ProMSdb(obj...
bsd-3-clause
-7,804,424,027,407,978,000
32.619048
113
0.585998
false
3.86698
false
false
false
manuvarkey/cmbautomiser
cmbautomiser/openpyxl/comments/comment_sheet.py
1
6134
from __future__ import absolute_import # Copyright (c) 2010-2018 openpyxl ## Incomplete! from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Float, Integer, Set, String, Bool, ) from openpyxl.descriptors.excel import Guid, ExtensionList from ope...
gpl-3.0
4,180,091,281,726,531,600
26.022026
90
0.585915
false
4.030223
false
false
false
stephanie-wang/ray
rllib/env/vector_env.py
1
3845
import logging import numpy as np from ray.rllib.utils.annotations import override, PublicAPI logger = logging.getLogger(__name__) @PublicAPI class VectorEnv: """An environment that supports batch evaluation. Subclasses must define the following attributes: Attributes: action_space (gym.Space)...
apache-2.0
-7,155,083,762,611,002,000
30.516393
77
0.583615
false
4.206783
false
false
false
embaldridge/retriever
test/test_retriever.py
1
5241
"""Tests for the EcoData Retriever""" import os from StringIO import StringIO from retriever.lib.engine import Engine from retriever.lib.table import Table from retriever.lib.templates import BasicTextTemplate from retriever.lib.tools import getmd5 from retriever import DATA_WRITE_PATH from nose.tools import with_setu...
mit
-9,058,752,952,050,883,000
35.395833
126
0.668766
false
3.46627
true
false
false
benfitzpatrick/cylc
lib/cylc/run_get_stdout.py
1
2749
#!/usr/bin/env python # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2016 NIWA # # 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 yo...
gpl-3.0
5,179,059,435,900,093,000
37.71831
79
0.65151
false
3.899291
false
false
false
botswana-harvard/tshilo-dikotla
td_maternal/models/td_consent_version.py
1
1294
from django.db import models from edc_base.model.models import BaseUuidModel from edc_base.model.validators import ( date_not_before_study_start, date_not_future) from .maternal_eligibility import MaternalEligibility CONSENT_VERSION = ( ('1', 'Consent version 1'), ('3', 'Consent version 3')) class TdCo...
gpl-2.0
2,935,157,544,889,101,000
29.093023
89
0.652241
false
3.584488
false
false
false
jpcallanta/spacecow
lib/window.py
1
2990
import pyglet from math import * from random import randint from lib.player import Player from lib.enemy import Enemy class Window(pyglet.window.Window): player = None enemy_qty = 100 enemy = [] label_mouse_xy = None mouse_x = 0 mouse_y = 0 # Class initializer def __init__(self, size_x, size_y, resize...
mit
-2,349,672,044,341,119,000
29.510204
91
0.609699
false
2.75069
false
false
false
sergey-dryabzhinsky/denyhosts_sync
denyhosts_server/models.py
1
1376
# denyhosts sync server # Copyright (C) 2015 Jan-Pascal van Best <janpascal@vanbest.org> # This program 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 License, o...
agpl-3.0
-8,411,537,085,998,720,000
36.189189
164
0.710029
false
3.574026
false
false
false
kim-tran/text-based-atk
game/actions.py
1
1676
from player import Player class Action(): """The base class for all actions""" def __init__(self, method, name, hotkey, **kwargs): """Creates a new action :param method: the function object to execute :param name: the name of the action :param ends_turn: True if the player is e...
mit
-4,322,177,107,159,053,300
29.472727
95
0.620525
false
3.667396
false
false
false
s-andrews/powerguide
www/powerguide.py
1
3812
import tempfile import os import shutil import subprocess import shlex import cgi import sys # For development only import cgitb cgitb.enable() # Set some global preferences template_dir = os.path.dirname(os.path.realpath(__file__))+"/../R/" pandoc_location = "/usr/lib/rstudio/bin/pandoc" path = "/usr/bin:/bin" # ...
gpl-3.0
4,918,219,642,766,401,000
31.305085
280
0.706978
false
3.361552
false
false
false
jjpr-mit/mkgu
mkgu/assemblies.py
1
1790
from __future__ import absolute_import, division, print_function, unicode_literals from xarray import DataArray, Dataset from mkgu import fetch class DataPoint(object): """A DataPoint represents one value, usually a recording from one neuron or node, in response to one presentation of a stimulus. """ d...
mit
5,113,871,609,670,946,000
30.964286
97
0.689944
false
4.031532
false
false
false
alone-walker/BlogSpider
www/src/app.py
1
2179
# -*- coding: utf-8 -*- import os import logging from datetime import datetime from collections import namedtuple from werkzeug.exceptions import NotFound, BadRequest from flask import Flask, render_template from converter import init_converter from model import init_db, get_article, get_spiders from api import ini...
mit
-4,376,690,904,073,989,600
21.463918
78
0.655805
false
3.316591
false
false
false
google-research/google-research
uq_benchmark_2019/criteo/data_lib_test.py
1
2111
# 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
-4,771,749,595,192,599,000
36.035088
79
0.712932
false
3.590136
true
false
false
michaeljones/packed
setup.py
1
1155
# -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: import distribute_setup distribute_setup.use_setuptools() from setuptools import setup setup( name='packed', version='0.2.0', url='https://github.com/michaeljones/packed', download_url='https://github.com/mich...
gpl-2.0
7,340,922,628,405,852,000
31.083333
58
0.622511
false
4.246324
false
false
false