repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
demharters/git_scripts
removeFirstLast.py
1
1584
#! /usr/bin/python import sys my_file = sys.argv[1] myIdx = my_file.find(".pdb") fout_name = my_file[:myIdx] + "_trunc.pdb" my_dict = {} myMax = [] myMin = [] # Create dictionary with chains as keys and lists of residues as values with open(my_file,"r") as f: for line in f: if "ATOM" in line: ...
apache-2.0
2,306,010,707,959,049,700
26.310345
139
0.470328
false
3.391863
false
false
false
odinjv/conference-udacity
conference.py
1
17989
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime import e...
apache-2.0
7,087,268,235,147,335,000
36.090722
77
0.627773
false
4.19324
false
false
false
Outernet-Project/librarian
librarian/helpers/lang.py
1
1268
# -*- coding: utf-8 -*- """ lang.py: Locale constants Copyright 2014-2015, Outernet Inc. Some rights reserved. This software is free software licensed under the terms of GPLv3. See COPYING file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt. """ from __future__ import unicode_literals from ...
gpl-3.0
-4,302,272,209,746,936,000
21.245614
77
0.649054
false
3.328084
false
false
false
vyscond/nest
nest/__init__.py
1
2910
import os import re import json import argparse import pip import copy from collections import OrderedDict from setuptools import find_packages BASE_FOLDER = os.path.basename(os.path.abspath('.')).replace(' ', '-').lower() EXCLUDE_FOLDERS = ['contrib','docs','tests*'] TEXT_FILES = '([A-Za-z]+)(\_[A-Za-z]+)*\.(rst|md)...
mit
-7,759,981,346,841,378,000
30.978022
132
0.540206
false
3.579336
false
false
false
pythonindia/junction
junction/proposals/forms.py
1
9639
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django import forms from django.utils.safestring import mark_safe from django.utils.timezone import now from pagedown.widgets import PagedownWidget from junction.base.constants import ( ConferenceSettingConstants, ProposalRe...
mit
-3,384,632,938,890,905,600
33.060071
94
0.637514
false
4.036432
false
false
false
decabyte/vehicle_core
scripts/trajectory_cli.py
1
4003
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import sys import argparse import numpy as np np.set_printoptions(precision=3, suppress=True) from numpy import cos, sin # fix imports sys.path.append('../src') from vehicle_core.path import trajectory_tools as tt # constants T_TYPES ...
bsd-3-clause
1,329,321,018,923,603,700
26.798611
125
0.57307
false
3.149489
false
false
false
adtennant/homebridge-energenie
lib/pyenergenie/src/setup_tool.py
2
8531
# setup_tool.py 28/05/2016 D.J.Whale # # A simple menu-driven setup tool for the Energenie Python library. # # Just be a simple menu system. # This then means you don't have to have all this in the demo apps # and the demo apps can just refer to object variables names # from an assumed auto_create registry, tha...
mit
-7,787,318,702,676,229,000
23.235795
96
0.553745
false
3.988312
false
false
false
evernym/zeno
plenum/server/consensus/view_change_trigger_service.py
2
7315
from typing import Callable from plenum.common.config_util import getConfig from plenum.common.constants import NODE_STATUS_DB_LABEL, VIEW_CHANGE_PREFIX from plenum.common.event_bus import InternalBus, ExternalBus from plenum.common.messages.internal_messages import VoteForViewChange, NodeNeedViewChange, NewViewAccept...
apache-2.0
5,930,155,047,965,912,000
49.10274
110
0.662064
false
3.847975
false
false
false
akuster/yali
yali/gui/ScrDateTime.py
1
8166
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2010 TUBITAK/UEKAE # # 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. # # ...
gpl-2.0
-7,855,595,690,134,043,000
33.744681
103
0.615064
false
3.97517
false
false
false
ella/ella-comments
ella_comments/forms.py
1
1988
from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_unicode from django.conf import settings from ella.utils.timezone import now from threadedcomments.forms import ThreadedCommentForm class AuthorizedCommentForm(ThreadedCommentForm): user = None def __init__(s...
bsd-3-clause
-4,359,619,489,563,180,500
36.509434
95
0.600604
false
4.016162
false
false
false
chenyujie/hybrid-murano
murano/db/services/core_services.py
1
8760
# 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...
apache-2.0
3,541,658,079,617,387,000
37.086957
79
0.651826
false
4.43769
false
false
false
thinker0/aurora
src/test/python/apache/aurora/client/cli/test_config_noun.py
8
3071
# # 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 ...
apache-2.0
-1,368,451,864,984,185,300
35.129412
98
0.648323
false
3.758874
true
false
false
azylstra/StockDB
run.py
1
1191
#!/usr/bin/python3 # Run the regular daily import of data, with error logging # # Author: Alex Zylstra # Date: 2014/05/17 # License: MIT from DB import DB, FILE from scripts import * from fetch import * import datetime import logging logging.basicConfig(filename='StockDB.log',level=logging.INFO) import smtplib def ...
mit
954,289,888,926,774,900
26.090909
69
0.5911
false
3.326816
false
false
false
mpalmi/clip
packages/scap-security-guide/scap-security-guide-0.1.25/shared/modules/splitchecks_module.py
4
3741
#!/usr/bin/python import sys import os import errno import string import re from optparse import OptionParser import lxml.etree as ET xmlns = { "o": "http://oval.mitre.org/XMLSchema/oval-definitions-5", "xsi": "http://www.w3.org/2001/XMLSchema-instance", "oval": "http://oval.mitre.org/XMLSchema/oval-commo...
apache-2.0
9,097,986,886,495,331,000
33.962617
114
0.616947
false
3.552707
false
false
false
AdrianEriksen/ttm4128
app.py
1
1126
from cim_client import CIMClient from snmp_client import SNMPClient from flask import Flask, redirect, render_template, url_for # Initiate Flask app = Flask(__name__) # Frontpage method redirecting to CIM dashboard @app.route("/") def index(): return redirect(url_for('cim_dashboard')) # CIM dashboard method @app...
mit
5,498,000,740,435,371,000
21.979592
74
0.622558
false
3.401813
false
false
false
ShikherVerma/tic-tac-toe
ttt.py
1
5016
''' Project - Tic Tic Tac Toe 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 program is distributed in the hope th...
gpl-3.0
7,665,694,044,367,622,000
24.591837
144
0.636563
false
2.760594
false
false
false
rvalyi/openerp-pt_br
tests_others/test_create_tax_include.py
2
1060
def test_create_tax_include(oerp): tax_code_obj = oerp.pool.get('account.tax.code') tax_code_id = tax_code_obj.create(oerp.cr, 1, { 'name': 'ISS 2%', 'company_id': 1, 'sign': 1, 'tax_discount': 'TRUE', 'tax_include': 'TRUE', 'notprintable': 'TRUE', 'doma...
agpl-3.0
2,861,934,955,532,070,000
27.648649
78
0.490566
false
2.888283
false
false
false
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/django_openid_auth/tests/test_models.py
4
3239
# django-openid-auth - OpenID integration for django.contrib.auth # # Copyright (C) 2013 Canonical Ltd. # # 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...
agpl-3.0
-6,921,360,719,145,145,000
42.77027
75
0.692806
false
4.341823
true
false
false
yanbober/SmallReptileTraining
AndroidSpider/Spider_ethsacn.py
1
1900
#-*-coding:utf-8 -*- # 将ETHSCAN记录保存的脚本 import urllib.request as urllib2 from urllib import request import random from bs4 import BeautifulSoup ''' # user_agent是爬虫与反爬虫斗争的第一步 ua_headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0', }''' # 用于模拟http头的User-agent ua_l...
mit
-6,785,151,779,548,744,000
26.786885
128
0.68595
false
2.060827
false
false
false
Basis/webargs
examples/bottle_example.py
1
1822
"""A simple number and datetime addition JSON API. Run the app: $ python examples/bottle_example.py Try the following with httpie (a cURL-like utility, http://httpie.org): $ pip install httpie $ http GET :5001/ $ http GET :5001/ name==Ada $ http POST :5001/add x=40 y=2 $ http POST :5001/datea...
mit
6,806,274,260,072,507,000
26.606061
84
0.656422
false
3.219081
false
false
false
s0faking/plugin.video.puls4
resources/lib/base.py
1
3786
#!/usr/bin/python # -*- coding: utf-8 -*- import xbmc import xbmcaddon import xbmcgui import xbmcplugin from .app_common import log, defaultbanner, addon_handle, addon_url, translate, showNotification, kodiVersion, installAddon from .utils import cleanText, encodeUrl def get_InputStreamHelper(drm): streamHelper...
gpl-2.0
7,925,485,877,021,984,000
33.733945
123
0.630481
false
3.927386
false
false
false
m4sterm1nd/python
betfair/AlgoView/algomanagementpanel.py
1
5683
import wx from algoloader import AlgorithmLoader from wx.lib.pubsub import Publisher as pub from publisherconstants import * # Event IDs ID_LOAD_ALGOS = wx.NewId() ID_LOAD_MARKETS = wx.NewId() class AlgoManagementPanel(wx.Panel): def __init__(self, parent, session): super(AlgoManagementPanel, self).__ini...
gpl-2.0
-1,328,546,920,181,080,300
39.021127
113
0.643146
false
3.549656
false
false
false
mdeutsch86/stocks
portfolio.py
1
2459
from asset import Asset from stock import Stock from savingsBook import SavingsBook class Portfolio(object): def __init__(self): """ You should first pay_in, otherwise you can not buy anything """ self.cash = 0. self.stocks = {} self.savingBooks = {} self.oth...
mit
-3,954,065,350,930,761,000
29.358025
105
0.575031
false
3.517883
false
false
false
johny-c/pylmnn
pylmnn/lmnn.py
1
50724
# coding: utf-8 """ Large Margin Nearest Neighbor Classification """ # Author: John Chiotellis <johnyc.code@gmail.com> # License: BSD 3 clause from __future__ import print_function from warnings import warn import sys import time import numpy as np from scipy.optimize import minimize from scipy.sparse import csr_mat...
bsd-3-clause
7,088,095,768,476,751,000
37.836907
115
0.587134
false
4.153374
false
false
false
enddo/smod
Application/modules/modbus/dos/writeAllRegister.py
1
2327
import os import threading import random from System.Core.Global import * from System.Core.Colors import * from System.Core.Modbus import * from System.Lib import ipcalc down = False class Module: info = { 'Name': 'DOS Write All Register', 'Author': ['@enddo'], 'Description': ("DOS With Write All Register Fu...
gpl-2.0
2,596,153,615,724,404,700
28.455696
240
0.619252
false
2.796875
false
false
false
hayderimran7/ec2-api
ec2api/tests/functional/api/test_images.py
2
14762
# 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,902,283,319,252,786,000
42.417647
79
0.628641
false
3.985421
true
false
false
AsimmHirani/ISpyPi
tensorflow/contrib/tensorflow-master/tensorflow/contrib/tensor_forest/hybrid/python/hybrid_layer_test.py
158
2156
# Copyright 2016 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
-4,702,249,139,691,213,000
35.542373
81
0.699443
false
3.843137
true
false
false
AlienCowEatCake/ImageViewer
src/ThirdParty/Exiv2/exiv2-0.27.3-Source/tests/bugfixes/redmine/test_issue_1058.py
3
1394
# -*- coding: utf-8 -*- import system_tests @system_tests.CopyFiles("$data_path/exiv2-empty.jpg") class CheckXmlLang(metaclass=system_tests.CaseMeta): url = "http://dev.exiv2.org/issues/1058" filename = system_tests.path("$data_path/exiv2-empty_copy.jpg") commands = [ ## Add titles in 2 language...
gpl-3.0
9,075,416,117,488,455,000
35.684211
145
0.479914
false
3.375303
false
false
false
ultimate-pa/benchexec
benchexec/test_runexecutor.py
1
43124
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import contextlib import logging import os import re import subprocess import sys import t...
apache-2.0
5,282,793,122,061,487,000
37.85045
105
0.555978
false
3.976395
true
false
false
uwescience/raco
c_test_environment/c_index_strings.py
1
1244
import csv import sys #TODO take a schema as input class WordIndexer: def __init__(self, indexf): self.words = {} self.count = 0 self.indexfw = open(indexf, 'w') def add_word(self, w): if w in self.words: return self.words[w] else: self.indexfw...
bsd-3-clause
9,030,464,873,541,193,000
20.824561
68
0.522508
false
3.398907
false
false
false
bartosh/zipline
etc/gen_type_stubs.py
5
1635
import inspect from operator import attrgetter from textwrap import dedent from zipline import api, TradingAlgorithm def main(): with open(api.__file__.rstrip('c') + 'i', 'w') as stub: # Imports so that Asset et al can be resolved. # "from MOD import *" will re-export the imports from the stub, s...
apache-2.0
6,159,726,706,091,059,000
35.333333
78
0.585933
false
4.455041
false
false
false
AlphaStaxLLC/scalr
app/python/scalrpy/util/dbmanager.py
2
11297
import time import socket import threading import pymysql import pymysql.err import pymysql.cursors from scalrpy.util import helper from scalrpy import LOG def make_connection(config, autocommit=True): connection = pymysql.connect( user=config['user'], passwd=config['pass'], db=config['n...
apache-2.0
-2,952,279,632,889,608,000
34.637224
100
0.512348
false
3.979218
true
false
false
iulian787/spack
var/spack/repos/builtin/packages/diffutils/package.py
2
1246
# 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) import re from spack import * class Diffutils(AutotoolsPackage, GNUMirrorPackage): """GNU Diffutils is a package of...
lgpl-2.1
-8,120,714,615,899,992,000
31.789474
93
0.683788
false
3.162437
false
false
false
theoryclub/tf_workshop
Iris.py
1
4006
import tensorflow as tf import numpy as np import struct import math import os path=os.path.dirname(os.path.realpath(__file__)) def normalize(v): norm=np.linalg.norm(v) if norm==0: return v return v/norm def readToLines(file): csvFile=open(file) lines=csvFile.read().splitlines() csvFi...
mit
-7,951,701,745,459,195,000
38.27451
171
0.696455
false
3.51712
false
false
false
RTHMaK/RPGOne
deep_qa-master/scripts/get_nearest_neighbors.py
1
2100
import argparse import codecs import logging from pyhocon import ConfigFactory from deep_qa.common.checks import ensure_pythonhashseed_set from deep_qa.data.instances.instance import TextInstance from deep_qa.models.memory_networks.differentiable_search import DifferentiableSearchMemoryNetwork logger = logging.getLo...
apache-2.0
-3,488,670,208,409,844,000
41.857143
98
0.661429
false
4.2
false
false
false
blumug/texapi
core/tests_utils.py
1
1204
import json from django.contrib.auth.models import User from django.test.client import Client from django.core.urlresolvers import reverse from rest_framework.authtoken.models import Token from api_users.models import ApiUser def generate_api_user(username='user', email='test@test.com', password='password', login=...
mit
3,645,814,566,693,316,600
25.755556
95
0.634551
false
3.909091
false
false
false
qiyuangong/leetcode
python/108_Convert_Sorted_Array_to_Binary_Search_Tree.py
2
1027
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): # def sortedArrayToBST(self, nums): # """ # :type nums: List[int] # :rtype: TreeNode # ""...
mit
6,595,800,867,033,099,000
29.235294
60
0.53554
false
3.389439
false
false
false
pfalcon/ScratchABlock
dce.py
1
1917
import logging from core import * _log = logging.getLogger(__file__) def make_dead(insts, idx): org_inst = insts[idx] if org_inst.op == "DEAD": return if org_inst.side_effect(): org_inst.dest = None else: dead = Inst(None, "DEAD", []) dead.addr = org_inst.addr ...
gpl-3.0
-6,786,215,095,110,471,000
28.045455
111
0.567553
false
3.623819
false
false
false
PyCQA/pylint
script/bump_changelog.py
1
5851
# ORIGINAL here: https://github.com/PyCQA/astroid/blob/main/script/bump_changelog.py # DO NOT MODIFY DIRECTLY """ This script permits to upgrade the changelog in astroid or pylint when releasing a version. """ # pylint: disable=logging-fstring-interpolation import argparse import enum import logging from datetime impo...
gpl-2.0
-1,239,026,852,657,562,600
35.798742
101
0.65664
false
3.337707
false
false
false
Tigge/platinumshrimp
plugins/feedretriever/test/test_basic_feed.py
1
1797
import os import unittest import unittest.mock import feedparser from plugins.feedretriever.feedretriever import Feedpoller def noop(*a, **kw): pass feedparse = feedparser.parse class FeedRetriverTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.dir = os.path.join("..", os.path.d...
mit
-1,768,466,555,112,967,400
28.459016
88
0.589872
false
3.509766
true
false
false
mediawiki-utilities/python-mwsessions
mwsessions/tests/test_sessionizer.py
1
1236
from nose.tools import eq_ from ..sessionizer import Sessionizer def test_sessionizer(): sessionizer = Sessionizer(cutoff=2) user_sessions = list(sessionizer.process("foo", 1)) eq_(user_sessions, []) user_sessions = list(sessionizer.process("bar", 2)) eq_(user_sessions, []) user_sessions =...
mit
-2,459,536,942,961,869,300
27.090909
73
0.640777
false
3.404959
false
false
false
EmreAtes/spack
var/spack/repos/builtin/packages/py-jpype/package.py
5
1891
############################################################################## # Copyright (c) 2013-2018, 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
2,660,631,295,842,671,600
41.977273
78
0.669487
false
3.629559
false
false
false
massimovassalli/wound
wound.py
1
9075
from PyQt5 import QtCore, QtGui, QtWidgets _fromUtf8 = lambda s: s import sys,os import wound_view as view import engine class woundWindow ( QtWidgets.QMainWindow ): def __init__ ( self, parent = None ): QtWidgets.QMainWindow.__init__( self, parent ) self.setWindowTitle( 'Scratch Test Wizard' ) ...
gpl-3.0
-9,087,444,954,185,123,000
39.333333
140
0.614325
false
3.952526
false
false
false
AstroTech/workshop-python
design-patterns/solution/iterator_addressbook.py
1
1148
class Kontakt: def __init__(self, imie, nazwisko, adresy=[]): self.imie = imie self.nazwisko = nazwisko self.adresy = adresy def __iter__(self): self.current_element = 0 return self def __next__(self): if self.current_element >= len(self.adresy): ...
mit
1,112,297,815,520,693,000
27
69
0.579268
false
2.94359
false
false
false
citrix-openstack-build/ryu
ryu/lib/packet/icmpv6.py
2
19717
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # 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 appli...
apache-2.0
-3,966,669,144,491,497,000
34.08363
79
0.549171
false
3.829287
false
false
false
sdynerow/Semirings-Library
python/Metarouting/Algebra/Semiring.py
2
2021
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012 - Seweryn Dynerowicz, FUNDP. # 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 ...
apache-2.0
-7,328,780,655,527,917,000
26.310811
87
0.619
false
3.924272
false
false
false
matrix-org/synapse
synapse/rest/media/v1/config_resource.py
1
1540
# Copyright 2018 Will Hunt <will@half-shot.uk> # Copyright 2020-2021 The Matrix.org Foundation C.I.C. # # 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/LI...
apache-2.0
5,197,898,967,068,174,000
34.813953
74
0.718831
false
3.684211
false
false
false
shaneneuerburg/cgrates
data/scripts/migrator/dbsmerge_mongo.py
3
3374
#!/usr/bin/python # depends: # ^ pymongo # install via: easy_install pymongo # behaviour: # ^ the script will "move" the collections if source and target server are the same # but will "copy" (dump/restore) if source and target servers are different from_host = '127.0.0.1' from_port = '27017' from_db ...
gpl-3.0
1,611,922,954,929,420,300
32.405941
158
0.54594
false
3.525601
false
false
false
kyubifire/softlayer-python
SoftLayer/CLI/dedicatedhost/create.py
4
3969
"""Order/create a dedicated Host.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import template @click.command( epilog="See 'slcli dedicatedhost cr...
mit
-9,193,515,461,802,948,000
33.815789
77
0.580499
false
4.112953
false
false
false
rgreinho/docker-django-cookiecutter
{{ cookiecutter.project_name }}/docs/source/conf.py
1
2818
# -*- coding: utf-8 -*- # 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...
mit
-603,125,598,092,764,400
38.690141
117
0.702626
false
3.818428
false
false
false
mrry/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py
3
29937
# Copyright 2016 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
-5,458,151,870,051,754,000
44.222054
82
0.665397
false
4.153878
true
false
false
tomato42/fsresck
fsresck/fragmenter.py
1
1882
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Description: File system resilience testing application # Author: Hubert Kario <hubert@kario.pl> # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Copyright (c) 2015 Hubert Kario. All rights reserved. # # This ...
gpl-2.0
6,986,712,135,830,994,000
32.607143
76
0.575983
false
4.524038
false
false
false
apenwarr/redo
setup.py
1
2105
import os, setuptools, subprocess # Construct the redo input files, including redo.version, if we're # starting from the original redo source dir. If we're running # from the python pip package, the files already exist, so we # skip this step. mydir = os.path.dirname(__file__) script = os.path.join(mydir, 'do') verfi...
apache-2.0
-2,273,679,286,823,372,000
34.677966
76
0.628029
false
3.579932
false
false
false
repotvsupertuga/tvsupertuga.repository
instal/script.module.resolveurl/lib/resolveurl/plugins/indavideo.py
3
2726
# -*- coding: UTF-8 -*- """ Kodi resolveurl plugin Copyright (C) 2016 alifrezser 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 y...
gpl-2.0
5,358,056,482,370,218,000
37.942857
106
0.604182
false
3.786111
false
false
false
rhyolight/nupic.son
app/melange/views/settings.py
1
2584
# Copyright 2013 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
621,038,370,779,500,400
31.708861
78
0.718266
false
3.772263
false
false
false
joelagnel/trappy
tests/test_systrace.py
1
3330
# Copyright 2016-2017 ARM Limited # # 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 w...
apache-2.0
2,596,708,892,532,037,000
37.275862
94
0.667267
false
3.737374
true
false
false
e2crawfo/dps
motmetrics/lap.py
1
6069
import numpy as np from collections import OrderedDict def linear_sum_assignment(costs, solver=None): """Solve a linear sum assignment problem (LSA). For large datasets solving the minimum cost assignment becomes the dominant runtime part. We therefore support various solvers out of the box (currently la...
apache-2.0
-6,842,815,007,946,274,000
29.044554
136
0.628604
false
3.750927
false
false
false
pietje666/plugin.video.vrt.nu
tests/test_tokenresolver.py
1
2324
# -*- coding: utf-8 -*- # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """Unit tests for TokenResolver functionality""" # pylint: disable=invalid-name from __future__ import absolute_import, division, print_function, unicode_literals import unittest from tokenresolver impo...
gpl-3.0
8,739,727,042,616,047,000
29.986667
91
0.645009
false
4.157424
true
false
false
NickShaffner/rhea
rhea/cores/video/lcd/lt24lcd.py
2
6910
""" This module contains a video driver for the terasic LT24 LCD display ... """ from __future__ import division import myhdl from myhdl import Signal, intbv, enum, always_seq, concat from .lt24intf import LT24Interface from .lt24lcd_init_sequence import init_sequence, build_init_rom from .lt24lcd_driver import lt24...
mit
-2,334,838,913,955,180,000
34.255102
76
0.544573
false
3.987305
false
false
false
openeventdata/UniversalPetrarch
UniversalPetrarch/tests/test_json_pipeline.py
1
1501
import sys sys.path.append('..') import datetime from bson.objectid import ObjectId import petrarch_ud import PETRreader formatted = [{u'language': u'english', u'title': u'6 killed in attacks in Iraqi capital Friday', u'url': u'http://www.menafn.com/1094827896/6-killed-in-attacks-in-Iraqi-capital-Friday?src=RSS', u'st...
mit
6,506,500,882,239,670,000
38.5
96
0.688874
false
2.267372
false
false
false
nicolasdespres/hunittest
hunittest/utils.py
1
1667
# -*- encoding: utf-8 -*- """Utility routines """ import os import re from enum import Enum from contextlib import contextmanager import sys from io import StringIO def pyname_join(seq): return ".".join(seq) def is_pkgdir(dirpath): return os.path.isdir(dirpath) \ and os.path.isfile(os.path.join(dir...
bsd-2-clause
11,221,398,954,023,508
19.329268
64
0.612478
false
3.696231
false
false
false
tehtechguy/mHTM
dev/sp_math_pub/boost_experiment.py
1
11796
# boost_experiment.py # # Author : James Mnatzaganian # Contact : http://techtorials.me # Organization : NanoComputing Research Lab - Rochester Institute of # Technology # Website : https://www.rit.edu/kgcoe/nanolab/ # Date Created : 10/13/15 # # Description : Study the boost. #...
mit
-8,973,424,034,394,797,000
24.039735
79
0.629281
false
2.797249
false
false
false
CLVsol/clvsol_odoo_addons
clv_patient/models/res_partner.py
1
2990
# -*- coding: utf-8 -*- # Copyright 2008 Luis Falcon <lfalcon@gnusolidario.org> # Copyright 2016 LasLabs Inc. # License GPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). from datetime import datetime from odoo import _, api, fields, models from odoo.exceptions import ValidationError class ResPartner(models.M...
agpl-3.0
1,173,964,329,214,253,600
32.222222
81
0.53913
false
3.63747
false
false
false
odrling/peony-twitter
peony/client.py
1
21586
# -*- coding: utf-8 -*- """ Peony Clients :class:`BasePeonyClient` only handles requests while :class:`PeonyClient` adds some methods that could help when using the Twitter APIs, with a method to upload a media """ import asyncio import io from contextlib import suppress import logging try: from asyncio.exceptio...
mit
5,343,106,315,839,828,000
30.837758
79
0.530714
false
4.803293
false
false
false
mastizada/kuma
vendor/packages/sqlalchemy/test/orm/inheritance/test_magazine.py
7
9296
from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.test import testing from sqlalchemy.util import function_named from test.orm import _base from sqlalchemy.test.schema import Table, Column class BaseObject(object): def __init__(self, *args, **kwargs): for key, value in kwargs.iteritems...
mpl-2.0
106,685,178,715,532,510
41.254545
176
0.600796
false
3.771197
true
false
false
udemy-course/udemy
setup.py
1
1468
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import os from udemy import __title__ from udemy import __version__ from udemy import __author__ from udemy import __email__ # from distutils.core import setup from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) wi...
apache-2.0
-1,127,698,628,932,444,200
30.234043
74
0.660763
false
3.725888
false
false
false
tnemisteam/cdf-steps
reports_basic/views.py
3
10027
from django.shortcuts import render from django.views.generic import View from baseapp.models import School,Block,Class_Studying,Academic_Year,District from students.models import Child_detail from django.template.loader import get_template from django.template import Context import cStringIO as StringIO import xhtml2...
mit
535,483,344,508,277,800
79.216
337
0.675177
false
3.538109
false
false
false
low-sky/h2codumb
h2cogrids.py
1
1560
from astropy.table import Table import pyradex import numpy as np R = pyradex.Radex(column=1e16,abundance=1e-4,species='ph2co-h2') fortho = 0.75 nFWHM = 5 FHWMmin = 0.5 FHWMmx = 5 nDens = 21 nlower = 2 nupper = 6 nCol = 41 Nlower = 10 Nupper = 16 nTemp = 31 Tlower = 10 Tupper = 300 Temps = np.logspace(1,2.5,nTem...
gpl-2.0
6,030,501,892,111,791,000
28.433962
152
0.55
false
2.648557
false
false
false
jcu-eresearch/TDH-dc24-ingester-platform
dc24_ingester_platform/service/tests.py
1
12960
"""This module tests the service CRUD functionality """ import unittest import tempfile import shutil import datetime from dc24_ingester_platform.service import ingesterdb, repodb from jcudc24ingesterapi.models.locations import Region, Location from jcudc24ingesterapi.models.dataset import Dataset from jcudc24ingestera...
bsd-3-clause
1,280,707,658,308,624,400
40.672026
208
0.624074
false
3.866348
true
false
false
Yubico/u2fval
u2fval/exc.py
1
1977
# Copyright (c) 2014 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
bsd-2-clause
-4,314,260,985,684,125,700
32.508475
71
0.738998
false
4.242489
false
false
false
jack51706/Maildb
core/hashing.py
2
1225
#!/usr/bin/env python ''' Copyright (C) 2012-2013 Kevin Breen. This file is part of the Maildb web application See the 'LICENSE' File for copying permission. ''' # All The Hashing Functions will be in here somewhere import os import sys import hashlib from core.common import Dictionary class MailHash(): def...
gpl-3.0
-4,344,832,424,352,688,600
14.705128
56
0.688163
false
3.002451
false
false
false
stanfordnqp/spins-b
examples/invdes/grating_coupler/grating.py
1
25229
"""2D fiber-to-chip grating coupler optimization code. This is a simple spins example that optimizes a fiber-to-chip grating coupler for the SOI platform. See Su et al. Optics Express (2018) for details. To run an optimization: $ python3 grating.py run save-folder To view results: $ python3 grating.py view save-fold...
gpl-3.0
1,575,267,830,922,040,600
37.517557
84
0.614214
false
3.83012
false
false
false
nathanIL/books
Foundations_of_Python_Network_Programming/Chapter02/tcp_servers.py
1
3607
""" Forking TCP Servers stuff based on book material (but not 1:1) """ import socket import argparse import time import os from multiprocessing import Process from functools import partial def args_handle(handlers, string): if string in handlers.keys(): return handlers.get(string) else: raise ...
apache-2.0
830,403,105,968,279,600
31.495495
120
0.61852
false
3.874329
false
false
false
jbradberry/mcts
mcts/uct.py
1
6593
from __future__ import division from __future__ import absolute_import from __future__ import print_function import time from math import log, sqrt from random import choice from six.moves import range class Stat(object): __slots__ = ('value', 'visits') def __init__(self, value=0.0, visits=0): self....
mit
3,440,120,661,568,870,400
34.637838
95
0.556348
false
3.819815
false
false
false
botstory/todo-bot
todo/stories.py
1
18715
from botstory.ast import story_context from botstory.middlewares import any, option, sticker, text from bson.objectid import ObjectId import datetime import emoji import logging import os import random import re from todo import orm, pagination_list, reflection from todo.lists import lists_document from todo.tasks imp...
mit
8,795,261,198,113,121,000
41.24605
119
0.455196
false
4.503128
false
false
false
beni55/django-multiselectfield
setup.py
2
1717
# -*- coding: utf-8 -*- # Copyright (c) 2012-2013 by Pablo Martín <goinnn@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
lgpl-3.0
-8,189,555,984,192,985,000
36.304348
89
0.69697
false
3.763158
false
false
false
Gustry/GeoHealth
src/core/blurring/layer_index.py
1
2584
# -*- coding: utf-8 -*- """ /*************************************************************************** GeoHealth A QGIS plugin ------------------- begin : 2014-08-20 copyright : ...
gpl-3.0
-7,222,612,915,611,914,000
40.015873
77
0.458204
false
5.394572
false
false
false
thomaserlang/firing-system
web.py
1
5483
import logging import tornado.ioloop import tornado.web import tornado.options import tornado.websocket import math import os import json import constants from decorators import new_cursor class Web_handler(tornado.web.RequestHandler): def get(self): self.render( 'ports.html', GROU...
mit
-4,520,526,623,585,199,600
27.712042
75
0.484406
false
4.457724
false
false
false
neuro-lyon/multiglom-model
src/script_fig_netw_freq.py
1
3172
# -*- coding:utf-8 -*- """ Script to see if the model is like the model of [1]_ by plotting the network frequency against the oscillation rate. References ---------- .. [1] Fourcaud-Trocmé, N., Courtiol, E., Buonviso, N., & Voegtlin, T. (2011). Stability of fast oscillations in the mammalian olfactory bulb: experi...
mit
6,029,708,695,739,347,000
30.376238
78
0.613758
false
3.116028
false
false
false
sazlin/reTOracle
SA_Mapper.py
1
3038
#!/usr/bin/python """ Note: You can test SA_Mapper.py and sa_reducer.py by themselves using the following line in the console: cat sa_input | python SA_Mapper.py | sort | python sa_reducer.py sa_input is an example input file created for S3 by SQ_Worker.py """ import json import time import sys #from sentimentML.ML_b...
mit
7,318,810,689,478,479,000
23.5
64
0.591178
false
2.826047
false
false
false
venthur/pyff
src/lib/vision_egg/util/frame_counter.py
3
1500
__copyright__ = """ Copyright (c) 2010-2011 Torsten Schmits 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 program is di...
gpl-2.0
8,166,437,170,635,239,000
29
71
0.67
false
4.237288
false
false
false
jorisroovers/gitlint
gitlint/cli.py
1
19134
# pylint: disable=bad-option-value,wrong-import-position # We need to disable the import position checks because of the windows check that we need to do below import copy import logging import os import platform import stat import sys import click import gitlint from gitlint.lint import GitLinter from gitlint.config i...
mit
6,357,240,374,226,622,000
42.684932
120
0.648531
false
3.819924
true
false
false
erikdab/pyrelaxmapper
pyrelaxmapper/plwn/queries.py
1
6013
# -*- coding: utf-8 -*- """plWordNet DB queries.""" from sqlalchemy import orm from sqlalchemy.sql import func from sqlalchemy.sql.expression import label from pyrelaxmapper.plwn.models import (Parameter, LexicalUnit, Synset, SynsetRelation, RelationType, UnitSynset, LexicalRelat...
lgpl-3.0
-6,753,829,671,476,212,000
31.327957
87
0.578247
false
3.615755
false
false
false
adbuerger/casiopeia
concept_tests/sd_check_pendulum_linear.py
1
4929
import casadi as ca import pylab as pl import casiopeia as cp import os # (Model and data taken from: Diehl, Moritz: Course on System Identification, # exercise 7, SYSCOP, IMTEK, University of Freiburg, 2014/2015) # Defining constant problem parameters: # # - m: representing the ball of the mass in kg # - ...
lgpl-3.0
-143,478,416,205,076,940
26.536313
78
0.602759
false
2.720199
true
false
false
devlware/Ontime
Ontime.py
1
10829
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ontime # Software to download the schedule for all public bus lines in Curitiba. # # Copyright (C) 2011 by Diego W. Antunes <devlware@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation...
mit
4,252,157,633,065,306,000
29.418539
122
0.574938
false
3.799649
false
false
false
akrherz/iem
htdocs/plotting/auto/scripts/p19.py
1
7899
"""histogram""" import datetime from collections import OrderedDict import numpy as np import pandas as pd from pandas.io.sql import read_sql from matplotlib.font_manager import FontProperties from pyiem import network from pyiem.plot import figure, get_cmap from pyiem.util import get_autoplot_context, get_dbconn from...
mit
-73,954,351,743,601,700
29.034221
79
0.515888
false
3.317514
false
false
false
JohnOmernik/pimeup
ledsound/LED_Sound.py
1
2592
#!/usr/bin/python import time import random import sys import alsaaudio import wave import sys import struct import math from dotstar import Adafruit_DotStar numpixels = 60 # Number of LEDs in strip # Here's how to control the strip from any two GPIO pins: datapin = 23 clockpin = 24 defaultColor = 0x0000FF default...
apache-2.0
2,788,391,041,103,778,300
21.53913
87
0.609568
false
3.383812
false
false
false
dtroyer/cliff
cliff/tests/test_formatters_yaml.py
1
3058
#!/usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
-9,176,197,613,891,788,000
29.58
76
0.519294
false
3.43982
true
false
false
orestkreminskyi/taf
utils/iperflexer/unitconverter.py
2
10932
""" Copyright (c) 2014 Russell Nakamura 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, merge, publish, distribut...
apache-2.0
8,128,448,898,096,653,000
29.707865
97
0.607757
false
3.797152
false
false
false
Titan-C/helpful_scripts
pyutils/keystats.py
1
1455
#!/usr/bin/env python # -*- coding: utf-8 -*- r""" Follow statistics of my keystrokes ================================== """ # Created Wed Sep 16 18:40:15 2015 # Author: Óscar Nájera from __future__ import division, absolute_import, print_function import re import os import collections import argparse parser = argpar...
gpl-2.0
999,833,351,648,647,800
27.490196
73
0.638679
false
3.27991
false
false
false
AustinHartman/randomPrograms
euler50.py
1
1672
import math import time def prime_list(lower, upper): p_ls = [2, 3, 5, 7] for n in range(lower, upper, 2): p = True for d in range(3, int(math.sqrt(n)) + 1): if n % d == 0: p = False break if p: p_ls.append(n) return p_ls def...
gpl-3.0
-2,495,375,094,756,850,700
17.786517
49
0.44378
false
3.557447
false
false
false
dleehr/cwltool
cwltool/utils.py
1
8161
"""Shared functions and other definitions.""" from __future__ import absolute_import import collections import os import platform import random import shutil import string import sys import tempfile from functools import partial # pylint: disable=unused-import from typing import (IO, Any, AnyStr, Callable, # pylint:...
apache-2.0
-1,387,636,412,206,536,700
33.289916
117
0.610587
false
3.853163
false
false
false
madgik/exareme
Exareme-Docker/src/exareme/exareme-tools/madis/src/functionslocal/aggregate/linearregressionresultsviewer.py
1
2533
# class linearregressionresultsviewer: # registered = True # Value to define db operator # # def __init__(self): # self.n = 0 # self.mydata = dict() # self.variablenames = [] # # def step(self, *args): # # if self.n == 0: # # print args, len(args) # # sel...
mit
1,042,671,281,403,169,500
36.80597
122
0.459929
false
3.324147
false
false
false
dimid/ansible-modules-extras
cloud/amazon/ec2_vpc_igw.py
15
4625
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
gpl-3.0
-2,129,451,769,415,334,400
28.272152
112
0.646919
false
3.688198
false
false
false
kovernik/python_training_new
test/add_contact_to_group.py
1
1071
from model.contact import Contact from model.group import Group from fixture.orm import ORMFixture import random db = ORMFixture(host='127.0.0.1', name='addressbook', user='root', password='') def test_add_contact_to_group(app): old_groups = db.get_group_list() if len(old_groups) == 0: app.group.crea...
apache-2.0
888,426,471,953,180,500
43.625
118
0.699346
false
3.095376
false
false
false
vialette/ultrastorage
ultrastorage/storagesystem/homogeneousstoragesystem.py
1
4026
# coding=utf-8 """Homogeneous storage system. .. moduleauthor:: Stéphane Vialette <vialette@gmail.com> """ from .storagesystem import StorageSystem from .storagesystemsnapshotcontroller import SuspendedStorageSystemSnapshotController from .storagesystemexception import StorageSystemException class HomogeneousStor...
mit
7,335,059,450,182,258,000
36.971698
129
0.668571
false
4.394105
false
false
false
compas-dev/compas
src/compas_ghpython/artists/__init__.py
1
1774
""" ******************************************************************************** artists ******************************************************************************** .. currentmodule:: compas_ghpython.artists .. rst-class:: lead Artists for visualising (painting) COMPAS objects with GHPython. Artists convert...
mit
-7,449,057,773,028,017,000
17.102041
80
0.631905
false
4.23389
false
false
false
emacsway/ascetic
ascetic/tests/test_relations.py
1
4696
import unittest from ascetic import validators from ascetic.databases import databases from ascetic.models import Model from ascetic.relations import ForeignKey Author = Book = None class TestCompositeRelation(unittest.TestCase): maxDiff = None create_sql = { 'postgresql': """ DROP TAB...
mit
7,920,552,640,540,147,000
33.277372
120
0.525128
false
4.304308
false
false
false
aspose-slides/Aspose.Slides-for-Cloud
Examples/Python/DeleteAllSlidesFromPowerPointPresentationThirdPartyStorage.py
2
1567
import asposeslidescloud from asposeslidescloud.SlidesApi import SlidesApi from asposeslidescloud.SlidesApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi from asposestoragecloud.StorageApi import ResponseMessage apiKey = "XXXXX" #sepcify App Key appSid = "XXXXX" #s...
mit
-7,580,811,026,189,730,000
34.613636
80
0.72559
false
3.482222
false
false
false
blacksph3re/alastair
cooking/shopping_list/shopping_list.py
1
7304
import math from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Submit, Button, Field, Hidden, HTML, Div from crispy_forms.bootstrap import FormActions, AppendedText, StrictButton, InlineField from django import forms from django.contrib.auth.decorators import login_required from django....
gpl-2.0
-7,200,600,426,151,556,000
49.722222
287
0.730559
false
3.378353
false
false
false