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
RNAcentral/rnacentral-webcode
rnacentral/portal/tests/description_tests.py
1
12803
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
apache-2.0
5,755,658,740,962,457,000
34.563889
123
0.645161
false
NicolasHug/Surprise
surprise/model_selection/search.py
1
24020
from __future__ import (absolute_import, division, print_function, unicode_literals) from abc import ABCMeta, abstractmethod from itertools import product import numpy as np from joblib import Parallel from joblib import delayed from six import moves, string_types, with_metaclass from .split i...
bsd-3-clause
-5,006,987,973,127,986,000
47.72211
79
0.600958
false
miguelalba89/hfdp-python
command/simpleremote.py
1
1687
""" Simple Remote Control Author: m1ge7 Date: 2014/03/28 """ from abc import ABCMeta, abstractmethod class Light: def on(self): print "Light is on" def off(self): print "Light is off" class GarageDoor: def up(self): print "Garage Door is Open" def down(self): p...
gpl-3.0
1,548,103,661,872,656,000
16.572917
52
0.605809
false
skibblenybbles/django-commando
commando/contrib/south/management/migrationcheck.py
1
1346
from commando import management BaseMigrationCheckCommand = management.get_command_class( "migrationcheck", exclude_packages=("commando",)) if BaseMigrationCheckCommand is not None: base = BaseMigrationCheckCommand() class MigrationCheckCommandOptions(management.CommandOptions): """ ...
mit
-4,172,246,087,825,936,000
30.302326
90
0.625557
false
dom96/MDSBot
IRCLibrary/events.py
1
2834
#!/usr/bin/env python """ MDS IRC Lib Copyright (C) 2009 Mad Dog Software http://maddogsoftware.co.uk - morfeusz8@yahoo.co.uk 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 ...
gpl-2.0
4,904,286,630,722,609,000
35.805195
123
0.589273
false
innerr/stars
core/client.py
1
2555
#coding:utf-8 #nature@20100725 from rpc import * class RpcApiNotFound(Exception): pass class RpcBadParams(Exception): pass class Client: def __init__(self, url, keyFile, apis='*', value='60', mode='minu', caller='anonymous'): self._auth = AutoAuth(caller, url, keyFile, apis, value, mode) ...
mit
1,409,873,323,210,285,300
32.066667
92
0.514286
false
Aravinthu/odoo
addons/mrp/models/mrp_workorder.py
1
25017
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.tools import float_compare, float_round from odoo.ad...
agpl-3.0
4,003,067,619,791,761,000
49.134269
311
0.574529
false
ianbro/ezi
ezi/views.py
1
10098
from django.shortcuts import render, get_object_or_404 from django.views.generic import View from utils import (IanmannJsonResponse, respond_bad_request_verb, get_params_to_queryset_kwargs, valid_method, respond_list_deleted, ...
gpl-3.0
-8,600,552,650,146,367,000
38.291829
96
0.653793
false
Jonathan-Z/PowerShellMusic
MusicCompiler.py
1
2279
usr_input = input("Welcome to the Single Voice Sinusoidal Music Compiler:\n" "The full file path should be specified with the file extension (preferably .csv)\n" "Music Should in the format of:\n" "Notes,AN4,BN2,0,CN4...\n" "Time(S or MS),1000,...
mit
-8,116,043,457,267,480,000
40.203704
125
0.46731
false
civilwargeeky/MusicDownloader
MusicDisplay.py
1
2895
#Display library for the MusicDownloader program #Has text boxes and display boxes and what have you import tkinter as tk from tkinter import ttk root = None #Global root (only supports one window) class MainBox(tk.Tk): def __init__(self, title = "Window", *args, **kwargs): global root root = self #Set glo...
mit
-1,315,857,887,776,140,500
33.47619
102
0.641796
false
ironbox360/PyCV-time
projects/laser_drawing/laser_drawing.py
1
2073
import cv2 import numpy as np from screen_finder.screen_finder import ScreenFinder from cam import OpenCV_Cam def draw_burning(canvas, location): cv2.circle(canvas, (lx, ly), 5, (255, 0, 0, 255)) return canvas def find_laser_loc(img, threshold): red_part = img[:,:,2] max_pos = red_part.arg...
mit
1,642,613,113,042,792,200
24.925
74
0.612639
false
googleapis/python-network-connectivity
docs/conf.py
1
12537
# -*- coding: utf-8 -*- # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
-1,129,188,744,146,832,900
31.992105
89
0.696498
false
DaveMDS/epymc
epymc/mainmenu.py
1
5021
#!/usr/bin/env python # This Python file uses the following encoding: utf-8 # # Copyright (C) 2010-2018 Davide Andreoli <dave@gurumeditation.it> # # This file is part of EpyMC, an EFL based Media Center written in Python. # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
gpl-3.0
-5,937,809,567,591,448,000
29.803681
100
0.637522
false
RedHatQE/pulp-automation
tests/general_tests/test_06_roles.py
2
6147
import unittest, json from tests import pulp_test from pulp_auto import Pulp from pulp_auto.role import Role from pulp_auto.user import User from pulp_auto.repo import Repo def setUpModule(): pass class RoleTest(pulp_test.PulpTest): @classmethod def setUpClass(cls): super(RoleTest, cls).setUpCla...
gpl-2.0
-8,056,997,648,611,090,000
33.728814
113
0.603709
false
tellapart/taba
src/taba/server/model/name_storage.py
1
7524
# Copyright 2014 TellApart, 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 agreed to in writi...
apache-2.0
-6,117,197,468,502,839,000
30.090909
80
0.660819
false
hivesolutions/netius
examples/basic/loop_old.py
1
1779
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Netius System # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foun...
apache-2.0
4,439,356,071,074,577,000
29.175439
76
0.660101
false
uw-it-aca/canvas-sis-provisioner
sis_provisioner/pidfile.py
1
2900
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from logging import getLogger from inspect import stack, getmodule import errno import os # modified from: # http://stackoverflow.com/questions/1444790/python-module-for-creating-pid- # based-lockfile class Pidfile(): def __in...
apache-2.0
2,368,466,773,915,116,000
29.851064
76
0.516897
false
swayf/pyLoad
module/plugins/addons/RehostTo.py
1
1153
# -*- coding: utf-8 -*- from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster class RehostTo(MultiHoster): __name__ = "RehostTo" __version__ = "0.41" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False")] __description_...
agpl-3.0
-5,902,631,902,444,201,000
28.564103
106
0.607979
false
teitei-tk/Marguerite
marguerite/accessors/abstract.py
1
1266
# -*- coding: utf-8 -*- class AbstractAccessor(object): def __init__(self, driver, structure): self.driver = driver self.structure = structure self.is_valid() self.initialize() def is_valid(self): pass def initialize(self): pass def reload(self, drive...
apache-2.0
-1,005,140,712,225,125,200
25.93617
70
0.617694
false
ucsb-ilabs/shapematching
src/main/python/edu/ucsb/ilab/shapematching/pt2graph.py
1
5365
#!/home/longbin/install/apps/Python-2.5_gcc/bin/python import sys import math import getopt import string import fileinput clrs = ['ff0000', '00ff00', '0000ff'] def printheader(n): print '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' print ' <graphml xmlns="http://graphml.graphdrawing.org/xmln...
gpl-2.0
8,524,151,017,851,959,000
45.25
362
0.541845
false
muraliselva10/designate
designate/tests/test_api/test_v1/test_records.py
1
31830
# coding=utf-8 # Copyright 2012 Managed I.T. # # Author: Kiall Mac Innes <kiall@managedit.ie> # # 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...
apache-2.0
-5,751,548,821,920,280,000
37.130695
79
0.571146
false
kevinjqiu/jirafs
jirafs/commands/search_users.py
1
1455
from __future__ import print_function import json from prettytable import PrettyTable from jirafs import utils from jirafs.plugin import CommandPlugin from jirafs.ticketfolder import TicketFolder class Command(CommandPlugin): """Search for users matching the specified search term""" MIN_VERSION = '1.0a1' ...
mit
-1,741,878,178,660,959,500
25.944444
79
0.535395
false
eLRuLL/scrapy
scrapy/pipelines/media.py
1
7888
import functools import logging from collections import defaultdict from twisted.internet.defer import Deferred, DeferredList, _DefGen_Return from twisted.python.failure import Failure from scrapy.settings import Settings from scrapy.utils.datatypes import SequenceExclude from scrapy.utils.defer import mustbe_deferred...
bsd-3-clause
-8,840,855,166,129,957,000
39.040609
84
0.610167
false
ActiveState/code
recipes/Python/310320_webcounter/recipe-310320.py
1
3389
#!/usr/bin/python -u # 2004/10/15 #v1.0.0 # webcounter.py # A very simple webcounter. # Copyright Michael Foord # You are free to modify, use and relicense this code. # No warranty express or implied for the accuracy, fitness to purpose or otherwise for this code.... # Use at your own risk !!! # For information abo...
mit
-237,837,532,002,947,260
27.008264
126
0.598112
false
dangunter/smoqe
smoqe/query.py
1
26384
""" Parse and transform a simplified query syntax into MongoDB queries. """ __author__ = "Dan Gunter" ## Imports # Standard library import copy from numbers import Number import re class BadExpression(Exception): """Raised by `query()` if the input is not understood. """ def __init__(self, expr, details=...
lgpl-3.0
-81,702,735,445,841,360
32.912596
96
0.543587
false
googleapis/googleapis-gen
google/cloud/aiplatform/v1/aiplatform-v1-py/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_text_sentiment.py
1
2042
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
5,663,014,639,283,729,000
29.939394
109
0.671401
false
wx-ast/django-seo
rollyourown/seo/backends.py
1
13884
#!/usr/bin/env python from collections import OrderedDict from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.db import models from django.contrib.sites.models import Site from django.contrib.contenttypes.models import ContentType try: from django.contrib.contenttyp...
bsd-3-clause
145,235,732,500,074,240
38.555556
176
0.607894
false
MicrosoftGenomics/PySnpTools
pysnptools/pstreader/psthdf5.py
1
11817
try: import h5py except: pass import logging import scipy as np from pysnptools.pstreader import PstReader from pysnptools.pstreader.pstdata import PstData import warnings try: from builtins import range except: pass class PstHdf5(PstReader): ''' A :class:`.PstReader` for reading \*.pst.hdf5 f...
apache-2.0
7,312,811,661,821,912,000
40.609155
209
0.601845
false
drewhutchison/coolerofdoom
data.py
1
3415
import sqlite3 TWITTER_CONSUMER_KEY = 'twitter_consumer_key' TWITTER_CONSUMER_SECRET = 'twitter_consumer_secret' TWITTER_ACCESS_TOKEN = 'twitter_access_token' TWITTER_ACCESS_TOKEN_SECRET = 'twitter_access_token_secret' LAST_LATITUDE = 'last_latitude' LAST_LONGITUDE = 'last_longitude' UPC_DATABASE_KEY = 'upc_database_k...
mit
2,877,343,525,712,414,000
31.226415
90
0.533236
false
vaurele/plugin.video.freplay
resources/lib/channels/cplus.py
1
3181
#-*- coding: utf-8 -*- import urllib,urllib2 import xml.dom.minidom from resources.lib import utils import json title=['Canal +'] img=['cplus'] readyForUse=True def get_token(): filePath=utils.downloadCatalog('http://service.mycanal.fr/authenticate.json/Android_Tab/1.1?highResolution=1','TokenCPlus.json',False,{}...
gpl-2.0
-2,913,353,975,952,722,000
36.869048
184
0.594153
false
asciimoo/searx
searx/engines/__init__.py
1
9783
''' searx 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. searx is distributed in the hope that it will be useful, but WITHOUT ANY W...
agpl-3.0
7,912,578,631,774,074,000
34.574545
109
0.60186
false
pyung/statistics
setup.py
1
1526
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'matplotlib',# TODO: put package requirements here ] test_requirements ...
mit
6,564,516,375,523,752,000
27.792453
118
0.613368
false
MobileCloudNetworking/maas
bundle/services/TemplateManager.py
1
19120
# Copyright 2014 Technische Universitaet Berlin # 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 # # U...
apache-2.0
-705,668,027,214,550,000
47.900256
164
0.501151
false
amjames/psi4
psi4/share/psi4/databases/HTBH.py
1
38462
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2018 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
6,250,482,744,679,843,000
46.601485
123
0.451771
false
GroestlCoin/electrum-grs
electrum_grs/gui/kivy/nfc_scanner/__init__.py
1
1350
from kivy.uix.widget import Widget from kivy.properties import ObjectProperty from kivy.core import core_select_lib __all__ = ('NFCBase', 'NFCScanner') class NFCBase(Widget): ''' This is the base Abstract definition class that the actual hardware dependent implementations would be based on. If you want to def...
gpl-3.0
4,330,989,779,723,513,000
27.125
130
0.637778
false
butozerca/fireplace
tests/test_main.py
1
143969
#!/usr/bin/env python from utils import * def test_cheat_destroy_deck(): game = prepare_game() game.player1.discard_hand() game.player2.discard_hand() game.player1.give(DESTROY_DECK).play(target=game.player2.hero) assert not game.player2.deck game.end_turn() assert not game.player2.hand assert game.player2.h...
agpl-3.0
-3,667,990,387,858,309,600
26.148595
86
0.720106
false
openhealthcare/randomise.me
rm/trials/migrations/0047_auto__add_field_trial_parent.py
1
8423
# -*- 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 'Trial.parent' db.add_column(u'trials_trial', 'parent', self.gf('django...
agpl-3.0
-8,153,389,739,321,435,000
72.894737
165
0.543749
false
kgullikson88/General
PrepareChorizos.py
1
3376
""" This script reads in BVJHK photometry from Kharchenko et al 2009, and measured E(B-V) from my spectra. It then prepares the Chorizos input file """ import os class StarInfo: def __init__(self): self.name = "" # Star designation self.EBV = 0.0 # E(B-V) self.B = 0.0 # B mag ...
gpl-3.0
-9,037,810,208,541,535,000
34.166667
113
0.408175
false
tortib/nzbToMedia
nzbtomedia/nzbToMediaSceneExceptions.py
1
5773
import os import re import nzbtomedia from nzbtomedia import logger from nzbtomedia.nzbToMediaUtil import listMediaFiles reverse_list = [r"\.\d{2}e\d{2}s\.", r"\.[pi]0801\.", r"\.p027\.", r"\.[pi]675\.", r"\.[pi]084\.", r"\.p063\.", r"\b[45]62[xh]\.", r"\.yarulb\.", r"\.vtd[hp]\.", r"\.ld[.-]?bew\.", ...
gpl-3.0
6,233,365,788,758,214,000
44.81746
172
0.569548
false
nmarley/dash
test/functional/test_framework/test_node.py
1
9148
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Class for dashd node under test""" import decimal import errno import http.client import json import loggin...
mit
-5,533,812,477,710,171,000
37.92766
248
0.619589
false
zmitchell/realms
realms/decks.py
1
13782
# -*- coding: utf-8 -*- """ .. module:: deck :synopsis: Encapsulates the behavior of card collections .. moduleauthor:: Zach Mitchell <zmitchell@fastmail.com> """ from random import shuffle from typing import List from .cards import ( Card, CardFaction, CardEffect, CardAction, CardTarget ) from...
mit
7,875,620,094,829,225,000
30.040541
100
0.572486
false
nicolasderam/ikaaro
ikaaro/autoadd.py
1
11925
# -*- coding: UTF-8 -*- # Copyright (C) 2011 Juan David Ibáñez Palomar <jdavid@itaapy.com> # # 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...
gpl-3.0
484,154,630,696,823,000
30.794667
81
0.57192
false
paulboal/pexpect-curses
swearjar/test/menu01.py
1
4723
#!/usr/bin/python import curses, curses.textpad, curses.ascii import math, os, sys, fcntl, struct, termios, array, time import logging logging.basicConfig(filename='menu01.log',level=logging.DEBUG) __doc__="""\ The program presents a series of menus that we're going to use for testing. 1. Enter new person 2. Update ...
mit
-1,247,154,064,368,957,200
26.143678
96
0.61571
false
AgentM-GEG/Tidal-Feature-Extraction-using-CNN
cutout_images.py
1
3446
def cut_out_gals(image_file,information,cutout_save_location): ''' Task : To cut out images given the main mosaic, and an information array with necessary parameters. Input : 1) Image Mosaic location 2) Information array : This array should be loaded using np.genfromtxt with the head...
mit
-3,117,631,306,226,541,600
41.036585
158
0.628265
false
lindegroup/lookback
server.py
1
2699
# This Python file uses the following encoding: utf-8 # Part of the Lookback project (https://github.com/lindegroup/lookback) # Copyright 2015 The Linde Group Computer Support, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
apache-2.0
-6,897,162,168,143,685,000
31.914634
78
0.743979
false
initcrash/django-denorm
setup.py
2
1220
#!/usr/bin/python from setuptools import setup setup( name='django-denorm', version='1.0.0', description='Denormalization magic for Django', long_description='django-denorm is a Django application to provide automatic management of denormalized database fields.', author=', '.join(( 'Christ...
bsd-3-clause
6,549,055,604,552,360,000
30.282051
126
0.617213
false
titouanc/lechbot
plugins/reminder.py
1
4249
import asyncio import random from ircbot.persist import Persistent from ircbot.text import parse_time from ircbot.plugin import BotPlugin from .helpers import public_api, mkurl, protect, full_pamela, spaceapi from datetime import datetime from time import time from operator import itemgetter minutes = 60 hours = 60 * ...
unlicense
1,959,366,140,816,231,400
33.120968
82
0.544552
false
lidaobing/itcc
itcc/molecule/relalist.py
1
2841
# $Id$ __all__ = ['Relalist', 'genconns', 'genR', 'genA', 'genD', 'genI'] __revision__ = '$Rev$' class Relalist: """ Relalist: Relation list, include bonds angles torsions imptors """ def __init__(self, mol = None): if mol is not None: mol.confirmconnect() ...
gpl-3.0
2,679,282,110,201,428,000
26.057143
77
0.500528
false
jreinhardt/constraining-order
src/constrainingorder/solver.py
1
6166
#Constraining Order - a simple constraint satisfaction library # #Copyright (c) 2015 Johannes Reinhardt <jreinhardt@ist-dein-freund.de> # #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 ...
mit
-9,198,803,084,648,208,000
33.836158
79
0.656666
false
GNS3/gns3-server
gns3server/handlers/api/compute/vmware_handler.py
1
16403
# -*- coding: utf-8 -*- # # Copyright (C) 2015 GNS3 Technologies Inc. # # 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. ...
gpl-3.0
-7,035,415,358,963,364,000
37.686321
173
0.584588
false
xbed/Mixly_Arduino
mixly_arduino/sample/mixpy/海龟画图/py/海龟画图10公共汽车_01公共汽车.py
1
1069
import turtle def moveandgo(x, y, distance): tina.penup() tina.goto(x,y) tina.pendown() tina.setheading(0) tina.forward(distance) def moveandcircle(x, y, radius): tina.fillcolor("#ffffff") tina.penup() tina.goto(x,y) tina.pendown() tina.begin_fill() tina.setheading(90) ...
apache-2.0
-6,258,536,222,794,368,000
19.557692
46
0.594949
false
trombastic/PyScada
pyscada/visa/signals.py
1
1330
# -*- coding: utf-8 -*- from __future__ import unicode_literals from pyscada.models import Device, Variable from pyscada.visa.models import VISAVariable, VISADevice, VISADeviceHandler, ExtendedVISAVariable, ExtendedVISADevice from django.dispatch import receiver from django.db.models.signals import post_save import ...
gpl-3.0
1,911,460,458,046,570,200
38.117647
117
0.755639
false
pawkoz/dyplom
blender/release/scripts/startup/bl_ui/properties_constraint.py
2
30186
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-2.0
5,697,486,073,241,071,000
31.423201
102
0.551779
false
BrianGuilardi/sjsu-cs158b-2010-noname
widgets/treestore.py
1
3145
# Copyright (c) 2010 Arthur Mesh # 2010 Christopher Nelson # # 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 us...
mit
3,913,113,329,938,206,700
31.091837
79
0.68744
false
shortaj/pyramid-learning-journal
learning_journal/learning_journal/views/default.py
1
1105
from pyramid.response import Response from pyramid.view import view_config from sqlalchemy.exc import DBAPIError from ..models import MyModel @view_config(route_name='home', renderer='../templates/mytemplate.jinja2') def my_view(request): try: query = request.dbsession.query(MyModel) one = query...
mit
5,299,190,196,649,907,000
32.484848
74
0.727602
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/feed_item_set_service/transports/grpc.py
1
11807
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-3,564,819,177,203,839,000
43.554717
112
0.608622
false
eacoin-project/eacore
contrib/linearize/linearize-data.py
1
8927
#!/usr/bin/python # # linearize-data.py: Construct 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 print_func...
mit
6,783,939,829,147,210,000
28.268852
108
0.675591
false
levythu/swift-layerC
kernel/distributedvc/internodevc.py
1
11214
# coding=utf-8 from utils.decorator.synchronizer import syncClassBase,sync,sync_ from threading import Thread from kernel.filetype import filemap import ex.exception_logic import utils.datastructure.splittree import filehandler import config.nodeinfo import cStringIO overhaulOrder=[] def addoverhaulOrder(node,lay): ...
gpl-2.0
5,076,079,122,552,938,000
43.324111
175
0.587569
false
filippog/pysnmp
examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py
1
2287
""" Bulk walk MIB +++++++++++++ Send a series of SNMP GETBULK requests * with SNMPv2c, community 'public' * over IPv4/UDP * to an Agent at 195.218.195.228:161 * with values non-repeaters = 0, max-repetitions = 25 * for two OIDs in tuple form * stop on end-of-mib condition for both OIDs This script performs similar to...
bsd-3-clause
-3,892,721,385,302,086,000
26.890244
96
0.681242
false
Xowap/django-leaflet
leaflet/admin.py
1
1986
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.admin import ModelAdmin from django.core.exceptions import ImproperlyConfigured try: from djgeojson.fields import GeoJSONField except ImportError: GeoJSONField = type(object) try: from django.contrib.gis.db.models import G...
lgpl-3.0
4,714,559,723,167,269,000
31.557377
94
0.642497
false
gskielian/Creating-a-Neural-Net-From-Scratch-With-Theano-Python
02-logistic-regression.py
1
1490
#!/usr/bin/python import numpy as np import sklearn import matplotlib.pyplot as plt import sklearn.datasets import sklearn.linear_model ###################### ## Helper Functions ## ###################### def plot_decision_boundary(pred_func): # Set min and max values and give it some padding x_min, x_max = ...
mit
5,034,935,029,688,332,000
27.653846
80
0.560403
false
jhlee525/janna
janna/streamer/base.py
1
18829
import six from abc import ABCMeta, abstractmethod from collections import deque, OrderedDict, Iterable, Mapping from copy import copy from ..logger import logger class DAGValidationError(Exception): pass class DAG(object): """ Code based-on https://github.com/thieman/py-dag Directed acyclic graph(...
mit
-3,574,955,176,137,060,000
31.12931
99
0.552294
false
hizhangp/yolo_tensorflow
utils/timer.py
1
1125
import time import datetime class Timer(object): ''' A simple timer. ''' def __init__(self): self.init_time = time.time() self.total_time = 0. self.calls = 0 self.start_time = 0. self.diff = 0. self.average_time = 0. self.remain_...
mit
-6,506,947,281,513,849,000
26.125
71
0.530667
false
negrinho/deep_architect
dev/tutorials/weight_sharing/weight_sharing/main.py
1
2524
###${MARKDOWN} # Recently, with the success of papers such as # [Efficient Neural Architecture Search via Parameter Sharing](https://arxiv.org/abs/1802.03268), # weight sharing has emerged as a popular way to speed up evaluation of sampled # architectures in architecture search. Weight sharing simply involves sharing #...
mit
4,993,573,131,159,879,000
39.725806
97
0.746038
false
IDMIPPM/reliability-aware-resynthesis
resynthesis/dynamic.py
1
2807
# coding: utf-8 __author__ = 'IDM.IPPM (Mihail Myachikov)' from itertools import product import copy def make_func(code): """ :param code: Source code of function definition. :return: Function defined in the input code. """ d = {} exec(code, d) return d['f'] def __make_operation_str(op, ...
apache-2.0
6,166,772,483,586,295,000
30.897727
118
0.529747
false
jbedorf/tensorflow
tensorflow/contrib/distribute/python/mirrored_strategy_multigpu_test.py
1
64753
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-6,203,748,347,429,417,000
40.139136
113
0.680555
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_watchers_operations.py
1
106175
# 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
2,492,714,922,565,979,600
51.797116
250
0.652282
false
xbmcmegapack/plugin.video.megapack.dev
resources/data/xsports.py
1
9003
#!/usr/bin/python # -*- coding: utf-8 -*- """ This file is part of XBMC Mega Pack Addon. Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com) 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...
gpl-3.0
1,473,721,082,253,633,800
42.917073
390
0.540598
false
Tigge/advent-of-code-2015
day_16.py
1
1117
#!/usr/bin/env python3 def which_sue(part=1): sues = [] for line in open("day_16.txt").read().strip().split("\n"): parts = line.split(" ") sues.append({parts[2][:-1]: int(parts[3][:-1]), parts[4][:-1]: int(parts[5][:-1]), parts[6][:-1]: int(parts[7])})...
mit
-7,158,631,042,694,402,000
33.90625
76
0.442256
false
md6113/404cmputProject
social/api/paginator.py
1
1105
from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response from collections import OrderedDict class CustomPagination(PageNumberPagination): def get_paginated_posts(self, data, request): result = OrderedDict([ ('count', self.page.paginator.count), ...
apache-2.0
2,874,166,160,473,792,500
33.5625
58
0.567421
false
SKIRT/PTS
modeling/data/inspector.py
1
15721
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
-7,193,105,397,903,090,000
27.529946
156
0.481107
false
dataewan/frantic-accelerator
FranticAccelerator/__init__.py
1
1466
""" Frantic Accelerator uses jinja2 templates to make static html files. """ import jinja2 import FranticAccelerator.Filters import FranticAccelerator.Config class FaEnv(jinja2.Environment): """ A frantic accelerator environment, extend a jinja environment; adding some extra filters, a template loader ...
gpl-3.0
-1,066,194,053,542,341,500
33.093023
82
0.654161
false
spencer404/PyLoom
examples/DouBanBook/captcha.py
1
5286
import cv2 import numpy import queue import string import enchant import pytesseract from PIL import Image def remove_bg(img, threshold): """二值化去除背景""" img = img.convert("L") # 转灰度 pixels = img.load() w, h = img.size for y in range(h): for x in range(w): if pixels[x, y] < thre...
mit
2,377,720,031,097,690,000
29.072727
98
0.490125
false
thucoldwind/ucore_mips
Decaf/submit.py
1
2484
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ts=4 sw=4 expandtab: """ 完成作业以后,运行本文件,它会将你的代码、实验报告一起打包为 submit.zip。 """ from __future__ import print_function # Requires Python 2.7+ import locale import os import re import sys import zipfile # Python3's input == Python2's raw_input try: ...
unlicense
-4,549,149,207,741,161,000
27.584416
95
0.609745
false
underyx/hiss
hiss/client.py
1
3351
import ssl import time import struct import asyncio import platform import functools import collections from . import Mumble_pb2 from .constants import MESSAGE_TYPES class Client: version = (1, 3, 0) def __init__(self, host, port=64738, username='snek', password=None): self.host = host self...
mit
6,261,956,060,427,688,000
30.914286
106
0.600716
false
ric2b/Vivaldi-browser
chromium/build/mac_toolchain.py
1
6819
#!/usr/bin/env python # Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ If should_use_hermetic_xcode.py emits "1", and the current toolchain is out of date: * Downloads the hermetic mac toolchain *...
bsd-3-clause
3,694,559,448,522,492,400
34.149485
80
0.706702
false
tomsimonart/GLM-web-interface
GLM/source/libs/slide.py
1
1940
#!/usr/bin/env python3 from .image import Image from .streamtools import MAT_WIDTH, MAT_HEIGHT from time import sleep from .rainbow import msg R = 'right' L = 'left' U = 'up' D = 'down' RU = 'right_up' LU = 'left_up' RD = 'right_down' LD = 'left_down' F = 'fluid' S = 'stop' class Slide: """ Slide is used to ...
mit
-2,837,132,528,465,262,600
23.871795
68
0.539175
false
d-qoi/TelegramBots
RoseAssassins/RoseAssassins.py
1
1869
import logging import argparse logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) # To make sure that it is just pushing modism debug into the log logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) from telegram.ext import Updater from pymongo ...
lgpl-3.0
1,104,310,580,972,480,100
30.15
149
0.685928
false
kumarisneha/todo_app
todo/urls.py
1
1455
"""todo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
mit
-7,646,928,580,618,175,000
39.416667
79
0.664605
false
lorenghoh/ent_analysis
time_profiles/surface_profiles.py
1
3385
#!/usr/bin/env python #Runtime (690, 130, 128, 128): 3 hours 40 minutes from pylab import * import numpy import cPickle from netCDF4 import Dataset import sys, os from thermo import SAM import model_param as mc # Load mean cloud field stat stat_file = Dataset(mc.get_stat()) data = {'z': stat_file.variables['z'][:].a...
mit
1,303,065,000,916,682,800
30.342593
76
0.55421
false
bgris/ODL_bgris
lib/python3.5/site-packages/docutils/writers/html4css1/__init__.py
1
33611
# $Id: __init__.py 7977 2016-11-29 12:00:39Z milde $ # Author: David Goodger # Maintainer: docutils-develop@lists.sourceforge.net # Copyright: This module has been placed in the public domain. """ Simple HyperText Markup Language document tree Writer. The output conforms to the XHTML version 1.0 Transitional DTD (*al...
gpl-3.0
3,137,856,337,254,234,000
39.839611
85
0.556098
false
napjon/moocs_solution
robotics-udacity/brute_stochastic.py
1
3934
# -------------- # USER INSTRUCTIONS # # Write a function called stochastic_value that # takes no input and RETURNS two grids. The # first grid, value, should contain the computed # value of each cell as shown in the video. The # second grid, policy, should contain the optimum # policy for each cell. # # Stay ...
mit
8,246,745,066,848,094,000
29.472
120
0.601678
false
BlackhatEspeed/electrum
lib/commands.py
1
19956
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
gpl-3.0
-4,087,671,363,318,755,000
47.202899
233
0.626679
false
capitalone/cloud-custodian
tools/c7n_gcp/c7n_gcp/resources/pubsub.py
1
3103
# Copyright 2018 Capital One Services, LLC # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from c7n.utils import type_schema from c7n_gcp.actions import MethodAction from c7n_gcp.provider import resources from c7n_gcp.query import QueryResourceManager, TypeInfo """ todo, needs detail_sp...
apache-2.0
5,589,301,755,121,085,000
30.343434
98
0.643893
false
mmihaltz/huwn-util
wn2to3.py
1
3799
#! /usr/bin/env python # coding=utf8 """Add PWN30 synset ids to HuWN XML Author: Ivan Mittelholcz """ import os.path import argparse import copy import xml.etree.cElementTree as ET def check_xml(xml_file): """Fájl létezésének és xml-ségének ellenőrzése. - input: fájlnév - output: xml tree """...
gpl-3.0
2,634,651,109,779,618,000
27.412214
78
0.56475
false
bat-serjo/vivisect
vstruct/defs/windows/win_5_2_i386/win32k.py
5
49833
# -*- coding: utf8 -*- # Version: 5.2 # Architecture: i386 # CompanyName: Microsoft Corporation # FileDescription: Multi-User Win32 Driver # FileVersion: 5.2.3790.5019 (srv03_sp2_gdr.120613-0334) # InternalName: win32k.sys # LegalCopyright: Microsoft Corporation. All rights reserved. # OriginalFilename: win32k.sys # P...
apache-2.0
4,592,170,121,099,246,000
30.5
104
0.657356
false
jonmorehouse/vimhub
lib/git.py
1
1552
import os import subprocess import re import utils import config try: import vim except: vim = False remote_hash = {} path_hash = {} def remotes(path): if remote_hash.get(path): return remote_hash.get(path) # grab only the remotes - this is safer than using python due to global character di...
mit
7,164,358,429,620,938,000
24.866667
131
0.590206
false
tesssny/Final-Project
final.py
1
10917
""" sources: http://stackoverflow.com/questions/306400/how-do-i-randomly-select-an-item-from-a-list-using-python, https://inventwithpython.com/chapter9.html, http://stackoverflow.com/questions/14667578/check-if-a-number-already-exist-in-a-list-in-python, mary feyrer, Glen Passow (game tester), http://stackoverflow.com/...
mit
-4,924,845,815,985,236,000
31.591045
706
0.457452
false
tommy-u/enable
enable/savage/svg/svg_extras.py
1
5270
""" Extra math for implementing SVG on top of Kiva. """ import sys from math import acos, sin, cos, hypot, ceil, sqrt, radians, degrees import warnings def bezier_arc(x1,y1, x2,y2, start_angle=0, extent=90): """ Compute a cubic Bezier approximation of an elliptical arc. (x1, y1) and (x2, y2) are the corners o...
bsd-3-clause
506,576,931,082,259,000
30.746988
85
0.552562
false
gkc1000/pyscf
pyscf/nao/test/test_0072_tddft_iter_dens_spatial.py
1
2632
from __future__ import print_function, division import os,unittest from pyscf.nao import tddft_iter from pyscf.nao.m_comp_spatial_distributions import spatial_distribution import h5py import numpy as np dname = os.path.dirname(os.path.abspath(__file__)) Ha = 27.211386024367243 td = tddft_iter(label='water', iter_broa...
apache-2.0
-66,785,252,218,591,430
37.144928
119
0.590426
false
bitforks/drawbot
drawBot/context/baseContext.py
1
52299
import AppKit import CoreText import Quartz from drawBot.misc import DrawBotError, cmyk2rgb, warnings from tools import openType _FALLBACKFONT = "LucidaGrande" class BezierContour(list): def __init__(self, *args, **kwargs): super(BezierContour, self).__init__(*args, **kwargs) self.open = True ...
bsd-2-clause
-2,830,084,130,208,015,000
34.313302
159
0.594581
false
srgblnch/skippy
skippylib/instructions/pumpController/norhof900.py
1
2779
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 ...
gpl-3.0
-8,703,218,580,630,605,000
28.206522
71
0.534005
false
naveensan1/nuage-openstack-neutron
nuage_neutron/vsdclient/restproxy.py
1
16519
# Copyright 2016 NOKIA # # 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...
apache-2.0
2,564,187,209,822,340,000
38.519139
79
0.556692
false
haticeerturk/Turkce-Ingilizce-Sozluk
Turkce-Ingılızce-Sozluk.py
1
3507
def kelimeEkleme() : dosya = open("sozluk.dat","a") m = raw_input("Turkce kelimeyi giriniz: ") h = raw_input("Ingilizce karsiligini girin: ") satir = m + "\t"+ ":" + "\t" + h + "\n" dosya.write(satir) dosya.close() def ingGuncelle() : dosya = open("sozluk.dat","r") istek = raw_input("Guncelleme yapacagin...
gpl-3.0
7,969,239,480,229,963,000
16.892857
88
0.64414
false
samatt/OpenWPM
test/test_crawl.py
1
4933
from urlparse import urlparse import tarfile import pytest import os from ..automation import TaskManager import utilities TEST_SITES = [ 'http://google.com', 'http://facebook.com', 'http://youtube.com', 'http://yahoo.com', 'http://baidu.com', 'http://wikipedia.org', 'http://qq.com', '...
gpl-3.0
-2,621,246,149,904,157,000
36.090226
94
0.559497
false
ResearchSoftwareInstitute/MyHPOM
hs_core/tests/api/rest/test_resource_flags.py
1
3642
import os import tempfile from rest_framework import status from hs_core.hydroshare import resource from .base import HSRESTTestCase class TestPublicResourceFlagsEndpoint(HSRESTTestCase): def setUp(self): super(TestPublicResourceFlagsEndpoint, self).setUp() self.tmp_dir = tempfile.mkdtemp() ...
bsd-3-clause
7,556,856,799,275,342,000
37.744681
75
0.580999
false
collective/mr.poe
raven/transport/base.py
1
9752
""" raven.transport.builtins ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import logging import sys import urllib2 from raven.utils import all try: # Google App Engine blacklists parts of the socket module, ...
bsd-3-clause
-6,220,213,269,785,607,000
29.763407
106
0.601928
false
beefoo/hollywood-diversity
scripts/imdb_enrich_movies.py
1
5115
# -*- coding: utf-8 -*- # Description: # This file takes in a .csv file of movies and adds IMDB information to it. # The script prompts user for input if there are ambiguities for a title. # # Example usage: # python imdb_enrich_movies.py ../data/box_office_top_50_movies_1995-2014.csv # .csv file must have...
mit
1,726,664,564,098,523,100
33.560811
171
0.556403
false
noslenfa/tutorialdjango
polls/views.py
1
1528
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_...
apache-2.0
7,863,918,660,426,906,000
30.854167
70
0.734948
false
OfficialWiddin/DeliBot
delibot/cogs/community.py
1
4455
import asyncio import json import logging import discord from discord.ext import commands from requests_html import AsyncHTMLSession log = logging.getLogger() class Community(commands.Cog): """ Commands for Community-day. """ def __init__(self, bot): self.bot = bot self.bot.loop.crea...
unlicense
-3,989,333,684,454,574,600
39.135135
145
0.59596
false