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
angst7/far
far.py
1
9209
from network.server import FarProtocol, FarFactory from network.messages import Tag from models.mob import Player, NPC, Attack from models.world import Room, Exit, Direction from twisted.internet import reactor, task from copy import deepcopy from guppy import hpy class Game(object): def __init__(self): se...
mit
-169,936,922,520,400,900
34.555985
112
0.468889
false
4.002173
false
false
false
IxLahiji/lahujChatBot
lahujChatBot.py
1
5703
import discord import discord.utils import asyncio import os.path import re import markovify import random import datetime from chatBot.settings import JSONSettings prog_path = os.path.dirname(os.path.abspath(__file__)) default_settings = {"Discord token": "", "Source type (channel ...
mit
-1,426,452,223,220,533,500
31.162791
148
0.595476
false
3.756917
false
false
false
PradeeshSuganthan/mnist-classifier
mlp.py
1
4683
#based off of neuralnetworksanddeeplearning.com import numpy as np import gzip import struct import random epochs = 10 #number of training cycles y_train = np.zeros((60000,10)) #initialize for one-hot encoding alpha = 100 #learning rate batchsize = 6 num_neurons def main(): print "Test" #read in data images_train...
mit
2,670,317,334,518,944,300
22.656566
86
0.681828
false
2.691379
true
false
false
defance/edx-platform
lms/djangoapps/courseware/tests/test_entrance_exam.py
11
26647
""" Tests use cases related to LMS Entrance Exam behavior, such as gated content access (TOC) """ from mock import patch, Mock from django.core.urlresolvers import reverse from django.test.client import RequestFactory from nose.plugins.attrib import attr from capa.tests.response_xml_factory import MultipleChoiceRespo...
agpl-3.0
-9,108,926,144,166,880,000
39.374242
130
0.587984
false
4.302067
true
false
false
scienceopen/madrigal-examples
test_globalisprint.py
1
1869
#!/usr/bin/env python3 """ This is not necessarily an efficient way of doing things by downloading ASCII per Madrigal remote filter and then converting to hdf5 locally, rather we want to download just HDF5, but it's a OK way to start. Tests loading of globalisprint ascii file, resaving as HDF5 for fast data processing...
gpl-3.0
6,723,598,362,351,025,000
34.264151
197
0.657571
false
3.173175
false
false
false
rlcode/reinforcement-learning-kr
1-grid-world/3-monte-carlo/environment.py
1
3707
import time import numpy as np import tkinter as tk from PIL import ImageTk, Image np.random.seed(1) PhotoImage = ImageTk.PhotoImage UNIT = 100 # 픽셀 수 HEIGHT = 5 # 그리드 월드 세로 WIDTH = 5 # 그리드 월드 가로 class Env(tk.Tk): def __init__(self): super(Env, self).__init__() self.action_space = ['u', 'd', '...
mit
2,465,659,495,563,917,000
31.297297
76
0.528591
false
3.085198
false
false
false
kwotsin/TensorFlow-ENet
predict_segmentation.py
1
4193
import tensorflow as tf import os import matplotlib.pyplot as plt from enet import ENet, ENet_arg_scope from preprocessing import preprocess from scipy.misc import imsave import numpy as np slim = tf.contrib.slim image_dir = './dataset/test/' images_list = sorted([os.path.join(image_dir, file) for file in os.listdir(i...
mit
-3,046,598,620,001,116,000
33.95
129
0.577868
false
3.414495
false
false
false
daineseh/kodi-plugin.video.ted-talks-chinese
youtube_dl/extractor/ruutu.py
29
4297
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_urlparse from ..utils import ( determine_ext, int_or_none, xpath_attr, xpath_text, ) class RuutuIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ruutu\.fi/video/(...
gpl-2.0
-5,128,898,413,219,188,000
41.078431
115
0.466449
false
3.852783
false
false
false
bebound/lknovel
novel.py
1
7902
import threading import re from bs4 import BeautifulSoup import requests from global_variable import HAS_QT, HEADERS if HAS_QT: from global_variable import SENDER class Novel(): """ get novel information for creating epub file Attributes: volume_name: A string represent the volume name ...
mit
4,027,273,509,634,045,000
32.389831
120
0.584264
false
3.885602
false
false
false
paurosello/frappe
frappe/tests/test_global_search.py
7
7660
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import unittest import frappe from frappe.utils import global_search from frappe.test_runner import make_test_objects import frappe.utils class TestGlobalSearch(unittest.TestCas...
mit
88,331,083,183,987,400
42.276836
166
0.707833
false
3.04815
true
false
false
CWSL/access-cm-tools
analyse/mom_plot_timeseries.py
1
1854
#!/usr/bin/env python import sys import os import argparse import netCDF4 as nc import numpy as np import pandas as pd import re import datetime import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from lib_util import time_dim_to_pandas_periods """ What this script does: Plot a full timeseries f...
apache-2.0
-1,058,263,979,802,645,000
24.39726
76
0.606257
false
3.693227
false
false
false
CGATOxford/Optic
scripts/gpipe/translate_forward2backward.py
1
4075
########################################################################## # # MRC FGU Computational Genomics Group # # $Id$ # # Copyright (C) 2009 Andreas Heger # # 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 ...
mit
8,499,062,192,981,369,000
24.955414
83
0.551656
false
3.615794
false
false
false
Impactstory/oadoi
put_repo_requests_in_db.py
2
5955
import csv import os import json import gspread import datetime import re import unicodecsv as csv from app import db from util import safe_commit from emailer import send from emailer import create_email from endpoint import Endpoint from repository import Repository from repo_request import RepoRequest def get_rep...
mit
-9,057,802,710,195,520,000
36.689873
142
0.68094
false
3.591677
false
false
false
doda/imagy
imagy/smush/scratch.py
1
1099
import os, sys, tempfile class Scratch (object): def __init__ (self): tup = tempfile.mkstemp() self._path = tup[1] self._file = os.fdopen(tup[0]) self._file.close() def __del__ (self): pass #if self._path != None: # self.destruct() def de...
bsd-2-clause
3,726,509,410,770,841,600
24.55814
91
0.532302
false
3.897163
false
false
false
Fenykepy/phiroom
src/api/portfolio/serializers.py
1
1312
from rest_framework import serializers from librairy.models import Picture from portfolio.models import Portfolio, PortfolioPicture class PortfolioSerializer(serializers.ModelSerializer): pub_date = serializers.DateTimeField(required=False, allow_null=True) pictures = serializers.SerializerMethodField() ...
agpl-3.0
-2,746,211,875,505,529,300
26.914894
73
0.645579
false
4.301639
false
false
false
sahildua2305/eden
controllers/hms.py
2
19534
# -*- coding: utf-8 -*- """ HMS Hospital Status Assessment and Request Management System """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------------------------------------...
mit
-315,330,539,855,334,660
57.837349
268
0.412563
false
5.17457
false
false
false
kiki86151/CKIP
PyCKIP/PyCCP.py
1
1481
#!/usr/bin/python # -*- coding: utf-8 -*- ######################################################################### # File Name: PyCCP.py # Author: Carson Wang # mail: kiki86151@hotmail.com # Created Time: 2017-03-04 21:48:51 ######################################################################### import urllib, urll...
bsd-3-clause
8,865,408,649,147,205,000
30.510638
86
0.505739
false
3.768448
false
false
false
JordanReiter/django-messages
django_messages/views.py
1
9916
import re from django.http import Http404, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.contrib import messages from django.contrib.auth.decorators import login_required from django.utils.translation import ugettext as _ ...
bsd-3-clause
-8,744,500,396,322,902,000
38.193676
99
0.649556
false
4.205259
false
false
false
GoogleCloudPlatform/cloudml-samples
census/keras/trainer/model.py
1
6274
# Copyright 2017 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
-3,561,300,868,377,775,000
34.851429
80
0.640421
false
3.960859
false
false
false
bkuczenski/lca-tools
antelope_v2_server/antelope/lc_pub.py
1
5428
""" A data structure describing the publication of an LCA data resource. Each publication has two forms: (1) the serialized form lives in the antelope directory and provides enough information to reconstitute the This object is supposed to provide the basic information and functionality common to both v1 and v2 reso...
gpl-2.0
8,605,270,400,607,402,000
33.138365
120
0.649042
false
4.35634
false
false
false
PKRoma/poedit
deps/boost/tools/build/test/TestCmd.py
7
20915
""" TestCmd.py: a testing framework for commands and scripts. The TestCmd module provides a framework for portable automated testing of executable commands and scripts (in any language, not just Python), especially commands and scripts that require file system interaction. In addition to running tests and evaluating...
mit
-138,059,334,429,083,740
33.570248
80
0.589099
false
4.185511
true
false
false
uffejakobsen/libsigrokdecode
decoders/can/pd.py
3
21034
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de> ## Copyright (C) 2019 Stephan Thiele <stephan.thiele@mailbox.org> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as p...
gpl-3.0
-9,165,277,726,687,421,000
39.527938
93
0.530855
false
3.424617
false
false
false
thequbit/mc911feedwatcher
scraper/popagencies.py
1
2136
import sys import _mysql as mysql def get_mysql_credentials(): # read in credentials file lines = tuple(open('mysqlcreds.txt', 'r')) # return the tuple of the lines in the file # # host # dbname # username # password # return lines def...
gpl-3.0
-2,299,675,220,458,369,300
25.37037
114
0.645131
false
3.518946
false
false
false
krathjen/studiolibrary
src/studiolibrary/widgets/lineedit.py
1
5144
# Copyright 2020 by Kurt Rathjen. All Rights Reserved. # # This library is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. This lib...
lgpl-3.0
-1,201,288,177,002,947,600
27.10929
86
0.617807
false
4.26888
false
false
false
DarkSouL11/UIP
uiplib/gui/mainGui.py
1
3273
"""Module that builds the Graphical User Interface.""" from uiplib.scheduler import scheduler from uiplib.setWallpaper import change_background from uiplib.utils.utils import update_settings, check_sites from uiplib.gui.gallery import Gallery from uiplib.gui import generalTab, settingsTab from tkinter import * from ...
agpl-3.0
4,991,921,592,364,811,000
30.776699
75
0.583562
false
4.278431
false
false
false
alsimoes/panelaco
website/models.py
2
1511
# -*- coding: utf-8 -*- from django.db import models class Profissao(models.Model): descricao = models.CharField(max_length=20) class Meta: ordering = ["descricao"] verbose_name_plural = "profissoes" def __unicode__(self): return self.descricao class Membro(...
gpl-3.0
7,481,464,319,621,882,000
25.981481
52
0.613651
false
3.50116
false
false
false
PLyczkowski/Sticky-Keymap
2.74/scripts/addons_contrib/ewoc_projects_tools/mesh_deathguppie.py
4
21956
# ##### 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
7,140,595,850,951,967,000
35.052545
134
0.619648
false
2.623805
false
false
false
lhagan/phoshare
Phoshare.py
8
1125
#!/usr/bin/env python """Reads iPhoto library info, and exports photos and movies.""" # Copyright 2010 Google 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-2.0
3,060,881,644,531,512,300
31.142857
76
0.684444
false
3.461538
false
false
false
mlex121/fb-chat-messages
get_chat_messages.py
1
3628
#!/usr/bin/python """This is a quick script I wrote up to count how many messages each of my friends posted in a big group chat. This script depends on the Facebook Platform Python SDK found here: https://github.com/pythonforfacebook/facebook-sdk """ from __future__ import division import argparse import faceboo...
mit
-7,504,689,657,368,632,000
32.592593
79
0.577453
false
4.451534
false
false
false
adsarwate/mergetex
mergetex.py
1
3284
#!/usr/bin/python # mergetex.py # # Script for merging tex files into a single monolithic file. This # script should make it easy to generate an ArXiV-friendly single # .tex file from a paper that is broken into subfiles using LaTeX's # \input{} command. # # USAGE: # python mergetex.py [input] [output] # py...
gpl-3.0
-3,236,888,002,015,941,000
30.576923
90
0.561815
false
3.723356
false
false
false
jdmonaco/vmo-feedback-model
src/figures/remapping.py
1
4689
#encoding: utf-8 """ remapping -- Remapping figure showing orthogonalization from initial phase reset Created by Joe Monaco on 2010-10-12. Copyright (c) 2009-2011 Johns Hopkins University. All rights reserved. This software is provided AS IS under the terms of the Open Source MIT License. See http://www.opensource....
mit
-8,417,916,709,066,976,000
36.214286
81
0.579868
false
3.88806
false
false
false
vpelletier/neoppod
neo/master/pt.py
1
13272
# # Copyright (C) 2006-2016 Nexedi SA # # 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 distributed...
gpl-2.0
-6,899,602,291,962,877,000
37.469565
80
0.526673
false
4.479244
false
false
false
mlperf/training_results_v0.5
v0.5.0/google/cloud_v3.8/gnmt-tpuv3-8/code/gnmt/model/t2t/tensor2tensor/models/research/vqa_recurrent_self_attention.py
3
10599
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
apache-2.0
6,046,979,351,341,825,000
32.435331
80
0.714407
false
3.458075
false
false
false
shirishagaddi/django-simple-pagination
simple_pagination/templatetags/paginate.py
1
12468
"""Django Endless Pagination template tags.""" import re from django import template from django.utils.encoding import iri_to_uri from simple_pagination import settings from django.core.paginator import ( EmptyPage, Page, PageNotAnInteger, Paginator, ) from simple_pagination import utils from simple_p...
mit
-5,307,911,888,844,843,000
32.426273
79
0.624398
false
4.038873
false
false
false
malkavi/Flexget
dev_tools.py
1
4640
import fileinput import io import os import shutil import subprocess import zipfile import click import requests def _get_version(): with open('flexget/_version.py') as f: g = globals() l = {} exec(f.read(), g, l) # pylint: disable=W0122 if not l['__version__']: raise click.C...
mit
3,200,527,783,122,051,000
30.351351
129
0.566379
false
3.561013
false
false
false
opencord/voltha
ofagent/protos/third_party/__init__.py
1
1583
# # Copyright 2017 the original author or 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...
apache-2.0
-7,145,884,688,873,406,000
30.66
77
0.714466
false
3.908642
false
false
false
maemre/rasim
args.py
1
2673
# -*- coding: utf-8 -*- """ Created on Mon Nov 10 17:14:37 2014 @author: Mehmet Emre Parser for command-line arguments, params will use this for setting it's values. """ import argparse parser = argparse.ArgumentParser(description="rasim - A radio network simulator") parser.add_argument('--batch-run', action='store...
apache-2.0
1,636,378,716,372,418,000
80
146
0.729892
false
3.61705
false
false
false
mattjmuw/iam-messaging
messagetools/aws.py
1
2352
# ======================================================================== # Copyright (c) 2015 The University of Washington # # 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 # # ht...
apache-2.0
1,520,452,569,509,629,400
26.034483
75
0.596088
false
3.986441
false
false
false
sonictk/MARI-Extension-Pack
Scripts/stkMariTools/Tools/Cache/clearHistory.py
1
1841
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Module clearHistory """ # noinspection PyUnresolvedReferences import logging import mari import traceback from PySide.QtGui import QMessageBox from stkMariTools.lib.ui_utils import MariToolsMenuItem def registerMenuItem(): """ This method acts as a identifi...
bsd-3-clause
-1,078,873,126,308,673,300
25.314286
79
0.593156
false
4.625628
false
false
false
OpenInkpot-archive/iplinux-xcb-proto
src/type.py
2
2054
#!/usr/bin/python from xml.sax.saxutils import XMLFilterBase, XMLGenerator from xml.sax.xmlreader import AttributesImpl from xml.sax import make_parser import sys def AttributesUnion(base, **values): baseitems = dict(base) baseitems.update(values) return AttributesImpl(baseitems) class AnnotateType(XMLFilterBase)...
mit
-6,028,549,231,484,408,000
26.756757
98
0.669426
false
2.955396
false
false
false
xiviwo/baiducloud
TaskDialog.py
1
9943
from gi.repository import Gtk import json,os from log import logger import settings import cloudapi import utils import re from Spinner import SpinnerDialog from VcodeDialog import VcodeDialog import urllib.parse class Singleton(type): def __init__(cls, name, bases, dict): super(Singleton, cls).__init__(name, ba...
gpl-3.0
3,616,626,242,526,466,000
29.314024
97
0.672131
false
2.861295
false
false
false
AmritaLonkar/trunk
SU2_PY/SU2/io/state.py
2
8884
## \file state.py # \brief python package for state # \author Trent Lukaczyk, Aerospace Design Laboratory (Stanford University) <http://su2.stanford.edu>. # \version 2.0.6 # # Stanford University Unstructured (SU2) Code # Copyright (C) 2012 Aerospace Design Laboratory # # This program is free software: you can redi...
gpl-2.0
6,104,734,270,056,771,000
32.273408
103
0.512269
false
4.466566
true
false
false
komola/swift-robots
robots/middleware.py
1
1570
# Copyright 2013 komola GmbH # # 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, s...
apache-2.0
2,509,246,652,877,904,400
30.42
98
0.666879
false
3.934837
false
false
false
swenger/glitter
examples/opencltexture2.py
1
3793
#!/usr/bin/env/python """Minimal example of OpenGL/CL interaction using textures. @author: Kai Ruhl @since 2013-02""" import sys import numpy as np import pyopencl as cl from glitter import Texture2D from glitter.raw import gl cl_source = """ const sampler_t T_RAW_SAMPLER = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRES...
mit
214,331,486,804,581,470
40.681319
165
0.652254
false
3.17938
false
false
false
mgymrek/pybamview
pybamview/utils.py
1
3400
# -*- coding: utf-8 -*- import os import random import sys from subprocess import Popen, PIPE, STDOUT def message(msg, msgtype='progress'): """Send a message to console. Args: msgtype (str): one of 'progress', 'warning', 'error', or 'debug' """ message = "[%(level)s]: %(text)s" % dict(level=ms...
mit
-5,352,880,757,352,825,000
32.663366
116
0.59
false
3.393214
false
false
false
jtauber/sgf
test.py
1
2727
#!/usr/bin/env python import glob import sgf try: from StringIO import StringIO # pragma: no cover except ImportError: # pragma: no cover from io import StringIO # pragma: no cover for filename in glob.glob("examples/*.sgf"): with open(filename) as f: sgf.parse(f.read()) example = "(;FF[4]G...
mit
2,341,016,438,754,120,000
20.139535
71
0.646498
false
2.948108
false
false
false
rpetit3-science/call_variants
call_variants/helpers/time_job.py
1
1609
#! /usr/bin/env python """ Add decorator to time pipeline steps. See the following links for more info: https://github.com/bunbun/ruffus/issues/15 https://github.com/daler/pipeline-example/blob/master/pipeline-2/helpers.py """ import sys import time class time_job(object): """ @time_job decorator. ...
mit
5,159,627,858,735,345,000
27.22807
79
0.525171
false
4.11509
false
false
false
codeforgood13/ability
shakti/migrations/0003_auto__del_field_jobdescriptor_who_can__add_field_jobdescriptor_who_can.py
1
7736
# -*- 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): # Deleting field 'JobDescriptor.who_can' db.delete_column(u'shakti_jobdescriptor', 'who_can') # Add...
mit
-2,028,688,624,644,257,300
56.738806
128
0.544209
false
3.505211
false
false
false
Charlotte-Morgan/inasafe
safe/gui/tools/multi_exposure_dialog.py
1
29397
# coding=utf-8 """Multi Exposure Tool.""" import logging from collections import OrderedDict from qgis.PyQt.QtCore import Qt from qgis.PyQt.QtWidgets import ( QDialog, QComboBox, QLabel, QSizePolicy, QTreeWidgetItem, QListWidgetItem ) from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtXml im...
gpl-3.0
-3,040,091,875,839,423,500
40.114685
79
0.579719
false
4.264761
false
false
false
andrewyoung1991/supriya
supriya/tools/pendingugentools/PulseDivider.py
1
3759
# -*- encoding: utf-8 -*- from supriya.tools.ugentools.UGen import UGen class PulseDivider(UGen): r''' :: >>> pulse_divider = ugentools.PulseDivider.ar( ... div=2, ... start=0, ... trigger=0, ... ) >>> pulse_divider PulseDivider.ar() ...
mit
-767,428,144,535,581,200
20.860465
64
0.444533
false
4.08587
false
false
false
beschulz/kyototycoon
tests/test_cas.py
2
2458
# -*- coding: utf-8 -*- from nose.tools import * from pykt import KyotoTycoon, KTException import time def clear(): db = KyotoTycoon() db = db.open() db.clear() db.close() @raises(IOError) def test_err_cas(): db = KyotoTycoon() db.cas("A") @with_setup(setup=clear) def test_cas(): db = Ky...
gpl-2.0
1,377,580,386,237,139,700
19.586207
53
0.523451
false
2.39039
true
false
false
schleichdi2/OPENNFR-6.0-CORE
bitbake/lib/bb/checksum.py
3
4435
# Local file checksum cache implementation # # Copyright (C) 2012 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that i...
gpl-2.0
7,265,004,168,654,512,000
32.097015
108
0.554904
false
4.102683
false
false
false
dwdm/splash
splash/tests/test_execute.py
1
94230
# -*- coding: utf-8 -*- from __future__ import absolute_import import re from base64 import standard_b64decode import unittest from cStringIO import StringIO import numbers import time from PIL import Image import requests import pytest from splash.exceptions import ScriptError lupa = pytest.importorskip("lupa") fro...
bsd-3-clause
3,293,931,774,307,080,000
34.236615
97
0.541146
false
3.798563
true
false
false
abought/osf.io
website/addons/box/views.py
16
2647
"""Views for the node settings page.""" # -*- coding: utf-8 -*- import os import httplib as http from box.client import BoxClient, BoxClientException from urllib3.exceptions import MaxRetryError from framework.exceptions import HTTPError from website.addons.box.model import Box from website.addons.base import generic...
apache-2.0
3,163,338,642,290,676,700
23.284404
84
0.595769
false
3.626027
false
false
false
raspibo/Livello1
var/www/cgi-bin/trimlistredis.py
1
3590
#!/usr/bin/env python3 # Questo file visualizza la chiave "lists" redis # # Prima verifica che ci sia la chiave nel form # Serve per la parte di gestione html in python import cgi import cgitb # Abilita gli errori al server web/http cgitb.enable() # Le mie librerie mjl (Json, Files), mhl (Html), flt (T w/ Redis) im...
mit
-8,274,615,101,611,687,000
22.774834
121
0.612256
false
2.558803
false
true
false
hazelcast/hazelcast-python-client
hazelcast/protocol/codec/custom/sql_query_id_codec.py
1
2446
from hazelcast.protocol.builtin import FixSizedTypesCodec, CodecUtil from hazelcast.serialization.bits import * from hazelcast.protocol.client_message import END_FRAME_BUF, END_FINAL_FRAME_BUF, SIZE_OF_FRAME_LENGTH_AND_FLAGS, create_initial_buffer_custom from hazelcast.sql import _SqlQueryId _MEMBER_ID_HIGH_ENCODE_OFF...
apache-2.0
2,555,215,645,692,374,500
60.15
142
0.729763
false
2.915375
false
false
false
python-xmp-toolkit/python-xmp-toolkit
libxmp/files.py
1
7164
# -*- coding: utf-8 -*- # # Copyright (c) 2008-2009, European Space Agency & European Southern # Observatory (ESA/ESO) # Copyright (c) 2008-2009, CRS4 - Centre for Advanced Studies, Research and # Development in Sardinia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # mod...
bsd-3-clause
8,964,087,153,198,126,000
36.705263
80
0.649079
false
3.882927
false
false
false
fdouetteau/PyBabe
pybabe/charset.py
1
3016
import codecs import csv import cStringIO import datetime ## From samples in http://docs.python.org/library/csv.html class UTF8Recoder(object): """ Iterator that reads an encoded stream and reencodes the input to UTF-8 Made mandatory by the csv module operating only on 'str' """ def __init__(sel...
bsd-3-clause
1,657,490,347,166,072,600
28.281553
79
0.590849
false
3.827411
false
false
false
ResearchSoftwareInstitute/MyHPOM
theme/tests/functional.py
1
5026
import time from django.core.urlresolvers import reverse from selenium import webdriver from selenium.webdriver.common.by import By from theme.tests.multiplatform import SeleniumTestsParentClass, create_driver class DesktopTests(SeleniumTestsParentClass.MultiPlatformTests): def setUp(self, driver=None): ...
bsd-3-clause
-6,951,728,978,178,363,000
43.087719
97
0.667927
false
3.524544
true
false
false
sparkslabs/kamaelia_
Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/OpenGL/MiniExamples/SimpleCube.py
6
1357
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
apache-2.0
-6,773,426,909,429,491,000
41.40625
92
0.680914
false
3.609043
false
false
false
jk977/twitch-plays
bot/interfaces/emuinput.py
1
4275
import config import os import re from . import * from interfaces.validator import Validator class EmuInput(Validator): ''' Base class for emulator inputs. Children classes only need to implement functions _validate_content and _validate_count to return true when the respective fields are valid, and ma...
gpl-3.0
2,922,635,052,704,346,000
27.506667
119
0.573099
false
4.543039
false
false
false
enoodle/virt-deploy
setup.py
2
1268
# # Copyright 2015 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 2 of the License, or # (at your option) any later version. # # This program is distributed in th...
gpl-2.0
-5,959,320,822,127,086,000
32.368421
78
0.722397
false
4
false
false
false
escudocloud/django_proxy_swift
proxy_server/enc_swift/simpleKeystoneClient.py
1
2290
#!/usr/bin/env python from keystoneclient.exceptions import NotFound, Conflict from keystoneauth1.identity import v3 from keystoneclient.auth import identity from keystoneclient import session from keystoneclient.v3 import client from myLogger import * class SimpleKeystoneClient: """ Add enc functions to cre...
apache-2.0
-7,565,121,562,511,033,000
39.892857
90
0.608734
false
3.927959
false
false
false
2franix/homewatcher
homewatcher/configuration.py
1
63634
#!/usr/bin/python3 # Copyright (C) 2014-2017 Cyrille Defranoux # # This file is part of Homewatcher. # # Homewatcher 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 y...
gpl-3.0
-8,028,309,703,692,791,000
46.594615
333
0.66136
false
4.20526
true
false
false
DoddyPhysics/AxionNet
RadiationBackground/gstar.py
1
1045
""" gstarS and gstarR fits from Wantz and Shellard, 0910.1066, Appendix A """ import numpy as np a0S=1.36 a1S=np.asarray([0.498,0.327,0.579,0.140,0.109]) a2S=np.asarray([-8.74,-2.89,-1.79,-0.102,3.82]) a3S=np.asarray([0.693,1.01,0.155,0.963,0.907]) def gS(T): """ The input temperature is measured in eV gstarS a...
mit
1,661,348,891,281,186,300
17.660714
69
0.626794
false
1.856128
false
false
false
kantale/molgenis-impute
molgenis-impute.py
1
4150
""" molgenis-impute v.0.7.0 Alexandros Kanterakis, alexandros.kanterakis@gmail.com Please read documentation in README.md """ import argparse from imputation import Imputation if __name__ == '__main__': description = """ MOLGENIS-compute imputation version 0.7.0 """ parser = argparse.ArgumentParser(descrip...
bsd-2-clause
-6,199,077,299,045,178,000
47.255814
169
0.752289
false
3.611836
false
false
false
vintol/listal-dl
Listal.py
1
7404
# Listal.py # 08/11/2016 - 31/03/2019 # v 1.2.2 import urllib.request, urllib.parse import http.cookiejar, ssl import bs4 import queue import threading import re import os import sys import argparse import time # Scrapers def get_ipages(): global IMG, STOP_AT while not qq.empty(): local = threa...
gpl-3.0
646,103,235,721,944,200
33.437209
120
0.603052
false
3.360872
false
false
false
Hitatm/Concentrator
app/views.py
1
61580
#coding:UTF-8 __author__ = 'dj' from app import app from flask import Flask, render_template, request, flash, redirect, url_for, send_from_directory from forms import Upload, ProtoFilter,User_and_pwd from utils.upload_tools import allowed_file, get_filetype, random_name from utils.gxn_topo_handler import getfile_con...
gpl-3.0
-7,940,013,802,798,929,000
40.75838
217
0.591809
false
3.210976
true
false
false
Rochester-NRT/RocAlphaGo
benchmarks/reinforcement_policy_training_benchmark.py
6
1150
from AlphaGo.training.reinforcement_policy_trainer import run_training from AlphaGo.models.policy import CNNPolicy import os from cProfile import Profile # make a miniature model for playing on a miniature 7x7 board architecture = {'filters_per_layer': 32, 'layers': 4, 'board': 7} features = ['board', 'ones', 'turns_s...
mit
2,693,906,516,910,817,000
38.655172
89
0.713913
false
3.142077
false
false
false
SKA-ScienceDataProcessor/integration-prototype
demos/02_running_a_workflow/generate_sbi_config.py
1
1542
# coding: utf-8 """Script to generate an SBI configuration for this demo.""" import datetime import json import sys from random import randint def generate_sbi(index: int = None): """Generate a SBI config JSON string.""" date = datetime.datetime.utcnow().strftime('%Y%m%d') if index is None: index ...
bsd-3-clause
4,506,671,685,868,727,000
28.653846
61
0.479248
false
3.671429
false
false
false
quiqueporta/django-rest-tools
tests/django_rest_tools_tests/settings.py
2
2299
""" Django settings for tests project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impo...
gpl-3.0
1,358,720,159,917,750,000
23.2
82
0.707699
false
3.260993
false
false
false
MDAnalysis/mdanalysis
package/MDAnalysis/converters/ParmEdParser.py
1
10818
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
gpl-2.0
-8,937,481,923,130,624,000
29.645892
85
0.566741
false
3.598802
false
false
false
ayleph/mediagoblin-recaptcha
recaptcha/tools.py
1
2772
# GNU MediaGoblin -- federated, autonomous media hosting # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. # # 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 versio...
agpl-3.0
2,041,587,880,511,200,800
41.646154
158
0.699495
false
3.834025
false
false
false
ljchang/nltools
nltools/utils.py
1
12415
''' NeuroLearn Utilities ==================== handy utilities. ''' __all__ = ['get_resource_path', 'get_anatomical', 'set_algorithm', 'attempt_to_import', 'all_same', 'concatenate', '_bootstrap_apply_func', 'set_decomposition_algorithm' ...
mit
8,238,618,207,601,119,000
33.29558
183
0.618284
false
4.013902
false
false
false
HG-Dev/tweetfeeder
tweetfeeder/tweeting.py
1
10358
""" Timed Tweet publishing """ from threading import Timer, Event from datetime import datetime, timedelta from queue import deque from time import sleep from random import uniform from tweepy import API from tweepy.models import Status from tweepy.error import TweepError from tweetfeeder.logs import Log from tweetfeed...
gpl-3.0
7,369,639,674,734,697,000
44.034783
111
0.584379
false
4.151503
true
false
false
roskakori/vcdb
vcdb/command.py
1
1897
""" Command line interface for vcdb. """ # Copyright (C) 2016 Thomas Aglassinger. # Distributed under the GNU Lesser General Public License v3 or later. import argparse import logging import os import sys import tempfile from sqlalchemy.exc import SQLAlchemyError import vcdb import vcdb.common import vcdb.subversion ...
lgpl-3.0
-774,233,551,628,635,300
31.152542
102
0.68213
false
3.927536
false
false
false
eman/tempodb-archive
setup.py
1
1078
import os from setuptools import setup project_dir = os.path.abspath(os.path.dirname(__file__)) long_descriptions = [] for rst in ('README.rst', 'LICENSE.rst'): with open(os.path.join(project_dir, rst), 'r') as f: long_descriptions.append(f.read()) setup(name='tempodb-archive', version='1.0.0', ...
bsd-2-clause
-4,740,467,918,732,794,000
32.6875
70
0.608534
false
3.809187
false
false
false
bmispelon/weirdict
weirdict/base.py
1
2306
from abc import abstractmethod from collections import MutableMapping, Mapping from .decorators import apply_keyfunc from functools import total_ordering from itertools import repeat, izip _SENTINEL = object() @total_ordering class AbstractNormalizedDict(MutableMapping): """A dictionary where keys are normalize...
bsd-2-clause
5,566,931,536,926,515,000
26.452381
83
0.619254
false
3.92845
false
false
false
nextstrain/augur
augur/utils.py
1
24646
import argparse import Bio import Bio.Phylo import gzip import os, json, sys import pandas as pd import subprocess import shlex from contextlib import contextmanager from treetime.utils import numeric_date from collections import defaultdict from pkg_resources import resource_stream from io import TextIOWrapper from ._...
agpl-3.0
4,288,972,644,168,853,000
33.615169
152
0.597095
false
3.88126
false
false
false
tdickers/mitmproxy
release/rtool.py
2
12215
#!/usr/bin/env python from __future__ import absolute_import, print_function, division from os.path import join import contextlib import os import shutil import subprocess import re import shlex import runpy import zipfile import tarfile import platform import click import pysftp import fnmatch # https://virtualenv.py...
mit
-2,785,414,311,183,450,600
30.97644
98
0.567745
false
3.880241
true
false
false
terrelln/python-zstandard
bench.py
1
34426
#!/usr/bin/env python # Copyright (c) 2016-present, Gregory Szorc # All rights reserved. # # This software may be modified and distributed under the terms # of the BSD license. See the LICENSE file for details. """Very hacky script for benchmarking zstd. Like most benchmarks, results should be treated with skepticism...
bsd-3-clause
887,005,041,969,168,800
34.674611
92
0.601057
false
3.776437
false
false
false
talbrecht/pism_pik07
site-packages/PISM/ssa.py
1
22015
# Copyright (C) 2011, 2012, 2013, 2014, 2015 David Maxwell and Constantine Khroulev # # This file is part of PISM. # # PISM is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 3 of the License, or (...
gpl-3.0
5,655,968,930,728,700,000
41.17433
138
0.599909
false
3.583171
true
false
false
axt/angr
angr/storage/file.py
4
10323
from ..state_plugins.plugin import SimStatePlugin from ..state_plugins.sim_action_object import SimActionObject from .. import sim_options import claripy import logging l = logging.getLogger("angr.storage.file") # TODO: symbolic file positions import itertools file_counter = itertools.count() dialogue_counter = itert...
bsd-2-clause
6,460,877,108,234,902,000
32.625407
158
0.606316
false
3.709307
false
false
false
TheAlgorithms/Python
project_euler/problem_067/sol1.py
1
1261
""" Problem Statement: By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom in triangle.txt (right click and 'Save Link/Target As...'), a 15K te...
mit
8,428,645,675,244,132,000
24.734694
79
0.555115
false
3.42663
false
false
false
FireBladeNooT/Medusa_1_6
medusa/server/web/core/error_logs.py
1
5951
# coding=utf-8 """Route to error logs web page.""" from __future__ import unicode_literals from datetime import datetime, timedelta from mako.filters import html_escape from six import text_type from tornroutes import route from .base import PageTemplate, WebRoot from .... import logger, ui from ....classes import E...
gpl-3.0
-6,083,476,195,281,966,000
38.673333
148
0.596202
false
3.904856
false
false
false
annoviko/pyclustering
pyclustering/cluster/elbow.py
1
9785
"""! @brief Elbow method to determine the optimal number of clusters for k-means clustering. @details Implementation based on paper @cite article::cluster::elbow::1. @authors Andrei Novikov (pyclustering@yandex.ru) @date 2014-2020 @copyright BSD-3-Clause """ import math from pyclustering.cluster.kme...
gpl-3.0
-6,176,914,998,356,930,000
38.770833
225
0.601635
false
3.961538
false
false
false
alabid/blinkdb
bin/dev/clear-buffer-cache.py
12
1406
#!/usr/bin/python # Copyright (C) 2012 The Regents of The University California. # 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/license...
apache-2.0
-2,378,912,866,519,992,300
28.914894
76
0.706259
false
3.247113
false
false
false
matsumoto-r/synciga
src/build/android/pylib/base/base_test_runner.py
2
7812
# Copyright (c) 2012 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. import contextlib import httplib import logging import os import tempfile import time from pylib import android_commands from pylib import constants fro...
bsd-3-clause
-5,498,488,929,738,747,000
36.37799
80
0.670635
false
3.869242
true
false
false
ncgr/lis_gis
grin_app/views.py
2
18316
import logging import simplejson as json import re from functools import reduce from decimal import Decimal from django.conf import settings from django.db import connection from django.shortcuts import render from django.http import HttpResponse from django.views.decorators.csrf import ensure_csrf_cookie from grin_app...
gpl-3.0
8,975,848,377,664,379,000
33.887619
80
0.589102
false
3.548925
false
false
false
testmana2/test
Helpviewer/Network/QtHelpAccessHandler.py
2
4066
# -*- coding: utf-8 -*- # Copyright (c) 2009 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a scheme access handler for QtHelp. """ from __future__ import unicode_literals import mimetypes import os from PyQt5.QtCore import QByteArray from .SchemeAccessHandler import SchemeAccessHand...
gpl-3.0
-7,076,045,622,750,163,000
31.528
79
0.570831
false
3.79291
false
false
false
Jumpscale/jumpscale6_core
apps/gridportal/base/system__packagemanager/methodclass/system_packagemanager.py
1
1921
from JumpScale import j import JumpScale.grid.agentcontroller class system_packagemanager(j.code.classGetBase()): def __init__(self): self._te = {} self.actorname = "packagemanager" self.appname = "system" self.client = j.clients.agentcontroller.get() self.gid = j.applicati...
bsd-2-clause
6,941,479,301,493,565,000
35.245283
114
0.624154
false
3.737354
false
false
false
Marcelpv96/SITWprac2017
sportsBetting/features/steps/register_events.py
1
1797
from behave import * use_step_matcher('parse') @given('Exist a event created by "{username}"') def step_impl(context, username): from sportsBetting.models import Event, Team from django.contrib.auth.models import User for row in context.table: name = row['local'] + ' v ' + row['visitor'] ...
gpl-3.0
9,157,351,948,259,877,000
34.94
100
0.604897
false
3.496109
false
false
false
cleinias/Homeo
src/VREP/VREPDetermTest.py
1
27074
''' Created on Feb 22, 2015 @author: stefano Script that tests V-REP deterministic runs. Runs V-REP repeatedly with a deterministic series of random motor commands over TCP/IP Include also related tests (such as light readings, Braitenberg-like simulations) Assumes: 1. V-REP world ("Scene") "$HOMEO/src/VREP/Khepera...
gpl-3.0
6,535,370,862,703,530,000
55.640167
162
0.582182
false
3.613239
true
false
false
ndawe/pyAMI
pyAMI/query.py
1
28966
# Author: Noel Dawe from __future__ import division import re import sys from pyAMI.objects import DatasetInfo, RunPeriod from pyAMI.schema import * from pyAMI.utils import * from pyAMI.defaults import YEAR, STREAM, TYPE, PROJECT, PRODSTEP DATA_PATTERN = re.compile( '^(?P<project>\w+).(?P<run>[0-9]+).' '(?P...
gpl-3.0
-2,716,299,493,972,413,000
32.720605
139
0.528378
false
4.271641
false
false
false
Arpaso/alphabetic-simple
src/alphabetic/models.py
1
1038
### -*- coding: utf-8 -*- #################################################### from django.core.cache import cache SESSION_GROUP_KEY = 'alphabetic_default_group' DEFAULT_GROUP = 'rus' CACHE_SECOND_PREFIX = 'alphabetic_second' def get_group(request): return request.session.get(SESSION_GROUP_KEY, DEFAULT_GROUP) de...
mit
2,268,775,377,863,402,800
31.4375
82
0.647399
false
3.591696
false
false
false
tilezen/joerd
setup.py
2
1627
from setuptools import setup, find_packages version = '0.0.1' setup(name='joerd', version=version, description="A tool for downloading and generating elevation data.", long_description=open('README.md').read(), classifiers=[ # strings from http://pypi.python.org/pypi?%3Aaction=list_c...
mit
-4,738,945,808,598,778,000
30.901961
79
0.553165
false
4.193299
false
false
false
yuanming-hu/taichi
examples/mpm_lagrangian_forces.py
1
5908
import numpy as np import taichi as ti ti.init(arch=ti.gpu) dim = 2 quality = 1 # Use a larger integral number for higher quality n_particle_x = 100 * quality n_particle_y = 8 * quality n_particles = n_particle_x * n_particle_y n_elements = (n_particle_x - 1) * (n_particle_y - 1) * 2 n_grid = 64 * quality dx = 1 / ...
mit
2,220,515,973,470,853,600
30.094737
124
0.488152
false
2.80932
false
false
false
dm6718/RITSAR
ritsar/phsRead.py
1
12945
#Include dependencies import numpy as np from numpy import pi from numpy.linalg import norm from scipy.io import loadmat from scipy.stats import linregress from fnmatch import fnmatch import os import sys import xml.etree.ElementTree as ET def AFRL(directory, pol, start_az, n_az=3): ###################################...
mit
-1,367,512,936,624,855,000
30.49635
78
0.449903
false
3.285533
false
false
false
jfelectron/python-driver
cassandra/murmur3.py
15
2387
from six.moves import range import struct def body_and_tail(data): l = len(data) nblocks = l // 16 tail = l % 16 if nblocks: return struct.unpack_from('qq' * nblocks, data), struct.unpack_from('b' * tail, data, -tail), l else: return tuple(), struct.unpack_from('b' * tail, data, -t...
apache-2.0
-2,561,335,672,573,787,600
20.123894
103
0.518224
false
2.664063
false
false
false
drogenlied/qudi
logic/laser_logic.py
1
5941
#-*- coding: utf-8 -*- """ Laser management. Qudi 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. Qudi is distributed in the hope that it w...
gpl-3.0
3,949,672,181,347,411,500
34.795181
91
0.63188
false
3.596247
false
false
false