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
opethe1st/CompetitiveProgramming
Codility/5PrefixSums/GeonomicRange.py
1
1181
def solution(S, P, Q): # write your code in Python 2.7 prefixA = [0] * (len(S) + 1) prefixC = [0] * (len(S) + 1) prefixG = [0] * (len(S) + 1) prefixT = [0] * (len(S) + 1) for i in xrange(len(S)): if S[i] == 'A': prefixA[i + 1] = prefixA[i] + 1 else: prefix...
gpl-3.0
-6,070,044,671,206,912,000
29.282051
47
0.42591
false
2.714943
false
false
false
magfest/ubersystem
alembic/versions/5ceaec4834aa_associate_mits_docs_and_pictures_with_.py
1
3130
"""Associate MITS docs and pictures with games instead of teams Revision ID: 5ceaec4834aa Revises: 4036e1fdb9ee Create Date: 2020-04-14 23:23:35.417496 """ # revision identifiers, used by Alembic. revision = '5ceaec4834aa' down_revision = '4036e1fdb9ee' branch_labels = None depends_on = None from alembic import op...
agpl-3.0
-4,039,767,539,974,114,300
41.297297
120
0.651757
false
3.193878
false
false
false
Coburn37/DoxygenMediawikiBot
doxymw.py
1
9187
#A python bot sitting atop PyWikibot and Doxygen to automatically #add doxygen docs to a wiki for your documentation pleasure #The main goal of this is to take the power and placement of doxygen docs #and combine it with the flexibility and remoteness of a wiki import re import os import sys import subprocess import ...
mit
-1,648,275,014,650,735,000
36.966942
169
0.560139
false
4.125281
true
false
false
Ledoux/ShareYourSystem
Pythonlogy/draft/Representer/__init__.py
1
25779
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> The Representer is an important module for beginning to visualize the structures of the instanced variables in the environnment. The idea is to use the indenting representation like in the jso...
mit
3,242,304,788,324,602,400
25.881126
132
0.704255
false
3.384848
false
false
false
peheje/baselines
baselines/deepq/experiments/atari/enjoy.py
1
2514
import argparse import gym import os import numpy as np from gym.monitoring import VideoRecorder import baselines.common.tf_util as U from baselines import deepq from baselines.common.misc_util import ( boolean_flag, SimpleMonitor, ) from baselines.common.atari_wrappers_deprecated import wrap_dqn from baselin...
mit
-9,141,925,088,257,811,000
35.434783
134
0.650756
false
3.596567
false
false
false
pbs/django-filer
filer/management/commands/take_out_filer_trash.py
1
1910
from django.core.management.base import BaseCommand from filer.models import File, Folder from filer import settings as filer_settings from django.utils import timezone from datetime import timedelta class Command(BaseCommand): help = "Hard-deletes old files and folders from filer trash." def handle(self, *...
bsd-3-clause
-1,781,223,535,377,464,600
40.521739
75
0.577487
false
3.759843
false
false
false
vmagnin/pyxmltv
telecharger_xmltv.py
1
2764
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distr...
gpl-3.0
-181,304,397,692,986,200
35.972973
77
0.638523
false
3.352941
false
false
false
mmgen/mmgen
test/test_py_d/ts_ref.py
1
13630
#!/usr/bin/env python3 # # mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution # Copyright (C)2013-2021 The MMGen Project <mmgen@tuta.io> # # 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 Softwa...
gpl-3.0
-1,095,619,924,337,389,300
45
119
0.688504
false
2.500921
true
false
false
sabas1080/InstagramPi
InstagramPi.py
1
4484
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # InstagramPi Gafas for Instagram with Raspberry Pi Zero # # Autor: Andrés Sabas @ Feb 2017 # # # Use text editor to edit the script and type in valid Instagram username/password import atexit import picamera import os import time import random from os import listdir fr...
agpl-3.0
-4,242,357,488,178,768,000
32.706767
247
0.662726
false
3.257994
false
false
false
amolenaar/gaphor
gaphor/ui/tests/test_mainwindow.py
1
1370
import pytest from gaphor.application import Session from gaphor.core.modeling import Diagram from gaphor.ui.abc import UIComponent from gaphor.ui.event import DiagramOpened @pytest.fixture def session(): session = Session( services=[ "event_manager", "component_registry", ...
lgpl-2.1
7,249,366,273,309,667,000
24.849057
60
0.625547
false
3.88102
false
false
false
gridpp/dirac-getting-started
perform_frame_query.py
1
3626
#!/usr/bin/env python # -*- coding: utf-8 -*- """ DIRAC and GridPP: perform a query on the CERN@school frames. """ #...for the operating system stuff. import os #...for parsing the arguments. import argparse #...for the logging. import logging as lg # Import the JSON library. import json # The DIRAC import stat...
mit
-6,275,122,451,724,172,000
28.479675
97
0.565913
false
3.541016
false
false
false
songsense/Pregelix_Social_Graph
preprocessing/twitter_with_tags_parser.py
1
4458
import os import sys neighborDict = {} #dictionary containing neighbors of each node weightDict = {} #dictionary containing weights of edges featureDict = {} #dictionary containing features of each node featureDictTotal = {} #dictionay containing all listed features of each node totalFeatureDict = {} #ditionary contai...
apache-2.0
521,520,475,521,803,800
37.765217
152
0.615074
false
4.030741
false
false
false
denadai2/A-Tale-of-Cities---code
converter.py
1
4148
__author__ = 'Marco De Nadai' __license__ = "MIT" import numpy as np import pandas as pd import matplotlib.pyplot as plt import math import datetime import csv from collections import namedtuple from collections import defaultdict import fiona from shapely.geometry import shape, Polygon # Import the CDRs of MILANO d...
mit
-7,795,471,707,981,156,000
32.451613
106
0.657425
false
3.411184
false
false
false
Edu-Glez/mesos-test
container/test_naive_bayes.py
1
1645
import pickle import pandas as pd #import numpy as np import nltk import time start_time = time.time() a=pd.read_table('tweets_pos_clean.txt') b=pd.read_table('tweets_neg_clean.txt') aux1=[] aux2=[] auxiliar1=[] auxiliar2=[] for element in a['Text']: for w in element.split(): if (w==':)' or len(w)>3): auxiliar...
mit
-3,334,451,982,492,560,400
21.847222
73
0.711246
false
2.627796
false
false
false
ReactiveX/RxPY
examples/asyncio/toasyncgenerator.py
1
1779
import asyncio from asyncio import Future import rx from rx import operators as ops from rx.scheduler.eventloop import AsyncIOScheduler from rx.core import Observable def to_async_generator(sentinel=None): loop = asyncio.get_event_loop() future = Future() notifications = [] def _to_async_generator(s...
mit
6,042,081,814,149,646,000
22.72
81
0.587409
false
4.266187
false
false
false
tkarna/cofs
examples/channel3d/channel3d_closed.py
1
2541
""" Idealised channel flow in 3D ============================ Solves shallow water equations in closed rectangular domain with sloping bathymetry. Initially water elevation is set to a piecewise linear function with a slope in the deeper (left) end of the domain. This results in a wave that develops a shock as it rea...
mit
-5,102,377,859,405,900,000
31.576923
105
0.72924
false
2.871186
false
false
false
mementum/tcmanager
src/mvcbase.py
1
5930
#!/usr/bin/env python # -*- coding: latin-1; py-indent-offset:4 -*- ################################################################################ # # Copyright (C) 2014 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
gpl-3.0
-4,661,281,447,062,204,000
31.762431
89
0.558685
false
4.135286
false
false
false
chrys87/orca-beep
test/keystrokes/firefox/line_nav_button_in_link_position_relative_on_focus.py
1
1860
#!/usr/bin/python from macaroon.playback import * import utils sequence = MacroSequence() #sequence.append(WaitForDocLoad()) sequence.append(PauseAction(5000)) # Work around some new quirk in Gecko that causes this test to fail if # run via the test harness rather than manually. sequence.append(KeyComboAction("<Con...
lgpl-2.1
-3,976,546,266,804,137,500
31.421053
70
0.690476
false
3.276596
false
true
false
jbest/digitization_tools
productivity/productivity.py
1
6643
""" Imaging productivity stats Jason Best - jbest@brit.org Generates a productivity report based on the creation timestamps of image files. Details of the imaging session are extracted from the folder name containing the images. Assumed folder name format is: YYYY-MM-DD_ImagerID_OtherInfo Usage: python productivity.p...
mit
7,707,624,852,203,826,000
32.550505
276
0.657986
false
3.602495
false
false
false
masschallenge/django-accelerator
accelerator/migrations/0036_add_user_deferrable_modal.py
1
1688
# Generated by Django 2.2.10 on 2021-03-03 17:08 from django.conf import settings from django.db import ( migrations, models, ) import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('accelerato...
mit
-8,131,171,024,774,738,000
32.098039
68
0.495853
false
4.75493
false
false
false
aixiwang/mqtt_datajs
upload_data_test.py
1
1737
#!/usr/bin/python import sys,time try: import paho.mqtt.client as mqtt except ImportError: # This part is only required to run the example from within the examples # directory when the module itself is not installed. # # If you have the module installed, just use "import paho.mqtt.client" impor...
bsd-3-clause
8,638,943,573,339,154,000
29.473684
137
0.679908
false
2.91443
false
false
false
scottsilverlabs/raspberrystem
rstem/projects/demos/two_buttons/button_test_aux.py
1
1652
#!/usr/bin/env python import curses, time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP) def main(stdscr): # Clear screen curses.noecho() curses.cbreak() curses.curs_set(0) stdscr.addstr("Button Tester", curses....
apache-2.0
8,123,518,483,904,408,000
21.630137
129
0.673123
false
2.465672
false
false
false
thuma/sestationinfo
stationinfo.py
1
1600
import urllib2 import json files = '''blataget-gtfs.csv blekingetrafiken-gtfs.csv dalatrafik-gtfs.csv gotlandskommun-gtfs.csv hallandstrafiken-gtfs.csv jonkopingslanstrafik-gtfs.csv kalmarlanstrafik-gtfs.csv lanstrafikenkronoberg-gtfs.csv localdata-gtfs.csv masexpressen.csv nettbuss-gtfs.csv nsb-gtfs.csv o...
gpl-2.0
7,348,605,985,020,554,000
28.109091
130
0.754375
false
2.515723
false
false
false
JasonBristol/spor-ct
spor/research/models.py
1
1571
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User from imagekit.models import ImageSpecField from imagekit.processors import ResizeToFill from django.utils.text import slugify class Project(models.Model): title = models.CharField(max_length=50) t...
mit
6,532,919,822,770,132,000
48.09375
135
0.724379
false
3.879012
false
false
false
rboman/progs
sandbox/tkinter/playing_with_tkinter.py
1
4424
#! /usr/bin/env python3 # -*- coding: utf-8 -*- from tkinter import * from future import standard_library standard_library.install_aliases() # nx.set("20") def sortir(): root.quit() root = Tk() root.title('Parameters') ni = IntVar() ni.set(50) nx = StringVar() nx.set("10") frame1 = Frame(root) lab1 = Labe...
apache-2.0
8,750,211,535,864,202,000
21.804124
98
0.654837
false
2.732551
false
false
false
jittat/ku-eng-direct-admission
application/fields.py
1
1109
from django.db import models class IntegerListField(models.Field): """ IntegerListField keeps a list of int as a comma-separated string. >>> g = IntegerListField() >>> g.get_db_prep_value([1,2,-1,20,30,40,-100]) '1,2,-1,20,30,40,-100' >>> g.to_python('1,2,-10,3,4,-100,7') [1,2,-10,3,4,-10...
agpl-3.0
-7,671,050,940,817,247,000
23.644444
69
0.522092
false
3.588997
false
false
false
p1c2u/openapi-core
tests/unit/unmarshalling/test_validate.py
1
32347
import datetime from unittest import mock import pytest from openapi_core.extensions.models.models import Model from openapi_core.spec.paths import SpecPath from openapi_core.unmarshalling.schemas.exceptions import ( FormatterNotFoundError, ) from openapi_core.unmarshalling.schemas.exceptions import InvalidSchema...
bsd-3-clause
4,296,732,595,900,197,400
25.866279
79
0.498532
false
4.144395
true
false
false
freehackquest/backend
fhq-server/templates/tmpl_create_new_storage_update.py
1
4081
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os import random import string updatespath = "../src/storages/updates/" fileslist = [f for f in os.listdir(updatespath) if os.path.isfile(os.path.join(updatespath, f))] pattern = r'.*StorageUpdateBase.*\(.*"([a-zA-Z0-9]*)".*,.*"([a-zA-Z0-9]*)".*,.*\).*' ...
mit
-4,647,844,123,428,140,000
30.152672
137
0.57976
false
3.122418
false
false
false
dstroppa/openstack-smartos-nova-grizzly
nova/exception.py
1
33666
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
-3,833,240,339,379,516,400
27.267003
79
0.67335
false
4.23312
false
false
false
jiangzhengshen/Interesting
Crawler/crawler_enhanced.py
1
10134
import argparse import hashlib import logging import os import queue import socket from urllib.parse import quote, urlsplit from urllib.request import Request, urlopen from urllib.error import URLError from pyquery import PyQuery ''' 根据输入的网址和深度爬网页 需要对php网页取得真实的网站地址 next: 并行化 断点续抓 URLCr...
mit
-901,503,238,482,499,200
36.588462
120
0.527883
false
3.499105
false
false
false
jacobwindsor/pubchem-ranker
CompoundRanker/DataManipulators/CIDGatherer.py
1
2702
import sys from CompoundRanker.database import get_db,query_db from CompoundRanker import app from requests import exceptions, get class CIDGatherer(object): def harvest(self, dataset_id): """ Harvest all of the CIDs from PubChem :return: List of tuples [(cid, metab_id),] """ ...
mit
3,315,396,116,340,576,000
31.95122
85
0.53738
false
3.726897
false
false
false
sertansenturk/symbtrdataextractor
symbtrdataextractor/unittests/extractor_tests.py
1
3913
import json import os from symbtrdataextractor.dataextractor import DataExtractor from symbtrdataextractor.reader.mu2 import Mu2Reader _curr_folder = os.path.dirname(os.path.abspath(__file__)) def _basic_txt_extractor(score_name, use_name=True): txt_filename = os.path.join(_curr_folder, 'data', score_name + '.t...
agpl-3.0
6,322,922,692,640,797,000
31.882353
79
0.675185
false
3.202128
true
false
false
takeshixx/deen
deen/plugins/codecs/plugin_url.py
1
1130
try: # Python 3 import urllib.parse as urllibparse except ImportError: # Python 2 import urllib as urllibparse from .. import DeenPlugin class DeenPluginUrl(DeenPlugin): name = 'url' display_name = 'URL' cmd_name = 'url' cmd_help='URL encode/decode data' def __init__(self): ...
apache-2.0
-2,507,691,634,774,062,600
26.560976
58
0.582301
false
3.869863
false
false
false
darknight-007/Firmware
testScripts/testOffboardPositionControlWithGainAndIntertialParamChange.py
1
5733
""" testing offboard positon control with a simple takeoff script """ import rospy from mavros_msgs.msg import State from geometry_msgs.msg import PoseStamped, Point, Quaternion import math import numpy from gazebo_msgs.srv import SetLinkProperties from gazebo_msgs.srv import SetLinkPropertiesRequest from gazebo_msg...
mit
-5,823,130,695,435,417,000
35.987097
139
0.618524
false
3.344807
false
false
false
ytsarev/rally
rally/openstack/common/config/generator.py
1
10531
# Copyright 2012 SINA Corporation # Copyright 2014 Cisco Systems, 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/licens...
apache-2.0
3,891,286,383,344,923,600
33.302932
79
0.578103
false
3.734397
false
false
false
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_4_0_0/models/resource.py
1
1819
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Resource) on 2019-05-07. # 2019, SMART Health IT. from . import fhirabstractresource class Resource(fhirabstractresource.FHIRAbstractResource): """ Base Resource. This is the...
bsd-3-clause
-6,473,601,764,319,109,000
29.830508
105
0.586586
false
4.162471
false
false
false
gouthambs/qtk-python
qtk/creators/indexes.py
1
3937
import QuantLib as ql from .common import CreatorBase from qtk.templates import Template as T from qtk.fields import Field as F class USDLiborCreator(CreatorBase): _templates = [T.INDEX_IBOR_USDLIBOR] _req_fields = [F.YIELD_CURVE, F.TENOR] _opt_fields = [] def _create(self, asof_date): yield_...
mit
3,303,185,191,772,193,300
29.292308
63
0.637795
false
2.978064
false
false
false
felixboes/hosd
experimental/compute_morse.py
1
3618
#!/usr/bin/env python # The software pyradbar is a bunch of programs to compute the homology of # Sullivan diagrams. # Copyright (C) 2015 - 2017 Felix Boes # # This file is part of pyradbar. # # pyradbar is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
gpl-3.0
4,686,020,170,505,466,000
43.121951
200
0.651741
false
3.540117
false
false
false
mariocesar/pengbot
src/pengbot/adapters/base.py
1
2798
import asyncio from collections import defaultdict from functools import wraps from pengbot import logger from pengbot.context import Context from pengbot.utils import isbound class UnknownCommand(Exception): pass class BaseAdapter: handlers = [] signals = {} running = False name = None loo...
mit
7,566,608,231,802,680,000
23.330435
75
0.546104
false
4.609555
false
false
false
kittiu/sale-workflow
sale_automatic_workflow_payment_mode/models/automatic_workflow_job.py
1
2353
# -*- coding: utf-8 -*- # © 2016 Camptocamp SA, Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) import logging from odoo import models, api, fields from odoo.tools.safe_eval import safe_eval from odoo.addons.sale_automatic_workflow.models.automatic_workflow_job \ import savepoint _logg...
agpl-3.0
-7,847,073,784,139,087,000
40.263158
78
0.576105
false
4.083333
false
false
false
warrenspe/NanoDB
NanoQueries/Alter.py
1
1805
# Standard imports import os # Project imports from _BaseQuery import BaseQuery import NanoIO.Table import NanoIO.File class Alter(BaseQuery): name = None addColumns = None removeColumns = None modifyColumns = None addIndex = None removeIndex = None grammar = """ "table"...
gpl-3.0
-183,135,863,889,413,900
26.348485
89
0.580609
false
4.257075
false
false
false
amenonsen/ansible
lib/ansible/modules/storage/netapp/na_ontap_fcp.py
2
7005
#!/usr/bin/python # (c) 2018-2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
-6,642,160,182,949,105,000
32.357143
114
0.561599
false
3.98691
false
false
false
mgeorgehansen/FIFE_Technomage
engine/python/fife/extensions/pychan/widgets/basictextwidget.py
1
2140
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2009 by the FIFE team # http://www.fifengine.de # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General P...
lgpl-2.1
-1,168,638,644,344,881,700
32.516129
91
0.648598
false
3.572621
false
false
false
ingadhoc/account-payment
account_check/models/account_chart_template.py
1
3098
############################################################################## # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## from odoo import models, fields import logging _logger = logging.getLogge...
agpl-3.0
7,020,589,236,783,189,000
39.763158
91
0.573273
false
4.243836
false
false
false
deepmind/reverb
reverb/trajectory_writer.py
1
27672
# Copyright 2019 DeepMind Technologies Limited. # # 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 agr...
apache-2.0
-4,714,772,191,559,620,000
39.279476
81
0.664751
false
4.039118
false
false
false
euronmetaliaj/MarketAnalyzer
core/social/Objects/rake.py
1
6665
# Implementation of RAKE - Rapid Automtic Keyword Exraction algorithm # as described in: # Rose, S., D. Engel, N. Cramer, and W. Cowley (2010). # Automatic keyword extraction from indi-vidual documents. # In M. W. Berry and J. Kogan (Eds.), Text Mining: Applications and Theory.unknown: John Wiley and Sons, Ltd. import...
mit
-2,379,889,619,676,009,000
38.678571
580
0.674269
false
3.769796
false
false
false
dsapandora/die_hard
backup.py
1
4670
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib2 import urllib import requests import math from flask import Flask, request app = Flask(__name__) API_KEY = 'ebc2ccbd44d15f282010c6f3514c5c02' API_URL = 'http://api.openweathermap.org/data/2.5/weather?' API_QUERY = 'lat={lat}&lon={lon}&appid={api}' # SAMPLE R...
gpl-3.0
4,456,546,718,283,175,000
30.993151
138
0.679872
false
2.688543
false
false
false
ayberkt/2048
game.py
1
3825
from random import randint from view import GridView class Grid(object): def __init__(self): self.matrix = [ [2, 0, 2, 0], [0, 0, 0, 8], [0, 2, 0, 0], [0, 0, 2, 4]] self.score = 0 print "Play with WASD!" def be...
mit
2,469,207,557,474,849,300
29.6
75
0.491242
false
3.947368
false
false
false
zimonkaizoku/GMTcsh2dos
GMTcsh2dos.py
1
3970
#!/usr/bin/env python ################################################################################ # GMTcsh2dos.py # ------------------------------------------------- # Version: 0.1 # Author: Simon Dreutter # License: GNU Generic Public License v3.0 / 2015 # ------------------------------------------------- ##...
gpl-3.0
-2,424,475,750,428,373,000
29.775194
121
0.455416
false
4.059305
false
false
false
Yelp/kafka-utils
kafka_utils/kafka_consumer_manager/commands/list_topics.py
1
2354
# -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 ...
apache-2.0
1,139,298,315,094,970,400
33.115942
79
0.639337
false
4.151675
false
false
false
Ogreman/django-termsearch
docs/conf.py
1
8138
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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. # # ...
bsd-3-clause
2,248,664,516,863,073,500
31.043307
80
0.706439
false
3.75023
true
false
false
jlmadurga/django-telegram-bot
telegrambot/bot_views/generic/responses.py
1
1680
from django.template import RequestContext, TemplateDoesNotExist from django.template.loader import get_template from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove import ast import logging from django.http.request import HttpRequest logger = logging.getLogger(__name__) class TemplateResponse(object): ...
bsd-3-clause
-3,643,803,183,915,614,000
33.306122
74
0.641667
false
4.60274
false
false
false
tangentlabs/django-oscar-fancypages
oscar_sandbox/sandbox/settings.py
1
6442
# Django settings for sandbox project. import os import oscar_fancypages.utils as ofp PROJECT_DIR = os.path.dirname(__file__) location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), "../%s" % x) DEBUG = True TEMPLATE_DEBUG = DEBUG USE_LESS = True ADMINS = ( # ('Your Name', 'your_email@ex...
bsd-3-clause
-5,179,257,276,437,302,000
28.550459
91
0.705061
false
3.417507
false
false
false
CZ-NIC/foris
foris/config_handlers/wan.py
1
17358
# Foris - web administration interface for OpenWrt based on NETCONF # Copyright (C) 2017, 2020 CZ.NIC, z.s.p.o. <http://www.nic.cz> # # 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
-9,020,859,925,960,720,000
39.842353
100
0.532204
false
3.808249
true
false
false
BorgERP/borg-erp-6of3
verticals/garage61/acy_vat_number_truncate/partner.py
1
1631
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
3,920,011,529,964,214,000
36.953488
128
0.600858
false
4.203608
false
false
false
feend78/evennia
evennia/commands/cmdset.py
1
23699
""" A Command Set (CmdSet) holds a set of commands. The Cmdsets can be merged and combined to create new sets of commands in a non-destructive way. This makes them very powerful for implementing custom game states where different commands (or different variations of commands) are available to the accounts depending on...
bsd-3-clause
-331,896,046,485,190,660
37.347896
130
0.581417
false
4.242571
false
false
false
endee1/gtv
script.gtvtvguide/ResetDatabase.py
1
2238
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Sean Poyser and Richard Dean (write2dixie@gmail.com) # # Modified for FTV Guide (09/2014 onwards) # by Thomas Geppert [bluezed] - bluezed.apps@gmail.com # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU Gener...
gpl-3.0
-9,127,050,276,214,440,000
32.909091
129
0.668007
false
3.73
false
false
false
pombredanne/invenio
modules/webjournal/lib/webjournal_washer.py
1
4833
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 ve...
gpl-2.0
580,070,241,764,031,600
34.8
81
0.634802
false
4.130769
false
false
false
lsaffre/lino
lino/utils/cycler.py
1
1933
# -*- coding: UTF-8 -*- # Copyright 2013-2014 by Rumma & Ko Ltd. # License: BSD, see LICENSE for more details. """ Turns a list of items into an endless loop. Useful when generating demo fixtures. >>> from lino.utils import Cycler >>> def myfunc(): ... yield "a" ... yield "b" ... yield "c" >>> c = Cycler...
bsd-2-clause
4,371,008,635,208,604,000
21.476744
76
0.54837
false
3.546789
false
false
false
sbremer/hybrid_rs
hybrid_model/models/sigmoid_item_asymfactoring.py
1
3419
import numpy as np from keras.layers import Embedding, Input, Flatten, Dense from keras.layers.merge import Concatenate, Dot, Add from keras.models import Model from keras.regularizers import l2 from util.layers_custom import BiasLayer from hybrid_model.models.abstract import AbstractModelCF, bias_init class Sigmoid...
apache-2.0
-9,212,830,444,832,515,000
37.41573
111
0.61246
false
3.554054
true
false
false
kyle8998/Practice-Coding-Questions
leetcode/23-Hard-Merge-K-Sorted-Lists/answer.py
1
2603
#!/usr/bin/env python3 #------------------------------------------------------------------------------- # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None #------------------------------------------------------------------------------- ...
unlicense
-1,056,980,143,340,566,400
33.25
99
0.384172
false
4.65653
false
false
false
fkie-cad/FACT_core
src/plugins/analysis/qemu_exec/routes/routes.py
1
3219
import os from contextlib import suppress from flask import render_template_string from flask_restx import Resource, Namespace from helperFunctions.database import ConnectTo from helperFunctions.fileSystem import get_src_dir from storage.db_interface_frontend import FrontEndDbInterface from web_interface.components.c...
gpl-3.0
604,691,004,250,413,800
37.783133
136
0.679714
false
3.721387
true
false
false
ericwhyne/datapop
datapop-publish.py
1
1446
#!/usr/bin/python import sqlite3 import datapop import sys import codecs import re import time current_milli_time = lambda: int(round(time.time() * 1000)) outfilename = 'index.html' interval = 3 * 60 * 60 * 1000 start_time = current_milli_time() - interval sys.stdout = codecs.getwriter('utf8')(sys.stdout) databasef...
apache-2.0
6,614,672,527,995,097,000
35.15
188
0.644537
false
3.242152
false
false
false
sbobovyc/GameTools
TSW/src/idx.py
1
6707
""" Copyright (C) 2013 Stanislav Bobovych This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the h...
gpl-3.0
6,742,526,433,551,087,000
36.892655
119
0.591472
false
3.50418
false
false
false
Lysxia/dissemin
papers/utils.py
1
16403
# -*- encoding: utf-8 -*- # Dissemin: open access policy enforcement tool # Copyright (C) 2014 Antonin Delpeuch # # 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 2 # of th...
agpl-3.0
3,605,507,531,110,764,000
29.530726
101
0.604636
false
3.163226
true
false
false
Rhoana/membrane_cnn
assess_thresh_smooth.py
1
2798
import mahotas import scipy.ndimage import scipy.misc import numpy as np import gzip import cPickle import glob import os import h5py #param_path = 'D:/dev/Rhoana/membrane_cnn/results/good3/' param_path = 'D:/dev/Rhoana/membrane_cnn/results/stumpin/' param_files = glob.glob(param_path + "*.h5") target_boundaries = ma...
bsd-3-clause
1,006,724,249,235,405,300
31.534884
100
0.632595
false
3.190422
false
false
false
teknolab/django.org.tr
apps/events/migrations/0001_initial.py
1
5772
# encoding: 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 'Event' db.create_table('events_event', ( ('id', self.gf('django.db.models.fiel...
bsd-3-clause
-6,493,933,952,741,872,000
65.344828
182
0.560464
false
3.709512
false
false
false
mago1chi/cTPR
calc_raw_lda_result.py
1
7204
import psycopg2 import os, sys TOPIC_NUM_LIST = [30, 100, 200, 500] if len(sys.argv) is 1: print("トピック数を入力") exit() topic_num = int(sys.argv[1]) if not topic_num in TOPIC_NUM_LIST: print("入力可能なトピック数は ", end="") for each in TOPIC_NUM_LIST: print("{0} ".format(each), end="") print("です.") exit() ...
gpl-2.0
9,060,584,416,003,994,000
28.017094
140
0.644772
false
2.456585
false
false
false
mfherbst/spack
lib/spack/llnl/util/filesystem.py
1
37492
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
536,191,456,906,617,700
29.985124
79
0.591219
false
3.925864
false
false
false
matejcik/weblate
weblate/trans/mixins.py
1
5486
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.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, eith...
gpl-3.0
-2,377,593,369,573,738,500
24.621495
73
0.572132
false
4.125658
false
false
false
bsipocz/astropy
astropy/_erfa/erfa_generator.py
1
27369
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module's main purpose is to act as a script to create new versions of ufunc.c when ERFA is updated (or this generator is enhanced). `Jinja2 <http://jinja.pocoo.org/>`_ must be installed for this module/script to function. Note that this does *no...
bsd-3-clause
-3,515,980,912,529,225,000
36.135685
136
0.517995
false
3.964224
false
false
false
ufukdogan92/is-teklif-sistemi
teklif/models.py
1
1928
from django.db import models from ilan.models import Ilan from kullanici.models import IsArayan from register.models import Register class Teklif(models.Model): ilan = models.ForeignKey(Ilan,blank=True,null=True,related_name="odeme_ilanı") teklif_veren = models.OneToOneField(IsArayan,related_name="is_arayan") ...
gpl-3.0
-4,214,891,582,358,801,000
36.627451
116
0.678832
false
2.941718
false
false
false
kg-bot/SupyBot
plugins/Misc1/__init__.py
1
2791
### # Copyright (c) 2014, KG-Bot # 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 list of condition...
gpl-3.0
5,609,393,713,654,504,000
38.449275
79
0.741311
false
3.998567
false
false
false
jeremiah-c-leary/vhdl-style-guide
vsg/tests/case/test_rule_003.py
1
1130
import os import unittest from vsg.rules import case from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_003_test_input.vhd')) lExpected = [] lExpected.append('') utils.read_file(os.path.join(sTestDir, 'ru...
gpl-3.0
-605,416,265,127,274,600
24.111111
106
0.673451
false
3.219373
true
false
false
TakeshiTseng/SDN-Work
mininet/bgp-3as/as.py
1
2401
#!/usr/bin/env python from mininet.net import Mininet from mininet.cli import CLI from mininet.log import setLogLevel ''' h1 -- r1 -- r2 -- r3 -- h3 | h2 h1 - r1 : 10.0.1.0/24 h2 - r2 : 10.0.2.0/24 h3 - r3 : 10.0.3.0/24 r1 - r2 : 192.168.1.0/24 r2 - r3 : 192.168.2.0/24 ''' if '__main__' == __...
mit
-5,056,204,420,631,575,000
30.592105
119
0.598917
false
2.093287
false
false
false
jrydberg/guild
guild/actor.py
1
26454
# Copyright (c) 2012 Johan Rydberg # Copyright (c) 2009 Donovan Preston # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use...
mit
2,611,560,143,730,872,300
30.605735
78
0.592878
false
4.110317
false
false
false
SKIRT/PTS
magic/dist_ellipse.py
1
2347
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** # ...
agpl-3.0
-1,271,247,990,375,277,300
34.545455
100
0.511083
false
4.037866
false
false
false
theresaswayne/imagej-plugins
Demos and Tests/misc scripts/Crop_Confocal_Series_corrected.py
1
1332
# @OpService ops # @Dataset data # @UIService ui # @OUTPUT ImgPlus c0 # @OUTPUT ImgPlus z12 # @OUTPUT ImgPlus c0z12 # @OUTPUT ImgPlus roiC0z12 # to run this tutorial run 'file->Open Samples->Confocal Series' and make sure that # confocal-series.tif is the active image from net.imglib2.util import Intervals from net.i...
gpl-3.0
-3,989,707,301,982,040,000
32.3
95
0.731231
false
2.576402
false
false
false
severin-lemaignan/dialogs
src/dialogs/verbalization/verbalization_test.py
1
179763
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created by Chouayakh Mahdi 08/07/2010 The package contains functions to perform test It is more used for the subject Functions: unit_tests : to perform unit tests """ import unittest import logging logger = logging.getLogger("dialogs") from dialogs.dialog_core ...
bsd-3-clause
-5,733,380,990,628,415,000
62.141201
161
0.281649
false
6.24676
true
false
false
ryanpdwyer/sigutils
sigutils/fdls.py
1
1223
""" Frequency Domain Least Squares ============================== This algorithm tries to approximate an analytic transfer function :math:`H(s)`. See digital signal processing book. - Pick an analytic transfer function H(s) - Select the numerator order N and denominator order D - Define M separate input u_m coside se...
mit
7,364,699,537,436,800,000
24.5
79
0.621423
false
2.547917
false
false
false
redhat-openstack/glance
glance/tests/unit/v2/test_registry_client.py
1
24550
# Copyright 2013 Red Hat, 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...
apache-2.0
5,718,802,242,312,375,000
37.479624
79
0.565743
false
4.133693
true
false
false
Freso/listenbrainz-server
listenbrainz/labs_api/labs/api/recording_from_recording_mbid.py
1
5867
import psycopg2 import psycopg2.extras from flask import current_app from datasethoster import Query psycopg2.extras.register_uuid() class RecordingFromRecordingMBIDQuery(Query): ''' Look up a musicbrainz data for a list of recordings, based on MBID. ''' def names(self): return ("recordi...
gpl-2.0
760,555,066,453,154,600
43.112782
125
0.46736
false
4.90142
false
false
false
sagarjauhari/BCIpy
eegml.py
1
10074
# /usr/bin/env python # Copyright 2013, 2014 Justis Grant Peters and Sagar Jauhari # This file is part of BCIpy. # # BCIpy 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 ...
gpl-3.0
8,123,222,228,558,660,000
32.247525
87
0.562835
false
3.11118
false
false
false
ospalh/kajongg-fork
src/hand.py
1
30524
# -*- coding: utf-8 -*- """Copyright (C) 2009-2012 Wolfgang Rohdewald <wolfgang@rohdewald.de> kajongg 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 ...
gpl-2.0
-5,353,195,466,614,206,000
39.862115
104
0.56146
false
3.94265
false
false
false
kcsry/wurst
wurst/core/migrations/0001_initial.py
1
4493
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-30 19:14 from __future__ import unicode_literals import autoslug.fields from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import enumfields.fields import wurst.core.const...
mit
-5,385,830,359,492,303,000
46.294737
191
0.594258
false
4.199065
false
false
false
kukushdi3981/sel-1_test-project
task14_check_handling_new_windows.py
1
3198
import pytest from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By @pytest.fixture def driver(request): wd = webdriver.Chrome() # Optional argument, if not specified wi...
apache-2.0
3,625,667,480,234,511,400
37.853333
116
0.731984
false
2.859666
false
false
false
mathandy/Classifiers2LearnWith
classifiers/tensorflow/vgg16_pre-trained.py
1
9534
"""A pre-trained implimentation of VGG16 with weights trained on ImageNet.""" ########################################################################## # Special thanks to # http://www.cs.toronto.edu/~frossard/post/vgg16/ # for converting the caffe VGG16 pre-trained weights to TensorFlow # this file is essentially ju...
mit
1,991,808,772,521,995,800
43.344186
87
0.595133
false
3.297821
false
false
false
zarr-developers/numcodecs
numcodecs/tests/test_shuffle.py
1
4387
from multiprocessing import Pool from multiprocessing.pool import ThreadPool import numpy as np import pytest try: from numcodecs.shuffle import Shuffle except ImportError: # pragma: no cover pytest.skip( "numcodecs.shuffle not available", allow_module_level=True ) from numcodecs.tests.common...
mit
2,365,699,436,646,874,600
28.05298
81
0.635742
false
3.235251
true
false
false
SorenSeeberg/MrDatabase
mr_database/column.py
1
1505
#!/usr/bin/python3 # -*- coding: utf-8 -*- class DataTypes: @staticmethod def char(num_chars) -> str: return f'CHAR({num_chars})' @staticmethod def varchar(num_chars=None) -> str: if num_chars: return f'VARCHAR({num_chars})' else: return 'VARCHAR' ...
mit
-5,761,736,747,812,785,000
19.337838
49
0.483721
false
3.839286
false
false
false
rickshinners/blinkenlights
app/plugins/plugin_loader.py
1
2974
from TestPlugin import TestPlugin from JenkinsPlugin import JenkinsPlugin, JenkinsHistoryPlugin import logging def load_plugins(config, scheduler, set_pixel): logger = logging.getLogger(__name__) logger.info("Stopping any existing jobs") scheduler.remove_all_jobs() if config is None or len(config) =...
mit
-5,793,354,938,301,005,000
47.754098
86
0.520511
false
4.56135
true
false
false
anthonynguyen/UrTSB
urtsb_src/ui/adv_filter_window.py
1
27886
# # Copyright (C) 2010 Sorcerer # # This file is part of UrTSB. # # UrTSB 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. # # UrTSB is...
gpl-3.0
-1,009,639,285,081,446,900
38.952722
85
0.578426
false
3.909435
false
false
false
Saturn/soccer-cli
soccer/writers.py
1
14627
import click import csv import datetime import json import io from abc import ABCMeta, abstractmethod from itertools import groupby from collections import namedtuple from soccer import leagueids, leagueproperties LEAGUE_PROPERTIES = leagueproperties.LEAGUE_PROPERTIES LEAGUE_IDS = leagueids.LEAGUE_IDS def get_writ...
mit
6,004,862,366,422,027,000
41.031609
94
0.521912
false
4.135426
false
false
false
yudaykiran/openebs
e2e/ansible/plugins/callback/openebs.py
1
2743
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.callback.default import ( CallbackModule as CallbackModule_default ) from ansible import constants as C """Implementation of Custom Class that inherits the 'default' stdout_...
apache-2.0
2,254,038,138,875,758,600
42.539683
79
0.56471
false
4.265941
false
false
false
TomAugspurger/pandas
pandas/core/computation/ops.py
1
15978
""" Operator classes for eval. """ from datetime import datetime from distutils.version import LooseVersion from functools import partial import operator from typing import Callable, Iterable, Optional, Union import numpy as np from pandas._libs.tslibs import Timestamp from pandas.core.dtypes.common import is_list_...
bsd-3-clause
-7,085,088,927,918,930,000
25.279605
86
0.550194
false
3.817921
false
false
false
AVSystem/Anjay
tests/integration/framework/asserts.py
1
10170
# -*- coding: utf-8 -*- # # Copyright 2017-2021 AVSystem <avsystem@avsystem.com> # # 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 ...
apache-2.0
-5,839,195,946,829,177,000
44.2
123
0.553392
false
4.205955
false
false
false
timpel/stanford-algs
quicksort/quicksort.py
1
1040
from random import randint import sys def sort(arr): length = len(arr) pivot_index = randint(0, length-1) pivot = arr[pivot_index] swap(arr, 0, pivot_index) i = j = 1 while j < length: if arr[j] < pivot: swap(arr, j, i) i += 1 j += 1 swap(arr, 0, i-1) first_part = arr[:i-1] second_part = arr[i:]...
mit
-7,494,212,191,945,609,000
15.25
57
0.618269
false
2.506024
false
false
false
egenerat/bank-statement-analyser
analyzer/utils.py
1
2843
import datetime import os import sys from constants import CATEGORIES, DIRECT_DEBIT_PAYMENT, ROOT_DIR def sum_total_expenses(data_dict): expenses_sum = 0 transaction_nb = 0 for i in data_dict: if DIRECT_DEBIT_PAYMENT.lower() not in i['description'].lower() and i['amount'] < 0 and not i['amount'] ==...
mit
-471,902,158,696,964,860
29.244681
120
0.594442
false
3.567127
false
false
false
nayas360/pyterm
bin/set.py
1
1471
# set command to set global variables from lib.utils import * def _help(): usage = ''' Usage: set [options] (var) [value] [options]: -h Print this help. -del (var) Delete variable (var) if defined. where (var) is a valid global variable if [value] is not given, current v...
mit
2,858,846,573,396,601,000
20.632353
71
0.507138
false
3.752551
false
false
false
WladimirSidorenko/DiscourseSenser
dsenser/xgboost/xgboostbase.py
1
2813
#!/usr/bin/env python # -*- coding: utf-8; mode: python; -*- """Module providing abstract interface class for XGBoost sense calssification. Attributes: XGBoostBaseSenser (class): abstract class defining interface for explicit and implicit classifier """ ########################################################...
mit
6,529,310,863,707,153,000
31.709302
79
0.520441
false
4.515249
false
false
false
neilLasrado/erpnext
erpnext/projects/doctype/timesheet/timesheet.py
1
14333
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ import json from datetime import timedelta from erpnext.controllers.queries import get_match_cond fr...
gpl-3.0
-2,669,668,574,416,058,400
34.654229
144
0.701388
false
3.007344
false
false
false