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
Yukarumya/Yukarum-Redfoxes
testing/marionette/harness/marionette_harness/tests/unit/test_screen_orientation.py
1
3917
# 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 http://mozilla.org/MPL/2.0/. from marionette_driver import errors from mozrunner.devices.emulator_screen import EmulatorScreen from marionette_harne...
mpl-2.0
-3,902,149,290,655,037,400
44.546512
103
0.725045
false
crodjer/atg
tests/unit/test_activities.py
1
2695
# atg: a small timezone utility # Copyright (C) 2015 Rohan Jain # # 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. # # Th...
gpl-3.0
-5,515,044,760,652,173,000
28.615385
78
0.5859
false
YannThorimbert/ThorPy-1.4.1
thorpy/elements/browser.py
1
5542
# -*- coding: utf-8 -*- import os import pygame from thorpy.elements.browserlight import BrowserLight from thorpy.elements._explorerutils._pathelement import PathElement from thorpy.elements.element import Element from thorpy.elements.inserter import Inserter from thorpy.elements.ddlf import DropDownListFast from tho...
mit
-6,465,121,483,309,031,000
40.365672
84
0.579033
false
avinet/adaptive3-qgis-plugin
dlgNewProjectBase.py
1
2600
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'dlgNewProject.ui' # # Created: Fri Apr 01 12:27:36 2016 # by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except ...
mit
3,318,942,337,191,141,000
46.272727
115
0.740385
false
TAMU-CPT/galaxy-tools
tools/webapollo/create_or_update_organism.py
1
3514
#!/usr/bin/env python import sys import json import argparse import time from webapollo import WAAuth, WebApolloInstance, OrgOrGuess, GuessOrg, AssertUser import logging logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) if __name__ == "__main__": parser = argparse.ArgumentParser( ...
gpl-3.0
1,875,516,418,846,996,000
33.792079
284
0.610985
false
team-hdnet/hdnet
tests/test_spikes.py
1
2011
# -*- coding: utf-8 -*- # This file is part of the hdnet package # Copyright 2014 the authors, see file AUTHORS. # Licensed under the GPLv3, see file LICENSE for details import os import numpy as np from hdnet.spikes import Spikes from hdnet.util import hdlog from test_tmppath import TestTmpPath class TestSpikes(T...
gpl-3.0
379,902,650,807,564,600
36.240741
103
0.652909
false
Com-Mean/MLinAcition
chapter2/numpyIntro.py
1
1099
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################### # File Name: numpyIntro.py # Author: lpqiu # mail: qlp_1018@126.com # Created Time: 2014年09月06日 星期六 16时33分05秒 ######################################################################### import numpy as...
gpl-3.0
-7,973,966,228,759,885,000
24.139535
76
0.427382
false
Southpaw-TACTIC/Team
src/python/Lib/site-packages/PySide/examples/graphicsview/elasticnodes.py
1
13943
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2006-2006 Trolltech ASA. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## Licensees holding a valid Qt License Agreement may use this file in ## accordance...
epl-1.0
-5,084,416,713,089,854,000
34.388325
138
0.588324
false
meisamhe/GPLshared
ML/HW4Q2RunAlgorithms.py
1
3869
__author__ = 'MeisamHe' #=================================Start with the first data set farm ads======================================================= import csv import sys import math import random import numpy as np import os #----------------------------------------------------------------------------- # Read t...
gpl-3.0
-3,387,909,138,458,844,700
49.907895
189
0.637891
false
stryder199/RyarkAssignments
Assignment2/web2py/gluon/decoder.py
1
3038
import codecs, encodings """Caller will hand this library a buffer and ask it to either convert it or auto-detect the type. Based on http://code.activestate.com/recipes/52257/ Licensed under the PSF License """ # None represents a potentially variable byte. "##" in the XML spec... autodetect_dict={ # bytepattern ...
mit
-9,123,745,468,234,891,000
40.054054
78
0.560895
false
FreeON/spammpack
src-C/prototype/stream_multiply/generate_SSE_assembly.py
1
19562
#!/usr/bin/python # # Generate SSE assembly code for a kernel operating on a 4x4 blocks. import math, optparse, sys class box: def __init__ (self, i_1, i_2, j_1, j_2): self.i_1 = i_1 self.i_2 = i_2 self.j_1 = j_1 self.j_2 = j_2 def __str__ (self): return "box: [%d-%d][%d-%d]" % (self.i_1, sel...
bsd-3-clause
-6,811,387,707,721,082,000
35.979206
132
0.586596
false
smjurcak/csm
csmserver/views/download_dashboard.py
1
8882
# ============================================================================= # Copyright (c) 2016, Cisco Systems, Inc # 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 sour...
apache-2.0
-7,126,437,171,829,432,000
34.670683
115
0.654582
false
51reboot/actual_13_homework
05/sxq/build.py
1
4185
#!/usr/bin/env python #coding:utf-8 # os/sys/math/time/random import os,sys,math,time,random,datetime # print os.sep #路径分隔符 # print os.name #系统 # print os.getcwd() #获取当前路径 # print os.getenv() #获取环境变量 # print os.putenv() #设置环境变量 # print os.listdir('/Users') #获取特定路径下的文件和目录 # print os.remove() 删除文件 # print os.removedirs(...
mit
-9,219,017,705,434,372,000
10.732919
54
0.787397
false
tdickers/mitmproxy
mitmproxy/utils.py
1
1071
from __future__ import absolute_import, print_function, division import netlib.utils pkg_data = netlib.utils.Data(__name__) class LRUCache: """ A simple LRU cache for generated values. """ def __init__(self, size=100): self.size = size self.cache = {} self.cacheList = ...
mit
1,121,692,843,674,526,200
27.184211
78
0.549953
false
Cladis/wikilabels
wikilabels/database/worksets.py
1
8760
import psycopg2 from psycopg2.extras import Json from .collection import Collection from .errors import IntegrityError, NotFoundError class Worksets(Collection): def get(self, workset_id, stats=False): with self.db.conn.cursor() as cursor: cursor.execute(""" SELECT ...
mit
8,908,630,188,383,749,000
37.086957
86
0.457648
false
ljhandlwt/flask-study
flask1/app/models.py
1
3601
#coding=utf-8 from flask import url_for from flask.ext.sqlalchemy import SQLAlchemy from app import db,app from hashlib import md5 from datetime import datetime import os user_user_concern=db.Table('user_user_concern', db.Column('user1_id',db.Integer,db.ForeignKey('user.id'),primary_key=True), db.Column('use...
mit
1,049,869,579,345,582,300
29.13913
111
0.706063
false
JohnLZeller/dd-agent
tests/test_cassandra.py
1
5263
import logging import unittest from dogstream.cassandra import parse_cassandra logger = logging.getLogger(__name__) class TestCassandraDogstream(unittest.TestCase): def testStart(self): events = parse_cassandra(logger, " INFO [main] 2012-12-11 21:46:26,995 StorageService.java (line 687) Bootstrap/Repla...
bsd-3-clause
-4,113,671,884,750,322,700
86.716667
689
0.758123
false
stanleykylee/worldbank-world-development-indicators-distributed-tf
src/build_sequences.py
1
1618
import csv import json # configuration DATA_FILE = 'WDI_Data.csv' INDICATORS_FILE = 'indicators.config' OUTPUT_FILE = 'population-data.csv.csv' def make_country_dict(): country = {} for i in range(0,57): country[i] = {} return country # extract selected indicators and write time series entries o...
gpl-3.0
-3,085,287,364,212,459,000
27.892857
74
0.543263
false
whitehorse-io/encarnia
Encarnia/typeclasses/statue.py
1
1228
""" Readables A readable plaque. """ from evennia import DefaultObject, Command, CmdSet from world import english_utils from evennia.utils import list_to_string from random import randint import time from typeclasses.objects import Object # the "read" command class CmdReadStatue(Command): """ ...
mit
-988,572,104,984,226,600
19.578947
73
0.614821
false
shastah/spacewalk
backend/server/importlib/packageImport.py
1
22007
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-7,587,173,102,851,040,000
40.998092
156
0.577907
false
geertj/bluepass
bluepass/frontends/qt/passwordbutton.py
1
10929
# # This file is part of Bluepass. Bluepass is Copyright (c) 2012-2013 # Geert Jansen. # # Bluepass is free software available under the GNU General Public License, # version 3. See the file LICENSE distributed with this file for the exact # licensing terms. from __future__ import absolute_import, print_function from...
gpl-3.0
-703,691,127,010,999,800
33.046729
79
0.637753
false
apophys/freeipa
ipalib/__init__.py
1
34622
# Authors: # Jason Gerard DeRose <jderose@redhat.com> # # Copyright (C) 2008 Red Hat # see file 'COPYING' for use and warranty information # # 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, ei...
gpl-3.0
9,104,041,449,937,767,000
34.220753
106
0.658136
false
lnls-fac/scripts
bin/delete_dups.py
1
3559
#!/usr/bin/python import subprocess import sys import os class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' @staticmethod def purple(string): return bcolors.HEADER + string + bcolors.ENDC @staticmethod def b...
mit
112,618,110,065,499,700
23.210884
90
0.650745
false
belokop/indico_bare
doc/dev/source/conf.py
1
6719
# -*- coding: utf-8 -*- # # cds-indico documentation build configuration file, created by # sphinx-quickstart on Sun Nov 29 13:19:24 2009. # # 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. # # ...
gpl-3.0
8,301,756,260,777,005,000
31.936275
110
0.701444
false
akuendig/RxPython
rx/linq/takeLast.py
1
4061
from rx.disposable import CompositeDisposable, SingleAssignmentDisposable from rx.internal import Struct from rx.observable import Producer import rx.linq.sink from collections import deque class TakeLastCount(Producer): def __init__(self, source, count, scheduler): self.source = source self.count = count ...
mit
-6,765,602,060,497,232,000
27.013793
82
0.658951
false
stoivo/GitSavvy
core/commands/remote.py
1
1346
import sublime from sublime_plugin import TextCommand from ..git_command import GitCommand from ...common import util from ..ui_mixins.quick_panel import show_remote_panel class GsRemoteAddCommand(TextCommand, GitCommand): """ Add remotes """ def run(self, edit): # Get remote name from user ...
mit
-3,694,500,971,462,770,700
28.26087
118
0.645617
false
gem/oq-engine
openquake/hazardlib/near_fault.py
1
18706
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2021 GEM Foundation # # OpenQuake 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 Licen...
agpl-3.0
-4,038,285,033,445,288,400
37.64876
79
0.599326
false
MySportsFeeds/mysportsfeeds-python
ohmysportsfeedspy/v1_0.py
1
7330
import os import csv import requests from datetime import datetime import simplejson as json import platform import base64 import ohmysportsfeedspy # API class for dealing with v1.0 of the API class API_v1_0(object): # Constructor def __init__(self, verbose, store_type=None, store_location=None): se...
mit
4,933,645,844,157,687,000
33.413146
159
0.54543
false
ua-snap/downscale
snap_scripts/epscor_sc/older_epscor_sc_scripts_archive/downscaled_data_to_netcdf_epscor_se.py
1
9999
# convert the downscaled data archive def run( x ): ''' simple wrapper to open and return a 2-D array from a geotiff ''' import rasterio return rasterio.open(x).read(1) def sort_files( files, split_on='_', elem_month=-2, elem_year=-1 ): ''' sort a list of files properly using the month and year parsed from the...
mit
2,371,635,134,616,050,000
36.037037
137
0.667767
false
apache/airflow
tests/plugins/test_plugins_manager.py
2
14930
# # 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...
apache-2.0
-9,114,536,456,285,706,000
37.981723
110
0.649565
false
danielholmstrom/nose-pyversion
setup.py
1
1770
""" ~~~~~~~~~~~~~~~~~~~~~ Nose-Pyversion-Plugin ~~~~~~~~~~~~~~~~~~~~~ """ import os import sys from setuptools import find_packages, setup # Required for nose.collector, see http://bugs.python.org/issue15881#msg170215 try: import multiprocessing except ImportError: pass here = os.path.abspath(os.path.dirnam...
mit
-7,525,720,973,531,597,000
27.548387
78
0.596045
false
egbertbouman/tribler-g
Tribler/Tools/dirtrackerseeder.py
1
6798
# Written by Arno Bakker # see LICENSE.txt for license information # # Razvan Deaconescu, 2008: # * corrected problem when running in background # * added usage and print_version functions # * uses getopt for command line argument parsing import sys import shutil import time import tempfi...
lgpl-2.1
-6,706,108,623,727,171,000
32.333333
191
0.521624
false
pstiasny/bigos
bigos/__init__.py
1
1522
#/bin/env python2 # encoding: utf8 __version__ = '0.0.3' import re import itertools from bigos.backend import generate_events watchlist = [] class EventHandler: def __init__(self, function, regex, dirs=False, types=['created', 'modified']): ''' :param function: function to run when the event is...
gpl-3.0
4,430,752,800,128,339,500
28.843137
83
0.603811
false
blooparksystems/odoo
addons/account/models/chart_template.py
1
43914
# -*- coding: utf-8 -*- import time import math from openerp.osv import expression from openerp.tools.float_utils import float_round as round from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp.exceptions import AccessError, UserError, ValidationError import openerp.addons.decimal_precision as dp fr...
gpl-3.0
-9,035,051,368,661,658,000
56.554391
193
0.633488
false
saaros/pghoard
pghoard/webserver.py
1
18310
""" pghoard - internal http server for serving backup objects Copyright (c) 2016 Ohmu Ltd See LICENSE for details """ from collections import deque from concurrent.futures import ThreadPoolExecutor from contextlib import contextmanager from http.server import HTTPServer, BaseHTTPRequestHandler from pghoard import wal...
apache-2.0
-1,124,583,806,674,144,100
42.595238
119
0.576461
false
truthcoin/truthcoin-cpp
contrib/linearize/linearize-hashes.py
1
3041
#!/usr/bin/python # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import pr...
mit
8,576,335,789,278,602,000
25.911504
90
0.664255
false
theJollySin/python_for_scientists
classes/14_netcdf/extract_cell_from_3d_ioapi.py
1
1291
import sys from netCDF4 import Dataset def main(): print(extract_cell_from_3d_ioapi(sys.argv[1], int(sys.argv[2]), int(sys.argv[3]), layer=0, var=None)) def extract_cell_from_3d_ioapi(file_path, row, col, layer=0, var=None): '''Extract a single grid cell from a GRIDDED IOAPI NetCDF file. If you don't p...
gpl-3.0
-4,119,864,125,831,360,000
32.102564
105
0.633617
false
daodewang/qingcloud-sdk-python
qingcloud/iaas/router_static.py
1
8191
# ========================================================================= # Copyright 2012-present Yunify, Inc. # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compliance with the Licens...
apache-2.0
8,290,995,983,507,668,000
30.503846
99
0.521182
false
matplotlib/freetypy
docstrings/truetype.py
1
5852
# -*- coding: utf-8 -*- # Copyright (c) 2015, Michael Droettboom All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, t...
bsd-2-clause
-7,203,823,751,697,514,000
25.527273
72
0.72207
false
foursquare/pants
contrib/errorprone/src/python/pants/contrib/errorprone/tasks/errorprone.py
1
7607
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os import re from builtins import str from pants.backend.jvm import argfile from ...
apache-2.0
2,359,390,993,532,608,000
40.342391
131
0.640331
false
nephthys/Nouweo
nouweo/wsgi.py
1
1419
""" WSGI config for nouweo project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
agpl-3.0
214,798,505,212,677,300
43.34375
79
0.792812
false
ace02000/pyload
module/plugins/accounts/Keep2ShareCc.py
1
2362
# -*- coding: utf-8 -*- import re import time from module.plugins.internal.Account import Account from module.plugins.internal.Plugin import set_cookie class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" __version__ = "0.10" __status__ = "testing" __description__ ...
gpl-3.0
-2,316,719,965,670,955,000
30.918919
101
0.516511
false
namgivu/shared-model-FlaskSqlAlchemy-vs-SQLAlchemy
python-app/model/user.py
1
1292
from base_model import BaseModel import sqlalchemy as db class User(BaseModel): #table mapping __tablename__ = "users" ##region column mapping id = db.Column(db.Integer, primary_key=True) user_name = db.Column(db.Text) primary_email_id = db.Column(db.Integer, db.ForeignKey('user_emails.id') ) #Use mod...
gpl-3.0
6,215,019,284,809,545,000
37
117
0.647059
false
Disiok/poetry-seq2seq
utils.py
1
1442
#! /usr/bin/env python # -*- coding:utf-8 -*- import os VOCAB_SIZE = 6000 SEP_TOKEN = 0 PAD_TOKEN = 5999 DATA_RAW_DIR = 'data/raw' DATA_PROCESSED_DIR = 'data/processed' DATA_SAMPLES_DIR = 'data/samples' MODEL_DIR = 'model' LOG_DIR = 'log' if not os.path.exists(DATA_PROCESSED_DIR): os.mkdir(DATA_PROCESSED_DIR)...
mit
-4,215,054,157,706,704,400
20.058824
106
0.609637
false
rohitwaghchaure/erpnext_develop
erpnext/regional/united_arab_emirates/setup.py
1
2919
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, os, json from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from erpnext.setup.setup_wizard.operations.tax...
gpl-3.0
1,549,981,976,826,451,200
37.407895
82
0.711545
false
googleinterns/ddsp-docker
mvp/trainer/helper_functions.py
1
2589
"""Helper functions for interatcing with Magenta DDSP internals. """ import json import os from absl import logging from ddsp.training import train_util import tensorflow.compat.v2 as tf from google.cloud import storage def get_strategy(tpu='', gpus=None): """Chooses a distribution strategy. AI Platform auto...
apache-2.0
-4,077,344,281,650,267,000
35.464789
101
0.677095
false
w1ll1am23/home-assistant
homeassistant/components/smartthings/sensor.py
1
12696
"""Support for sensors through the SmartThings cloud API.""" from __future__ import annotations from collections import namedtuple from typing import Sequence from pysmartthings import Attribute, Capability from homeassistant.components.sensor import SensorEntity from homeassistant.const import ( AREA_SQUARE_MET...
apache-2.0
-5,184,662,723,028,571,000
32.856
88
0.604285
false
LucienD/ww
tests/test_s.py
1
2614
# coding: utf-8 from __future__ import ( unicode_literals, division, print_function, absolute_import ) import re import pytest from ww import s, g, f def test_lshift(): res = s >> """ This is a long text And it's not indented """ assert isinstance(res, s) s == "This is a long text\nAnd...
mit
1,834,878,893,787,160,300
24.339806
78
0.502299
false
pixelpicosean/my-godot-2.1
platform/android/detect.py
1
9664
import os import sys import string import platform def is_active(): return True def get_name(): return "Android" def can_build(): import os if (not os.environ.has_key("ANDROID_NDK_ROOT")): return False return True def get_opts(): return [ ('ANDROID_NDK_ROOT', 'the path...
mit
7,101,317,733,062,213,000
35.467925
119
0.561465
false
Endika/connector-accountedge
hr_expense_accountedge/hr_expense_accountedge.py
1
8226
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it und...
agpl-3.0
-4,562,259,662,920,168,000
40.336683
117
0.531972
false
JakeWharton/mkvdts2ac3
test.py
1
1757
#!/usr/bin/env python import sys if sys.version_info < (2, 3): raise RuntimeError('Python 2.3+ is required.') import logging import os import shutil import subprocess import unittest import tests TEST_FILE_NAME = 'test.mkv' BASE_PATH = os.path.dirname(__file__) WORK_PATH = os.path.join(BASE_PATH, 'work') TEST_...
apache-2.0
-8,740,686,622,334,408,000
28.779661
215
0.659078
false
srcole/qwm
usa_map/map_util.py
1
4006
""" map_util.py Visualizing US state data on a geographical colormap """ import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap as Basemap from matplotlib.colors import rgb2hex from matplotlib.patches import Polygon def usa_state_colormap(state_dict, title...
mit
-7,728,630,059,513,854,000
36.439252
100
0.638293
false
protwis/protwis
signprot/migrations/0008_auto_20200829_1739.py
1
3041
# Generated by Django 3.0.3 on 2020-08-29 15:39 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('common', '0003_citation_page_name'), ('structure', '0028_auto_20200829_1704'), ('protein', '0009_auto_202005...
apache-2.0
4,604,085,215,076,593,000
41.830986
150
0.599474
false
Fizzadar/pyinfra
pyinfra/api/connectors/winrm.py
1
7851
from __future__ import print_function, unicode_literals import base64 import ntpath import click from pyinfra import logger from pyinfra.api import Config from pyinfra.api.exceptions import ConnectError, PyinfraError from pyinfra.api.util import get_file_io, memoize, sha1_hash from .pyinfrawinrmsession import Pyinf...
mit
-1,413,492,209,220,742,400
28.851711
94
0.61075
false
silmeth/Simple-Library-Manager
server/slm_db_interface/views.py
1
10693
from django.shortcuts import render from django.http import HttpResponse from django.db import transaction, connection from django.views.decorators.csrf import csrf_exempt from django.contrib.auth import authenticate, login from slm_db_interface.models import Book, Author, Publisher, Borrower, SLMUser from bisect impor...
lgpl-3.0
4,883,945,105,540,650,000
38.899254
119
0.600673
false
shanot/imp
modules/core/test/test_transform_particles.py
2
1094
from __future__ import print_function import IMP import IMP.core import IMP.algebra import IMP.test class Tests(IMP.test.TestCase): """Test particle transformations""" def test_transformation(self): """Test the TransformationFunction class""" imp_model = IMP.Model() particles = IMP.c...
gpl-3.0
4,263,365,101,596,354,600
30.257143
69
0.575868
false
davidjrichardson/uwcs-zarya
newsletter/tasks.py
1
2020
import gc from celery.decorators import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import render_to_string from django.urls import reverse from blog.models import Sponsor from .models import Subscription, Mail def mail_newsletter(recipients, ...
mit
-830,727,445,206,895,400
37.113208
88
0.64703
false
biblepay/biblepay
test/functional/llmq-simplepose.py
1
5396
#!/usr/bin/env python3 # Copyright (c) 2015-2020 The Däsh Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import time from test_framework.test_framework import BiblePayTestFramework from test_framework.util import...
mit
-2,549,316,573,065,459,700
38.379562
253
0.619833
false
nasfarley88/pyhabitica
tests/test_task.py
1
1430
# This is a user supplied file with user credentials import config import habiticaapi import unittest2 import logger import copy class TestTask(unittest2.TestCase): def setUp(self): """Setup character.""" self.character = habiticaapi.Character( config.USERID, config.APIKEY ...
cc0-1.0
-2,569,176,016,536,914,000
28.183673
78
0.625175
false
ianmiell/shutit-distro
screen/screen.py
1
1148
"""ShutIt module. See http://shutit.tk """ from shutit_module import ShutItModule class screen(ShutItModule): def build(self, shutit): shutit.send('mkdir -p /tmp/build/screen') shutit.send('cd /tmp/build/screen') shutit.send('wget -qO- http://ftp.gnu.org/gnu/screen/screen-4.2.1.tar.gz | tar -zxf -') shutit...
gpl-2.0
4,438,800,849,325,293,000
26.333333
175
0.682927
false
PROGRAM-IX/vectorwars
vw_game_engine.py
1
10587
import pygame from pygame.locals import * from pystroke.hud import * from pystroke.game_engine import GameEngine from pystroke.vector2 import Vector2 from pystroke.vex import Vex from pystroke.input_engine import InputEngine from pystroke.event_engine import EventEngine from pystroke.draw_engine import DrawEngine from...
mit
8,833,229,971,831,664,000
34.891525
79
0.489657
false
liqd/a4-meinberlin
meinberlin/apps/polls/migrations/0006_copy_poll_data_to_a4_polls.py
1
2716
# Generated by Django 2.2.24 on 2021-06-18 12:18 from django.db import migrations def copy_data(apps, schema_editor): Item = apps.get_model('a4modules', 'Item') MBPoll = apps.get_model('meinberlin_polls', 'MBPoll') Poll = apps.get_model('a4polls', 'Poll') MBQuestion = apps.get_model('meinberlin_polls...
agpl-3.0
-491,148,125,555,496,700
38.362319
78
0.60162
false
ulrikpedersen/toggl-gnome-applet
toggl.py
1
5391
#!/usr/bin/env python import logging from datetime import datetime logging.basicConfig(level=logging.WARNING) import os import urllib2, base64, json import dateutil.parser def from_ISO8601( str_iso8601 ): return dateutil.parser.parse(str_iso8601) def to_ISO8601( timestamp ): return timestamp.isoformat() de...
unlicense
6,207,641,037,173,916,000
37.241135
116
0.565758
false
JulyKikuAkita/PythonPrac
cs15211/BaseballGame.py
1
3441
__source__ = 'https://leetcode.com/problems/baseball-game/description/' # Time: O() # Space: O() # # Description: Leetcode # 682. Baseball Game # # You're now a baseball game point recorder. # # Given a list of strings, each string can be one of the 4 following types: # # Integer (one round's score): Directly represen...
apache-2.0
3,322,218,805,070,624,000
34.854167
135
0.588782
false
fancycode/dnsadmin
scripts/dnsadmin.py
1
4877
# # Copyright (C) 2016 Joachim Bauch <mail@joachim-bauch.de> # # 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, or (at your option) any later version. # ...
agpl-3.0
8,245,141,423,036,300,000
33.835714
83
0.58294
false
pinterest/mysql_utils
mysql_backup_csv.py
1
33689
#!/usr/bin/env python import argparse import datetime import json import logging import multiprocessing import os import subprocess import threading import time import traceback import uuid import boto import _mysql_exceptions import psutil import safe_uploader import mysql_backup_status from lib import backup from l...
gpl-2.0
-410,670,963,058,634,600
42.808843
98
0.531123
false
docusign/docusign-python-client
docusign_esign/models/workflow.py
1
5166
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
mit
5,507,776,582,154,696,000
28.861272
140
0.577429
false
nttcom/eclcli
eclcli/orchestration/heatclient/common/http.py
1
13729
# 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
-2,518,008,748,685,360,600
37.564607
79
0.592541
false
uclouvain/osis
base/tests/templatetags/test_education_group_pdf.py
1
5264
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-3,077,404,031,487,803,000
44.765217
108
0.646399
false
ramineni/my_congress
congress_dashboard/policies/views.py
1
5367
# Copyright 2014 VMware. # # 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, sof...
apache-2.0
-726,373,775,188,115,800
39.353383
78
0.618968
false
JohnPeel/Sarabi
misc.py
1
2767
import os import shutil import stat import yaml from strings import * ignored_paths = ['.git'] class EPackageNotFound(Exception): pass class EAmbiguousAtom(Exception): def __init__(self, valid_packages): self.valid_packages = valid_packages message = PACKAGE_TOO_AMBIGUOUS % len(valid_packages) messa...
gpl-3.0
873,124,693,430,433,500
23.927928
95
0.606433
false
ianmiell/shutit-distro
postgresql/postgresql.py
1
1264
"""ShutIt module. See http://shutit.tk """ #http://www.linuxfromscratch.org/blfs/view/svn/postlfs/mitkrb.html configs and context and configureation from shutit_module import ShutItModule class postgresql(ShutItModule): def build(self, shutit): shutit.send('mkdir -p /tmp/build/postgresql') shutit.send('cd /tmp...
gpl-2.0
7,476,906,327,428,438,000
37.30303
151
0.719146
false
cprn/samegame
model.py
1
1390
import random data = [] NUM_COLOURS = 5 GRID_SIZE = 20 def init(): for y in range(GRID_SIZE): r = [] for x in range(GRID_SIZE): r.append(random.randint(0, NUM_COLOURS - 1)) data.append(r) def get_block_colour(x, y): if x in range(get_width()) and y in range(get_height())...
unlicense
6,598,916,812,739,268,000
22.166667
66
0.539568
false
silverapp/silver
silver/api/views/transaction_views.py
1
4548
# Copyright (c) 2015 Presslabs 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
2,897,298,705,134,729,000
35.97561
95
0.645339
false
maojrs/riemann_book
exact_solvers/burgers_demos.py
2
10422
""" Additional functions and demos for Burgers' equation. """ import sys, os from clawpack import pyclaw from clawpack import riemann import matplotlib import matplotlib.pyplot as plt from matplotlib import animation from IPython.display import HTML import numpy as np from utils import riemann_tools from . import burge...
bsd-3-clause
5,794,931,405,617,469,000
38.477273
112
0.572059
false
unicef/un-partner-portal
backend/unpp_api/settings/base.py
1
10700
from __future__ import absolute_import import os import sys #### # Change per project #### from django.urls import reverse_lazy from django.utils.text import slugify PROJECT_NAME = 'unpp_api' # project root and add "apps" to the path PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path...
apache-2.0
250,126,248,760,582,600
30.378299
120
0.647477
false
hendrycks/robustness
old/Icons-50/models/wrn.py
1
3908
import math import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): def __init__(self, in_planes, out_planes, stride, dropRate=0.0): super(BasicBlock, self).__init__() self.bn1 = nn.BatchNorm2d(in_planes) self.relu1 = nn.ReLU(inplace=True) se...
apache-2.0
-3,741,773,476,238,839,300
39.708333
116
0.56781
false
Connexions/cnx-authoring
cnxauthoring/tests/test_functional.py
1
173550
# -*- coding: utf-8 -*- # ### # Copyright (c) 2013, Rice University # This software is subject to the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. # ### """Functional tests of API.""" import datetime import json import os import sys import re import unittest f...
agpl-3.0
2,964,078,937,698,059,000
39.794775
121
0.510653
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/summary_lsa/types_of_service/type_of_service/state/__init__.py
1
20811
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
-3,628,145,791,548,564,000
40.291667
440
0.575273
false
praekelt/jmbo-foundry
foundry/migrations/0037_auto__add_field_country_country_code__add_unique_country_slug.py
1
27780
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Country.country_code' db.add_column('foundry_country', 'country_code', ...
bsd-3-clause
169,661,863,726,752,320
83.43769
208
0.546724
false
siliconsmiley/QGIS
python/plugins/processing/gui/ParametersPanel.py
1
16790
# -*- coding: utf-8 -*- """ *************************************************************************** ParametersPanel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya (C) 2013 by CS Systemes d'information (CS SI) ...
gpl-2.0
8,098,731,851,604,483,000
42.492228
143
0.58792
false
SKIRT/PTS
core/extract/progress.py
1
16047
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
3,470,374,518,671,627,000
31.881148
134
0.491836
false
felipenaselva/felipe.repository
script.module.resolveurl/lib/resolveurl/plugins/trt.py
1
1776
''' vidzi resolveurl plugin Copyright (C) 2014 Eldorado 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 distri...
gpl-2.0
3,321,776,893,372,562,000
37.608696
98
0.671734
false
mikesname/python-ocrlab
ocrsite/ocrlab/forms/__init__.py
1
1274
"""Ocrlab forms.""" from django import forms from django.template.defaultfilters import filesizeformat from django.utils.translation import ugettext_lazy as _ from django.conf import settings from ocrlab.models import Preset # Add to your settings file CONTENT_TYPES = ['image', 'video'] # 2.5MB - 2621440 # 5MB - 524...
mit
-1,963,474,988,661,655,800
28.627907
103
0.658556
false
all-of-us/raw-data-repository
rdr_service/dao/questionnaire_response_dao.py
1
57185
import json import logging import os import re from datetime import datetime from dateutil import parser from hashlib import md5 import pytz from sqlalchemy import or_ from sqlalchemy.orm import joinedload, subqueryload from typing import Dict from werkzeug.exceptions import BadRequest from rdr_service.lib_fhir.fhircl...
bsd-3-clause
193,286,261,942,352,830
52.594189
120
0.611594
false
akunze3/pytrajectory
examples/ex8_ConstrainedDoublePendulum.py
1
8675
# constrained double pendulum # import all we need for solving the problem from pytrajectory import ControlSystem import numpy as np import sympy as sp from sympy import cos, sin, Matrix from numpy import pi # to define a callable function that returns the vectorfield # we first solve the motion equations of form Mx...
bsd-3-clause
-5,700,278,940,750,666,000
30.660584
102
0.566686
false
phageghost/pg_tools
pgtools/rnatools.py
1
13893
import os import itertools import numpy import scipy import pandas import seaborn import matplotlib.pyplot as plt from pgtools import toolbox PSEUDO_COUNT = 1 EXPRESSION_THRESHOLD = 1 FIG_EXTS = ['pdf', 'png'] PNG_DPI = 600 def load_and_clean(datafile): exp_data = pandas.read_csv(datafile, sep='\t', index_col=0)...
mit
1,190,259,456,043,873,800
45.620805
180
0.618081
false
IvarsKarpics/mxcube
gui/bricks/TreeBrick.py
1
53816
# Project: MXCuBE # https://github.com/mxcube # # This file is part of MXCuBE software. # # MXCuBE 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 3 of the License, or # (at your o...
lgpl-3.0
-3,314,555,617,902,337,000
41.44164
100
0.579697
false
mhspradlin/go-lite-bot
bot.py
1
1582
# Simply the class definitions for the bot and worker declarations # Nice way to make HTTP get requests import requests # A nice holder for information we need between function calls class Bot: double_resets = {} def __init__ (self, token): self.token = token handlers = {} # Adds a singl...
mit
952,455,742,594,944,600
38.575
79
0.513274
false
AlexRiina/django-money
tests/test_form.py
1
2341
# -*- coding: utf-8 -*- """ Created on May 7, 2011 @author: jake """ from decimal import Decimal import moneyed import pytest from moneyed import Money from .testapp.forms import ( MoneyForm, MoneyFormMultipleCurrencies, MoneyModelForm, OptionalMoneyForm, ) from .testapp.models import ModelWithVanill...
bsd-3-clause
-7,676,951,155,857,008,000
23.642105
79
0.620248
false
uw-it-aca/mdot-developers
mdotdevs/views.py
1
3614
from django.conf import settings from django.template.loader import get_template from django.template import RequestContext, Context from django.shortcuts import render_to_response, render from django.core.mail import send_mail, BadHeaderError from django.http import HttpResponse, HttpResponseRedirect import urllib im...
apache-2.0
-5,927,210,176,114,259,000
38.714286
76
0.589651
false
yayoiukai/signalserver
policies/views.py
1
11360
import os import datetime from django.shortcuts import render from django.http import HttpResponse from django.template import loader from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.contrib.auth.decorators import login_req...
mit
-2,504,476,941,914,115,600
35.178344
79
0.617077
false
unicefuganda/edtrac
edtrac_project/rapidsms_xforms_src/test_settings.py
1
5949
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 # encoding=utf-8 # -------------------------------------------------------------------- # # MAIN CONFIGURATION # # -------------------------------------------------------------------- # # you should configure your da...
bsd-3-clause
183,958,754,814,737,820
32.234637
72
0.635233
false
sixty-north/cosmic-ray
tests/resources/example_project/adam/adam_1.py
1
1178
"""adam.adam_1 """ # pylint: disable=C0111 import operator from math import * # noqa: F401,F403 # Add mutation points for comparison operators. def constant_number(): return 42 def constant_true(): return True def constant_false(): return False def bool_and(): return object() and None def ...
mit
6,149,737,179,712,978,000
11.804348
62
0.611205
false
bytescout/ByteScout-SDK-SourceCode
PDF.co Web API/Add Text And Images To PDF/Python/Add Image by finding target coordinates/AddImageByFindingTargetCoordinates.py
1
3639
import os import requests # pip install requests # The authentication key (API Key). # Get your own by registering at https://app.pdf.co/documentation/api API_KEY = "**************************************" # Base URL for PDF.co Web API requests BASE_URL = "https://api.pdf.co/v1" # Direct URL of source PDF file. Sour...
apache-2.0
3,477,542,829,167,449,600
29.082645
110
0.623523
false
numberly/graphitesend
tests/test_all.py
1
10724
#!/usr/bin/env python from graphitesend import graphitesend import unittest import socket import os class TestAll(unittest.TestCase): """ Basic tests ( better than nothing ) """ def setUp(self): """ reset graphitesend """ # Drop any connections or modules that have been setup from other test...
apache-2.0
-6,224,074,902,658,010,000
39.014925
81
0.631854
false
reedessick/pointy-Poisson
stripRawUnsafe.py
1
1801
#!/usr/bin/python usage = "stripRawUnsafe.py unsafe.txt interesting.txt" description = "reads in a list of unsafe channels from unsafe.txt. If these are not \"raw\" channel names, it converts them to that form. I then reads in a channel list from interesting.txt and performs a filter based on the unsafe channels. Chann...
mit
-4,477,093,486,662,943,000
33.634615
350
0.60633
false
terasaur/tstracker
mqclient/src/tstracker/stats_db.py
1
2493
# # Copyright 2012 ibiblio # # 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.txt # # Unless required by applicable law or agreed to in writing...
apache-2.0
6,713,933,945,272,915,000
29.777778
74
0.686723
false
ESSS/qmxgraph
qmxgraph/widget.py
1
23408
from __future__ import absolute_import import json import os import weakref from PyQt5.QtCore import QDataStream, QIODevice, QObject, Qt, pyqtSignal from PyQt5.QtGui import QPainter from PyQt5.QtWidgets import QDialog, QGridLayout, QShortcut, QSizePolicy, \ QWidget, QStyleOption, QStyle from qmxgraph import cons...
mit
-7,056,639,670,278,203,000
34.253012
96
0.600436
false
google-research/nisaba
nisaba/brahmic/fst_properties_test.py
1
3617
# Copyright 2021 Nisaba 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 writi...
apache-2.0
7,504,591,750,468,167,000
39.640449
79
0.641416
false