repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
ostrokach/biskit
scripts/Mod/align.py
1
4218
#!/usr/bin/env python ## ## Biskit, a toolkit for the manipulation of macromolecular structures ## Copyright (C) 2004-2012 Raik Gruenberg & Johan Leckner ## ## 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 Softwar...
gpl-3.0
5,412,043,434,244,115,000
31.446154
83
0.627786
false
sopython/kesh
kesh/_database/creation/create_post_history.py
1
1880
from pymongo import MongoClient from lxml import etree from dateutil.parser import parse import pickle from time import gmtime, strftime import os import re data_dir = '../../../bin/so_data_/' file_name = 'PostHistory.xml' db_name = 'kesh' coll_name = 'post_history' client = MongoClient() db = client[db_name] coll =...
bsd-3-clause
-2,257,058,302,008,041,500
27.923077
74
0.551064
false
lsbardel/python-stdnet
tests/all/query/related.py
1
6409
import datetime from random import randint, uniform from stdnet.utils import test from examples.models import Node, Role, Profile, Dictionary from examples.data import FinanceTest, Position, Instrument, Fund def create(cls, root=None, nesting=None): models = cls.mapper if root is None: with models.s...
bsd-3-clause
-5,532,104,236,342,709,000
36.7
90
0.591512
false
nijel/weblate
setup.py
1
5078
#!/usr/bin/env python3 # # Copyright © 2012 - 2021 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, eithe...
gpl-3.0
7,299,572,486,727,412,000
34.229167
86
0.650108
false
michael-hart/tactile_tablet
src/tablet.py
1
1195
# File created 26/01/2015 # Contains main method to write Braille output to a tablet # Pins are [12, 16, 18, 22, 24, 26] in GPIO.BOARD mode import RPi.GPIO as GPIO import time import atexit from braille_converter import convert_string from braille_dict import braille_dict as bdict led_pins = [12, 16, 18, 22, 24, 26]...
gpl-2.0
-7,119,182,581,759,252,000
22.431373
105
0.687029
false
zmr/namsel
edit_distance_tests/generate_accuracy_report.py
1
5481
#encoding: utf-8 import os import sys import glob import re import codecs from difflib import HtmlDiff from recognize import run_main import Levenshtein as L import requests import datetime import multiprocessing from config_manager import Config, run_all_confs_for_page LOGIN_URL = 'https://dhattupages.appspot.com/a...
mit
8,027,859,567,957,796,000
31.903614
129
0.564366
false
rafin/Spotify-Visualizations
engine/views.py
1
3163
from django.http import JsonResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.core.urlresolvers import reverse from urllib import unquote #spotify tools from spot import pl from spot import keys import json from json import loads as dict #converts json back to dictionary #ge...
mit
-6,362,495,189,862,798,000
33.010753
97
0.654758
false
murgatroid99/grpc
src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
1
7918
# Copyright 2016 gRPC 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 applicable law or agreed to in writing...
apache-2.0
6,177,281,417,734,686,000
35.827907
80
0.575272
false
trthanhquang/bus-assistant
webApp/getBusTiming.py
1
2827
#!/usr/bin/env python import urllib2 from bs4 import BeautifulSoup as BS import re import time def getAgenciesList(): agenciesList_req = urllib2.Request('''http://services.my511.org/Transit2.0/GetAgencies.aspx?token=aeeb38de-5385-482a-abde-692dfb2769e3''') xml_resp = urllib2.urlopen(agenciesList_req) soup = BS(xm...
mit
6,510,849,392,254,107,000
27
139
0.694022
false
NYUEcon/NYUecondata
psid/psid.py
1
12753
""" Working with PSID in python @author : Spencer Lyon <spencer.lyon@stern.nyu.edu> @date : 2015-02-04 09:02:56 use the read_csv option `usecols` to only keep what we need """ import re import os import gc import os.path import zipfile import requests import lxml.html import numpy as np import pandas as pd # ----...
mit
-7,739,318,489,776,719,000
28.183066
78
0.57312
false
Ry09/Python-projects
Programs & Challenges from Python for beginners book/Chapter 2/wordProblems.py
1
1208
#Program using word problems to demonstrate math and number operators print("If a 2000 pound pregnant hippo gives birth to a 100 pound calf,") print("but then eats 50 pounds of food, how much does she weigh?") input("Press the enter key to find out.") print("2000 - 100 + 50 = ", 2000 - 100 + 50) print("\nIf an advent...
mit
-6,853,118,525,491,717,000
42.142857
79
0.70447
false
clebergnu/autotest
server/server_job.py
1
45482
""" The main job wrapper for the server side. This is the core infrastructure. Derived from the client side job.py Copyright Martin J. Bligh, Andy Whitcroft 2007 """ import getpass, os, sys, re, stat, tempfile, time, select, subprocess, platform import traceback, shutil, warnings, fcntl, pickle, logging, itertools, ...
gpl-2.0
-7,604,342,849,247,894,000
38.549565
80
0.587551
false
odoo-brazil/PySPED
pysped/cte/leiaute/consrecicte_300.py
1
8951
# -*- coding: utf-8 -*- from pysped.xml_sped import * from pysped.cte.leiaute import ESQUEMA_ATUAL_VERSAO_300 as ESQUEMA_ATUAL import os from .cte_300 import CTe DIRNAME = os.path.dirname(__file__) class ConsReciCTe(XMLNFe): def __init__(self): super(ConsReciCTe, self).__init__() self.versao = ...
lgpl-2.1
8,531,728,794,076,872,000
40.985915
180
0.587499
false
machinalis/django-srd20
browse/tests.py
1
1842
from django.test import TestCase from django.contrib.auth.models import User, Permission class BrowseTest(TestCase): fixtures = ['srd.json'] def test_get(self): response = self.client.get('/browse/spell/alarm/') # Check that we got a result self.assertEqual(200, response.status_code) ...
bsd-3-clause
7,727,649,877,768,813,000
41.837209
124
0.661781
false
jbarascut/blog
pelicanconf.py
1
1230
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'Gnupyx' SITENAME = u'Gnupyx' SITEURL = 'http://gnupyx.ninja' PATH = 'content' TIMEZONE = 'Europe/Paris' DEFAULT_LANG = u'fr' # Feed generation is usually not desired when developing FEED_ALL_ATOM = True CATEGORY_FEED...
gpl-3.0
4,497,086,495,078,515,000
26.333333
94
0.630081
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher.py
1
2066
# 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
8,103,589,322,604,929,000
34.016949
85
0.575508
false
RichardLMR/xls2txtISA.NANO.archive
xls2txtISA.NANO.archive.py
1
9430
''' xls2txtISA.NANO.archive.py *********************** The research leading to the development of this program has received funding from the European Union Seventh Framework Programme (FP7/2007-2013) under grant agreement number 309837 (NanoPUZZLES project). http://wwww.nanopuzzles.eu ************************ ######...
gpl-2.0
-1,746,001,864,893,949,200
37.178138
259
0.714952
false
rmelo19/rmelo19-arduino
fritzing/fritzing.0.9.2b.64.pc/parts/part-gen-scripts/misc_scripts/findfonts.py
1
2245
# usage: # findfonts.py -d <directory> -f [font1] -f [font2] .... # # <directory> is a folder, with subfolders, containing .svg files. In each svg file in the directory or its children # look for fonts that aren't in the list import getopt, sys, os, re def usage(): print """ usage: droid.py ...
gpl-3.0
-7,906,983,742,202,827,000
27.782051
120
0.498441
false
ff0000/red-fab-deploy2
fab_deploy2/base/collectd.py
1
10192
import os import re from fab_deploy2 import functions from fab_deploy2.config import CustomConfig from fab_deploy2.tasks import ServiceContextTask, task_method from fabric.api import run, sudo, env, put, local from fabric.contrib.files import append, exists from jinja2.exceptions import TemplateNotFound class Colle...
mit
-3,502,012,099,853,734,400
39.444444
245
0.587323
false
peterheim1/robbie_ros
robbie_moveit/nodes/pick_test1.py
1
4531
#!/usr/bin/env python import sys import rospy from moveit_commander import RobotCommander, MoveGroupCommander from moveit_commander import PlanningSceneInterface, roscpp_initialize, roscpp_shutdown from geometry_msgs.msg import PoseStamped from moveit_msgs.msg import Grasp, GripperTranslation, PlaceLocation from traj...
bsd-3-clause
-1,146,657,331,692,744,300
27.859873
87
0.651291
false
MAECProject/maec-to-stix
maec_to_stix/indicator_extractor/config_parser.py
1
9270
# Copyright (c) 2015, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import os import collections import json class ConfigParser(object): """Used to parse the JSON indicator extraction configuration files. Attributes: config_dict: the parsed dictionary representati...
bsd-3-clause
-5,422,211,667,800,922,000
49.38587
119
0.588457
false
plaes/numpy
numpy/core/code_generators/genapi.py
1
15403
""" Get API information encoded in C files. See ``find_function`` for how functions should be formatted, and ``read_order`` for how the order of the functions should be specified. """ import sys, os, re try: import hashlib md5new = hashlib.md5 except ImportError: import md5 md5new = md5.new if sys.vers...
bsd-3-clause
8,382,274,081,688,541,000
31.427368
81
0.510355
false
souravbadami/oppia
core/domain/stats_services_test.py
1
110817
# coding: utf-8 # # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
-6,070,531,319,868,672,000
43.937956
118
0.603003
false
skysports-digitalmedia/php-buildpack
tests/test_compile_helpers.py
1
15810
import os import os.path import tempfile import shutil from nose.tools import eq_ from build_pack_utils import utils from compile_helpers import setup_webdir_if_it_doesnt_exist from compile_helpers import convert_php_extensions from compile_helpers import is_web_app from compile_helpers import find_stand_alone_app_to_r...
apache-2.0
2,697,824,671,140,327,000
42.315068
76
0.569892
false
omarios90/openshift-cartridge-python-3.5.1
template/config/utils/excel_styles.py
1
3230
from xlwt import Font, Borders, Alignment, XFStyle, Pattern, Style from .utils import EmptyClass # PRE STYLES # ==================================================== PreStyles = EmptyClass() # title PreStyles.title = Font() PreStyles.title.height = 360 PreStyles.title.bold = True # bold PreStyles.bold = Font() PreS...
mit
8,924,968,726,708,385,000
26.606838
71
0.755108
false
soarpenguin/python-scripts
terminal.py
1
1467
#!/usr/bin/env python import os def clrscr(): """ Clear screen and move cursor to 1,1 (upper left) pos. """ print '\033[2J\033[1;1H' def clreol(): """ Erases from the current cursor position to the end of the current line. """ print '\033[K' def delline(): """ Erases the entire current line. """ ...
gpl-3.0
4,358,864,761,990,705,700
30.891304
83
0.498978
false
igordejanovic/parglare
tests/func/parsing/test_dynamic_disambiguation_filters.py
1
3477
import pytest # noqa from parglare import GLRParser, Grammar, Parser, SHIFT, REDUCE from parglare.exceptions import SRConflicts grammar = r""" E: E op_sum E {dynamic} | E op_mul E {dynamic} | number; terminals number: /\d+/; op_sum: '+' {dynamic}; op_mul: '*' {dynamic}; """ instr1 = '1 + 2 * 5 + 3' instr2 = '1 * ...
mit
-6,702,298,791,674,917,000
28.218487
79
0.633592
false
gelbander/retain24wrapper
retain24wrapper/retain24wrapper.py
1
5339
# -*- coding: utf-8 -*- import time from tempfile import NamedTemporaryFile from xml.etree import cElementTree as ET from xml.etree.cElementTree import XML from dicttoxml import dicttoxml import requests import xmltodict ACTIONS = {} ACTIONS['GET_PROVIDERS'] = {'TA_ACTION': '5-45103'} ACTIONS['ISSUE'] = {'TA_ACTION...
mit
-3,539,120,547,608,042,500
30.222222
129
0.567335
false
toddpalino/kafka-tools
kafka/tools/protocol/responses/leader_and_isr_v0.py
1
1199
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-8,818,196,669,233,564,000
37.677419
62
0.674729
false
chinfeng/gumpy
huacaya/auth/endpoint.py
1
13593
# -*- coding: utf-8 -*- __author__ = 'chinfeng' import os import uuid import json import datetime import tornado.web from tornado.web import HTTPError from tornado.escape import json_decode try: from urllib import urlencode from urlparse import urlsplit, urlunsplit except ImportError: from urllib.parse imp...
lgpl-3.0
-4,256,504,983,164,449,000
39.875758
127
0.602046
false
kobronson/cs-voltdb
tests/scripts/examples/sql_coverage/partial-covering-schema.py
1
1941
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2013 VoltDB Inc. # # 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 limitati...
agpl-3.0
-6,313,715,119,694,214,000
42.133333
72
0.655332
false
markovmodel/thermotools
test/test_util.py
1
10124
# This file is part of thermotools. # # Copyright 2015, 2016 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # thermotools is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either...
lgpl-3.0
-6,054,468,994,515,322,000
46.530516
103
0.568352
false
sigmavirus24/pip
tests/functional/test_freeze.py
1
16681
import sys import os import re import textwrap import pytest from doctest import OutputChecker, ELLIPSIS from tests.lib import _create_test_package, _create_test_package_with_srcdir distribute_re = re.compile('^distribute==[0-9.]+\n', re.MULTILINE) def _check_output(result, expected): checker = OutputChecker()...
mit
-4,954,706,562,733,606,000
30.121269
79
0.591032
false
provideyourown/SiteMonitoring
memoryusage.py
1
1362
#!/usr/bin/env python """ Display the system memory usage. Can be called on a remote server or use 'local' or 'localhost' for your computer Usage: ./memoryusage.py MYSERVER """ import argparse import subprocess def getMemoryUsage(server): """ Returns the cpu load as a value from the interval [0.0, 1.0] ...
gpl-3.0
2,848,168,859,462,388,700
31.428571
193
0.654185
false
Naeka/vosae-app
www/invoicing/models/payment.py
1
3144
# -*- coding:Utf-8 -*- from mongoengine import Document, fields from django.utils.timezone import now import decimal from core.fields import DateField from invoicing import PAYMENT_TYPES, currency_format from invoicing.exceptions import ( InvalidPaymentAmount, ) __all__ = ( 'Payment', 'InvoicePayment', ...
agpl-3.0
-8,912,325,496,183,845,000
29.823529
100
0.66285
false
BTCfork/hardfork_prototype_1_mvf-core
qa/rpc-tests/mvf-core-csig.py
1
9119
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Copyright (c) 2016 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # MVF-Core """ Exercise the signature change (replay protectio...
mit
-2,729,698,025,060,871,000
43.26699
156
0.617173
false
DBeath/flask-feedrsub
feedrsub/utils/feeds/feed_generation.py
1
1207
from flask import current_app as app from typing import List, Dict from flask import url_for def websub_discovery_link() -> Dict: """ Creates a WebSub discovery link :return: link as dict """ hub_enabled = app.config.get("HUB_ENABLED", False) if hub_enabled: hub_url = url_for( ...
mit
-544,283,231,300,035,600
22.211538
83
0.59652
false
JonathanFrederick/job-hunt
company_scripts.py
1
1197
from selenium import webdriver from companies.red_hat import red_hat from app import db from models import Company def print_result(info): """Takes in a dictionary with keys for 'company', 'title', 'url', and 'description' and prints them neatly to the terminal""" for key in ['company', 'title', 'url', ...
mit
-6,624,179,340,990,161,000
28.195122
71
0.56391
false
alexismirandan/Edit-image-kivy-app
layout/edit_image_layout.py
1
2428
# -*- coding: utf-8 -* from kivy.uix.floatlayout import FloatLayout from kivy.properties import ListProperty, ObjectProperty from components.touch_selector import TouchSelector from components.bubble_buttons import BubbleButtons from layout.image_layout import ImageLayout from kivy.uix.button import Button class EditI...
mit
7,713,281,658,232,743,000
43.145455
99
0.689044
false
botswana-harvard/bcpp-export
bcpp_export/old_export/constants.py
1
1213
import numpy as np from edc_constants.constants import ( ALIVE as edc_ALIVE, DEAD as edc_DEAD, YES as edc_YES, NO as edc_NO, POS as edc_POS, NEG as edc_NEG, IND as edc_IND, UNK as edc_UNK, NOT_APPLICABLE as edc_NOT_APPLICABLE, MALE as edc_MALE, FEMALE as edc_FEMALE) SUBJECT_IDENTIFIER = 'subject_ident...
gpl-2.0
-9,128,420,541,188,606,000
17.104478
71
0.611707
false
NLeSC/PattyAnalytics
tests/test_utils.py
1
2201
import os from tempfile import NamedTemporaryFile import pcl import numpy as np from patty import utils from numpy.testing import assert_array_almost_equal from nose.tools import assert_equal, assert_raises def _compare( pcA, pcB ): ''' compare two pointclouds point-by-point''' pcA_arr = np.asarray(pcA) ...
apache-2.0
-6,275,963,288,678,196,000
25.518072
73
0.625625
false
Shihta/python-novaclient
novaclient/tests/v1_1/test_hypervisors.py
1
5832
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-1,797,045,827,420,671,200
32.906977
78
0.54321
false
Spotipo/spotipo
tests/core/test_guestutils.py
1
10985
import sys import pytest from flask import current_app,url_for from flask_wtf import Form from wtforms import TextField from faker import Faker import arrow import uuid from unifispot.core.models import Wifisite,Device,Guesttrack,Guest,Loginauth,\ Guestsession from unifispot.core.g...
agpl-3.0
-1,459,336,541,446,399,200
39.241758
146
0.640419
false
PaloAltoNetworks/minemeld-core
minemeld/ft/ipop.py
1
15103
# Copyright 2015 Palo Alto Networks, 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 agre...
apache-2.0
-2,142,277,314,815,049,000
30.01232
88
0.517579
false
giovannipro/map-the-glam
scraper/scrape/scrape_image_size-analogic.py
1
9603
#!/usr/bin/env python # -*- coding: utf-8 -*- # Get data from file page import os # get file path import webbrowser # open webpages import time # get unix code import datetime # convert in unix timestamp import urllib, json, io # read json from urllib import urlopen # open file import sys # r...
gpl-3.0
-1,088,663,877,356,968,000
26.09322
88
0.512043
false
tom-mi/pyrad
pyrad/server.py
1
9027
# server.py # # Copyright 2003-2004,2007 Wichert Akkerman <wichert@wiggy.net> import select import socket from pyrad import host from pyrad import packet import logging logger = logging.getLogger('pyrad') class RemoteHost: """Remote RADIUS capable host we can talk to. """ def __init__(self, address, s...
bsd-3-clause
-1,549,894,543,043,070,200
34.4
80
0.611056
false
unioslo/cerebrum
contrib/exchange/exchange_group_state_verification.py
1
22909
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2018 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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...
gpl-2.0
7,390,959,573,923,553,000
35.713141
79
0.533677
false
domeger/SplunkTAforPuppetEnterprise
bin/puppet_enterprise_metrics.py
1
4586
import splunktaforpuppetenterprise_declare import os import sys import time import datetime import json import modinput_wrapper.base_modinput from solnlib.packages.splunklib import modularinput as smi import input_module_puppet_enterprise_metrics as input_module bin_dir = os.path.basename(__file__) ''' Do no...
apache-2.0
-8,698,139,154,685,138,000
43.960784
214
0.586786
false
EiNSTeiN-/deluge-gtk3
deluge/ui/gtkui/edittrackersdialog.py
1
9157
# # edittrackersdialog.py # # Copyright (C) 2007, 2008 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) ...
gpl-3.0
-8,834,094,978,799,285,000
38.640693
106
0.624331
false
fsxfreak/club-suite
clubsuite/suite/views/view_budget.py
1
4194
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.views.generic import View from django.urls import reverse from django.contrib import messages from suite.models imp...
mit
-6,044,569,809,767,433,000
38.196262
94
0.610157
false
regnart-tech-club/programming-concepts
Goals.py
1
1519
# Rationale: # * Learn computational thinking # * thought processes involved in formulating problems and their solutions # so that the solutions are represented in a form # that can be effectively carried out by an information-processing agent. # * compositional reasoning, pattern matching, procedural think...
apache-2.0
2,031,229,498,634,800,400
46.46875
88
0.760369
false
tarbell-project/tarbell
setup.py
1
2186
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from setuptools import setup, find_packages from tarbell import __VERSION__ as VERSION APP_NAME = 'tarbell' settings = dict() # Publish Helper. if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() settings.upda...
bsd-3-clause
-7,955,737,072,833,608,000
30.2
339
0.619505
false
USGSDenverPychron/pychron
pychron/hardware/pychron_laser.py
1
1127
# =============================================================================== # Copyright 2012 Jake Ross # # 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
-491,999,547,571,266,600
40.740741
81
0.539485
false
djmattyg007/bfinterpreter
bfinterpreter.py
1
6325
#!/usr/bin/python3 class Tape: ''' A generic implementation of a record tape for a Turing Machine. It's bounded on the left side and unbounded on the right side. It stores only Python integers. ''' def __init__(self): self.reset() def inc_val(self): self.cells[self.pointer...
unlicense
1,415,792,457,444,116,500
28.694836
112
0.502609
false
eharney/cinder
cinder/cmd/volume_usage_audit.py
1
10138
#!/usr/bin/env python # Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICE...
apache-2.0
-8,139,628,104,453,433,000
40.044534
78
0.577037
false
Davideddu/python-liquidcrystal
setup.py
1
1093
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): with open(os.path.join(os.path.dirname(__file__), fname), "r") as f: return f.read() setup( name="liquidcrystal", version="0.1", author="Davide Depau", author_email="apps@davideddu.org...
gpl-2.0
-760,723,976,487,144,700
31.147059
117
0.650503
false
kkleidal/kentf
config.py
1
8940
#!/usr/bin/env python3 import sys import argparse import os import argparse import yaml import json from attrdict import AttrDict class ConfigKWArg: def __init__(self, name, example, type=str, default=None, required=False, short_name=None, nargs=1, help=None): self.name = name self.type = type ...
mit
6,601,954,506,612,758,000
38.210526
133
0.576063
false
agrover/targetd
targetd/fs.py
1
10302
# 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 hope that it will be useful, # bu...
gpl-3.0
-551,828,838,198,015,300
28.603448
79
0.584158
false
philipkershaw/ndg_security_server
ndg/security/server/wsgi/authz/pep.py
1
22782
'''NDG Security Policy Enforcement Point Module __author__ = "P J Kershaw" __date__ = "11/07/10" __copyright__ = "(C) 2010 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revision__ = '$Id$' ''' import logging log = lo...
bsd-3-clause
-8,820,283,140,040,014,000
41.424581
106
0.592485
false
viranch/exodus
resources/lib/indexers/episodes.py
1
65108
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
gpl-3.0
-4,454,347,603,305,280,000
41.526453
502
0.504408
false
dakrauth/strutil
setup.py
1
1169
#!/usr/bin/env python import os, sys from setuptools import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit(0) with open('README.rst', 'r') as f: long_description = f.read() # Dynamically calculate the version based on swingtime.VERSION. version = __import__('struti...
mit
-4,161,712,837,771,272,700
30.594595
89
0.63302
false
maas/maas
src/maasserver/rpc/tests/test_leases.py
1
20464
# Copyright 2015-2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for `rpc.leases`.""" from datetime import datetime import random import time from django.utils import timezone from netaddr import IPAddress from testtools.matcher...
agpl-3.0
3,252,529,167,948,657,700
39.362919
79
0.613614
false
torkelsson/meta-package-manager
setup.py
1
6388
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2016-2018 Kevin Deldycke <kevin@deldycke.com> # and contributors. # All Rights Reserved. # # This program is Free Software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published ...
gpl-2.0
-2,708,297,968,679,874,000
32.445026
78
0.607702
false
gabstopper/smc-python
smc/elements/profiles.py
1
9278
""" Profiles are templates used in other parts of the system to provide default functionality for specific feature sets. For example, to enable DNS Relay on an engine you must specify a DNSRelayProfile to use which defines the common settings (or sub-settings) for that feature. A DNS Relay Profile allows multiple DNS...
apache-2.0
-6,040,503,220,421,455,000
32.861314
117
0.613171
false
unicef/rhizome
rhizome/api/resources/source_submission.py
1
1345
from rhizome.api.resources.base_model import BaseModelResource from rhizome.models.document_models import SourceSubmission class SourceSubmissionResource(BaseModelResource): ''' **GET Request** Returns all SourceSubmissions unless an optional parameter is specified - *Optional Parameters:* ...
agpl-3.0
15,860,401,860,111,412
39.757576
93
0.657993
false
Eksmo/calibre
src/calibre/gui2/preferences/search_ui.py
1
13356
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/preferences/search.ui' # # Created: Thu Jul 19 23:32:29 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _...
gpl-3.0
2,683,885,192,424,116,700
63.834951
320
0.699386
false
RobRuana/sideboard
sideboard/internal/logging.py
1
1819
from __future__ import unicode_literals, absolute_import import os import logging.config import logging_unterpolation from sideboard.config import config class IndentMultilinesLogFormatter(logging.Formatter): """ Provide a formatter (unused by default) which adds indentation to messages which are split ...
bsd-3-clause
-6,979,212,933,264,625,000
35.38
106
0.59978
false
jolyonb/edx-platform
openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py
1
2916
""" Tests for helpers.py """ from __future__ import absolute_import import datetime import hashlib from django.test import TestCase from mock import patch from pytz import UTC from openedx.core.djangolib.testing.utils import skip_unless_lms from student.tests.factories import UserFactory from ..image_helpers import...
agpl-3.0
-586,315,608,555,252,000
34.560976
114
0.641632
false
splav/servo
tests/wpt/web-platform-tests/tools/wpt/run.py
1
30731
import argparse import os import platform import sys from distutils.spawn import find_executable from six.moves import input wpt_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) sys.path.insert(0, os.path.abspath(os.path.join(wpt_root, "tools"))) from . import browser, install, te...
mpl-2.0
-6,961,727,314,799,412,000
35.759569
129
0.605057
false
MD-Studio/MDStudio
mdstudio/mdstudio/tests/db/impl/test_mongo_database_wrapper.py
1
74367
# coding=utf-8 import datetime import mongomock import pytz import twisted from bson import ObjectId from faker import Faker from mock import mock, call from twisted.internet import reactor from mdstudio.db.cursor import Cursor, query from mdstudio.db.exception import DatabaseException from mdstudio.db.fields import...
apache-2.0
94,760,294,051,316,580
39.285482
140
0.587855
false
MarkusHackspacher/unknown-horizons
horizons/world/buildability/potentialroadconnectivitycache.py
1
3725
# ################################################### # Copyright (C) 2008-2017 The Unknown Horizons Team # team@unknown-horizons.org # This file is part of Unknown Horizons. # # Unknown Horizons is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-2.0
-8,918,137,794,307,005,000
37.010204
86
0.713826
false
beeftornado/sentry
src/sentry/integrations/msteams/utils.py
1
3654
from __future__ import absolute_import import six import logging import enum from django.http import Http404 from sentry.models import ( Integration, Organization, IdentityProvider, ) from sentry.shared_integrations.exceptions import ApiError from sentry.utils.compat import filter from .client import Ms...
bsd-3-clause
6,982,754,459,844,222,000
29.966102
95
0.688013
false
shnergle/ShnergleServer
api/util.py
1
5137
import calendar import datetime import functools import json import os import time import cherrypy import pyodbc def connect(thread_index): cherrypy.thread_data.db = pyodbc.connect(os.environ['DATABASE']) current_dir = os.path.dirname(os.path.abspath(__file__)) cherrypy.thread_data.placeholder_image = op...
mit
8,012,379,061,196,236,000
30.133333
108
0.512167
false
mathause/regionmask
regionmask/defined_regions/giorgi.py
1
2880
# F. Giorgi R. Francisco # Uncertainties in regional climate change prediction: a regional analysis # of ensemble simulations with the HADCM2 coupled AOGCM outlines = dict() outlines[1] = ((110, -45), (155, -45), (155, -11), (110, -11)) outlines[2] = ((-82, -20), (-34, -20), (-34, 12), (-82, 12)) outlines[3] = ((-76, ...
mit
7,027,897,503,199,743,000
30.648352
88
0.545833
false
WheatonCS/Lexos
lexos/receivers/rolling_window_receiver.py
1
7808
"""This is the receiver for rolling windows analysis model.""" import pandas as pd from enum import Enum from typing import NamedTuple, Optional, List from lexos.receivers.base_receiver import BaseReceiver from lexos.managers.utility import load_file_manager class RWATokenType(Enum): """This type specify what ki...
mit
428,797,673,821,050,750
34.981567
78
0.615907
false
alexandresobolevski/yahoo_ff
yahoo_ff/tools/scrapingTools.py
1
2687
from urllib.request import urlopen import time import numpy as np BASE_URL = 'https://ca.finance.yahoo.com/' powers = {'%': 10 ** (-2), 'M': 10 ** 6, 'B': 10 ** 9, 'T': 10 ** 12} def getUnixTime (dateTime): return int(time.mktime(dateTime.timetuple())) def parse_powers(x): power = x[-1] if (power in pow...
mit
3,454,508,166,530,037,000
29.885057
123
0.599181
false
totoro-zhang/hello-word
spider/distributespider/myfirstSpider_URLManager.py
1
2465
#coding:utf-8 import _compat_pickle import hashlib class UrlManager(object): def __init__(self): #self.new_urls = set() #self.old_urls = set() self.new_urls = self.load_progress('new_urls.txt')#未爬取的url集合 self.old_urls = self.load_progress('old_urls.txt')#已爬取的URL集合 def ...
unlicense
-7,736,062,366,020,673,000
22.833333
69
0.46264
false
leon-adams/datascience
algorithms/k_nearest_neighbor.py
1
4659
import numpy as np class KNearestNeighbor(object): """ a kNN classifier with L2 distance """ def __init__(self): pass def train(self, X, y): """ Train the classifier. For k-nearest neighbors this is just memorizing the training data. Inputs: - X: A numpy array of shape (num_train, D) ...
mpl-2.0
1,120,641,967,713,897,000
33.768657
85
0.623095
false
Azure/azure-sdk-for-python
sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/aio/operations/_operation_status_operations.py
1
5447
# 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 may ...
mit
5,413,257,254,874,317,000
48.072072
217
0.665504
false
thomasyu888/synapsePythonClient
setup.py
1
4360
# Installation script for Synapse Client for Python ############################################################ import sys import os import platform import setuptools import json # check Python version, before we do anything if sys.version_info.major < 3 and sys.version_info.minor < 6: sys.stderr.write("The Synap...
apache-2.0
8,091,647,534,263,639,000
34.737705
91
0.642431
false
moden-py/SWAPY
swapy-ob.py
1
1727
# GUI object/properties browser. # Copyright (C) 2011 Matiychuk D. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at your option) any la...
lgpl-2.1
-9,084,540,459,404,032,000
25.412698
79
0.665316
false
blindtex/blindtex
blindtex/iotools/iotools.py
1
5776
#-*-:coding:utf-8-*- import os import copy import json import string import subprocess #from blindtex import mainBlindtex import sys from sys import argv #HU1 #Method to open a file and return its content as a string. def openFile(fileName): '''This function takes a file a return its content as a string. ...
gpl-3.0
-1,899,846,381,258,995,200
39.65493
158
0.639182
false
fanchao01/pythontools
Queue.py
1
4492
#!/bin/env python #-*- encoding: utf-8 -*- __author__ = "fanchao01" __version__ = "0.0.1" '''multi-thread queue likes Queue.queue''' import threading as _threading import time as _time class Full(Exception): """Exception Full raised by Queue.put/put_nowait""" class Empty(Exception): """Exception Empty ra...
gpl-2.0
4,892,882,358,093,603,000
27.43038
134
0.511131
false
FilWisher/distributed-project
icarus/icarus/results/visualize.py
1
3641
"""Functions for visualizing results on graphs of topologies""" from __future__ import division import os import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import networkx as nx __all__ = [ 'draw_stack_deployment', 'draw_network_load', ] # Colormap for node stacks ...
mit
-1,813,796,021,012,025,600
31.508929
102
0.608075
false
jessada/pyCMM
setup.py
1
4017
import sys import glob import pkgutil import os import fnmatch from setuptools import setup from pycmm.settings import DNASEQ_SLURM_MONITOR_PIPELINE_BIN from pycmm.settings import DUMMY_TABLE_ANNOVAR_BIN from pycmm.settings import MUTREP_SLURM_MONITOR_PIPELINE_BIN from pycmm.settings import MUTREP_FAMILY_REPORT_BIN fro...
gpl-2.0
-6,294,524,803,636,695,000
35.853211
139
0.591735
false
bowen0701/algorithms_data_structures
lc0240_search_a_2d_matrix_ii.py
1
1900
"""Leetcode 240. Search a 2D Matrix II URL: https://leetcode.com/problems/search-a-2d-matrix-ii/ Medium Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: - Integers in each row are sorted in ascending from left to right. - Integers in each column ar...
bsd-2-clause
-1,983,297,366,930,088,000
24.675676
75
0.543158
false
angadpc/Alexa-Project-
twilio/rest/chat/v1/service/__init__.py
1
49759
# coding=utf-8 """ This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base....
mit
-8,875,363,262,685,539,000
46.29943
115
0.655721
false
vardis/pano
src/pano/model/__init__.py
1
1157
''' Copyright (c) 2008 Georgios Giannoudovardis, <vardis.g@gmail.com> 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
7,207,051,549,773,082,000
46.291667
77
0.770959
false
berndca/xmodels
xmodels/constraints.py
1
12866
from __future__ import unicode_literals from collections import namedtuple import logging from six import string_types from .fields import RegexField, ValidationException, NCName, Name logger = logging.getLogger(__name__) KeyRef = namedtuple('KeyRef', 'key_name key_value ref_path') class KeyStore(object): ""...
bsd-3-clause
3,555,487,826,444,224,000
33.218085
79
0.596844
false
agripo/website
core/models/shop.py
1
12773
from django.conf import settings from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import models, IntegrityError from django.db.models import Q, Sum from django.utils import timezone from django.db.models.signals import pre_save, post_save from django.contrib...
gpl-2.0
-3,663,379,892,135,324,000
33.448649
116
0.642162
false
zhuyue1314/simuvex
simuvex/s_slicer.py
1
3706
import pyvex from .s_errors import SimSlicerError class SimSlicer(object): """ A super lightweight single-IRSB slicing class. """ def __init__(self, statements, target_tmps=None, target_regs=None, inslice_callback=None, inslice_callback_infodict=None): self._statements = statements se...
bsd-2-clause
7,626,896,577,661,538,000
26.864662
126
0.588505
false
ConflictGK/Codecatch-RSSE
properties.py
1
1114
import os class Properties: def __init__(self, query, example_query_index = -1, thepath = None): self.query = query main_dir = os.getcwd() self.SCRAPY_EXEC = "C:/WinPython36/python-3.6.3.amd64/Scripts/scrapy.exe" self.PARENT_DIR = main_dir + os.path.sep if example_query_index >= 0: self.DATA_DIR...
mit
5,942,278,755,511,353,000
46.434783
151
0.654399
false
npinto/pytest
_pytest/skipping.py
1
9336
""" support for skip/xfail functions and markers. """ import py, pytest import sys def pytest_addoption(parser): group = parser.getgroup("general") group.addoption('--runxfail', action="store_true", dest="runxfail", default=False, help="run tests even if they are marked xfail") def pyte...
mit
-6,791,166,302,753,156,000
33.450185
80
0.564053
false
zh012/flask-dropin
docs/conf.py
1
9664
# -*- coding: utf-8 -*- # # Flask-DropIn documentation build configuration file, created by # sphinx-quickstart on Fri Nov 13 12:26:05 2015. # # 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. ...
mit
2,382,465,205,383,267,300
31.106312
79
0.706436
false
clembou/PCWG
pcwg/gui/grid_box.py
1
7539
import Tkinter as tk import tkFont as tkFont import ttk as ttk from ..exceptions.handling import ExceptionHandler class GridBox(object): def __init__(self, master, headers, row, column): self.master = master self.headers = headers self.items_dict = {} self.tree = None ...
mit
2,690,398,291,229,796,400
27.026022
89
0.569041
false
digitalocean/netbox
netbox/extras/admin.py
1
6231
from django import forms from django.contrib import admin from utilities.forms import LaxURLField from .models import CustomField, CustomLink, ExportTemplate, JobResult, Webhook def order_content_types(field): """ Order the list of available ContentTypes by application """ queryset = field.queryset.o...
apache-2.0
-5,184,452,310,745,300,000
26.091304
118
0.540363
false
QISKit/qiskit-sdk-py
qiskit/extensions/standard/s.py
1
2513
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
apache-2.0
-7,865,258,483,430,124,000
24.383838
77
0.564266
false
quantumlib/Cirq
cirq-core/cirq/sim/simulator_base.py
1
12429
# Copyright 2021 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
7,946,348,196,334,659,000
39.223301
100
0.620323
false
lelandbatey/defuse_division
defusedivision/game.py
1
9622
import logging import random import curses import queue from .minesweeper.minefield import MineField from .minesweeper.contents import Contents class Conveyor(object): """ Abstract class Conveyor describes the basic contract for communicating about games of Minesweeper. """ def get_state(self): ...
gpl-3.0
-569,778,188,004,578,700
30.34202
102
0.585014
false
beni55/rinohtype
rinohlib/templates/article.py
1
1907
from rinoh.document import DocumentSection from rinoh.paragraph import Paragraph from rinoh.structure import GroupedFlowables from .base import (ContentsPart, DocumentBase, DocumentOptions, TableOfContentsSection) class ArticleFrontMatter(GroupedFlowables): def __init__(self): self.to...
agpl-3.0
-5,709,940,673,110,627,000
28.338462
78
0.588359
false