repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
sleibrock/discord-bots
bots/dumb-bot.py
1
8132
#!/usr/bin/env python #-*- coding: utf-8 -*- from random import randint, choice from Bot import ChatBot from requests import get from bs4 import BeautifulSoup as BS from json import dump as jdump class DumbBot(ChatBot): """ Dumb Bot is a basic toy bot integration He has some built in functionality as well...
mit
-1,982,356,323,345,148,200
33.134454
93
0.566716
false
3.69105
false
false
false
deadRaccoons/MameAirlines
tabo/Admi.py
3
6552
from Conexion import * import hashlib import cherrypy class Administrador(object): @cherrypy.expose def index(self): return """<html> <head></head> <body> <a href="aviones"> Aviones </a> </br> <a href="registrarse"> Registrarse </a> ...
gpl-2.0
-3,377,978,494,086,084,600
32.428571
131
0.475733
false
3.588171
false
false
false
shifter/rekall
rekall-core/rekall/plugins/addrspaces/amd64.py
3
16516
# Rekall Memory Forensics # Copyright 2013 Google Inc. All Rights Reserved. # # Authors: # Mike Auty # Michael Cohen # Jordi Sanchez # # 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 vers...
gpl-2.0
4,323,372,041,946,845,000
36.967816
79
0.585917
false
3.696509
false
false
false
tvgdb/pianissimo
backend/models/audio/smart_collage.py
1
1994
from models import db, ma from models.audio import Album from models.audio.meta import WritableField, SmartCollageField from webargs import Arg smart_collage_album_association_table = db.Table( "smart_collage_albums", db.Column('album_id', db.Integer, db.ForeignKey("album.id", ondelete='cascade')...
gpl-3.0
-5,952,614,232,860,148,000
35.254545
107
0.662487
false
3.385399
false
false
false
ScriptRock/content
code/python/snippets/template.py
1
2684
#!/usr/bin/env python from __future__ import print_function import argparse import http.client from snippets import getBrowser, APICall, getNodes, getNodeGroups, getConnectionManagerGroups, getNodesInCMGroups, getPolicies, getEvents, scan from datetime import date, timedelta parser = argparse.ArgumentParser(descript...
mit
-6,655,439,311,549,170,000
38.470588
143
0.659091
false
3.622132
false
false
false
benzkji/django-layout
apps/project_name/models.py
1
1467
# coding: utf-8 from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from cms.models.fields import PageField from django.db import models from django.conf import settings from filer.fields.file import FilerFileField from ckeditor_link.link_model.models import CMSFilerLinkBase...
mit
5,993,031,699,955,553,000
23.45
60
0.644853
false
3.986413
false
false
false
mekkablue/Glyphs-Scripts
Compare Frontmost Fonts/Compare Glyph Info.py
1
8188
#MenuTitle: Compare Glyph Info # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Compares open fonts and builds a lits of differing glyph info, including Unicode values and categorisation. """ import vanilla # CONSTANTS: thingsToCompare = ( "Unicodes", "Category"...
apache-2.0
8,742,762,920,542,435,000
28.730909
171
0.689297
false
3.160031
false
false
false
joyxu/kernelci-backend
app/utils/tests/test_log_parser.py
1
5410
# 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. # # This program is distributed in the hope that it will be usefu...
agpl-3.0
-1,274,055,998,561,299,700
30.823529
74
0.580591
false
3.796491
true
false
false
Micronaet/micronaet-mx8
vector_not_registred/vector.py
1
2813
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
agpl-3.0
2,158,299,057,235,871,500
34.607595
79
0.621756
false
4.118594
false
false
false
trondhindenes/ansible
lib/ansible/modules/network/f5/bigip_partition.py
9
9992
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
8,998,525,193,449,595,000
26.226158
91
0.614692
false
4.152951
false
false
false
ihatevim/aetherbot
plugins/steam_user.py
33
2667
import requests from lxml import etree from cloudbot import hook from cloudbot.util import formatting # security parser = etree.XMLParser(resolve_entities=False, no_network=True) API_URL = "http://steamcommunity.com/id/{}/" ID_BASE = 76561197960265728 headers = {} class SteamError(Exception): pass def conve...
gpl-3.0
-2,445,590,810,197,459,500
24.160377
111
0.610049
false
3.304833
false
false
false
sostenibilidad-unam/SHV
create_run.py
1
5127
import argparse import random import os import setup import numpy as np parser = argparse.ArgumentParser(description='Create meta-simulation package at workdir') parser.add_argument('--netlogo', required=True, help='absolute path to netlogo directory') parser.add_argument('--workdir', required=True, help='absolute pat...
gpl-3.0
6,282,423,725,192,038,000
57.261364
127
0.497367
false
4.164907
false
false
false
RedHatInsights/insights-core
insights/combiners/virt_what.py
1
3545
""" VirtWhat ======== Combiner to check if the host is running on a virtual or physical machine. It uses the results of the ``DMIDecode`` and ``VirtWhat`` parsers. Prefer ``VirtWhat`` to ``DMIDecode``. Examples: >>> vw = shared[VirtWhat] >>> vw.is_virtual True >>> vw.is_physical False >>> vw...
apache-2.0
-1,563,430,414,772,870,000
33.086538
113
0.573484
false
3.580808
false
false
false
pjsier/rainapp
events/views.py
1
4334
import pandas as pd from django.http import HttpResponse from django.shortcuts import render from csos.models import RiverCso, RiverOutfall from events.analyzer import rainfall_graph, find_n_years, build_flooding_data from events.models import HourlyPrecip, NYearEvent from flooding.models import BasementFloodingEvent ...
mit
-7,805,179,108,453,252,000
35.728814
108
0.603138
false
3.222305
false
false
false
Niektory/fifengine
tests/swig_tests/timer_tests.py
5
1770
#!/usr/bin/env python # -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU L...
lgpl-2.1
7,787,208,797,495,950,000
29
70
0.657062
false
3.532934
true
false
false
adviti/melange
app/soc/modules/gsoc/views/helper/request_data.py
1
15071
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange 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 applic...
apache-2.0
-116,678,680,622,381,740
30.33264
90
0.681574
false
3.690255
false
false
false
rosswhitfield/mantid
qt/python/mantidqt/widgets/workspacedisplay/table/view.py
3
10194
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
-8,458,622,923,449,505,000
39.452381
112
0.671768
false
3.829452
false
false
false
OiNutter/microbit-scripts
rainman/rainman.py
1
2395
from microbit import * import random letters = ['A', 'B'] def get_letter(): return random.choice(letters) display.scroll("RAINMAN") display.scroll('Press any button to play', wait=False, loop=True) while True: if button_a.is_pressed() or button_b.is_pressed(): print("start playing") break d...
mit
8,623,448,568,692,925,000
21.809524
82
0.469729
false
4.087031
false
false
false
rienafairefr/nYNABapi
pynYNAB/utils.py
2
2524
import random import time import json from datetime import datetime from sqlalchemy.exc import IntegrityError from sqlalchemy.orm.exc import NoResultFound from pynYNAB.schema import AccountTypes from pynYNAB.schema.budget import Account, Payee def rate_limited(maxpersecond): minInterval = 1.0 / float(maxperseco...
mit
-704,101,776,097,413,900
28.694118
93
0.608954
false
3.895062
false
false
false
nedlowe/amaas-core-sdk-python
amaascore/assets/interface.py
1
8700
from __future__ import absolute_import, division, print_function, unicode_literals import json import logging from amaascore.assets.utils import json_to_asset from amaascore.config import ENVIRONMENT from amaascore.core.interface import Interface from amaascore.core.amaas_model import json_handler class AssetsInter...
apache-2.0
1,866,251,523,994,682,400
46.027027
120
0.599195
false
3.847855
false
false
false
minesense/VisTrails
vistrails/gui/pipeline_view.py
1
168552
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
5,503,474,275,681,508,000
41.574387
173
0.55571
false
4.365162
false
false
false
JetStarBlues/Nand-2-Tetris
PlayArea/screen/screen.py
1
2677
''''''''''''''''''''''''' imports ''''''''''''''''''''''''''' # Built ins import tkinter import threading SCREEN_MEMORY_MAP = 16384 ''''''''''''''''''''''''' screen ''''''''''''''''''''''''''' class Screen(): ''' 16 bit screen with a 512 x 256 pixels display. Specifications hardcoded for simplicity. Data ...
mit
-1,159,839,531,719,495,200
19.442748
76
0.609638
false
3.077011
false
false
false
genome21/dcos-cli
tests/test_cmds.py
3
2181
from dcos import cmds import pytest @pytest.fixture def args(): return { 'cmd-a': True, 'cmd-b': True, 'cmd-c': False, 'arg-1': 'arg-1', 'arg-2': 'arg-2', 'arg-0': 'arg-0', } def test_single_cmd(args): commands = [ cmds.Command( hierar...
apache-2.0
6,580,438,426,622,830,000
21.030303
54
0.498854
false
3.523425
true
false
false
moira-alert/python-moira-client
setup.py
1
1468
from distutils.core import setup with open('requirements.txt') as f: required = f.read().splitlines() setup( name='moira-client', version='2.4', description='Client for Moira - Alerting system based on Graphite data', keywords='moira monitoring client metrics alerting', long_description=""" ...
mit
-803,249,410,176,711,800
31.622222
76
0.617166
false
4.170455
false
false
false
dan-cristian/haiot
common/performance.py
1
3139
__author__ = 'dcristian' import threading import utils import prctl from main.logger_helper import L from main import thread_pool import psutil import os from common import Constant class P: query_count = None query_cumulative_time_miliseconds = None min_query_time_miliseconds = None max_query_time_mil...
gpl-2.0
-7,687,099,009,642,972,000
33.494505
117
0.591271
false
3.328738
false
false
false
somemarsupials/bnfparsing
bnfparsing/whitespace.py
1
1761
# -*- encoding: utf-8 -*- from functools import wraps from .utils import NULL from .exceptions import DelimiterError """ This module contains decorators used to handle the whitespace between tokens, when parsing. """ def ignore(string): """ A whitespace handler that ignores the whitespace between tokens. T...
gpl-3.0
4,995,026,481,958,532,000
30.446429
73
0.675185
false
4.733871
false
false
false
ColdSauce/golems
src/game_objects.py
1
38506
import pygame class Tile: def __init__(self, image, solid = False): self.sprite = image self.solid = solid class MovableCharacter: def move(self,speed = 2): direction = self.current_direction if direction == Direction.UP: self.yOffset -= speed elif direction...
mit
-1,776,726,705,024,889,000
52.185083
334
0.583727
false
3.531041
false
false
false
aploium/zmirror
more_configs/config_google_and_zhwikipedia.py
3
8546
# coding=utf-8 # 这是为Google和中文维基(无缝整合)镜像配置的示例配置文件 # # 使用方法: # 1. 复制本文件到 zmirror 根目录(wsgi.py所在目录), 并重命名为 config.py # 2. 修改 my_host_name 为你自己的域名 # # 各项设置选项的详细介绍请看 config_default.py 中对应的部分 # 本配置文件假定你的服务器本身在墙外 # 如果服务器本身在墙内(或者在本地环境下测试, 请修改`Proxy Settings`中的设置 # # 由于google搜索结果经常会出现中文维基, 所以顺便把它也加入了. # google跟中文维基之间使用了本程序的镜...
mit
8,131,184,257,439,234,000
25.753623
103
0.639085
false
2.228123
false
false
false
k1203/meeting
public/app/assets/plugins/vector-map/converter/simplifier.py
234
5985
import argparse import sys import os from osgeo import ogr from osgeo import osr import anyjson import shapely.geometry import shapely.ops import codecs import time format = '%.8f %.8f' tolerance = 0.01 infile = '/Users/kirilllebedev/Maps/50m-admin-0-countries/ne_50m_admin_0_countries.shp' outfile = 'map.shp' # Open...
mit
6,680,298,553,978,392,000
28.2
87
0.664495
false
3.535145
false
false
false
mdtareque/difflet-backend
scripts/similarity.py
1
1449
#!/usr/bin/python import nltk from nltk.corpus import wordnet """ Similarity between two words Threshold decided manually, can be tweaked after discussion """ """" Sample Output: similarity( sparrow, parrot ) = 0.869565217391 ==> Very similar similarity( ship, boat ) = 0.90...
apache-2.0
-8,353,782,072,916,627,000
23.559322
107
0.556936
false
3.170678
false
false
false
brean/python-pathfinding
test/grid_test.py
1
1538
# -*- coding: utf-8 -*- from pathfinding.core.diagonal_movement import DiagonalMovement from pathfinding.core.grid import Grid from pathfinding.finder.a_star import AStarFinder import numpy as np BORDERLESS_GRID = """ xxx xxx """ BORDER_GRID = """ +---+ | | | | +---+ """ WALKED_GRID = """ +---+ |s# | |xe | +---+...
mit
-8,421,383,694,970,449,000
17.094118
78
0.570221
false
2.761221
true
false
false
ItsLastDay/academic_university_2016-2018
subjects/MachineLearning/hw01/knn.py
1
13052
import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.spatial.distance import euclidean from sklearn.neighbors import KNeighborsClassifier from sklearn.neighbors import KDTree from sklearn.model_selection import LeaveOneOut import sys import abc import math import time import os.path impor...
gpl-3.0
8,926,484,933,648,611,000
28.731207
118
0.613316
false
3.350963
true
false
false
cneill/barbican
functionaltests/api/v1/models/order_models.py
2
1661
""" Copyright 2014-2015 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
apache-2.0
7,290,632,580,848,813,000
38.547619
79
0.680313
false
4.081081
false
false
false
Worldev/UsefulShell
modules/workurl/workurl.py
1
1096
import webbrowser import os def work_web(): """ Opens a website and saves it to tmp/url_work.txt if wanted """ if lang == 'ca': listdir = os.listdir('tmp') if 'url_work.txt' in listdir: work_url = open('tmp/url_work.txt', 'r').read() else: work_url = input('Url ...
gpl-3.0
5,171,995,902,833,589,000
34.322581
71
0.49863
false
3.625828
false
false
false
tanyaweaver/data-structures
src/graph.py
1
5618
#!/usr/bin/env python # -*- coding: utf -8 -*- from __future__ import unicode_literals, division class Graph(object): """Defining class Graph.""" def __init__(self, iterable=None): """Initiate an instance of class Graph.""" self._dict = {} try: for item in iterable: ...
mit
-6,529,629,342,918,017,000
31.853801
78
0.473656
false
3.995733
false
false
false
guillermooo-forks/Vintageous
vi/dot_file.py
9
1610
from Vintageous import PluginLogger import sublime import os _logger = PluginLogger(__name__) class DotFile(object): def __init__(self, path): self.path = path @staticmethod def from_user(): path = os.path.join(sublime.packages_path(), 'User', '.vintageousrc') return DotFile(p...
mit
-6,728,869,773,391,696,000
29.377358
84
0.490683
false
3.995037
false
false
false
Princeton-CDH/winthrop-django
winthrop/common/tests.py
1
2693
from django.test import TestCase from django.core.exceptions import ValidationError import pytest from .models import Named, Notable, DateRange class TestNamed(TestCase): def test_str(self): named_obj = Named(name='foo') assert str(named_obj) == 'foo' class TestNotable(TestCase): def test...
apache-2.0
261,411,447,796,503,740
32.246914
86
0.608986
false
3.766434
true
false
false
NoahCristino/montyhall
montyhall.py
1
2651
from random import randint def montyhall(firstdoor="duck", switchornot="duck"): """ This function can be called with no parameters, so you can play the game, or with params to simulate the games """ sim = False if firstdoor == "duck" or switchornot == "duck": sim = True doors = ["", "", ""] cardoor = randint(0...
mit
3,311,140,192,704,882,000
24.490385
129
0.632214
false
2.653654
false
false
false
pandada8/mirrord
setup.py
1
1389
from setuptools import setup, find_packages from codecs import open from os import path __version__ = '0.0.1' here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() # get the dependen...
mit
-1,364,647,403,577,741,800
29.866667
87
0.648668
false
3.516456
false
false
false
alexgorban/models
research/autoaugment/wrn.py
5
5415
# 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 applicab...
apache-2.0
2,077,167,805,379,991,600
33.272152
80
0.648569
false
3.451243
false
false
false
fusionbox/django-two-factor-auth
two_factor/forms.py
4
5418
from binascii import unhexlify from time import time from django import forms from django.forms import ModelForm, Form from django.utils.translation import ugettext_lazy as _ from django_otp.forms import OTPAuthenticationFormMixin from django_otp.oath import totp from django_otp.plugins.otp_totp.models import TOTPDev...
mit
8,383,093,971,943,688,000
32.652174
97
0.608712
false
3.989691
false
false
false
skirpichev/omg
diofant/polys/galoistools.py
1
18750
"""Dense univariate polynomials with coefficients in Galois fields.""" import math import random from ..ntheory import factorint from .densearith import (dmp_add, dmp_add_term, dmp_mul, dmp_quo, dmp_rem, dmp_sqr, dmp_sub) from .densebasic import dmp_degree_in, dmp_normal, dmp_one_p from .dens...
bsd-3-clause
7,375,662,049,824,548,000
23.541885
90
0.494293
false
2.737626
false
false
false
samisalkosuo/mazingame
mazingame/gameclasses.py
1
2362
#Classes for MazingGame. # # The MIT License (MIT) # Copyright (c) 2015, 2016 Sami Salkosuo # 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...
mit
-2,358,601,345,035,029,000
32.267606
142
0.696867
false
3.923588
false
false
false
timshenkao/StringKernelSVM
stringSVM.py
1
10377
import numpy as np from sklearn import svm from sklearn.datasets import fetch_20newsgroups from sklearn.svm import libsvm import sys from time import time from functools import wraps LIBSVM_IMPL = ['c_svc', 'nu_svc', 'one_class', 'epsilon_svr', 'nu_svr'] def caching(): """ Cache decorator. Arguments to the ...
bsd-3-clause
6,206,781,025,852,649,000
38.162264
119
0.522213
false
3.648734
false
false
false
100Shapes/100shapes.github.com
fabfile.py
1
1220
from fabric.api import local, abort, env from fabric.contrib import django django.project('ohs_site') from django.conf import settings import os BUILD_DIR = settings.BUILD_DIR def setup(): local('cp ohs_site/offline/sample.env ohs_site/.env') local('nano ohs_site/.env') def build_site(): e = getattr(env, 'env...
mit
-1,133,104,399,933,351,700
21.181818
72
0.692623
false
2.939759
false
false
false
basho/riak-python-client
riak/tests/test_kv.py
1
29624
# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, 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 require...
apache-2.0
2,122,825,286,487,329,500
34.995134
79
0.595613
false
3.752917
true
false
false
sujoykroy/motion-picture
editor/example/render_server.py
1
8491
import requests import json import sys import os import tarfile import shutil from MotionPicture import * import imp import argparse import getpass parser = argparse.ArgumentParser(description="Render MotionPicture video segment from remote.") parser.add_argument("--booking", nargs="?", default="-1", type=int, ...
gpl-3.0
-5,244,898,743,986,705,000
40.622549
104
0.535862
false
4.139932
false
false
false
gljohn/meterd
meterd/currentcostd.py
1
2227
#!/usr/bin/python ################################################## # currentcostd.py # # # # @author Gareth John <gljohn@fedoraproject.org> # ################################################## import sys import time import logging import ...
gpl-3.0
4,528,696,204,868,289,500
29.506849
60
0.46026
false
4.324272
false
false
false
sbaogang/teletraan
deploy-board/deploy_board/webapp/env_views.py
1
53714
# Copyright 2016 Pinterest, 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
736,445,885,809,333,800
35.244265
119
0.602618
false
3.679545
true
false
false
jrbl/python-wtf
test_wtf.py
1
1043
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014 Joseph Blaylock <jrbl@jrbl.org> # # 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...
apache-2.0
1,199,571,914,817,227,000
31.59375
76
0.674976
false
3.465116
false
false
false
eponvert/texnlp
src/main/python/score_tags.py
2
3070
############################################################################### ## Copyright (C) 2007 Jason Baldridge, The University of Texas at Austin ## ## 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 ...
lgpl-3.0
-4,555,898,188,288,726,500
30.979167
92
0.62215
false
3.50057
false
false
false
mariuszkowalski/BioCounter
analysis/export_statistics.py
1
1332
#!/usr/bin/env python3 import codecs import csv class ExportStatistics: ''' Class used for exporting the created in software statistics. ''' @staticmethod def export_to_csv(file_path, samples, statistics): ''' Exports the basic statistics form the application to the CSV file...
gpl-3.0
-1,886,476,106,400,703,200
26.183673
130
0.568318
false
4.242038
false
false
false
tuc-osg/micropython
tests/extmod/vfs_fat_ramdisk.py
8
2135
import sys import uos import uerrno try: uos.VfsFat except AttributeError: print("SKIP") sys.exit() class RAMFS: SEC_SIZE = 512 def __init__(self, blocks): self.data = bytearray(blocks * self.SEC_SIZE) def readblocks(self, n, buf): #print("readblocks(%s, %x(%d))" % (n, id(bu...
mit
688,574,128,968,513,800
20.138614
65
0.594379
false
2.695707
false
false
false
bitcraft/pyglet
tests/unittests/integration/text_tests/empty_bold.py
1
1233
"""Test that an empty document doesn't break, even when its (nonexistent) text is set to bold. """ __noninteractive = True import unittest from pyglet import gl from pyglet import graphics from pyglet.text import document from pyglet.text import layout from pyglet import window class TestWindow(window.Window): ...
bsd-3-clause
6,124,426,004,767,012,000
26.4
75
0.616383
false
4.237113
true
false
false
asomya/test
horizon/dashboards/nova/networks/ports/views.py
1
2247
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright Cisco Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with th...
apache-2.0
8,638,973,069,664,146,000
29.780822
78
0.727192
false
4.026882
false
false
false
osergeev/bike
test_ga.py
1
3154
#test_ga.py from genetic import * import matplotlib.pyplot as plt import random class Eq1(object): """ parabole with max in 30.0 """ def __init__(self): self.bestval = 10000.0 self.minval = 10.0 self.maxval = 50.0 def get_result(self,x): return self.eq1(x) def...
gpl-2.0
4,118,245,763,700,684,000
26.911504
109
0.502219
false
3.524022
false
false
false
quantmind/pulsar
pulsar/async/mixins.py
1
6580
import time from asyncio import Queue, CancelledError DEFAULT_LIMIT = 2**16 class FlowControl: """A protocol mixin for flow control logic. This implements the protocol methods :meth:`pause_writing`, :meth:`resume_writing`. """ _b_limit = 2*DEFAULT_LIMIT _paused = False _buffer_size = 0...
bsd-3-clause
-3,372,958,613,512,494,600
30.037736
74
0.537538
false
4.500684
false
false
false
open-austin/influence-texas
src/influencetx/legislators/models.py
1
1822
from django.db import models from influencetx.core import constants, utils import logging log = logging.getLogger(__name__) class Legislator(models.Model): # Legislator ID from Open States API. openstates_leg_id = models.CharField(max_length=48, db_index=True) tpj_filer_id = models.IntegerField(default=0,...
gpl-2.0
-8,889,635,678,502,600,000
36.958333
97
0.697036
false
3.457306
false
false
false
beast-arena/beast-arena
Beast.py
2
1039
# -*- coding: utf-8 -*- import random class Beast(object): """ Basic Beast class (implements Random move "stragegy") """ def __init__(self): self.environment = None def bewege(self, paramString): """ calculates the destination where to move @param para...
gpl-3.0
-6,030,475,482,796,140,000
31.46875
98
0.559192
false
4.172691
false
false
false
prymitive/upaas-admin
upaas_admin/apps/applications/api.py
1
12209
# -*- coding: utf-8 -*- """ :copyright: Copyright 2013-2014 by Łukasz Mierzwa :contact: l.mierzwa@gmail.com """ from __future__ import unicode_literals import logging import mongoengine from django.core import exceptions from django.http import HttpResponseNotFound, HttpResponseBadRequest from django.conf....
gpl-3.0
88,815,950,642,673,780
39.829431
79
0.589531
false
4.400865
false
false
false
3dfxsoftware/cbss-addons
mrp_bom_subproduct_cost/mrp_subproduct.py
1
2731
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/ # All Rights Reserved. # info Vauxoo (info@vauxoo.com) ####################################...
gpl-2.0
1,877,546,884,443,324,400
39.761194
153
0.56829
false
3.846479
false
false
false
arc64/datawi.re
datawire/views/api/entities.py
1
2324
from flask import Blueprint, request from flask.ext.login import current_user from werkzeug.exceptions import BadRequest from apikit import obj_or_404, jsonify, Pager, request_data from datawire.model import Entity, Collection, db from datawire.model.forms import EntityForm from datawire import authz blueprint = Blue...
mit
-3,900,141,859,984,782,300
31.732394
75
0.685026
false
3.58642
false
false
false
shlomif/PySolFC
pysollib/kivy/tkutil.py
1
14609
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # ---------------------------------------------------------------------------# # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free softwar...
gpl-3.0
4,965,557,221,259,048,000
27.03263
79
0.510236
false
3.469945
false
false
false
bruinxiong/SENet.mxnet
symbol_se_inception_v4.py
1
20343
""" Inception V4, suitable for images with around 299 x 299 (original) Implemented the following paper: Szegedy C, Ioffe S, Vanhoucke V. Inception-v4, inception-resnet and the impact of residual connections on learning[J]. arXiv preprint arXiv:1602.07261, 2016. Jie Hu, Li Shen, Gang Sun. "Squeeze-and-Excitation N...
apache-2.0
7,157,415,611,834,751,000
48.478908
157
0.523817
false
2.618821
false
false
false
osmr/utct
Gluon/trainer.py
1
3553
import logging from utct.common.trainer_template import TrainerTemplate import mxnet as mx from mxnet import gluon, autograd class Trainer(TrainerTemplate): """ Class, which provides training process under Gluon/MXNet framework. Parameters: ---------- model : object instance of Model cl...
mit
-2,329,165,689,116,485,600
29.895652
93
0.534478
false
4.397277
false
false
false
ROIV/ViorCoin-ElectrumWallet
gui/qt/main_window.py
1
90385
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 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
-2,286,613,206,495,023,000
36.707551
454
0.583415
false
3.888029
true
false
false
thirdwing/SFrame
oss_src/unity/python/sframe/_scripts/_pylambda_worker.py
1
4845
import sys import os import ctypes from ctypes import PyDLL, c_char_p, c_int from os.path import split, abspath, join from glob import glob from itertools import chain def set_windows_dll_path(): """ Sets the dll load path so that things are resolved correctly. """ # Back up to the directory, then to ...
bsd-3-clause
8,055,003,699,847,656,000
34.108696
104
0.615273
false
3.419195
false
false
false
Denisolt/IEEE-NYIT-MA
local/lib/python2.7/site-packages/tests/test_base.py
1
21285
# coding: utf-8 import os import ntpath import posixpath import shutil from mock import patch from filebrowser.base import FileObject, FileListing from filebrowser.sites import site from filebrowser.settings import VERSIONS from tests import FilebrowserTestCase as TestCase class FileObjectPathTests(TestCase): ...
gpl-3.0
-7,885,753,741,644,402,000
40.478516
234
0.650092
false
3.699826
true
false
false
sschiau/swift
utils/gyb_syntax_support/Node.py
1
3036
from __future__ import print_function import sys from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word def error(msg): print('error: ' + msg, file=sys.stderr) sys.exit(-1) class Node(object): """ A Syntax node, possibly with children. If the kind is "SyntaxCollection", then t...
apache-2.0
-8,498,343,167,070,602,000
33.11236
79
0.61166
false
4.080645
false
false
false
xueqiang41/shopsite
shopsite/shopsite/settings.py
1
4757
""" Django settings for shopsite project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # ...
gpl-2.0
-2,099,231,296,338,303,500
26.856209
91
0.676132
false
2.68494
false
false
false
mlperf/training_results_v0.7
Intel/benchmarks/minigo/8-nodes-32s-cpx-tensorflow/oneoffs/rotate_examples.py
7
5384
# Copyright 2018 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 agreed to in writing, ...
apache-2.0
-4,926,151,409,267,089,000
33.512821
79
0.613484
false
3.429299
false
false
false
baffolobill/django-lfs
lfs/mail/utils.py
3
6009
# django imports from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.template import RequestContext from django.template.base import TemplateDoesNotExist from django.templ...
bsd-3-clause
1,145,132,046,764,439,400
27.751196
106
0.659511
false
3.439611
false
false
false
rebase-helper/rebase-helper
rebasehelper/constants.py
1
1925
# -*- coding: utf-8 -*- # # This tool helps you rebase your package to the latest version # Copyright (C) 2013-2019 Red Hat, 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...
gpl-2.0
7,541,820,209,842,720,000
33.872727
114
0.728884
false
3.175497
false
false
false
dfang/odoo
addons/mass_mailing/wizard/mail_compose_message.py
22
2775
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class MailComposeMessage(models.TransientModel): """Add concept of mass mailing campaign to the mail.compose.message wizard """ _inherit = 'mail.compose.message' mas...
agpl-3.0
7,045,370,708,939,977,000
49.454545
108
0.55027
false
4.129464
false
false
false
marquesarthur/BugAnalysisRecommender
patterny/resources/script/shenanigans.py
1
6080
------------------------------------------------------------------------------------------------ def sss_similarity(s1, s2, threshold=0.50, type='relation', corpus='webbase'): sss_url = "http://swoogle.umbc.edu/SimService/GetSimilarity" try: response = get(sss_url, params={'oper...
mit
870,109,135,793,218,200
31.005263
236
0.630428
false
3.156802
false
false
false
craws/OpenAtlas-Python
openatlas/models/network.py
1
3821
from typing import Any, Dict, Iterator, Optional from flask import flash, g from flask_wtf import FlaskForm from psycopg2.extras import NamedTupleCursor from openatlas.util.display import truncate class Network: properties = ['P7', 'P11', 'P14', 'P22', 'P23', 'P24', 'P25', 'P67', 'P74', 'P107', 'OA7', ...
gpl-2.0
2,012,162,949,420,295,400
43.952941
98
0.556399
false
3.828657
false
false
false
deepjets/deepjets
deepjets/generate.py
1
2156
from ._libdeepjets import generate_events as _generate_events from ._libdeepjets import PythiaInput, HepMCInput import os from fnmatch import fnmatch import logging from .extern.six import string_types log = logging.getLogger(__name__) __all__ = [ 'generate_events', 'PythiaInput', 'HepMCInput', 'get_gener...
bsd-3-clause
-5,898,751,006,015,875,000
37.5
87
0.605751
false
3.723661
false
false
false
madgik/exareme
Exareme-Docker/src/exareme/exareme-tools/madis/src/functionslocal/vtable/createderivedcolumns.py
1
2211
import setpath import functions import json import re registered=True class createderivedcolumns(functions.vtable.vtbase.VT): #uses + and : for multiplication def VTiter(self, *parsedArgs,**envars): largs, dictargs = self.full_parse(parsedArgs) if 'query' not in dictargs: raise functi...
mit
-3,548,538,125,132,672,500
26.296296
88
0.556309
false
4.086876
false
false
false
plamut/ggrc-core
src/ggrc/migrations/versions/20160707132122_1269660b288b_remove_ca_duplicate_values.py
7
1826
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ remove ca duplicate values Create Date: 2016-07-07 13:21:22.732299 """ # disable Invalid constant name pylint warning for mandatory Alembic variables. # pylint: disable=invalid-name from alembic impor...
apache-2.0
-855,889,480,554,926,200
27.53125
79
0.687295
false
3.652
false
false
false
odahoda/noisicaa
build_utils/waf/csound.py
1
2382
# -*- mode: python -*- # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # 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 # (...
gpl-2.0
-5,177,411,920,902,307,000
27.357143
88
0.645676
false
3.549925
false
false
false
ldoktor/autotest
client/tests/kvm/tests/migration_with_reboot.py
2
1512
from autotest.client.shared import utils def run_migration_with_reboot(test, params, env): """ KVM migration test: 1) Get a live VM and clone it. 2) Verify that the source VM supports migration. If it does, proceed with the test. 3) Reboot the VM 4) Send a migration command to the...
gpl-2.0
-2,831,542,114,939,271,000
34.162791
78
0.625661
false
3.978947
true
false
false
CMPUT410W15T02/CMPUT410W15-project
testenv/lib/python2.7/site-packages/django/contrib/formtools/tests/tests.py
53
7410
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os import unittest import warnings from django import http from django.contrib.formtools import preview, utils from django.test import TestCase, override_settings from django.utils._os import upath from django.contrib.formtools.te...
gpl-2.0
5,029,489,336,572,046,000
39.043243
81
0.649028
false
4.07033
true
false
false
gabrielfalcao/steadymark
steadymark/__init__.py
1
1948
#!/usr/bin/env python # -*- coding: utf-8 -*- # <steadymark - markdown-based test runner for python> # Copyright (C) <2012-2020> Gabriel Falcão <gabriel@nacaolivre.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Softwar...
mit
-1,674,765,360,954,304,500
32
85
0.714946
false
3.965377
false
false
false
isb-cgc/ISB-CGC-Webapp
scripts/data_source_etl.py
1
19107
### # Copyright 2015-2020, Institute for Systems Biology # # 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 la...
apache-2.0
-4,132,635,280,405,714,400
47.007538
229
0.558748
false
3.989768
true
false
false
mstubinis/PaintPartners
PaintPartners/objects/TextField.py
1
5910
import pygame from pygame.locals import * class TextField(pygame.sprite.Sprite): def __init__(self,pos,maxChars,buttonName,font,password=False): pygame.sprite.Sprite.__init__(self) self.pos = pos self.selected = False self.blink = False self.password = password self....
gpl-3.0
-8,113,434,477,920,135,000
40.328671
152
0.544332
false
3.466276
false
false
false
kreitek/metaespacio
metaespacio/contabilidad2/admin.py
2
1244
# -*- coding: utf-8 -*- from django.contrib import admin from .models import Validacion, Registro, Categoria @admin.register(Categoria) class CategoriaAdmin(admin.ModelAdmin): list_display = ('espacio', 'nombre', 'ayuda') @admin.register(Validacion) class ValidacionAdmin(admin.ModelAdmin): list_display = ('...
agpl-3.0
4,024,719,277,030,134,300
30.871795
108
0.608206
false
3.046569
false
false
false
livni/old-OK
src/knesset/api/handlers.py
1
9520
from datetime import datetime import urllib from django.db.models import Q from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.core.cache import cache from django.db.models import Count from piston.handler import BaseHandler from piston.utils import rc fro...
bsd-3-clause
5,660,173,439,571,471,000
33.618182
316
0.593382
false
3.712949
false
false
false
nathanbjenx/cairis
cairis/gui/VulnerabilityEnvironmentPanel.py
1
6188
# 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...
apache-2.0
1,378,462,077,631,647,200
45.526316
158
0.766968
false
3.757134
false
false
false
williamgilpin/pypdb
pypdb/clients/fasta/fasta_client_test.py
1
2511
"""Tests for RCSB FASTA fetching logic.""" import pytest import requests import unittest from unittest import mock from pypdb.clients.fasta import fasta_client class TestFastaLogic(unittest.TestCase): @mock.patch.object(requests, "get") @mock.patch.object(fasta_client, "_parse_fasta_text_to_list") def te...
mit
5,745,887,918,968,113,000
41.559322
114
0.593787
false
2.815022
true
false
false
OPpuolitaival/django-info-screen
info_screen/views.py
1
2210
# coding: utf-8 import json from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.views.generic import TemplateView, View from .models import InfoScreen, Page class ScreenView(TemplateView): template_name = 'info_screen/screen.html' def get_context_data(self, **kwa...
mit
-6,112,927,717,599,500,000
29.273973
88
0.551131
false
3.932384
false
false
false
titanmonsta/fluorescence
gumps/shardlist.py
12
1457
from data import * from ui import * import client import theme # In case you want to redesign this gump, keep in mind that at this point, you can not # access any uo data (e.g. art.mul graphics, hues), as the mul files are not loaded yet. def create(args): g = GumpMenu("shardlist", 400, 300) g.closable = Fals...
gpl-3.0
-7,818,187,446,363,884,000
25.981481
88
0.660947
false
3.39627
false
false
false
benrudolph/commcare-hq
corehq/apps/fixtures/interface.py
2
3474
from couchdbkit import ResourceNotFound from django.contrib import messages from django.http import HttpResponseRedirect from corehq.apps.fixtures.views import fixtures_home, FixtureViewMixIn from corehq.apps.reports.generic import GenericReportView, GenericTabularReport from corehq.apps.reports.filters.base import Bas...
bsd-3-clause
-2,079,126,917,013,998,000
30.87156
113
0.689119
false
4.145585
false
false
false
GoogleCloudPlatform/datacatalog-connectors-rdbms
google-datacatalog-rdbms-connector/src/google/datacatalog_connectors/rdbms/scrape/metadata_normalizer.py
1
8545
#!/usr/bin/python # # 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 ag...
apache-2.0
-5,122,508,654,907,185,000
33.595142
79
0.541603
false
4.697636
false
false
false
Ledoux/ShareYourSystem
Pythonlogy/draft/Filterer/Drafts/__init__ copy.py
1
1800
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> A Filterer pick and """ #<DefineAugmentation> import ShareYourSystem as SYS BaseModuleStr="ShareYourSystem.Applyiers.Walker" DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer" ...
mit
-6,953,273,175,532,897,000
18.78022
90
0.682222
false
3.169014
false
false
false
avatar29A/adbook
adbook/examples/find_person_by_email_example.py
1
1158
# coding=utf-8 from typing import List, Callable from adbook.orm.entity import Entity from adbook.addressbook import AddressBook def convert_person_list(persons: List[Entity]) -> List[str]: return [str(person) for person in persons] if __name__ == '__main__': """ * Find person by email address (can supp...
mit
-1,871,371,984,925,062,100
33.058824
95
0.657168
false
3.198895
false
false
false
mganeva/mantid
qt/python/mantidqt/widgets/workspacedisplay/matrix/table_view_model.py
1
8826
# coding=utf-8 # Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the ma...
gpl-3.0
4,422,619,221,616,382,000
40.242991
119
0.619873
false
4.000907
false
false
false
leifos/treconomics
treconomics_project/search/diversify.py
1
6884
# # Diversification Algorithm with access to the diversity QRELs # Mark II -- More complex algorithm, not as rewarding as the first attempt. # Updated to work with the ifind search objects. # # Slightly updated to make it easier to drop into the treconomis environment. # # Author: David Maxwell and Leif Azzopardi # Da...
mit
-5,953,792,841,605,681,000
38.563218
230
0.667635
false
3.904708
false
false
false
SCSSoftware/BlenderTools
addon/io_scs_tools/unused/import_pmx.py
1
9863
# ##### 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
8,172,225,801,110,876,000
37.228682
164
0.589577
false
3.195011
false
false
false
Fibio/flask-mongoset
examples.py
1
2098
import flask import trafaret as t from flask.ext.mongoset import MongoSet, Model app = flask.Flask(__name__) app.config['MONGODB_HOST'] = "localhost" app.config['MONGODB_PORT'] = 27017 app.config['MONGODB_DATABASE'] = "testdb" app.config['MONGODB_AUTOREF'] = True app.config['TESTING'] = True mongo = MongoSet(app) ...
mit
-3,599,347,163,045,619,700
28.138889
79
0.540515
false
3.394822
false
false
false
arulalant/UMRider
bsubScripts/ncumeps_global_tigge/tigge_create_tarball_g2files_put_into_ftp.py
1
5917
#!/usr/bin/env python ## This is call back script which will be executed after created the grib2 files. ## ## Hycom Model Input requires analysis of 06, 09, 12, 15, 18, 21-hours from ## yesterday and 00 & 03-hours from today date. All 3-hourly forecasts from ## today date. ## ## While creating tar ball, all files m...
gpl-2.0
2,097,474,215,553,767,000
38.18543
285
0.576475
false
3.107668
false
false
false