repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
jonahbaron/xml_authentication
rot13.py
1
1218
#!/usr/bin/env python import string import argparse def rot13(text1): rot = string.maketrans( "ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz", "NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm") text2 = string.translate(text1, rot) return text2 def rot13file(fname): with open(fname) as f: fcon...
mit
3,926,159,674,733,126,700
22.882353
131
0.70936
false
3.045
false
false
false
TomRowland/University-of-Oregon
CIS_210/fall_2015/week_2/counting_majors/counts.py
1
1513
""" Count the number of occurrences of each major code in a file. Authors: #FIXME Credits: #FIXME Input is a file in which major codes (e.g., "CIS", "UNDL", "GEOG") appear one to a line. Output is a sequence of lines containing major code and count, one per major. """ import argparse def count_codes(majors_file): ...
gpl-2.0
1,830,469,701,498,136,000
27.018519
92
0.624587
false
3.811083
false
false
false
raphaelgyory/django-rest-messaging
tests/test_serializers.py
1
3707
# coding=utf8 # -*- coding: utf8 -*- # vim: set fileencoding=utf8 : from __future__ import unicode_literals from django.conf import settings from django.contrib.auth.models import User from rest_framework import serializers from rest_messaging.compat import compat_serializer_method_field from rest_messaging.models im...
isc
8,838,852,320,773,912,000
44.765432
168
0.713515
false
4.26092
true
false
false
CuppenResearch/vcf-explorer
vcfexplorer/api/resources.py
1
6497
""" vcfexplorer.api.resources VCF Explorer api resources """ from flask.ext.restful import Api, Resource, abort, reqparse import pymongo from ..helpers import get_mongodb ## Common argument parsing common_reqparse = reqparse.RequestParser() common_reqparse.add_argument('limit', type = int, default = 1) comm...
mit
4,725,029,672,474,799,000
25.518367
103
0.481299
false
4.030397
false
false
false
Spoken-tutorial/spoken-website
events/migrations/0016_learndrupalfeedback.py
1
3536
# -*- coding: utf-8 -*- from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('events', '0015_stworkshopfeedback_stworkshopfeedbackpost_stworkshopfeedbackpre'), ] operations = [ migrations.CreateModel( name='LearnDrupalFeedback', ...
gpl-3.0
-6,650,883,392,878,040,000
85.243902
387
0.565611
false
3.101754
false
false
false
jcarrascal/petprojects
xna-flashpunk/as3tocsharp.py
1
1724
#!/usr/bin/python import os, os.path, re def visit_file(fullpath): try: infile = open(fullpath, 'rb') text = "".join(infile.readlines()) infile.close() except IOError as ex: print fullpath, "not processed:", ex text = re.sub(r'\bString\b', 'string', text) text = re.sub(r'\bNumber\b', 'float', ...
mit
-2,299,124,958,148,542,200
38.093023
121
0.566125
false
2.361644
false
false
false
FlintHill/SUAS-Competition
VectorFieldSDASimulatorPackage/VectorFieldSDASimulator/matplotlib_testing.py
1
1647
import numpy as np import matplotlib from matplotlib.patches import Circle, Wedge, Polygon from matplotlib.collections import PatchCollection import matplotlib.pyplot as plt from SDAWithVectorField import * from MovingObstacleSimulator import * import matplotlib.patches as patches from datetime import datetime import s...
mit
-6,450,744,835,015,023,000
22.542857
76
0.664845
false
2.754181
false
false
false
satterly/alerta5
alerta/app/webhooks/riemann.py
1
1658
from flask import request, g, jsonify from flask_cors import cross_origin from alerta.app.auth.utils import permission from alerta.app.models.alert import Alert from alerta.app.utils.api import process_alert, add_remote_ip from alerta.app.exceptions import ApiError, RejectException from . import webhooks def parse...
apache-2.0
1,857,266,815,311,275,500
28.607143
76
0.656212
false
3.742664
false
false
false
lsp84ch83/PyText
PyGameImage框架/11.py
1
3457
# _*_ coding: utf-8 _*_ import pygame import random from sys import exit class Bullet: def __init__(self): self.x = 0 self.y = -1 self.image = pygame.image.load('bullet.png').convert_alpha() self.active = False def move(self): if self.active: self.y -= 0.8 ...
gpl-3.0
-2,327,678,143,261,059,000
26.097561
88
0.540954
false
2.926251
false
false
false
eugene-petrash/selenium-webdriver-full-tutorial
python-example/pages/product_page.py
1
2067
from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC class ProductPage: def __init__(self, driver): self.driver = driver self.wait = WebDriverWait(driver, 10) def open(self, numb...
apache-2.0
-163,330,474,248,367,170
47.069767
159
0.630866
false
3.639085
false
false
false
zerothi/sisl
sisl/io/vasp/sile.py
1
1772
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. """ Define a common VASP Sile """ from ..sile import Sile, SileCDF, SileBin from sisl._internal import set_module import...
lgpl-3.0
2,548,451,849,167,419,000
24.681159
96
0.664786
false
3.343396
false
false
false
SamYaple/apt-reflect
apt_reflect/indices/sources.py
1
2017
import logging import re LOG = logging.getLogger(__name__) OPT_MAP = { 'Files': 'md5', 'Checksums-Sha1': 'sha1', 'Checksums-Sha256': 'sha256', 'Checksums-Sha512': 'sha512', } class SourcesIndex: def __init__(self, data): self.word_opt = { 'Directory', } self.m...
mit
-5,674,739,369,248,854,000
25.539474
71
0.494298
false
3.908915
false
false
false
stochasticHydroTools/RotationalDiffusion
sphere/sphere_rotational_msd.py
1
14671
''' Estimate the total time dependent MSD (with std dev) for a sphere near a single wall, and save to a pkl file in the data subfolder. This file can then be used to plot any component of time dependent mobility with the plot_sphere_rotational_msd.py script. We care most about the x-x diffusion and how it relates to ...
gpl-3.0
3,765,284,513,898,685,000
38.227273
95
0.625315
false
3.465045
false
false
false
MikeLaptev/sandbox_python
mera/practice_with_function/function_with_arguments.py
1
1507
''' Created on Aug 3, 2015 @author: Mikhail @summary: Create several functions: 1. First function has two positional parameters and infinity numbers of positional parameters 2. Second function has a mandatory parameter with key and infinity number of parameters with keys ''' def function_one(param_1, param_2, *list_...
apache-2.0
8,844,934,310,798,691,000
37.641026
97
0.615129
false
3.554245
false
false
false
yaoice/dzhops
managekeys/views.py
1
12524
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.views.generic.list import ListView from hostlist.models import...
apache-2.0
-6,962,178,651,873,938,000
26.547511
96
0.559872
false
3.170833
false
false
false
bmccann/examples
OpenNMT/preprocess.py
1
5950
import onmt import argparse import torch parser = argparse.ArgumentParser(description='preprocess.lua') ## ## **Preprocess Options** ## parser.add_argument('-config', help="Read options from this file") parser.add_argument('-train_src', required=True, help="Path to the training source data")...
bsd-3-clause
-1,177,454,665,738,133,200
31.513661
92
0.565882
false
3.896529
false
false
false
PLOS/citation_scripts
xml_parsing.py
1
4591
#!/usr/bin/env python # coding=utf-8 ''' xml_parsing.py Utilities for using the XML parsing API. ''' import json import time from multiprocessing import Pool import requests # the only non-native dependency here BASE_URL='http://xmlapi.richcitations.org/v0/' PAPER_URL='%spapers'%(BASE_URL) DELAY = 1 # delay betwe...
mit
8,917,456,506,323,129,000
38.239316
128
0.635809
false
3.426119
false
false
false
HacktheCampus/my
main/email.py
1
3331
from django.core.mail import send_mail from django.template.loader import render_to_string from django.conf import settings from django.urls import reverse def recover_token_email(hacker): context = { 'title': 'Recuperação de Token', 'subtitle': '', 'description': 'Você está recebendo essa...
agpl-3.0
-6,316,297,480,441,199,000
40.848101
314
0.649728
false
3.095506
false
false
false
Luthaf/Zested
zested/gui/editor.py
1
7972
import os import urllib.request import time from PySide import QtGui, QtUiTools, QtCore from zested import UI_DIR, CSS_DIR from zested.render import MarkdownRenderThread from zested.spellcheck import MarkdownHighlighter from zested.gui.messages import SaveModifiedMessage RENDER_INTERVAL = 500 class ZestedEditorTab...
bsd-2-clause
-2,417,593,150,434,194,000
30.262745
80
0.579779
false
4.107161
false
false
false
jimmyskull/ironandblood
ironandblood/game/views.py
1
7269
from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.db.models impo...
mit
-4,252,593,656,091,220,500
33.126761
80
0.673545
false
3.554523
false
false
false
Dybov/real_estate_agency
real_estate_agency/new_buildings/migrations/0004_residentalcomplex_slug.py
1
1458
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-09-09 19:44 from __future__ import unicode_literals from django.db import migrations, models from uuslug import slugify def create_slug(apps, schema_editor): ResidentalComplex = apps.get_model("new_buildings", "ResidentalComplex") for rc in Resident...
mit
7,644,100,442,580,730,000
28.142857
121
0.565826
false
3.933884
false
false
false
ozmartian/tvlinker
setup.py
1
2737
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from codecs import open from os import path from re import match from setuptools import setup def get_value(varname, filename='tvlinker/__init__.py'): with open(path.join(here, filename), encoding='utf-8') as initfile: for line in initfile.readli...
gpl-3.0
-1,270,775,642,614,847,000
31.2
118
0.611984
false
3.790859
false
false
false
yu239/Paddle
benchmark/tensorflow/image/smallnet_mnist_cifar.py
13
9996
from six.moves import xrange # pylint: disable=redefined-builtin from datetime import datetime import math import time import tensorflow.python.platform import tensorflow as tf FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_integer('batch_size', 128, """Batch size.""") tf.app.flags.DEFINE_integer('num_batches', 100...
apache-2.0
5,429,674,672,197,741,000
31.881579
82
0.566827
false
3.573829
false
false
false
cgrates/cgradmin
contrib/django/editor/views.py
1
6173
import json from base64 import b64encode, b64decode from urllib import quote_plus import cStringIO as StringIO from editor.json_client import CGRConnector from django.http import HttpResponse, HttpResponseForbidden from django.views.decorators.http import require_POST from django.views.decorators.csrf import csrf_exemp...
gpl-3.0
7,537,355,389,779,986,000
35.526627
115
0.675846
false
3.674405
false
false
false
mp2893/medgan
process_mimic.py
1
4543
# This script processes MIMIC-III dataset and builds a binary matrix or a count matrix depending on your input. # The output matrix is a Numpy matrix of type float32, and suitable for training medGAN. # Written by Edward Choi (mp2893@gatech.edu) # Usage: Put this script to the folder where MIMIC-III CSV files are locat...
bsd-3-clause
-1,982,411,631,544,125,200
35.934959
162
0.606868
false
3.428679
false
false
false
danieldmm/minerva
evaluation/athar_corpus.py
1
15276
# Parser for Awais Athar's Citation Context Corpus # see http://www.cl.cam.ac.uk/~aa496/citation-context-corpus/ # # Copyright: (c) Daniel Duma 2015 # Author: Daniel Duma <danielduma@gmail.com> # For license information, see LICENSE.TXT from __future__ import print_function from __future__ import absolute_import i...
gpl-3.0
7,246,105,114,565,988
33.251121
131
0.586672
false
3.600283
false
false
false
smbuben/fiwse
controllers/upload.py
1
1436
# # This file is part of the fiwse project. # # Copyright (C) 2014 Stephen M Buben <smbuben@gmail.com> # # fiwse 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...
agpl-3.0
-8,373,600,226,709,610,000
34.02439
77
0.726323
false
3.769029
false
false
false
linktlh/Toontown-journey
toontown/minigame/DistributedPairingGame.py
1
21083
from pandac.PandaModules import * from toontown.toonbase.ToonBaseGlobal import * from DistributedMinigame import * from direct.fsm import ClassicFSM, State from direct.fsm import State from toontown.toonbase import TTLocalizer, ToontownTimer from toontown.toonbase import ToontownBattleGlobals from toontown.minigame imp...
apache-2.0
-3,126,926,301,154,106,400
38.629699
456
0.625907
false
3.410937
true
false
false
hunger/cleanroom
cleanroom/commands/pkg_nginx.py
1
6016
# -*- coding: utf-8 -*- """pkg_nginx command. @author: Tobias Hunger <tobias.hunger@gmail.com> """ from cleanroom.command import Command from cleanroom.helper.file import create_file from cleanroom.location import Location from cleanroom.systemcontext import SystemContext import os import textwrap import typing c...
gpl-3.0
6,947,904,007,882,055,000
31.874317
102
0.44764
false
4.260623
false
false
false
dimV36/webtests
questions.py
1
3741
#!/usr/bin/env venv/bin/python # coding=utf-8 __author__ = 'dimv36' from sys import argv from re import match from webtests.models import Process from sqlalchemy.orm.exc import NoResultFound if __name__ == '__main__': if len(argv) != 2: print('Too few arguments for script') exit(1) file_name = ...
gpl-2.0
-5,296,568,871,898,024,000
41.364706
117
0.4325
false
3.643725
false
false
false
bdcht/amoco
amoco/arch/eBPF/spec.py
1
8507
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2017 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license # spec_xxx files are providers for instruction objects. # These objects are wrapped and created by disasm.py. from amoco.arch.eBPF import env from amoco.arch.core import * # -...
gpl-2.0
1,483,204,184,605,021,000
45.233696
95
0.586341
false
2.238684
false
false
false
races1986/SafeLanguage
CEM/maintenance/check_disambiguationspage.py
1
2341
#!/usr/bin/python # -*- coding: utf-8 -*- """ Checks whether MediaWiki:Disambiguationpages exists on a site and compares it with Family.disambiguationTemplates dictionary """ # # (C) xqt 2013 # # Distributed under the terms of the MIT license. # __version__ = '$Id: b788c44efc5317d2b38e26313f07b10b4b41ad3b $' # im...
epl-1.0
9,075,420,161,665,716,000
30.213333
79
0.542503
false
3.927852
false
false
false
andrewor14/iolap
python/pyspark/sql/context.py
2
26208
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
7,906,171,644,152,183,000
37.884273
100
0.596421
false
3.965502
true
false
false
ScazLab/snap_circuits
board_perception/test/test_part_classifier.py
1
10109
from unittest import TestCase import numpy as np from board_perception.part_classifier import ( DATA, H_MARGIN, W_MARGIN, H_CELL, W_CELL, N_ROWS, N_COLUMNS, NORTH, SOUTH, EAST, WEST, ROTATION, PART_TAG_LOCATION, cell_coordinate, rotate_tag_location, tag_location_from_part, inverse_orientation, part_ref...
gpl-3.0
-4,172,323,352,358,775,300
35.76
78
0.468296
false
3.642883
true
false
false
askielboe/JAVELIN
javelin/predict.py
1
35132
from gp import Mean, Covariance, observe, Realization, GPutils from gp import NearlyFullRankCovariance, FullRankCovariance from cholesky_utils import cholesky, cholesky2, trisolve, chosolve, chodet, chosolve_from_tri, chodet_from_tri import numpy as np from numpy.random import normal, multivariate_normal from cov impor...
gpl-2.0
7,938,174,185,794,229,000
37.186957
165
0.568285
false
3.462645
false
false
false
pymedusa/Medusa
medusa/providers/torrent/html/speedcd.py
1
6679
# coding=utf-8 """Provider code for Speed.cd.""" from __future__ import unicode_literals import logging import re from medusa import tv from medusa.bs4_parser import BS4Parser from medusa.helper.common import convert_size from medusa.logger.adapters.style import BraceAdapter from medusa.providers.torrent.torrent_pr...
gpl-3.0
5,996,800,666,661,833,000
31.901478
98
0.509657
false
4.446738
false
false
false
Karaage-Cluster/karaage-debian
karaage/legacy/common/south_migrations/0003_remove_old_tables.py
3
9327
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration from django.db import connection class Migration(SchemaMigration): @staticmethod def delete_table(name): cursor = connection.cursor() if name in connection.introspection.get_table_list(cursor): db....
gpl-3.0
-765,645,482,677,866,500
72.440945
250
0.566849
false
3.630596
false
false
false
vvnc/django-dvd-releases
movies/views.py
1
6043
import datetime import json from django.shortcuts import render from django.http import Http404, HttpResponse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.utils.html import escape from .models import TmdbMovie class MovieType( object ): ALL = 'all' RELEASED = 'release...
gpl-3.0
1,558,533,382,433,422,300
30.310881
97
0.60417
false
3.433523
false
false
false
jccotou/panther
setup/database/etl/processors/etl_processor.py
1
4300
import inspect import math from sqlalchemy import select from setup.database.metadata.database import CCLEDatabase class ETLProcessor(object): # NOTE: null_value is hackish. This should be done through the data source, which should return a row object and # automatically determine which values are None b...
gpl-3.0
3,909,012,084,420,178,400
39.566038
117
0.602093
false
4.146577
false
false
false
VigneshChennai/PyUploader
pyupdater.py
1
6070
#!/bin/env python2 import urllib import urllib2 import json import os import sys import time import shutil import traceback add_url = "http://example.com/add" login_url = "http://example.com/login" class SMS: def __init__(self, number, when, ctype, amount, category, desc): self.number = number se...
gpl-3.0
9,033,325,475,064,747,000
28.901478
88
0.569522
false
3.858868
false
false
false
pombredanne/git-git.fedorahosted.org-git-pyrpm
pyrpm/installer/lvm.py
2
10898
# # Copyright (C) 2005,2006 Red Hat, Inc. # Author: Thomas Woerner <twoerner@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Library General Public License as published by # the Free Software Foundation; version 2 only # # This program is distributed ...
gpl-2.0
-2,104,841,986,790,828,500
34.041801
78
0.503762
false
3.965793
false
false
false
phil-mansfield/gotetra
render/scripts/plot_filament_remover.py
1
7301
from __future__ import division import sys import matplotlib.pyplot as plt import numpy as np import scipy.signal as signal import scipy.stats as stats import scipy.interpolate as intr import deriv import profile # figure numbers fig_profile = 0 fig_valid_profile = 1 fig_mean_profile = 2 fig_mean_edge = 3 cs = ["Red...
mit
9,201,460,602,028,884,000
30.469828
79
0.551157
false
2.751979
false
false
false
PanDAWMS/panda-bigmon-core
core/reports/TitanProgressReport.py
1
2528
from django.template import RequestContext from django.shortcuts import render_to_response from django.db import connection class TitanProgressReport: def __init__(self): pass def dictfetchall(self, cursor): "Returns all rows from a cursor as a dict" desc = cursor.description ...
apache-2.0
4,830,803,818,919,674,000
44.963636
174
0.602453
false
3.836115
false
false
false
BoPeng/simuPOP
docs/importExport.py
1
1639
#!/usr/bin/env python # # $File: importExport.py $ # # This file is part of simuPOP, a forward-time population genetics # simulation environment. Please visit http://simupop.sourceforge.net # for details. # # Copyright (C) 2004 - 2010 Bo Peng (bpeng@mdanderson.org) # # This program is free software: you can redistribu...
gpl-2.0
-9,142,303,037,797,965,000
36.25
77
0.729713
false
3.311111
false
false
false
DarioGT/Zim-QDA
zim/async.py
1
5909
# -*- coding: utf-8 -*- # Copyright 2010 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''Asynchronous operations based on threading. We define the AsyncOperation class to wrap a function that can be executed asynchronous. AsyncOperation wraps the function in a thread so it can run in parallel with the main program....
gpl-2.0
-8,429,545,148,066,894,000
31.827778
90
0.647656
false
4.436186
false
false
false
Qix-/starfuse
starfuse/pak/pakfile.py
1
3695
"""VFS tracked, BTree package backed Pakfile Note that this implementation supports asset pakfiles (including modpak files) that are keyed with SHA256 digests for StarBound. It will not work with anything else. """ import hashlib import io import logging import starfuse.pak.sbon as sbon from starfuse.pak.btreedb4 im...
mit
5,496,316,784,804,225,000
30.853448
86
0.630582
false
3.755081
false
false
false
C0rvus/iAMA_Reddit_Bachelor
python/a__everything_Big_CSV_analyzer.py
1
177442
# Sources used within this class: # 1. (02.04.2016 @ 18:30) - # http://www.scipy-lectures.org/packages/statistics/index.html # 2. (10.04.2016 @ 12:37) - # https://stackoverflow.com/questions/20235401/remove-nan-from-pandas-series # 3. (10.04.2016 @ 13:04) - # https://stackoverflow.com/questions/13413590/how-to-drop-row...
gpl-3.0
-6,863,817,979,029,347,000
44.346793
201
0.628341
false
3.624002
false
false
false
jphber/django-avanzado
artists/migrations/0005_auto_20141017_0146.py
3
1072
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('artists', '0004_auto_20141014_0215'), ] operations = [ migrations.AlterModelOptions( name='track', o...
gpl-2.0
-9,194,732,485,274,945,000
26.487179
79
0.535448
false
4.340081
false
false
false
myDevicesIoT/Cayenne-Agent
myDevices/utils/history.py
1
26171
from myDevices.utils.logger import exception, info, warn, error, debug, setDebug, logJson from json import loads, dumps from time import time from datetime import datetime, timedelta from sqlite3 import connect from operator import itemgetter from os import rename from sys import argv class History: NOT_READY = 'N...
mit
8,115,570,628,034,040,000
61.166271
250
0.564136
false
4.399227
false
false
false
updatengine/updatengine-client
Windows/updatengine-client.py
3
8193
#!/usr/bin/env python ############################################################################### # UpdatEngine - Software Packages Deployment and Administration tool # # # # Copyright (C) Yves Guimard - yves.guimard@gmail.com ...
gpl-2.0
-3,584,561,599,390,091,300
43.770492
99
0.535945
false
4.56689
false
false
false
olavvatne/CNN
tools/measurement/run.py
1
2403
import sys, os import matplotlib.pyplot as plt import json #Makes sh scripts find modules. sys.path.append(os.path.abspath("./")) from printing import print_section, print_action from storage import ParamStorage from precisionrecall import PrecisionRecallCurve from interface.server import send_precision_recall_data f...
mit
-19,722,748,938,531,624
42.709091
124
0.716604
false
3.832536
false
false
false
hanzorama/magenta
magenta/models/shared/melody_rnn_model.py
1
3253
# Copyright 2016 Google Inc. 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 applicable law or ag...
apache-2.0
-6,692,017,484,062,864,000
34.747253
78
0.717184
false
4.159847
false
false
false
wesley1001/rtbkit
rtbkit/core/router/testing/convert_keys.py
20
1065
#!/usr/bin/python import redis import time import argparse import string import sys if len(sys.argv < 3): raise Exception("expected source and target hosts as arguments") r = redis.Redis(host=sys.argv[1], port=6379) newR = redis.Redis(host=sys.argv[2], port=6379) print "Connected to Redis...retrieving keys" cam...
apache-2.0
-6,766,381,761,790,592,000
27.783784
71
0.70892
false
3
false
false
false
asifpy/django-crudbuilder
setup.py
1
1313
import os from setuptools import setup import crudbuilder # Allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='django-crudbuilder', version=...
apache-2.0
-422,900,851,824,583,550
31.02439
78
0.623762
false
3.873156
false
false
false
mitodl/ccxcon
webhooks/tasks.py
1
3311
""" Celery tasks. """ import hashlib import hmac import json import logging from django.apps import apps from django.core.exceptions import FieldError from django.utils.encoding import force_bytes import requests from requests.exceptions import RequestException from rest_framework.status import HTTP_200_OK from ccxco...
agpl-3.0
-1,221,235,448,070,447,000
31.782178
93
0.5672
false
4.328105
false
false
false
Sinkmanu/auth-system-chronos
Chronos Auth System/tools/Chronos Auth System/tools/urwid/__init__.py
7
2318
#!/usr/bin/python # # Urwid __init__.py # Copyright (C) 2004-2010 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at y...
gpl-3.0
6,290,775,217,443,169,000
35.793651
78
0.697153
false
3.528158
false
false
false
heiths/allura
ForgeDiscussion/forgediscussion/widgets/admin.py
2
3842
# 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 (t...
apache-2.0
-5,342,006,427,076,557,000
38.204082
100
0.605934
false
4.268889
false
false
false
rhyolight/nupic.son
app/melange/templates/readonly.py
1
2051
# Copyright 2014 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 applicable law or agreed to in wr...
apache-2.0
5,247,808,026,608,660,000
30.553846
78
0.707947
false
4.255187
false
false
false
sunqm/pyscf
examples/misc/02-chkfile.py
2
1392
#!/usr/bin/env python ''' This example shows how to access the data stored in checkpoint file, Also how to quickly update an object using the data from the checkpoint file. ''' import numpy import h5py from pyscf import gto, scf, ci from pyscf.lib import chkfile mol = gto.M(atom='N 0 0 0; N 0 0 1.2', basis='ccpvdz')...
apache-2.0
3,926,687,008,309,922,300
29.933333
91
0.660201
false
2.597015
false
true
false
LLNL/spack
var/spack/repos/builtin/packages/intltool/package.py
5
1854
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Intltool(AutotoolsPackage): """intltool is a set of tools to centralize translation of man...
lgpl-2.1
-6,618,418,379,926,558,000
37.625
96
0.673139
false
3.34657
false
false
false
SoulCoders/PyAtx
atx/Shell.py
1
4102
""" Shell ----- 众生万象,皆有规律可循,神一般的我发现了其中的规律,开始指手画脚。 我就像个产品狗,我不动手实践,我就瞎BB。 Builder使用组合方式还是类继承由设计者决定。这里只是提供了一个解决方案,并没有提供具体功能。 总要一个例子来说明下 ----------------- from atx.Shell import * import time # 我伪装成一个真实shell,不管你发什么,我都只返回时间 class ShellSimulator: def send(self, cmd=''): return time.ctime() # 通过telnet接入shel...
apache-2.0
2,673,794,140,748,800,000
19.046512
61
0.601218
false
2.345578
false
false
false
ICT4H/dcs-mangrove
mangrove/datastore/database.py
1
11595
from threading import Lock from couchdb import http from couchdb.design import ViewDefinition from couchdb.http import ResourceNotFound import couchdb.client import settings from documents import DocumentBase from datetime import datetime from mangrove.utils import dates from mangrove.utils.types import is_empty, i...
bsd-3-clause
-1,502,727,716,559,656,400
32.414986
105
0.62182
false
3.99552
false
false
false
arteria/django-sessioninfo
sessioninfo/admin.py
1
1392
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib import admin from django.contrib.auth.models import User from django.contrib.sessions.models import Session class SessionAdmin(admin.ModelAdmin): def _session_data(self, obj): return obj.get_decoded() _session_data.short_desc...
mit
624,479,971,881,414,800
32.95122
79
0.619971
false
3.663158
false
false
false
ramseylab/cerenkov
ground_truth/osu17/snap_client_py2.py
2
4378
from urllib import urlencode from urllib2 import Request, urlopen import pandas from io import StringIO class SnapQuery: # 1000 Genomes Pilot 1 / HapMap release 22 / HapMap release 21 _dataset_options = {'onekgpilot', 'rel22', 'rel21'} _population_options = {'onekgpilot': {'CEU', 'YRI', 'CHBJPT'}, ...
apache-2.0
7,486,398,845,098,564,000
40.301887
104
0.501827
false
4.267057
false
false
false
jasnyder/MultiplexMarkovChain
extract_counts.py
1
9222
#!/usr/bin/env python """ File contains functions to compute counts for constructing Markov chains for the dynamics of edges on a two-layer multiplex network. """ import numpy as np import networkx as nx import logging #set up logs logger = logging.getLogger("multiplex_markov_chain") logger.setLevel(logging.DEBUG) c...
bsd-3-clause
-5,357,338,298,771,570,000
37.11157
134
0.608545
false
3.757946
false
false
false
dave-the-scientist/brugia_project
model_tools.py
1
39229
"""Useful atts: m.reactions or .metabolites: .get_by_id() rxn.reactants or .products rxn.get_coefficient('C00689'): -1 for consumed, +1 for produced rxn.metabolites: {'C00689': -1, ...} mtb.reactions: all of the reactions that produce or consume mtb. mtb.summary(): rates mtb is being produced and used in the current FB...
gpl-3.0
3,079,368,367,123,855,000
47.015912
306
0.585307
false
2.940925
true
false
false
chenyujie/hybrid-murano
murano/engine/system/yaql_functions.py
1
10775
# Copyright (c) 2013 Mirantis 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 writ...
apache-2.0
4,520,562,257,778,652,000
26.987013
76
0.686589
false
3.669959
true
false
false
saisankargochhayat/algo_quest
leetcode/430.FlattenMultilevelDoublyLinkedList/soln.py
1
2507
""" # Definition for a Node. class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child """ # Stack approach class Solution: def flatten(self, head: 'Node') -> 'Node': # Empty head if head is None:...
apache-2.0
-1,777,817,506,501,644,800
30.3375
102
0.487435
false
4.270869
false
false
false
ffsdmad/shool_api
api/schoolboy_classroom.py
1
1321
from app import db from api import Classroom, Schoolboy, schoolboy_classroom from api import api, Resource, reqparse, paginate, abort class ApiSchoolboy_Classroom(Resource): """Api from create and remove relation schoolboy <> classroom """ def post(self, classroom_id=None, schoolboy_id=None): """add r...
gpl-3.0
-8,876,287,548,001,833,000
34.702703
85
0.59349
false
3.503979
false
false
false
lambday/shogun
applications/asp/signal_detectors.py
7
5013
# This software is distributed under BSD 3-clause license (see LICENSE file). # # Authors: Soeren Sonnenburg, Gunnar Raetsch import sys import numpy import seqdict from shogun import LibSVM from shogun import StringCharFeatures,DNA from shogun import WeightedDegreeStringKernel from shogun import DynamicIntArray cla...
bsd-3-clause
-7,442,744,190,045,049,000
29.198795
94
0.724317
false
2.824225
false
false
false
wiki2014/Learning-Summary
alps/cts/apps/CameraITS/tests/scene1/test_locked_burst.py
1
2805
# Copyright 2014 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
5,481,494,957,026,756,000
34.961538
75
0.629234
false
3.568702
false
false
false
viglesiasce/charts
stable/mysqldump/files/openstack-upload.py
3
7755
#!/usr/bin/python from optparse import OptionParser import os, sys, subprocess, json, re, threading global VERBOSE VERBOSE = False class Expando(object): pass def curl(args, shell=True, check=True, input=None, timeout_sec = 30, **kwargs): '''python3 subprocess.run() workalike with more appropriate defaults ...
apache-2.0
-7,342,214,661,245,033,000
35.580189
135
0.546615
false
3.871692
false
false
false
esten/StoriTell
StoriTell/settings.py
1
4089
# Django settings for storitell project. DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( #('Name', 'email'), ) AKISMET_API_KEY = # 'YOUR_KEY' MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3...
bsd-3-clause
2,469,966,277,043,069,000
32.793388
134
0.693813
false
3.58056
false
false
false
hahnicity/pytrader
pytrader/main.py
1
2039
""" Serves to gather data from the internet on our stock of choice """ from argparse import ArgumentParser from cowboycushion.multiprocessing_limiter import RedisMultiprocessingLimiter from redis import StrictRedis from pytrader.gatherer import gather_data_with_multiprocess_client from pytrader.storage import push_to...
gpl-2.0
-4,794,021,402,121,401,000
34.155172
85
0.703286
false
3.503436
false
false
false
marcecj/scons_asciidoc
__init__.py
1
5406
"""The SCons AsciiDoc tool This is an SCons tool for compiling AsciiDoc documents to various formats using the `asciidoc` and `a2x` programs using two builders, `AsciiDoc` and `A2X`, to the construction environment. """ # support Python 2.5 from __future__ import with_statement import SCons.Util # TODO: write tests ...
mit
1,006,964,094,207,575,000
35.527027
80
0.622087
false
3.1875
false
false
false
gurch101/rosalind
mrna.py
1
1399
# coding=utf-8 """ For positive integers a and n, a modulo n (written amodn in shorthand) is the remainder when a is divided by n. For example, 29mod11=7 because 29=11×2+7. Modular arithmetic is the study of addition, subtraction, multiplication, and division with respect to the modulo operation. We say that a and b a...
mit
9,150,013,966,207,796,000
34.538462
78
0.750361
false
3.08686
false
false
false
vinodkc/spark
examples/src/main/python/ml/vector_slicer_example.py
27
1496
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
6,469,558,512,927,764,000
33.790698
85
0.713235
false
3.885714
false
false
false
cgvarela/Impala
tests/query_test/test_analytic_tpcds.py
16
1671
# Copyright (c) 2014 Cloudera, Inc. 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 applicable law o...
apache-2.0
6,539,550,189,827,843,000
36.133333
82
0.748055
false
3.746637
true
false
false
jlew/Web2Py-Inventory
controllers/manage.py
1
3852
# coding: utf8 # try something like def index(): redirect(URL('default','index')) @auth.requires_membership("add_inventory") def addItem(): form = SQLFORM(db.item) if form.accepts(request.vars, session): response.flash = T("Item Added to Inventory") item = db(db.item.BarCode == request...
gpl-3.0
7,425,538,341,200,143,000
37.138614
142
0.579439
false
3.725338
false
false
false
RobertABT/heightmap
build/matplotlib/examples/pylab_examples/contour_image.py
9
3353
#!/usr/bin/env python ''' Test combinations of contouring, filled contouring, and image plotting. For contour labelling, see contour_demo.py. The emphasis in this demo is on showing how to make contours register correctly on images, and on how to get both of them oriented as desired. In particular, note the usage of ...
mit
7,419,733,090,098,749,000
30.632075
77
0.659409
false
3.233365
false
false
false
sqall01/alertR
managerClientConsole/lib/manager/elementCore.py
1
1434
#!/usr/bin/env python3 # written by sqall # twitter: https://twitter.com/sqall01 # blog: https://h4des.org # github: https://github.com/sqall01 # # Licensed under the GNU Affero General Public License, version 3. import urwid import types # This class is an urwid object for the search field. class SearchViewUrwid: ...
agpl-3.0
-2,024,779,288,205,721,300
32.348837
96
0.678522
false
3.824
false
false
false
catethos/ocropy
ocrolib/lstm.py
10
37384
# An implementation of LSTM networks, CTC alignment, and related classes. # # This code operates on sequences of vectors as inputs, and either outputs # sequences of vectors, or symbol sequences. Sequences of vectors are # represented as 2D arrays, with rows representing vectors at different # time steps. # # The code ...
apache-2.0
577,904,610,915,553,800
36.99187
108
0.602905
false
3.523801
false
false
false
jschuhmacher/cvm
src/train/cvm.py
1
15698
#!/usr/bin/env python # vim: set fileencoding=utf-8 ts=4 sw=4 expandtab: ################################################################################ # Copyright (c) 2009, Jelle Schühmacher <j.schuhmacher@student.science.ru.nl> # # This program is free software: you can redistribute it and/or modify it under # th...
gpl-3.0
8,598,431,232,007,924,000
32.116034
91
0.501816
false
3.869115
false
false
false
mvidalgarcia/indico
indico/modules/events/management/controllers/base.py
2
2882
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from collections import defaultdict from flask import session fr...
mit
8,508,950,903,496,616,000
39.591549
106
0.661346
false
4.440678
false
false
false
davidh-ssec/polar2grid
polar2grid/core/script_utils.py
1
12901
#!/usr/bin/env python3 # encoding: utf-8 # Copyright (C) 2014 Space Science and Engineering Center (SSEC), # University of Wisconsin-Madison. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ei...
gpl-3.0
-4,802,888,853,698,745,000
39.442006
123
0.659329
false
4.072285
false
false
false
dmgawel/helios-server
helios/forms.py
1
3275
""" Forms for Helios """ from django import forms from models import Election from widgets import * from fields import * from django.conf import settings class ElectionForm(forms.Form): short_name = forms.SlugField(max_length=25, help_text='no spaces, will be part of the URL for your election, e.g. my-club-2010') ...
apache-2.0
-1,449,483,202,724,032,000
65.836735
219
0.730992
false
3.760046
false
false
false
MediaKraken/MediaKraken_Deployment
source/common/common_hardware_cddvdbrrom.py
1
1579
import gudev from common import common_logging_elasticsearch_httpx # https://stackoverflow.com/questions/2861098/how-do-i-use-udev-to-find-info-about-inserted-video-media-e-g-dvds def com_hard_cddvdbrrom(): client = gudev.Client(['block']) drives = [] for device in client.query_by_subsystem("block"): ...
gpl-3.0
-4,921,685,082,469,177,000
53.448276
112
0.476251
false
4.410615
false
false
false
googleapis/googleapis-gen
google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/tests/unit/gapic/dialogflowcx_v3beta1/test_pages.py
1
89446
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-7,857,990,295,543,740,000
35.688269
247
0.639928
false
4.005284
true
false
false
wmvanvliet/psychic
psychic/nodes/align.py
1
3088
import numpy as np from ..trials import erp from ..dataset import DataSet from .spatialfilter import SpatialBlur def channel_temporal_offsets(data, k=list(range(-20, 20))): ''' Calculate temporal shift required for optimal cross channel covariances. parameters: data - (channels x samples) the sign...
bsd-3-clause
8,864,856,796,728,509,000
33.311111
79
0.539508
false
3.521095
false
false
false
deveee/supertuxkart-0.8.1-updates
data/po/extract_strings_from_XML.py
7
3846
import xml.dom.minidom import sys import codecs f = open('./data/po/gui_strings.h', 'w') f.write( codecs.BOM_UTF8 ) def traverse(file, node, isChallenge, isGP, isKart, isTrack, level=0): for e in node.childNodes: if e.localName == None: continue #print ' '*level, e.localName...
gpl-3.0
7,073,406,847,456,508,000
40.354839
141
0.475299
false
3.838323
false
false
false
jesopo/bitbot
modules/hostmask_tracking.py
1
1601
from src import ModuleManager, utils class Module(ModuleManager.BaseModule): _name = "Hostmasks" @utils.hook("new.user") def new_user(self, event): userhost = event["user"].userhost() if not userhost == None: known_hostmasks = event["user"].get_setting("known-hostmasks", []) ...
gpl-2.0
-6,911,197,691,064,925,000
39.025
80
0.583385
false
3.876513
false
false
false
babab/tuhinga
tuhinga_webrepl.py
1
3458
#!/usr/bin/env python # Copyright (c) 2014-2015 Benjamin Althues <benjamin@babab.nl> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS...
isc
226,210,069,512,556,350
26.664
76
0.641122
false
3.430556
false
false
false
walter2645-cmis/walter2645-cmis-cs2
whileloops.py
1
1210
def counter(x): if x > 0: while x >= 0: print x x -= 1 else: while x <= 0: print x x += 1 def counter2(x): while x >= 0: print x x -= 1 while x <= 0: print x x += 1 #def sequence(n): # while n != 1: # ...
cc0-1.0
3,914,112,833,126,847,500
12.444444
40
0.353719
false
3.288043
false
false
false
back-to/streamlink
src/streamlink_cli/compat.py
4
1189
import os import re import sys is_py2 = (sys.version_info[0] == 2) is_py3 = (sys.version_info[0] == 3) is_win32 = os.name == "nt" if is_py2: input = raw_input stdout = sys.stdout file = file _find_unsafe = re.compile(r"[^\w@%+=:,./-]").search from backports.shutil_get_terminal_size import get_ter...
bsd-2-clause
-2,482,151,182,867,140,600
24.297872
81
0.600505
false
3.204852
false
false
false
jazcek/tripping_dangerzone
scripts/build_dhcp_files.py
1
1101
#!/usr/bin/env python import json import sys import urllib2 import base64 PROTO = 'http' SERVER = 'localhost:8000' URI = '/td/rf/dhcp/' USER = 'admin' password = sys.argv[1] domain = sys.argv[2] url = "{0}://{1}{2}".format(PROTO,SERVER,URI) request = urllib2.Request(url) base64string = base64.encodestring("%s:%s"%...
mit
-2,470,421,597,540,468,700
25.878049
86
0.639419
false
3.110169
false
false
false
Teino1978-Corp/pre-commit
pre_commit/languages/python.py
2
1972
from __future__ import unicode_literals import contextlib import distutils.spawn import os import sys import virtualenv from pre_commit.languages import helpers from pre_commit.util import clean_path_on_failure ENVIRONMENT_DIR = 'py_env' class PythonEnv(helpers.Environment): @property def env_prefix(self...
mit
4,899,661,441,764,269,000
29.8125
79
0.63641
false
3.741935
false
false
false
alexforencich/verilog-ethernet
tb/test_xgmii_baser_dec_64.py
2
5446
#!/usr/bin/env python """ Copyright (c) 2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
mit
403,200,512,068,402,900
25.436893
95
0.607051
false
3.232047
true
false
false
NunoEdgarGub1/pytrademonster
pytrademonster/services/orderService.py
3
20281
__author__ = 'adamsherman' from datetime import datetime from collections import OrderedDict import xmltodict from pytrademonster.constants import TradeMonsterConstants from pytrademonster.objects import LimitOrder, OrderType, OrderResponse, NewOrderLeg, OrderPreview, StopLimit, StopOrder class OrderRequests(obje...
mit
8,864,700,905,180,015,000
43.185185
126
0.671614
false
4.19549
false
false
false
Kongsea/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/__init__.py
15
3103
# 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
2,538,524,808,296,436,000
39.828947
90
0.797615
false
3.869077
false
false
false
zehome/jinja2-commentif
jinja2_commentif/ext.py
1
1029
from jinja2 import nodes from jinja2.ext import Extension class CommentIfExtension(Extension): """Put a string before each line to comment out a block based on a boolean expression. Example:: {% set comment=True %} {% commentif "#" comment %} My text should be comment if ...
bsd-2-clause
-5,567,593,057,281,370,000
31.15625
79
0.59378
false
4.116
false
false
false