repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
veestr/sjsu-298-experiment
main.py
1
9053
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
mit
-3,909,256,515,630,310,400
30.764912
118
0.709599
false
xiangke/pycopia
mibs/pycopia/mibs/SNMPv2_TM.py
1
2645
# python # This file is generated by a program (mib2py). Any edits will be lost. from pycopia.aid import Enum import pycopia.SMI.Basetypes Range = pycopia.SMI.Basetypes.Range Ranges = pycopia.SMI.Basetypes.Ranges from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, RowObject, ScalarObject, N...
lgpl-2.1
7,965,699,751,727,708,000
25.717172
204
0.727032
false
alexryndin/ambari
ambari-common/src/main/python/resource_management/libraries/functions/packages_analyzer.py
1
10470
#!/usr/bin/env python """ 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")...
apache-2.0
-3,688,034,880,890,380,000
31.71875
352
0.675454
false
openpli-arm/enigma2-arm
lib/python/Components/PluginComponent.py
1
4036
from os import path as os_path, listdir as os_listdir from traceback import print_exc from sys import stdout from Tools.Directories import fileExists from Tools.Import import my_import from Plugins.Plugin import PluginDescriptor import keymapparser class PluginComponent: firstRun = True restartRequired = False d...
gpl-2.0
6,843,298,663,866,455,000
26.834483
112
0.665263
false
SydneyUniLibrary/auto-holds
patron/migrations/0007_auto_20160316_0257.py
1
1269
# Copyright 2016 Susan Bennett, David Mitchell, Jim Nicholls # # This file is part of AutoHolds. # # AutoHolds 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 opt...
gpl-3.0
-6,266,376,468,078,874,000
31.538462
101
0.708432
false
xen0n/gingerprawn
gingerprawn/shrimp/academic/academic_curricula_frame.py
1
8581
#!/usr/bin/env python # -*- coding: utf-8 -*- # JNMaster / academic / curriculum querier interface # the original code was contributed by Chen Huayue, later almost entirely # rewritten by Wang Xuerui. # Copyright (C) 2011 Chen Huayue <489412949@qq.com> # Copyright (C) 2011 Wang Xuerui <idontknw.wang@gmail.com> # # This...
gpl-3.0
7,586,603,775,980,176,000
33.645833
80
0.600722
false
MediffRobotics/DeepRobotics
DeepLearnMaterials/lstm_tfl.py
1
1796
# -*- coding: utf-8 -*- """ Simple example using LSTM recurrent neural network to classify IMDB sentiment dataset. References: - Long Short Term Memory, Sepp Hochreiter & Jurgen Schmidhuber, Neural Computation 9(8): 1735-1780, 1997. - Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng,...
gpl-3.0
-6,052,200,692,671,277,000
34.92
84
0.711581
false
SeattleTestbed/repy_v2
namespace.py
1
39911
""" <Program> namespace.py <Started> September 2009 <Author> Justin Samuel <Purpose> This is the namespace layer that ensures separation of the namespaces of untrusted code and our code. It provides a single public function to be used to setup the context in which untrusted code is exec'd (that is, the ...
mit
8,661,446,760,081,302,000
31.057028
109
0.655308
false
tsg-/pyeclib
pyeclib/utils.py
1
3062
# Copyright (c) 2013, 2014, Kevin Greenan (kmgreen2@gmail.com) # Copyright (c) 2014, Tushar Gohad (tusharsg@gmail.com) # 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...
bsd-2-clause
2,439,260,725,972,171,000
39.826667
78
0.710973
false
ssh0/growing-string
triangular_lattice/diecutting/result_count_on_edge.py
1
9360
#!/usr/bin/env python # -*- coding:utf-8 -*- # # written by Shotaro Fujimoto # 2016-12-16 import matplotlib.pyplot as plt # from mpl_toolkits.mplot3d.axes3d import Axes3D import matplotlib.cm as cm import numpy as np import set_data_path class Visualizer(object): def __init__(self, subjects): self.data_...
mit
-8,337,780,784,412,532,000
36.44
89
0.49797
false
grantcolasurdo/geras
fifth_edition/alignment.py
1
3115
"""Alignment object class""" __author__ = "Grant Colasurdo" class Alignment: SHORT_TO_LONG = { 'N': 'Neutral', 'G': 'Good', 'E': 'Evil', 'C': 'Chaotic', 'L': 'Lawful', '': '' } def __init__(self, short_string: str=""): if "L" in short_string: ...
gpl-2.0
-2,634,461,766,640,477,000
23.527559
60
0.488925
false
PJB3005/MoMMI
MoMMI/Modules/chance.py
1
3714
import asyncio import random from typing import Match from discord import Message from MoMMI import command, MChannel @command("pick", r"(?:pick|choose)\s*\((.*?)\)") async def pick_command(channel: MChannel, match: Match, message: Message) -> None: choices = [x.strip() for x in match.group(1).split(",")] if ...
mit
-9,183,143,027,374,585,000
37.268041
434
0.651401
false
openqt/algorithms
leetcode/python/lc919-complete-binary-tree-inserter.py
1
2138
# coding=utf-8 import unittest """919. Complete Binary Tree Inserter https://leetcode.com/problems/complete-binary-tree-inserter/description/ A _complete_ binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. Write a data structu...
gpl-3.0
-8,482,655,244,249,253,000
22.875
199
0.600561
false
Fidge123/league-unlock-challenge
src/UpdateHallOfFame.py
1
1936
#!/usr/bin/env python3 """Take match and player data, get champ and save it to the database""" from os import environ import psycopg2 # with open("db_config") as file: # HOST = file.readline().strip() # DBNAME = file.readline().strip() # USER = file.readline().strip() # PASS = file.readline().strip() ...
gpl-3.0
-2,136,385,206,930,364,400
36.960784
134
0.576963
false
grantdelozier/TextGWR
GWRMain.py
1
14380
import sys if len(sys.argv) >= 3: #try: print sys.argv args = sys.argv mode_arg = args[args.index("-mode")+1] print mode_arg #############Build Reference File Mode############### if mode_arg.lower() == "build_ref_files": import BuildRef print "Building Reference Files" ...
apache-2.0
-2,837,285,821,625,328,600
33.15677
161
0.525174
false
jeroanan/Aquarius
tests/TestAquarius.py
1
4439
import unittest from unittest.mock import Mock from aquarius.Aquarius import Aquarius from aquarius.Harvester import Harvester from aquarius.Interactor import Interactor from aquarius.InteractorFactory import InteractorFactory from aquarius.interactors.AddBookInteractor import AddBookInteractor from aquarius.interacto...
gpl-3.0
-6,790,716,137,706,200,000
45.25
117
0.713449
false
Mandelag/util
AGSMSLayerDownloader/consolidator.py
1
1493
import os, sys, arcpy, json def consolidate(directory, output, output_name): #import pdb scriptpath = sys.path[0] inputdir = os.path.join(scriptpath, directory) outputdir = os.path.join(scriptpath, output) files = os.listdir(inputdir) n_files = len(files) jsons = [] features = {} ...
gpl-3.0
-4,808,712,708,481,130,000
30.104167
97
0.556597
false
boztalay/MeshnetTest
node.py
1
7721
from Tkinter import * from basics import * NODE_RADIUS = 5 NODE_COLOR = "green" NODE_PENDING_COLOR = "purple" CONNECTION_COLOR = "yellow" PACKETS_SENT_MAX = 100 class NodeError(Exception): pass class Node: def __init__(self, location): self.location = location self.connections = [] s...
mit
7,091,429,230,517,577,000
38.594872
135
0.634892
false
zhester/hzpy
examples/parseriff.py
1
2368
#!/usr/bin/env python """ Example RIFF (WAV contents) Data Parser Sample data is written to a CSV file for analysis. If matplotlib and numpy are available, signal plots (DFTs) are generated. """ import math import os import struct import wave try: import matplotlib.pyplot as plot import numpy import nu...
bsd-2-clause
-7,917,740,915,021,355,000
22.919192
78
0.508868
false
AnnaWyszomirska/lesson1_1
tests/test_remove_contact_from_group.py
1
1949
from model.contact import Contact from model.group import Group import random def test_remove_contact_from_group(app, db, orm): if len(db.get_group_list()) == 0: app.group.create(Group(name="New one")) if len(db.get_contact_list()) == 0: app.contact.add(Contact(firstname="Anna", middlename="Jo...
apache-2.0
5,070,481,090,748,076,000
58.090909
114
0.567984
false
ext/slideshow-frontend
slideshow/lib/queue.py
1
3299
#!/usr/bin/env python # -*- coding: utf-8 -*- from slideshow.lib.slide import Slide from slideshow.settings import Settings import slideshow.event as event import cherrypy def div_id(id): if id >= 0: return 'queue_%d' % id elif id == -1: return 'queue_int' else: raise ValueError, '...
agpl-3.0
2,793,161,652,640,297,000
20.562092
85
0.449227
false
marklar/fowles
py/ids_ventilator.py
1
1430
import re import time import zmq # # The input file is expected to have on each line: # 1. a video_id # 2. a tab # 3. a channel_id # The provided file (below: INPUT_FILE) matches that format. # # cfg INPUT_FILE = "py/10_pairs_of_vid_and_chan_ids.txt" PORT = 5557 # globals context = None pusher = None def m...
mit
-6,243,151,740,370,340,000
20.029412
60
0.599301
false
ThomasSweijen/TPF
doc/sphinx/conf.py
1
28022
# -*- coding: utf-8 -*- # # Yade documentation build configuration file, created by # sphinx-quickstart on Mon Nov 16 21:49:34 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
gpl-2.0
-657,527,205,585,148,000
34.729592
482
0.695523
false
armikhael/software-center
test/gtk3/test_views.py
1
1845
#!/usr/bin/python from gi.repository import Gtk, GObject import sys import unittest sys.path.insert(0,"../..") sys.path.insert(0,"..") #from mock import Mock TIMEOUT=300 import softwarecenter.paths softwarecenter.paths.datadir = "../data" class TestViews(unittest.TestCase): def test_viewswitcher(self): ...
gpl-3.0
-2,807,920,920,501,459,500
30.271186
94
0.673713
false
zhanghui9700/eonboard
eoncloud_web/biz/account/views.py
1
16684
#-*-coding-utf-8-*- import logging from datetime import datetime from rest_framework import generics from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view from django.conf import settings from django.contrib.auth.models import User from django.u...
apache-2.0
3,498,255,991,737,627,000
31.972332
92
0.611664
false
martindisch/Arduino
Watering/logger.py
1
1285
import os, serial, time, numpy watchTime = 3600 measureInterval = 5 calcTime = 1.5 def receiving(ser): global last_received buffer_string = '' while True: buffer_string = buffer_string + ser.read(ser.inWaiting()) if '\n' in buffer_string: lines = buffer_string.split('\n') # Gua...
mit
-8,848,546,226,253,781,000
25.770833
97
0.583658
false
fahhem/plumbum
plumbum/commands/modifiers.py
1
12344
import os from select import select from subprocess import PIPE import sys from itertools import chain from plumbum.commands.processes import run_proc, ProcessExecutionError from plumbum.commands.base import AppendingStdoutRedirection, StdoutRedirection from plumbum.lib import read_fd_decode_safely class Future(obje...
mit
-2,994,591,293,210,177,000
35.847761
103
0.597294
false
feend78/evennia
evennia/server/inputfuncs.py
1
15810
""" Functions for processing input commands. All global functions in this module whose name does not start with "_" is considered an inputfunc. Each function must have the following callsign: inputfunc(session, *args, **kwargs) Where "options" is always one of the kwargs, containing eventual protocol-options. Th...
bsd-3-clause
-4,752,840,159,224,686,000
32.85439
119
0.618849
false
williballenthin/ida-netnode
netnode/test_netnode.py
1
4807
import random import string import logging import contextlib import idaapi from netnode import netnode # get the IDA version number ida_major, ida_minor = list(map(int, idaapi.get_kernel_version().split("."))) using_ida7api = (ida_major > 6) TEST_NAMESPACE = '$ some.namespace' def get_random_data(N): ''' ...
apache-2.0
-8,118,597,814,484,286,000
25.125
91
0.546911
false
hasteur/g13bot_tools_new
scripts/maintenance/compat2core.py
1
7684
#!/usr/bin/python # -*- coding: utf-8 -*- """ A helper script to convert compat 1.0 scripts to the new core 2.0 framework. NOTE: Please be aware that this script is not able to convert your codes completely. It may support you with some automatic replacements and it gives some warnings and hints for converting. Please...
mit
-2,691,116,725,510,714,000
34.906542
81
0.598386
false
ActiveState/code
recipes/Python/170995_Manipulating_infinite_lists_implemented/recipe-170995.py
1
3490
"""Collection of useful functions which work on infinite lists. The infinite lists are actually the generator objects. Note that the functions will have side effects on the passed-in gLists. """ from __future__ import generators def gInfinite(obj): """Return infinite list of repeated objects obj""" while 1: ...
mit
-5,975,087,572,587,617,000
26.698413
104
0.566476
false
jiriprochazka/lnst
obsolete/netconfig.py
1
6220
#! /usr/bin/env python """ Netconfig tool Copyright 2011 Red Hat, Inc. Licensed under the GNU General Public License, version 2 as published by the Free Software Foundation; see COPYING for details. """ __author__ = """ jpirko@redhat.com (Jiri Pirko) """ import getopt import sys import logging import re import os fr...
gpl-2.0
-657,340,184,908,149,100
29.194175
89
0.581029
false
napalm-automation/napalm
napalm/base/netmiko_helpers.py
1
1807
# The contents of this file are 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, softw...
apache-2.0
-5,194,614,369,650,901,000
36.645833
85
0.713337
false
zstackio/zstack-woodpecker
integrationtest/vm/multihosts/migrate/test_migrate_vm_console_access.py
1
1292
''' New Integration test for testing console access after vm migration between hosts. @author: Quarkonics ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.account_operations as acc_ops vm = None test_stub = test_lib.lib_ge...
apache-2.0
-5,268,923,533,346,941,000
28.761905
126
0.651703
false
xray/xray
xarray/core/options.py
1
5201
import warnings DISPLAY_WIDTH = "display_width" ARITHMETIC_JOIN = "arithmetic_join" ENABLE_CFTIMEINDEX = "enable_cftimeindex" FILE_CACHE_MAXSIZE = "file_cache_maxsize" WARN_FOR_UNCLOSED_FILES = "warn_for_unclosed_files" CMAP_SEQUENTIAL = "cmap_sequential" CMAP_DIVERGENT = "cmap_divergent" KEEP_ATTRS = "keep_attrs" DIS...
apache-2.0
-791,005,009,121,592,200
32.127389
86
0.617958
false
Inspq/ansible
lib/ansible/modules/cloud/ovirt/ovirt_networks.py
1
9528
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
-7,966,133,857,572,089,000
34.552239
120
0.592045
false
tanzaho/python-goose
tests/extractors.py
1
18282
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
apache-2.0
-3,193,002,466,137,419,000
30.905759
104
0.639481
false
SotongDJ/SotongDJ-PythonLab
Exp6-wget-batch-tools/progress/main.py
1
1524
import os def status(): print "----RESULT-----------" os.system("ls -1>progress/file.tmp") for wgetlog in open("progress/file.tmp").read().splitlines(): if "wget-log" in wgetlog: percentage="0%" for line in open(wgetlog).read().splitlines(): if "K ." in line o...
gpl-3.0
8,098,244,853,867,098,000
42.542857
165
0.434383
false
onepercentclub/django-token-auth
setup.py
1
1301
#!/usr/bin/env python import os import setuptools import token_auth with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setuptools.setup( name="django-token-auth", version=token_a...
gpl-2.0
-2,578,384,992,987,437,000
27.911111
78
0.607225
false
Superjom/NeuralNetworks
models/mlp.py
1
5692
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on Feb 24, 2014 @author: Chunwei Yan @ PKU @mail: yanchunwei@outlook.com ''' import sys sys.path.append('..') import numpy import theano from theano import tensor as T from softmax_regression import SoftmaxRegression class HiddenLayer(object): ''' a laye...
apache-2.0
-4,254,905,750,425,097,700
29.276596
85
0.514055
false
cloud-fan/spark
python/pyspark/pandas/tests/data_type_ops/test_binary_ops.py
1
6682
# # 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
-3,714,611,770,325,020,700
38.305882
87
0.65669
false
z123/build-a-saas-app-with-flask
catwatch/tests/billing/test_views.py
1
7627
from flask import url_for, json from flask_babel import gettext as _ from catwatch.tests.lib.util import ViewTestMixin from catwatch.tests.lib.assertions import assert_status_with_message class TestBilling(ViewTestMixin): def test_pricing_page(self): """ Pricing page renders successfully. """ res...
mit
1,646,622,906,478,730,200
38.931937
78
0.57126
false
youknowone/instantauth
python/instantauth/cryptors/aes.py
1
2071
""" Install 'pycrypto' package to use this module """ from Crypto.Cipher import AES from . import BaseCryptor def add_padding(data, block_size): data_len = len(data) pad_len = (block_size - data_len) % block_size if pad_len == 0: pad_len = block_size padding = chr(pad_len) return ''.join...
bsd-2-clause
146,333,978,805,470,620
30.861538
89
0.62337
false
manasgarg/flask-sauth
flask_sauth/forms.py
1
3424
#!/usr/bin/env python from datetime import datetime from wtforms import Form, TextField, PasswordField, HiddenField, ValidationError from wtforms import validators as v from models import User, authenticate class RegistrationForm( Form): name = TextField( validators=[v.DataRequired(), v.Length(max=256)]) ema...
bsd-3-clause
-6,195,643,495,887,408,000
39.282353
114
0.672897
false
k-zen/Ama
ama/file_listener.py
1
2550
# -*- coding: utf-8 -*- """ Clase perteneciente al módulo de procesamiento de datos e inferencias Ama. .. module:: file_listener :platform: Unix :synopsis: Funciones útiles para la detección de cambios en directorios. Ej. cuando se agrega un nuevo archivo de radar. .. moduleauthor:: Andreas P. Koenzen <akc@apk...
bsd-2-clause
-5,032,125,557,542,773,000
37.560606
139
0.636935
false
ntoll/foox
foox/species/third.py
1
12608
""" This module encapsulates the behaviour of third species counterpoint. """ import random import foox.ga as ga from .utils import is_parallel, make_generate_function, is_stepwise_motion # Some sane defaults. DEFAULT_POPULATION_SIZE = 4000 DEFAULT_MAX_GENERATION = 200 DEFAULT_MUTATION_RANGE = 3 DEFAULT_MUTATION_RAT...
mit
-8,580,951,361,316,207,000
37.206061
78
0.598509
false
denibertovic/django-client-certificates
client_certs/admin.py
1
1094
from django.contrib import admin from .models import Cert from .cert import revoke_certificates class CertAdmin(admin.ModelAdmin): list_display = ('user', 'install_link', 'is_valid', 'valid_until') fields = ('user', 'country', 'state', 'locality', 'organization', 'organizational_unit', 'common_name'...
bsd-2-clause
-7,066,993,477,669,360,000
32.151515
96
0.667276
false
forgeservicelab/forge.insightly-sync
ldap_updater.py
1
27000
"""Push updates to LDAP.""" import ldap as _ldap import ldap.modlist as _modlist import logging from __init__ import sanitize, fileToRedmine from unidecode import unidecode from canned_mailer import CannedMailer from insightly_updater import InsightlyUpdater from fuzzywuzzy.process import extractOne class ForgeLDAP(o...
mit
6,728,499,487,768,978,000
51.023121
119
0.505963
false
hlange/LogSoCR
pysc/usi/log/console_reporter.py
1
4184
import json import colorlog import logging import logging.handlers from elloghandler.handler import ElLogHandler from socr_streamhandler.handler import SoCR_StreamHandler from socr_filehandler.handler import SoCR_FileHandler from datetime import datetime, date, time def logger_conf(loglevel,index=None): #Formatte...
agpl-3.0
-30,429,728,282,431,344
26.526316
150
0.573853
false
cstrap/python-vuejs
docs/conf.py
1
8556
#!/usr/bin/env python # -*- coding: utf-8 -*- # # python_vuejs documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this ...
mit
-3,259,803,063,698,980,000
30.112727
76
0.706989
false
jvkersch/hsmmlearn
docs/conf.py
1
9948
# -*- coding: utf-8 -*- # # hsmmlearn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 1 17:33:24 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
gpl-3.0
8,598,572,443,615,208,000
31.298701
79
0.702151
false
hguemar/cinder
cinder/tests/test_drbdmanagedrv.py
1
11637
# Copyright 2014 OpenStack Foundation # 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 requ...
apache-2.0
8,359,004,270,935,753,000
35.942857
78
0.592679
false
thewizardplusplus/micro
micro/utilities.py
1
1209
import os.path from . import function_type MICRO_VERSION = '2.3' HEXADECIMAL_NUMBER = '[A-Fa-f0-9]' def extract_and_add_function(entity, functions): entity_type = function_type.FunctionType( len(entity.children[0].children[1].children), function_type.make_type(entity.children[0].children[2].child...
mit
8,061,258,927,986,879,000
25.866667
76
0.65426
false
deerwalk/voltdb
tests/sqlcoverage/schema/sql-grammar-gen-schema.py
1
14110
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2017 VoltDB Inc. # # 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...
agpl-3.0
-9,008,785,377,411,091,000
53.061303
73
0.549043
false
davidbgk/udata
udata/tests/frontend/test_territories.py
1
1165
# -*- coding: utf-8 -*- from __future__ import unicode_literals from flask import url_for from udata.tests.features.territories.test_territories_process import ( create_geozones_fixtures ) from udata.tests.frontend import FrontTestCase class TerritoriesTest(FrontTestCase): modules = ['features.territories',...
agpl-3.0
-1,281,052,889,574,804,500
34.30303
73
0.672961
false
kpbochenek/empireofcode
call_base.py
1
1180
# kpbochenek@gmail.com def total_cost(calls): result = 0 for c in calls: length = int(c.split(' ')[2]) mins = int(round(length / 60, 0)) if mins > 100: result += (mins - 100) * 2 mins = min(100, mins - 100) result += mins print(result) retur...
apache-2.0
791,751,094,155,661,700
34.757576
78
0.482203
false
uclouvain/OSIS-Louvain
learning_unit/tests/api/serializers/test_component.py
1
2250
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
6,898,525,427,319,093,000
42.25
87
0.663851
false
waristo/opensource
tensorflow/tensorflow.py
1
1806
import tensorflow as tf #Tensorflow사용을 위한 import from tensorflow.examples.tutorials.mnist import input_data # Dataset loading mnist = input_data.read_data_sets("./samples/MNIST_data/", one_hot=True) # Set up model x = tf.placeholder(tf.float32, [None, 784]) #심볼릭 변수들을 사용하여 상호작용하는 작업들을 기술 W = tf.Variable(tf....
gpl-3.0
-6,607,569,596,838,577,000
41.411765
110
0.660194
false
jgorgulho/installs
workstationInstall.py
1
8596
#!/bin/env python import os import sys import shlex import subprocess import shutil # # Constants # WELCOME_STRING = """ ######################################################## # Running Installation Script for Workstation # ########################################################\n\n\n """ RAN_SCRIP_ST...
gpl-3.0
-5,450,493,732,590,814,000
31.684411
105
0.684388
false
justinvforvendetta/electrum-rby
gui/qt/qrcodewidget.py
1
3721
from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore import PyQt4.QtGui as QtGui import os import qrcode import electrum_rby from electrum_rby import bmp from electrum_rby.i18n import _ class QRCodeWidget(QWidget): def __init__(self, data = None, fixedSize=False): QWidget....
gpl-3.0
1,245,174,242,556,951,300
26.768657
113
0.52244
false
panmari/tensorflow
tensorflow/examples/skflow/boston.py
1
1485
# Copyright 2015-present Scikit Flow 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...
apache-2.0
-4,287,292,242,645,421,000
34.357143
91
0.751515
false
aliaksandrb/anydo_api
docs/conf.py
1
8486
#!/usr/bin/env python # -*- coding: utf-8 -*- # # anydo_api documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # a...
mit
8,169,311,527,095,483,000
29.858182
76
0.705161
false
jmrozanec/white-bkg-classification
scripts/preprocessing.py
1
1441
#https://github.com/tflearn/tflearn/issues/180 from __future__ import division, print_function, absolute_import import tflearn from tflearn.data_utils import shuffle, to_categorical from tflearn.layers.core import input_data, dropout, fully_connected from tflearn.layers.conv import conv_2d, max_pool_2d from tflearn.la...
apache-2.0
3,670,213,307,102,543,000
36.921053
164
0.76891
false
dimonaks/siman
siman/functions.py
1
29689
from __future__ import division, unicode_literals, absolute_import import os, tempfile, copy, math, itertools, sys import numpy as np from operator import itemgetter from itertools import product try: import scipy except: print('functions.py: no scipy, smoother() will not work()') from siman import header ...
gpl-2.0
-4,048,599,918,254,212,600
27.993164
209
0.548688
false
lukecampbell/compliance-checker
compliance_checker/tests/test_ioos_sos.py
1
2367
import unittest from compliance_checker.suite import CheckSuite from compliance_checker.runner import ComplianceChecker import os import httpretty # TODO: Use inheritance to eliminate redundant code in test setup, etc class TestIOOSSOSGetCapabilities(unittest.TestCase): def setUp(self): with open(os.path...
apache-2.0
-7,692,406,608,126,215,000
44.519231
95
0.652725
false
steabert/molpy
molpy/molden.py
1
5280
# molden.py -- Molden format # Implements the Molden file format, specification can be found here: # http://www.cmbi.ru.nl/molden/molden_format.html # # Copyright (c) 2016 Steven Vancoillie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-2.0
4,687,063,611,598,560,000
35.413793
94
0.575568
false
SMALLplayer/smallplayer-image-creator
storage/.xbmc/addons/script.cu.lrclyrics/resources/lib/culrcscrapers/alsong/lyricsScraper.py
1
3106
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- """ Scraper for http://lyrics.alsong.co.kr/ edge """ import sys import socket import hashlib import urllib2 import xml.dom.minidom as xml from utilities import * from audiofile import AudioFile __title__ = "Alsong" __priority__ = '115' __lrc_...
gpl-2.0
-7,442,588,133,466,447,000
32.021277
344
0.585052
false
dderevjanik/agescx
agescx/scenario.py
1
3376
from .models import * from .controller import * from .utilities import * # utilities from .decompress import * from .compress import * class Scenario: """ Scenario class """ def __init__(self, filename=None, ver=1.21): """create scenario with defaults values, check default.txt for more i...
mit
6,019,703,332,485,331,000
28.876106
84
0.544135
false
deanishe/alfred-packal-search
src/workflow/workflow.py
1
98456
# encoding: utf-8 # # Copyright (c) 2014 Dean Jackson <deanishe@deanishe.net> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2014-02-15 # """The :class:`Workflow` object is the main interface to this library. :class:`Workflow` is targeted at Alfred 2. Use :class:`~workflow.Workflow3` if you wa...
mit
-8,473,999,698,847,352,000
31.602193
94
0.547717
false
InUrSys/PescArt2.0
src/srcPlus/GenericPesquisas.py
1
10030
''' Created on 13/12/2017 @author: chernomirdinmacuvele ''' from PyQt5.Qt import QDialog, QModelIndex, QStandardItemModel, QStandardItem,\ QGroupBox import mixedModel import QT_tblViewUtility import rscForm import frmPesquisa_Sort class GenericPesquisas(QDialog): def configCombox(self): ''' ...
gpl-3.0
-1,872,132,791,458,829,000
48.905473
185
0.54008
false
clemenshage/grslra
smmprod/__init__.py
1
1426
# # -*- coding: utf-8 -*- import numpy as np from . import _smmprod def smmprod_c(A, B, Omega): # out wird hier preallocated, kann in Schleifen dann wiederverwendet werden out = np.zeros(Omega[0].shape[0]) _smmprod.smmprod(A, B, Omega, out) return out # def smmprod(A, B, Omega): # A_rows = A[Omeg...
mit
-1,816,194,977,066,251,800
28.040816
81
0.602249
false
thejens/luigi
luigi/worker.py
1
33476
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
7,350,108,259,306,369,000
37.214612
160
0.577668
false
krount/sslyze
sslyze/plugins/heartbleed_plugin.py
1
6967
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import socket import types from xml.etree.ElementTree import Element from nassl._nassl import WantReadError from sslyze.plugins import plugin_base from sslyze.plugins.plugin_base import PluginScanResult, PluginScan...
gpl-2.0
521,774,391,793,940,600
37.705556
120
0.679776
false
keseldude/brobot
brobot/plugins/users.py
1
1217
#=============================================================================== # brobot # Copyright (C) 2010 Michael Keselman # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
gpl-3.0
-2,537,083,521,998,450,000
40.965517
80
0.624486
false
amstart/demo
vote/polls/forms.py
1
1604
from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions class PremiseForm(forms.Form): radio_buttons = form...
mit
-2,778,027,478,078,338,600
33.12766
121
0.613466
false
nicfitzgerald/pyrogue-game
map_utils.py
1
4764
from tdl.map import Map from random import randint from components.ai import BasicMonster from components.fighter import Fighter from entity import Entity class GameMap(Map): def __init__(self, width, height): super().__init__(width, height) self.explored = [[False for y in range(height)] for x in ...
gpl-3.0
7,027,452,467,717,760,000
37.12
96
0.561293
false
open-synergy/opnsynid-l10n-indonesia
l10n_id_taxform_faktur_pajak_common/models/faktur_pajak_common.py
1
24141
# -*- coding: utf-8 -*- # Copyright 2017 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api import openerp.addons.decimal_precision as dp from datetime import datetime import re class FakturPajakCommon(models.AbstractModel): ...
agpl-3.0
-7,488,912,429,143,546,000
27.440244
77
0.518413
false
kije/PySpyX
pyspy/migrations/0004_auto_20150515_1104.py
1
1390
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('pyspy', '0003_surveillancevideos'), ] operations = [ migrations.CreateModel( name='SurveillanceVideo', ...
gpl-3.0
2,700,681,298,944,059,000
36.567568
109
0.553237
false
ShaolongHu/Nitrate
tcms/xmlrpc/utils.py
1
7751
# -*- coding: utf-8 -*- import re from django.db.models import Count, FieldDoesNotExist from tcms.management.models import Product COUNT_DISTINCT = 0 QUERY_DISTINCT = 1 ACCEPTABLE_BOOL_VALUES = ('0', '1', 0, 1, True, False) def parse_bool_value(value): if value in ACCEPTABLE_BOOL_VALUES: if value is ...
gpl-2.0
613,022,896,010,496,300
30.636735
79
0.589859
false
misabelcarde/kivy-mobile-computing
src/BoardPlay.py
1
3832
from kivy.uix.gridlayout import GridLayout from kivy.uix.button import Button from kivy.uix.label import Label from Singleton import * from Instructions import Instructions from OwnBoard import BaseOwnBoard from BoardFunctions import * from SendPackage import * from kivy.lang import Builder Builder.load_string(''' <B...
mit
9,012,469,336,740,509,000
29.388889
105
0.627743
false
vladikoff/loop-server
loadtests/loadtest.py
1
5543
from gevent import monkey monkey.patch_all() import json import gevent from requests_hawk import HawkAuth from loads.case import TestCase class TestLoop(TestCase): def setUp(self): self.wss = [] def tearDown(self): for ws in self.wss: ws.close() # XXX this is miss...
mpl-2.0
-7,240,788,177,399,997,000
31.605882
77
0.532383
false
ravenshooter/BA_Analysis
Preprocess.py
1
5604
import numpy import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import scipy import mdp import csv from thread import start_new_thread import DataSet from DataAnalysis import plot from Main import getProjectPath def readFileToNumpy(fileName): reader=csv.reader(open(fileName,"rb"),delimiter=...
mit
5,430,040,770,081,094,000
27.74359
138
0.618487
false
igel-kun/pyload
module/plugins/hoster/JWPlayerBased.py
1
3736
# -*- coding: utf-8 -*- import re from module.network.CookieJar import CookieJar from module.network.PhantomRequest import PhantomRequest from module.plugins.internal.misc import eval_js_script, get_domain, make_oneline from module.plugins.internal.XFSHoster import XFSHoster class JWPlayerBased(XFSHoster): __n...
gpl-3.0
2,496,716,507,070,426,000
35.990099
124
0.56531
false
kaste/mockito-python
tests/modulefunctions_test.py
1
3675
# Copyright (c) 2008-2016 Szczepan Faber, Serhiy Oplakanets, Herr Kaste # # 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
1,511,132,505,961,215,000
35.75
79
0.69551
false
kkmonlee/Project-Euler-Solutions
Python/p412v1.py
1
1413
from kkmonleeUtils import EulerTools import math upperlim = 75000000 primes = EulerTools.primes_sieve(upperlim) factor_dict = {} # Compute how many of each prime factors are there in 75000000! for p in primes: num_factors = 0 q = p while upperlim // q > 0: num_factors += upperlim // q q *=...
gpl-3.0
-6,085,984,801,262,973,000
27.26
79
0.556263
false
tcmitchell/geni-ch
plugins/chapiv1rpc/chapi/DelegateBase.py
2
4206
#---------------------------------------------------------------------- # Copyright (c) 2011-2016 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including ...
mit
7,589,951,973,677,695,000
41.484848
117
0.644318
false
aschn/goodtechgigs
docs/conf.py
1
7831
# -*- coding: utf-8 -*- # # goodtechgigs documentation build configuration file, created by # sphinx-quickstart. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values h...
apache-2.0
2,750,946,561,795,250,000
30.963265
80
0.697867
false
RealImpactAnalytics/airflow
airflow/contrib/operators/segment_track_event_operator.py
1
2675
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
-8,805,401,860,075,005,000
37.768116
83
0.669907
false
imminent-tuba/thesis
server/chatterbot/chatterbot/adapters/storage/jsondatabase.py
1
4775
from chatterbot.adapters.storage import StorageAdapter from chatterbot.adapters.exceptions import EmptyDatabaseException from chatterbot.conversation import Statement, Response # from jsondb import Database class JsonDatabaseAdapter(StorageAdapter): """ The JsonDatabaseAdapter is an interface that allows Chat...
mit
-6,168,372,665,822,359,000
30.006494
78
0.573194
false
andymckay/zamboni
mkt/developers/tests/test_providers.py
1
14056
from datetime import datetime from django.core.exceptions import ObjectDoesNotExist from mock import ANY, Mock, patch from nose.tools import eq_, ok_, raises from amo.tests import app_factory, TestCase from mkt.constants.payments import (PROVIDER_BANGO, PROVIDER_BOKU, PROVIDER_REFEREN...
bsd-3-clause
-3,848,961,013,239,043,000
36.28382
79
0.577334
false
ballesterus/UPhO
Get_fasta_from_Ref.py
1
3740
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import argparse #Function definitions def Fasta_to_Dict(File): '''Creates a dictionary of FASTA sequences in a File, with seqIs as key to the sequences.''' with open(File, 'r') as F: Records = {} for Line in F: if...
gpl-3.0
-4,248,451,519,692,429,300
49.540541
575
0.604011
false
EzeAlbornoz5/TP-Ingenieria-web
doyourfreight/forums/views.py
1
12790
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseNotFound from django.shortcuts import render, redirect from django.contrib.auth.models import User from .forms import * from .models import * from shippings.models im...
gpl-3.0
-4,424,713,529,764,889,600
49.133333
162
0.565864
false
junwoo091400/MyCODES
Projects/FootPad_Logger/logged_data_analyzer_LSTM/RNN_LSTM.py
1
2131
from __future__ import print_function, division import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import ipdb def RNN_LSTM(batch_size_in = 5, total_len_in = 30000, pad_len_in = 5, backprop_len_in = 50, state_size_in = 10, num_class_in = 32): # total_len_in = (backprop_len_in) * (num_batches...
gpl-3.0
8,832,610,003,618,815,000
40.803922
147
0.742374
false
radekp/qt
doc/src/diagrams/programs/mdiarea.py
1
3712
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## ## This file is part of the test suite of the Qt Toolkit. ## ## $QT_BEG...
lgpl-2.1
-810,234,570,365,328,900
32.441441
81
0.618804
false
EndlessDex/euler
13-largeSum.py
1
5187
numStr = ('''37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 89261670696623633820136378418383684178734361726757 2...
mit
-5,320,979,860,929,871,000
49.359223
63
0.973973
false
RicherMans/QPy
src/qpy.py
1
8949
import marshal import subprocess as sub import os from inspect import getsource, getargspec import re import types from functools import wraps from contextlib import contextmanager import sys import qsubsettings from glob import glob def _globalimports(func): for name, val in func.__globals__.iteritems(): ...
mit
-8,531,946,139,641,074,000
34.939759
128
0.613476
false
pgmillon/ansible
test/units/pytest/plugins/ansible_pytest_coverage.py
1
1260
"""Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`.""" from __future__ import (absolute_import, division, print_function) def pytest_configure(): try: import coverage except ImportError: coverage = None try: ...
gpl-3.0
-5,488,508,721,618,347,000
21.5
127
0.601587
false
Schpin/schpin-chassis
schpin_tote/src/lib/stl.py
1
1937
import subprocess, os from lib.util import convert_scad def render(filename, scad_cfg, mirror): """ renders scad module defined by scad_cfg into stl 'filename' """ assert filename[-1] == 'b' scad = "../scad/tmp.scad" with open(scad, "w") as fd: fd.write("include <model.scad>;\n $fn=32;") ...
gpl-3.0
-4,759,282,188,491,088,000
28.348485
98
0.56634
false
bmenendez/20up
tntwrapper.py
1
7920
#! /usr/bin/python # -*- coding: utf-8 -*- """ Copyright (C) 2016 Borja Menendez Moreno 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 any later version. This p...
gpl-3.0
2,368,601,534,291,196,400
33.580786
128
0.572042
false
jalourenco/wagtaildemo
demo/templatetags/demo_tags.py
1
5358
from datetime import date from django import template from django.conf import settings from demo.models import * register = template.Library() # settings value @register.assignment_tag def get_googe_maps_key(): return getattr(settings, 'GOOGLE_MAPS_KEY', "") @register.assignment_tag(takes_context=True) def ge...
bsd-3-clause
3,196,997,872,230,201,300
27.5
79
0.653602
false