repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
phalladar/SCOTUSHaikus
haikufinder/__init__.py
1
10233
# A hack to find "haikus" in English text. For the purposes of this program # a "haiku" is one or more complete sentences that, together, can be broken # into groups of 5, 7, and 5 syllables. Each canididate haiku line, and then # the entire haiku, has to make it through a few heuristics to filter out # constructions ...
bsd-3-clause
-299,711,272,710,562,400
36.346715
123
0.552722
false
3.443136
false
false
false
Desenho-2-2017/Ecom_merci
products/viewsets.py
1
8123
from rest_framework.viewsets import ModelViewSet from .models import ( ProductCategory, Product ) from .serializers import ( ProductCategorySerializerDefault, ProductCategorySerializerPOST, ProductSerializerDefault, ProductSerializerPOST ) from .permissions import ( ProductPermission...
mit
1,955,034,141,973,025,500
26.442568
76
0.508187
false
4.786682
false
false
false
chenghao/haoAdmin
service/sys/SysMenuService.py
1
4894
# coding:utf-8 __author__ = "gaunt" from models import (SysMenuDao) def get_user_menu(auths): """ 根据权限获取主菜单 :param auths: :return: """ menus = SysMenuDao.get_all_menu() # 获取自己权限的菜单 self_menus = [] [self_menus.append(m) for m in menus if not m["authority"] or m["authority"] in aut...
apache-2.0
7,500,983,009,860,910,000
24.393258
127
0.536947
false
2.71798
false
false
false
lsaffre/lino-welfare
lino_welfare/modlib/cbss/fixtures/purposes.py
1
9137
# -*- coding: UTF-8 -*- # Copyright 2012 Rumma & Ko Ltd # License: BSD (see file COPYING for details) """ Fills the cbss.Purposes table with the official values defined in `lijst_hoedanigheidscodes.pdf <http://www.bcss.fgov.be/binaries/documentation/fr/documentation/general/lijst_hoedanigheidscodes.pdf>`__. """ fro...
agpl-3.0
7,014,070,598,673,712,000
57.2
304
0.764439
false
2.348607
false
false
false
koehlma/uv
uv/common.py
1
3450
# -*- coding: utf-8 -*- # Copyright (C) 2016, Maximilian Köhl <mail@koehlma.de> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed in the hope th...
lgpl-3.0
-7,197,550,074,827,018,000
30.354545
86
0.616411
false
4.033918
false
false
false
smhilde/dhhd_project
dhhd/plan/migrations/0001_initial.py
1
4011
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Customer', fields=[ ('id', models.AutoField(aut...
apache-2.0
-599,572,122,547,535,100
40.78125
114
0.529294
false
4.696721
false
false
false
FriedrichK/python-edifact
edifact/segments/base.py
1
2357
# -*- coding: utf-8 -*- """This module provides the base for segment wrappers.""" import six class Composite(object): """Part of a segment.""" _content = None def __init__(self, index=0, max_length=3, required=False): """Constructor.""" self.index = index self.max_length = max_l...
apache-2.0
-4,451,063,390,457,396,000
28.4625
137
0.574883
false
4.308958
false
false
false
Zyell/home-assistant
homeassistant/components/light/__init__.py
1
9429
""" Provides functionality to interact with lights. For more details about this component, please refer to the documentation at https://home-assistant.io/components/light/ """ import logging import os import csv import voluptuous as vol from homeassistant.components import ( group, discovery, wemo, wink, isy994,...
mit
90,728,029,092,372,830
30.747475
79
0.622972
false
3.664594
true
false
false
excelly/xpy-ml
sdss_iii/proc_transform_data.py
1
4304
from ex import * from ex.ioo.FITS import FITS import multiprocessing as mp import sdss.utils as utils import sdss_iii.settings as settings def usage(): print(''' transform the data into standard form python proc_transform_data.py --input_files={input_files} --npixel=[500] --nproc=[1] ''') sys.exit(1) def Fi...
apache-2.0
-8,651,753,374,808,732,000
31.360902
118
0.549024
false
3.072091
false
false
false
ericholscher/djangoembed
oembed/sites.py
1
8297
import datetime import re import simplejson from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.db.models import signals from oembed.constants import DEFAULT_OEMBED_TTL, MIN_OEMBED_TTL, RESOURCE_TYPES from oembed.exceptions import AlreadyRegistered, NotRegistered, O...
mit
7,125,871,521,904,948,000
36.542986
102
0.575148
false
4.903664
false
false
false
ocelot-collab/ocelot
ocelot/adaptors/madx_old.py
1
8302
__author__ = 'Sergey Tomin' from ocelot import * def RFcavity(l, volt, lag, harmon): rf = Cavity(l = l, volt=volt, id = id) rf.lag = lag rf.harmon = harmon return rf class MadObj: name = "" type = "" params = "" def parse_params(self): self.dic_p = {} for param in se...
gpl-3.0
-5,919,753,922,739,795,000
25.954545
88
0.49988
false
3.482383
false
false
false
fantasycheng/udacity-deep-learning-project
language-translation/dlnd_language_translation.py
1
34429
# coding: utf-8 # # Language Translation # In this project, you’re going to take a peek into the realm of neural network machine translation. You’ll be training a sequence to sequence model on a dataset of English and French sentences that can translate new sentences from English to French. # ## Get the Data # Since...
mit
-3,339,668,714,111,853,000
41.135863
398
0.631954
false
3.885879
true
false
false
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/dla/__init__.py
5
1504
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
-5,837,073,634,880,245,000
46
113
0.59375
false
4.516517
false
false
false
lucidlylogicole/scope
plugins/find_files/scope_plugin.py
1
1192
import os from PyQt4 import QtGui, QtCore class Plugin(object): title = 'Search in Files' location = 'app' # left, bottom, right, app widget = None # The widget for the plugin (set at getWidget) def __init__(self,parent=None): self.parent = parent def load(self): self.btn...
gpl-3.0
7,168,575,003,864,687,000
35.121212
108
0.638423
false
3.820513
false
false
false
Iconik/eve-suite
src/model/static/chr/bloodline.py
1
1330
from model.flyweight import Flyweight from model.static.database import database class Bloodline(Flyweight): def __init__(self,bloodline_id): #prevents reinitializing if "_inited" in self.__dict__: return self._inited = None #prevents reinitializing self.bloodli...
gpl-3.0
4,880,972,858,588,442,000
35.944444
71
0.627068
false
3.843931
false
false
false
danshick/httpdns
client/dns_passthrough.py
1
2178
import socket import requests class DNSQuery: def __init__(self, data): self.data=data self.domain='' type = (data[2] >> 3) & 15 # Opcode bits if type == 0: # Standard query ind=12 len=data[ind] while len != 0: self.domain+=data[ind+1:ind+len+1].de...
gpl-2.0
4,777,273,893,117,795,000
32.507692
125
0.550046
false
3.226667
false
false
false
erdc-cm/air-water-vv
2d/numericalTanks/nonlinearWaves/nonlinear_waves.py
1
13481
""" Non linear waves """ from proteus import Domain, Context from proteus.mprans import SpatialTools as st from proteus import WaveTools as wt import math import numpy as np opts=Context.Options([ # predefined test cases ("water_level", 0.4, "Water level from y=0"), # tank ("tank_dim", (7.8, 0.7), "Dim...
mit
2,326,082,894,898,492,400
34.476316
155
0.640012
false
2.923027
false
false
false
personalrobotics/or_ompl
scripts/wrap_planners.py
1
5651
#!/usr/bin/env python # Copyright (c) 2014, Carnegie Mellon University # All rights reserved. # # Authors: Michael Koval <mkoval@cs.cmu.edu> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of...
bsd-2-clause
-1,007,516,185,716,829,200
32.838323
92
0.662538
false
3.841604
false
false
false
sebastic/QGIS
python/plugins/processing/algs/qgis/Merge.py
1
4761
# -*- coding: utf-8 -*- """ *************************************************************************** Gridify.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *****************************...
gpl-2.0
-1,091,023,555,943,208,200
39.692308
126
0.508297
false
5.147027
false
false
false
google-research/tapas
tapas/utils/pruning_utils.py
1
22339
# coding=utf-8 # Copyright 2019 The Google AI Language Team 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 ...
apache-2.0
5,498,816,398,818,340,000
33.053354
95
0.660683
false
4.007714
false
false
false
emkailu/PAT3DEM
bin/p3locres2bf.py
1
1509
#!/usr/bin/env python import os import sys import argparse from EMAN2 import * import pat3dem.pdb as p3p import pat3dem.main as p3m def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <localres.mrc> Get local resolution from localres.mrc and transfer to bfactors in pdb. """ ar...
mit
3,064,638,372,130,385,000
28.588235
109
0.614314
false
2.523411
false
false
false
gavruskin/microinteractions
data_preprocess_6_reps_with_negatives.py
1
9983
import pandas as pd data = pd.read_csv("development_times_exp1and2.csv", sep="\t") # Add all parameters (Taylor coefficients) as 0 in rows following the data: for i in range(data.shape[0]): for j in range(10, 42): data.set_value(i, j, 0) data.rename(columns={10: "a", 11: "a1", 12: "a2", 13: "...
mit
9,091,952,240,143,484,000
32.840678
79
0.601222
false
2.151509
false
false
false
Jumpscale/jumpscale_core8
lib/JumpScale/tools/cuisine/systemservices/CuisineOpenvSwitch.py
1
4701
from JumpScale import j app = j.tools.cuisine._getBaseAppClass() # TODO: *1 implement & test & document (test on packet.net) # make sure you use the trick we used in jumpscale/jumpscale_core8/lib/JumpScale/tools/cuisine/systemservices/CuisineFW.py # : setRuleset... here we use a python script to make sure we se...
apache-2.0
-7,045,752,899,892,516,000
31.42069
122
0.617315
false
4.066609
false
false
false
libresoft/CVSAnaly-ALERT-branch
pycvsanaly2/CVSParser.py
1
8925
# Copyright (C) 2007 LibreSoft # # 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 the ...
gpl-2.0
3,152,438,898,054,378,500
32.679245
146
0.510252
false
4.172511
false
false
false
MTASZTAKI/ApertusVR
plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/tools/genv8constants.py
1
2791
#!/usr/bin/env python # # genv8constants.py output_file libv8_base.a # # Emits v8dbg constants stored in libv8_base.a in a format suitable for the V8 # ustack helper. # import re import subprocess import sys import errno if len(sys.argv) != 3: print "usage: objsym.py outfile libv8_base.a" sys.exit(2); outfile =...
mit
8,205,209,713,110,499,000
23.482456
79
0.63454
false
3.043621
false
false
false
agrif/django-cannen
cannen/management/commands/runcannenftp.py
1
7841
# This file is part of Cannen, a collaborative music player. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This ...
gpl-3.0
8,713,329,083,339,235,000
33.091304
142
0.60579
false
3.992363
false
false
false
martinloland/rov
pc/ui.py
1
7085
''' ui.py - Create and update the user interface ''' BLACK = (0,0,0) WHITE = (255,255,255) GRAY = (60,60,60) GRAYtrans = (60,60,60,150) STROKE = 2 BIGSTROKE = 7 t=l=0 c=1 b=r=2 class UI: def __init__(self): self.nbCirclesR = 0 self.nbCirclesL = 0 self.overlay = True self.info = False ...
mit
-363,425,104,164,392,600
29.220264
79
0.639661
false
2.535791
false
false
false
henrytao-me/openerp.positionq
addons/positionq/pq_salary/pq_tcc2.py
1
1594
# -*- coding: utf-8 -*- from openerp.osv import osv, fields from openerp.tools.translate import _ import logging from datetime import datetime from openerp.osv.fields import datetime as datetime_field from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT from unidecode import unidecode i...
agpl-3.0
519,983,520,925,627,140
33.955556
103
0.642721
false
3.001908
false
false
false
FirstAidKitten/Roguelike-Sandbox
ai.py
1
1113
import session from fov import generate from random import randint class Aggressive: # AI for a basic monster. def take_turn(self): # a basic monster takes its turn. If you can see it, it can see you monster = self.owner monster_fov = generate(monster.x, monster.y) if (session....
mit
6,383,235,628,075,894,000
33.78125
75
0.604672
false
3.533333
false
false
false
marcua/qurk_experiments
qurkexp/join/movie_comparisons.py
1
4332
#!/usr/bin/env python import sys, os ROOT = os.path.abspath('%s/../..' % os.path.abspath(os.path.dirname(__file__))) sys.path.append(ROOT) os.environ['DJANGO_SETTINGS_MODULE'] = 'qurkexp.settings' from django.core.management import setup_environ from django.conf import settings from qurkexp.join.models import * from q...
bsd-3-clause
7,571,860,350,783,712,000
30.620438
96
0.592567
false
3.347759
false
false
false
aliyun/aliyun-oss-python-sdk
examples/upload.py
1
3341
# -*- coding: utf-8 -*- import os import random import string import oss2 # 以下代码展示了文件上传的高级用法,如断点续传、分片上传等。 # 基本的文件上传如上传普通文件、追加文件,请参见object_basic.py # 首先初始化AccessKeyId、AccessKeySecret、Endpoint等信息。 # 通过环境变量获取,或者把诸如“<你的AccessKeyId>”替换成真实的AccessKeyId等。 # # 以杭州区域为例,Endpoint可以是: # http://oss-cn-hangzhou.aliyuncs.com # ...
mit
3,825,733,195,884,948,500
26.882979
114
0.715376
false
2.020817
false
false
false
luoguizhou/gooderp_addons
warehouse/models/scan_barcode.py
1
3228
# -*- coding: utf-8 -*- from odoo import models, fields, api from odoo.exceptions import UserError class ScanBarcode(models.Model): _name = 'scan.barcode' scan_barcode_input_code = fields.Char(string='输入要扫描的条码') def prepare_line_out_data(self, line_out_ids): line_data = {} for line in lin...
agpl-3.0
-6,958,131,263,197,142,000
47.333333
114
0.512539
false
3.717949
false
false
false
krishauser/Klampt
Python/python2_version/klampt/apps/klampt_browser.py
1
30664
from klampt import * from klampt.io import loader,resource from klampt.math import se3 from klampt.model.trajectory import Trajectory,RobotTrajectory from klampt.model.multipath import MultiPath from klampt.model import types from klampt import vis from klampt.vis.qtbackend import QtGLWindow from klampt.vis.glcommon im...
bsd-3-clause
-2,346,998,096,091,174,000
40.664402
177
0.591541
false
4.097822
false
false
false
bjodah/chempy
chempy/util/parsing.py
1
18241
# -*- coding: utf-8 -*- """ Functions for chemical formulae and reactions """ from collections import defaultdict import re import warnings from .pyutil import ChemPyDeprecationWarning, memoize from .periodic import symbols parsing_library = "pyparsing" # info used for selective testing. def get_parsing_context...
bsd-2-clause
-7,726,565,216,656,472,000
28.518699
88
0.546326
false
3.39454
false
false
false
Duke-Medical-Instrumentation/Respi-Rite
Software/FinalCode/date_time.py
1
3127
def checkTime(path, whichExercise, userID): # This function checks the time to ensure the user is not over training # Import important libraries import os import time import pickle from mainmenu import menu oDir = os.getcwd() os.chdir(path) cur_time = time.localtime() cur_epoch ...
apache-2.0
-7,552,014,188,763,341,000
43.056338
142
0.622322
false
3.653037
false
false
false
andresriancho/nimbostratus-target
servers/django_frontend/deploy.py
1
3653
import sys import requests import os import time import logging from core.region_connection import EC2Connection from config import AMI, SIZE, DEPLOY_PRIVATE_PATH, DEPLOY_PUBLIC_PATH from aws.keypair import create_keypair from aws.ec2 import create_instance_profile TEST_URL = 'http://%s/?url=http://httpbin.org/user-a...
agpl-3.0
-4,153,315,520,433,086,000
32.513761
110
0.582809
false
4.027563
false
false
false
chrsrds/scikit-learn
sklearn/neighbors/lof.py
3
20358
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np import warnings from .base import NeighborsBase from .base import KNeighborsMixin from .base import UnsupervisedMixin from ..base import Outlie...
bsd-3-clause
-8,288,186,774,796,448,000
39.879518
81
0.614697
false
4.243018
false
false
false
heromod/migrid
mig/grsfs-fuse/benchmarks/code/benchmark_ro.py
1
3646
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # benchmark_ro - benchmark read-only access # Copyright (C) 2003-2011 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public ...
gpl-2.0
-6,773,150,630,597,240,000
28.403226
81
0.572957
false
3.743326
false
false
false
LambdaCast/LambdaCast
portal/views.py
1
16341
# -*- coding: utf-8 -*- from django.shortcuts import get_object_or_404, redirect from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.db.models import Q from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core import serializers from...
bsd-2-clause
1,480,997,677,373,973,200
49.435185
212
0.663668
false
3.851284
false
false
false
akrherz/iem
scripts/current/stage4_hourly.py
1
2162
""" Plot the hourly stage IV precip data """ import sys import os import datetime import pygrib import pytz from pyiem.util import utc, logger from pyiem.plot import MapPlot, get_cmap LOG = logger() def doit(ts): """ Generate hourly plot of stage4 data """ gmtnow = datetime.datetime.utcnow() ...
mit
9,102,741,022,298,464,000
21.757895
75
0.50185
false
3.04507
false
false
false
jarifibrahim/finance
forms.py
1
1380
from flask_wtf import Form from wtforms import StringField, PasswordField, validators, SubmitField # Render login form. u' indicated unicode encoding class LoginForm(Form): username = StringField('Username', [validators.InputRequired(message=(u'Invalid Username')), validator...
mit
-6,423,164,901,180,357,000
61.727273
114
0.583333
false
5.18797
false
false
false
kcyu1993/ML_course_kyu
projects/project1/scripts/gradient.py
1
2752
""" This file consists of operation related to gradient descent generally, would be referenced by model.py and implementations.py """ import numpy as np from data_utils import batch_iter from costs import compute_loss def compute_gradient(y, tx, w): """Compute the gradient.""" e = y - (tx).dot(w) N = le...
mit
5,545,966,083,635,659,000
31.376471
81
0.563953
false
3.689008
false
false
false
sbranson/online_crowdsourcing
crowdsourcing/util/multibox/export.py
1
4021
""" Export a model, loading in the moving averages and saving those. """ import argparse import logging import os import pprint import sys import tensorflow as tf import tensorflow.contrib.slim as slim from tensorflow.python.framework import graph_util import time from config import parse_config_file import model de...
mit
8,448,636,228,364,823,000
31.699187
111
0.618752
false
3.807765
true
false
false
pypa/warehouse
warehouse/search/tasks.py
1
9822
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
apache-2.0
7,808,638,181,856,625,000
36.064151
88
0.587151
false
4.263021
false
false
false
AIRLab-POLIMI/ReLe
rele/doc/build.py
1
1557
#!/usr/bin/env python # Build the documentation. import sys, os from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE def build_docs(srcPath): print(srcPath) print(os.path.join(srcPath, 'include/rele/')) # Build docs. # cmd = ['doxygen', '-'] # p = Popen(cmd, stdin=PIPE) # p.com...
gpl-3.0
3,206,385,621,774,522,000
35.209302
108
0.519589
false
2.994231
false
false
false
cournape/numscons
numscons/scons-local/scons-local-1.2.0/SCons/compat/_scons_hashlib.py
1
2946
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # 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 limitati...
bsd-3-clause
-9,077,548,005,859,742,000
31.373626
89
0.666327
false
3.835938
false
false
false
NickBayard/mlh
Parser.py
1
1761
import re import bs4 from datetime import datetime from copy import copy class ParseError(Exception): pass class ParseChildIdError(ParseError): pass class ParseAvailableDatesError(ParseError): pass class Parser: """Parser is essentially the web page scraper that returns various bits of infor...
mit
-8,018,932,969,187,574,000
24.897059
102
0.597956
false
3.836601
false
false
false
BitNetwork/pysys
pyfile.py
1
5243
import sys import os import tty import termios import shutil import time import signal import math width = 80 height = 20 terminalConfig = None cd = os.getcwd() display = [] columnLength = 20 selected = 0 keypressCache = [] def inputMode(): global terminalConfig terminalConfig = termios.tcgetattr(sys.stdin) tty...
mit
1,662,445,574,557,499,100
33.267974
240
0.632272
false
2.882353
false
false
false
low-sky/degas
degas/examples/gridgals.py
1
3442
from degas.gridding import gridGalaxy datadir='/mnt/bigdata/erosolow/surveys/DEGAS/' datadir = '/mnt/bigdata/erosolow/surveys/DEGAS/' ppo = True # gridGalaxy(galaxy='IC0342', setup='12CO', # release='QA0', datadir=datadir, # PostprocOnly=ppo) gallist = [#'IC0342', 'NGC0337', ...
gpl-3.0
5,651,762,327,323,637,000
25.682171
83
0.614468
false
2.503273
false
false
false
land-pack/pyroom
examples/tornado_ioloop_add_future.py
1
1250
import tornado from tornado.httpclient import HTTPRequest from tornado.web import Application from tornado.websocket import websocket_connect from tornado.testing import AsyncHTTPTestCase, gen_test def message_processed_callback(*args, **kwargs): print 'Callback(args=%r, kwargs=%r)' % (args, kwargs) class Realt...
gpl-3.0
-7,800,830,354,087,437,000
28.093023
76
0.6672
false
3.943218
true
false
false
tleonhardt/CodingPlayground
python/crypto/nacl_sign.py
1
1736
#!/usr/bin/env python3 # coding=utf-8 """ Uses PyNaCl to sign a message using ed25519 digital signature algorithm """ import sys import colorama from colorama import Fore from nacl.encoding import HexEncoder, RawEncoder from nacl.signing import SigningKey if __name__ == '__main__': colorama.init(autoreset=True) ...
mit
6,721,731,631,513,710,000
33.72
111
0.684332
false
3.579381
false
false
false
carmenfdezb/osmscout-server
scripts/import/poly.py
1
1635
from shapely.geometry import MultiPolygon, Polygon # taken from http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Python_Parsing def parse_poly(fname): """ Parse an Osmosis polygon filter file. Accept a sequence of lines from a polygon file, return a shapely.geometry.MultiPolygon object. ...
gpl-3.0
-8,498,851,842,667,847,000
30.442308
102
0.540061
false
4.149746
false
false
false
google/ml-compiler-opt
compiler_opt/rl/trainer.py
1
6179
# 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 agreed ...
apache-2.0
8,987,349,337,808,561,000
33.519553
78
0.674381
false
3.684556
false
false
false
torchingloom/edx-platform
lms/djangoapps/instructor/views/instructor_dashboard.py
1
11063
""" Instructor Dashboard Views """ from django.utils.translation import ugettext as _ from django_future.csrf import ensure_csrf_cookie from django.views.decorators.cache import cache_control from edxmako.shortcuts import render_to_response from django.core.urlresolvers import reverse from django.utils.html import esc...
agpl-3.0
-1,831,634,395,016,032,000
42.727273
133
0.670614
false
3.7965
false
false
false
ligregni/coursera
designalgo2/week5/tsp_bottom_up.py
1
1459
# Design and Analysis of Algorithms II # Week 5 # Traveling Salesman Problem # Bottom up approach import math import sys def distance(a,b): return math.sqrt( (a[0]-b[0])**2 + (a[1]-b[1])**2 ) def constructsets(m, n, i): if m == 0: return [0] r = [] r += map(lambda x : x | i, constructsets(m-1...
bsd-3-clause
-6,299,900,798,455,404,000
21.106061
99
0.494859
false
2.559649
false
false
false
leanix/leanix-sdk-python
src/leanix/models/Provider.py
1
4357
#!/usr/bin/env python """ The MIT License (MIT) Copyright (c) 2017 LeanIX GmbH 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,...
mit
-3,824,801,298,034,065,000
44.385417
105
0.662153
false
4.271569
false
false
false
becm/meson
mesonbuild/cmake/interpreter.py
1
56165
# Copyright 2019 The Meson development team # 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 ...
apache-2.0
-7,696,294,225,233,389,000
42.237105
150
0.565673
false
3.9036
true
false
false
calispac/digicampipe
digicampipe/scripts/spe.py
1
14553
#!/usr/bin/env python """ Do the Single Photoelectron anaylsis Usage: digicam-spe [options] [--] <INPUT>... Options: -h --help Show this screen. --max_events=N Maximum number of events to analyse. --max_histo_filename=FILE File path of the max histogram. ...
gpl-3.0
8,734,357,305,808,476,000
34.322816
79
0.5302
false
3.793796
false
false
false
mikand/pySmartMirror
modes/clock.py
1
2299
import pygame import time import math import os.path class ClockMode(object): def __init__(self, assets_path): self.clockfont = pygame.font.Font(os.path.join(assets_path, "Helvetica.ttf"), 70) self.datefont = pygame.font.Font(os.path.join(assets_path, "Arimo-Regular.ttf"), 20) self.white =...
apache-2.0
6,010,482,935,936,599,000
36.080645
125
0.530666
false
3.284286
false
false
false
amandapersampa/MicroGerencia
app/main/controllers/Unidade_medida_controller.py
1
1550
# coding=utf-8 from flask import jsonify from flask import render_template,flash,redirect,url_for from app import app from app.main.forms.Unidade_medida_forms import Unidade_medida_forms from app.main.models.Unidade_medida import Unidade_medida_dao from app.main.service.Unidade_medida_service import Unidade_medida_ser...
mit
8,792,491,212,698,203,000
28.807692
75
0.692705
false
2.917137
false
false
false
AoiKuiyuyou/AoikProducerConsumerRunner
src/aoikproducerconsumerrunner/dep/aoikimportutil.py
1
15431
# coding: utf-8 """ File ID: 3ngd7IH """ from __future__ import absolute_import import imp import os.path import sys try: from urllib.request import urlopen ## Py3 except ImportError: from urllib2 import urlopen ## Py2 #/ __version__ = '0.2.2' #/ define |exec_| and |raise_| that are 2*3 compatible. ## ## Mod...
mit
3,262,029,837,573,121,000
23.610845
108
0.554274
false
3.285288
false
false
false
joequant/Fudge-Python
setup.py
1
1200
# # 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 u...
apache-2.0
-5,373,877,245,192,901,000
36.5
104
0.735
false
3.947368
false
false
false
hodger/regolith
regolith/main.py
1
3514
"""The main CLI for regolith""" from __future__ import print_function import os import json from argparse import ArgumentParser from regolith.runcontrol import RunControl, NotSpecified from regolith.validators import DEFAULT_VALIDATORS from regolith.database import connect from regolith import commands DEFAULT_RC = R...
cc0-1.0
-3,644,257,841,367,243,000
32.466667
90
0.627775
false
3.626419
false
false
false
shainer/matasano
set7/md4.py
1
3296
# Thanks to http://www.acooke.org/cute/PurePython0.html for # this part. #!/usr/bin/python3 import binascii from array import array from struct import pack, unpack def _pad(msg, fakeLen): n = len(msg) if fakeLen is None else fakeLen bit_len = n * 8 index = (bit_len >> 3) & 0x3f pad_len = 120 - index if index <...
gpl-3.0
5,463,946,068,264,438,000
25.804878
89
0.512136
false
1.739314
false
false
false
terranodo/eventkit-cloud
scripts/ci_utils.py
1
2122
import json import logging import os import subprocess from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED import requests import yaml logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def run_subprocess(command, shell=True, cwd=None): current_working_directory = cw...
bsd-3-clause
1,915,902,245,713,058,800
34.366667
208
0.6541
false
3.684028
false
false
false
rookdev/pyes
pyes/connection.py
1
6728
# -*- coding: utf-8 -*- from __future__ import absolute_import import random import socket import threading import time from thrift import Thrift from thrift.transport import TTransport from thrift.transport import TSocket from thrift.protocol import TBinaryProtocol from .pyesthrift import Rest from .exceptions impor...
bsd-3-clause
-1,582,925,262,316,940,300
34.225131
104
0.598692
false
4.269036
false
false
false
skyostil/tracy
src/generator/Cheetah/Filters.py
1
9941
#!/usr/bin/env python # $Id: Filters.py,v 1.1 2006-09-06 09:50:08 skyostil Exp $ """Filters for the #filter directive; output filters Cheetah's $placeholders . Filters may now be used standalone, for debugging or for use outside Cheetah. Class DummyTemplate, instance _dummyTemplateObj and class NoDefault exist on...
mit
-7,940,394,277,864,934,000
32.27931
145
0.54411
false
4.192746
false
false
false
skosukhin/spack
var/spack/repos/builtin/packages/r-base64/package.py
1
1765
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-1,151,951,975,833,587,200
44.25641
78
0.675921
false
3.887665
false
false
false
Skylion007/popupcad
dev_tools/propertyeditor.py
1
11614
# -*- coding: utf-8 -*- """ Written by Daniel M. Aukes. Email: danaukes<at>seas.harvard.edu. Please see LICENSE.txt for full license. """ import PySide.QtCore as qc import PySide.QtGui as qg class Child(object): # display = ['a','b','c','d','e'] editable = ['a', 'b', 'c'] new_attr = {'<new_string>': ''...
mit
4,632,046,971,831,045,000
30.906593
103
0.482779
false
4.417649
false
false
false
pjh/vm-analyze
analyze/RssEvent.py
1
1166
# Virtual memory analysis scripts. # Developed 2012-2014 by Peter Hornyack, pjh@cs.washington.edu # Copyright (c) 2012-2014 Peter Hornyack and University of Washington import trace.vm_common as vm ''' Describes trace events that caused the rss page count (resident in physical memory) to change. ''' class RssEvent: t...
bsd-3-clause
1,830,437,122,687,074,300
28.15
75
0.696398
false
3.126005
false
false
false
jiaphuan/models
research/object_detection/models/faster_rcnn_resnet_v1_feature_extractor_test.py
1
5797
# 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
-1,776,759,771,459,436,300
41.313869
100
0.683112
false
3.675967
true
false
false
upconsulting/IsisCB
isiscb/isisdata/forms.py
1
10686
from __future__ import unicode_literals from haystack.forms import FacetedSearchForm from django import forms from django.db import models from django.apps import apps from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ from haystack import connections from haystack.constants...
mit
5,529,970,389,522,010,000
39.022472
155
0.627363
false
3.909989
false
false
false
abhishekraok/GraphMap
graphmap/perf_tester.py
1
5189
import cStringIO import random import time import urllib2 from datetime import datetime class TileTimeStat: def __init__(self, x, y, z, time_taken_ms, http_code, time_of_request): self.x = x self.y = y self.z = z self.time_taken_ms = time_taken_ms self.http_code = http_code...
apache-2.0
4,986,538,957,537,860,000
36.064286
146
0.56851
false
3.395942
true
false
false
chris-martin/refund-calculation
python/refund_calculation/tests/test_history_properties.py
1
2426
from __future__ import absolute_import import hypothesis import hypothesis.searchstrategy import hypothesis.testdecorators import sure from collections import namedtuple from decimal import Decimal from itertools import count import sys from .. import * from ..util import zip zero = Decimal('0') @hypothesis.sear...
mit
-5,923,718,451,341,819,000
28.585366
76
0.699918
false
3.790625
false
false
false
tehasdf/AdventOfCode2016
p23.py
1
1576
def p1(inp): r = dict.fromkeys('abcd', 0) r['a'] = 12 def getval(x): return r[x] if x in r else int(x) instrs = [] for line in inp: parts = line.strip().split() cmd = parts[0] instrs.append([cmd, parts[1:]]) i = 0 c = 0 import pudb; pu.db # NOQA wh...
mit
4,577,882,635,814,515,000
24.836066
60
0.350254
false
3.283333
false
false
false
akvo/akvo-rsr
akvo/rsr/migrations/0014_auto_20150803_1017.py
1
2541
# -*- coding: utf-8 -*- from django.db import models, migrations import akvo.rsr.fields def unique_organisation_names(apps, schema_editor): """Make sure that the organisation.name and organisation.long_name are unique.""" Organisation = apps.get_model('rsr', 'Organisation') org_double_name = {} org...
agpl-3.0
-1,828,263,784,954,637,800
36.925373
212
0.576151
false
3.720351
false
false
false
CLVsol/clvsol_odoo_addons
clv_family_aux/models/family.py
1
3314
# -*- coding: utf-8 -*- # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging from odoo import api, fields, models _logger = logging.getLogger(__name__) class FamilyAux(models.Model): _inherit = 'clv.family_aux' related...
agpl-3.0
4,554,583,028,333,337,000
41.487179
112
0.626132
false
3.551983
false
false
false
kaushik94/tardis
tardis/montecarlo/tests/test_base.py
1
1152
import os import pandas as pd import numpy as np import pytest from astropy import units as u from numpy.testing import assert_almost_equal ### # Save and Load ### @pytest.fixture(scope="module", autouse=True) def to_hdf_buffer(hdf_file_path, simulation_verysimple): simulation_verysimple.runner.to_hdf(hdf_file_pa...
bsd-3-clause
120,374,102,820,287,300
35
70
0.640625
false
3.64557
false
false
false
kepstin/picard
picard/ui/ui_options_metadata.py
1
7398
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/options_metadata.ui' # # Created: Fri May 24 09:20:07 2013 # by: PyQt4 UI code generator 4.10.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 e...
gpl-2.0
3,693,362,362,089,422,000
57.714286
109
0.72479
false
3.764885
false
false
false
pbabik/minstrel
get_lat_lon_exif_pil.py
1
2051
from PIL import Image from PIL.ExifTags import TAGS, GPSTAGS def get_exif_data(image): """Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags""" exif_data = {} info = image._getexif() if info: for tag, value in info.items(): decoded = TAGS.get(ta...
gpl-2.0
-1,580,035,933,895,308,300
29.61194
126
0.557289
false
3.189736
false
false
false
frumiousbandersnatch/supybot-code
plugins/ShrinkUrl/config.py
1
4888
### # Copyright (c) 2005, Jeremiah Fincher # Copyright (c) 2009-2010, James McCoy # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyr...
bsd-3-clause
120,014,738,128,993,890
48.373737
79
0.727291
false
3.996729
false
false
false
chauhankaranraj/hackathon2017
TFKMeansCluster.py
1
6066
from categorize_clusters import categorize_clusters import tensorflow as tf from random import choice, shuffle import numpy as np import pickle def main(): num_clusters = 3 with open('normal_hashes.obj', 'rb') as fHandler: normal_hashes = pickle.load(fHandler) with open('malware_hashes.obj', '...
mit
-1,452,658,285,003,858,200
32.662857
71
0.704088
false
3.578761
false
false
false
alxgu/ansible
lib/ansible/modules/cloud/azure/azure_rm_roledefinition.py
1
13325
#!/usr/bin/python # # Copyright (c) 2018 Yunge Zhu, (@yungezz) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu...
gpl-3.0
-634,955,316,576,536,600
32.39599
143
0.564953
false
4.574322
false
false
false
serendi-app/serendi-server
laufpartner_server/core/api/serializers.py
1
1696
# -*- coding: utf-8 -*- # This file is part of Laufpartner. # # Laufpartner is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # #...
agpl-3.0
7,861,105,898,456,781,000
29.836364
77
0.632665
false
4.901734
false
false
false
karissa/papertalk
papertalk/utils/__init__.py
1
1827
import urllib, urllib2 import re try: import simplejson as json except ImportError: try: import json except ImportError: raise ImportError from datetime import datetime from bson.objectid import ObjectId from werkzeug import Response import pytz def scrape(url): """ Scrapes a url a...
mit
-4,882,801,964,975,490,000
25.478261
105
0.619595
false
3.903846
false
false
false
edusegzy/pychemqt
lib/mEoS/nC5.py
1
12728
#!/usr/bin/python # -*- coding: utf-8 -*- from lib.meos import MEoS from lib import unidades class nC5(MEoS): """Multiparameter equation of state for n-pentane""" name = "pentane" CASNumber = "109-66-0" formula = "CH3-(CH2)3-CH3" synonym = "R-601" rhoc = unidades.Density(232.) Tc = unidad...
gpl-3.0
4,311,531,323,736,320,000
41.406667
149
0.465021
false
2.459308
false
false
false
sunu/oppia-test-4
oppia/apps/exploration/models.py
1
3784
# coding: utf-8 # # Copyright 2013 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 ...
apache-2.0
4,514,169,461,693,996,000
37.222222
85
0.696882
false
4.081985
false
false
false
wangheda/youtube-8m
youtube-8m-zhangteng/losses_embedding.py
1
6481
# 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 ...
apache-2.0
-204,301,208,306,886,980
50.848
149
0.647122
false
4.003088
false
false
false
fedspendingtransparency/data-act-broker-backend
tests/unit/dataactbroker/test_update_historical_duns.py
1
27488
import os import pandas as pd from dataactbroker.scripts import update_historical_duns from dataactcore.config import CONFIG_BROKER from dataactcore.utils.duns import DUNS_COLUMNS, EXCLUDE_FROM_API from dataactcore.models.domainModels import DUNS, HistoricDUNS def test_remove_existing_duns(database): """ Testing...
cc0-1.0
-5,065,725,103,259,083,000
46.805217
116
0.578616
false
3.059662
true
false
false
harsham05/image_space
imagespace_georgetown/server/__init__.py
1
1353
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
apache-2.0
-2,677,355,904,935,077,000
36.583333
79
0.623799
false
4.1
false
false
false
UniversidadDelEste/PyZombis
lab/week4/4_diversity1/listapalabras.py
1
1529
#!/usr/bin/python2 # coding: utf-8 """ Sea la declaracion sobre la diversidad: “The Python Software Foundation and the global Python community welcome and encourage participation by everyone. Our community is based on mutual respect, tolerance, and encouragement, and we are working to help each other live up to thes...
agpl-3.0
7,313,390,221,214,390,000
45.212121
144
0.735082
false
3.14433
false
false
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/code/model/codeimportmachine.py
1
4459
# Copyright 2009 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Database classes including and related to CodeImportMachine.""" __metaclass__ = type __all__ = [ 'CodeImportMachine', 'CodeImportMachineSet', ] from sqlobject imp...
agpl-3.0
5,931,219,688,010,093,000
33.3
71
0.657098
false
4.250715
false
false
false
kaonashi-tyc/zi2zi
model/unet.py
1
32928
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import tensorflow as tf import numpy as np import scipy.misc as misc import os import time from collections import namedtuple from .ops import conv2d, deconv2d, lrelu, fc, batch_norm, init_embedding, conditional_instan...
apache-2.0
-3,483,903,955,147,367,400
53.88
120
0.528426
false
4.000972
false
false
false
nathanhilbert/FPA_Core
openspending/views/admin.py
1
1077
import colander from flask import Blueprint, render_template, request, redirect, Response from flask.ext.login import current_user from flask import current_app from openspending.auth import require from wtforms import Form, TextField, PasswordField, validators from openspending.model import Dataset from openspendi...
agpl-3.0
7,766,214,459,022,135,000
24.642857
90
0.704735
false
3.97417
false
false
false
pingpan2013/sensor-box-project
sensor_project/genGraphs.py
1
4044
#!/usr/bin/python import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np import pandas as pd # used to convert datetime64 to datetime import csv import sys from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA class Gen_Graph: def __init__(self, _...
gpl-3.0
6,884,106,537,588,109,000
30.348837
94
0.516815
false
3.76186
false
false
false
FederatedAI/FATE
python/federatedml/nn/hetero_nn/backend/tf_keras/data_generator.py
1
1243
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
apache-2.0
3,918,844,614,413,614,600
24.367347
75
0.650845
false
3.666667
false
false
false
michal-ruzicka/archivematica
src/archivematicaCommon/lib/databaseFunctions.py
1
14914
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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, e...
agpl-3.0
1,886,681,623,791,319,000
43.12426
178
0.671584
false
4.261143
false
false
false
dongweiming/flask_reveal
social/apps/django_app/default/models.py
1
2611
"""Django ORM models for Social Auth""" from django.db import models from django.conf import settings from django.db.utils import IntegrityError from social.utils import setting_name from social.storage.django_orm import DjangoUserMixin, \ DjangoAssociationMixin, \ ...
bsd-3-clause
-8,976,431,457,367,216,000
31.6375
76
0.646879
false
4.197749
false
false
false
chromium/chromium
tools/android/native_lib_memory/java_code_pages_pss.py
7
2976
#!/usr/bin/env python # Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Prints the total PSS attributed to another app in Chrome's mappings. This script assumes a device with Monochrome, and requires roo...
bsd-3-clause
-2,056,070,294,114,388,500
31.347826
78
0.679772
false
3.542857
false
false
false
jalexvig/tensorflow
tensorflow/python/ops/rnn.py
1
62998
# Copyright 2015 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,907,007,333,491,746,300
40.473338
96
0.662418
false
3.79918
false
false
false