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
Bitcoin-ABC/bitcoin-abc
test/functional/abc-replay-protection.py
1
11337
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Copyright (c) 2017 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ This test checks activation of UAHF and the different cons...
mit
787,828,342,569,320,100
34.428125
129
0.61242
false
scality/ScalitySproxydSwift
test/scenario/multi-backend/fabfile/saio.py
1
3713
import os import os.path import fabric.contrib.files from fabric.api import sudo from utils import build_object_ring, render def disk_setup(swift_user): # Setup a loopdevice to act as disk for swift sudo('mkdir -p /srv') sudo('truncate -s 1GB /srv/swift-disk') sudo('mkfs.xfs /srv/swift-disk') f...
apache-2.0
453,750,375,810,706,200
27.128788
79
0.578508
false
gwu-libraries/sfm-ui
sfm/sfm/settings/test_settings.py
1
1817
from sfm.settings.common import * import tempfile import os DATABASES = { # for unit tests 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'testdb' } } SFM_DB_DATA_DIR = os.path.join(tempfile.gettempdir(), "test-data") SFM_MQ_DATA_DIR = os.path.join(tempfile.gettempdir(), "tes...
mit
-1,005,177,759,540,445,600
23.226667
82
0.519538
false
mikexine/tweetset
tweetset/collect/views.py
1
6251
from django.shortcuts import render, get_object_or_404, redirect from django.http import Http404, HttpResponse from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators import login_required from django.conf import settings from django.contrib import auth from django.contrib.auth import a...
mit
-1,877,005,152,931,094,800
32.25
148
0.666773
false
HardLight/denyhosts
DenyHosts/sync.py
1
7559
import logging import os import time import sys import socket import requests if sys.version_info < (3, 0): from xmlrpclib import ServerProxy else: from xmlrpc.client import ServerProxy, Transport, ProtocolError from .constants import SYNC_TIMESTAMP, SYNC_HOSTS, SYNC_HOSTS_TMP, SYNC_RECEIVED_HOSTS, SOCKET_TI...
gpl-2.0
7,353,463,990,728,281,000
31.165957
102
0.513957
false
susi/angya
widgets/nav.py
1
1162
"""This module defines the left navigation and its buttons.""" import flask from google.appengine.api import users class Navigation(object): """The Navigation returns information to render the nav menu buttons.""" def __init__(self, app): self.app = app def render(self): """Returns a json map of the...
apache-2.0
3,088,551,322,639,043,600
28.794872
74
0.583477
false
sbenthall/bigbang
tests/bigbang_tests.py
1
7419
from nose.tools import * from testfixtures import LogCapture from bigbang import repo_loader import bigbang.archive as archive import bigbang.mailman as mailman import bigbang.parse as parse import bigbang.process as process import bigbang.utils as utils import mailbox import os import networkx as nx import pandas as p...
agpl-3.0
-7,112,561,389,532,358,000
36.664975
122
0.684189
false
CodeReclaimers/neat-python
examples/xor/visualize.py
1
5915
from __future__ import print_function import copy import warnings import graphviz import matplotlib.pyplot as plt import numpy as np def plot_stats(statistics, ylog=False, view=False, filename='avg_fitness.svg'): """ Plots the population's average and best fitness. """ if plt is None: warnings.warn(...
bsd-3-clause
8,867,354,121,167,928,000
29.025381
112
0.597464
false
jdgwartney/boundary-einstein-python
bootstrap.py
1
2028
#!/usr/bin/env python import os import shutil import sys import subprocess import tarfile import urllib class Bootstrap: def __init__(self, version="12.0.4", base='http://pypi.python.org/packages/source/v/virtualenv', python="python2", env="py", ...
apache-2.0
-8,298,653,270,635,625,000
24.670886
88
0.622288
false
Praxyk/Praxyk-DevOps
server/unittest/unit_test.py
1
2481
#!/bin/env python import _fix_path_ import sys import datetime class UnitTest : def maintest(self,name, desc, f) : return self.logger.log_event(self.logclient, 'UNIT TEST', ("s" if f else "f"), ['Test Name', 'Description'], (str(name)...
gpl-2.0
1,886,044,161,479,319,300
43.303571
107
0.554212
false
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py
1
114261
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
306,901,749,235,503,800
58.635177
180
0.645382
false
megaserg/geographiclib-cython-bindings
tests.py
1
1720
import unittest import pytest from geographiclib.geodesic import Geodesic from geographiclib_cython import Geodesic as CythonGeodesic from geopy.distance import great_circle # Run with: python -m pytest tests.py class TestGeodesic(unittest.TestCase): def test_inverse(self): actual = CythonGeodesic.WGS84.I...
mit
2,819,382,609,057,512,400
40.95122
79
0.659884
false
dhavalmanjaria/dma-student-information-system
user_management/tests/test_basic_info_form.py
1
2326
from django.test import TestCase from user_management.forms import UserForm, BasicInfoForm, StudentInfoForm from django.contrib.auth.models import User, Group from django.contrib.auth.hashers import check_password from datetime import datetime from user_management.management.commands import initgroups import lo...
gpl-2.0
-3,238,570,885,542,016,000
32.205882
74
0.600602
false
sekikn/ambari
ambari-agent/src/test/python/ambari_agent/TestCommandHooksOrchestrator.py
2
2534
""" 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 use this ...
apache-2.0
833,573,844,282,085,100
27.47191
103
0.693765
false
theDrake/python-experiments
YouFace/page.py
1
5613
from html import * TITLE = 'YouFace' SUBTITLE = "A billion dollars and it's yours!" STYLESHEET = '/youface.css' LINKLIST = [('http://cit.cs.dixie.edu/cs/1410/', 'CS 1410'), \ ('http://new.dixie.edu/reg/syllabus/', 'College calendar'),] class Form(BlockContainer): def __init__(self, action): BlockContain...
mit
-4,225,685,870,735,543,000
31.445087
74
0.582576
false
ProfHoekstra/bluesky
bluesky/traffic/windfield.py
1
9404
""" Wind implementation for BlueSky.""" from numpy import array, sin, cos, arange, radians, ones, append, ndarray, \ amin, minimum, repeat, delete, zeros, around, maximum, floor, \ interp, pi from bluesky.tools.aero import ft class Windfield(): """ Windfield class: ...
gpl-3.0
-166,896,459,923,706,270
39.245614
130
0.542003
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/contrib/sphinx.py
1
3587
# -*- coding: utf-8 -*- """Sphinx documentation plugin used to document tasks. Introduction ============ Usage ----- Add the extension to your :file:`docs/conf.py` configuration module: .. code-block:: python extensions = (..., 'celery.contrib.sphinx') If you'd like to change the prefix for ...
apache-2.0
4,783,719,491,929,786,000
31.609091
79
0.666574
false
guildai/guild
guild/serving_util.py
1
3478
# Copyright 2017-2021 TensorHub, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
3,184,719,521,864,172,500
26.603175
86
0.642036
false
omelkonian/cds
cds/modules/webhooks/views.py
1
3801
# -*- coding: utf-8 -*- # # This file is part of CERN Document Server. # Copyright (C) 2016, 2017 CERN. # # CERN Document Server 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 # Licens...
gpl-2.0
-581,411,640,366,413,000
33.87156
78
0.665614
false
leighpauls/k2cro4
third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
1
4480
# Copyright (C) 2010 Google Inc. 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 copyright # notice, this list of conditions and the ...
bsd-3-clause
8,073,396,660,738,244,000
44.252525
133
0.714509
false
mrakitin/sirepo
sirepo/template/elegant_command_parser.py
1
4455
# -*- coding: utf-8 -*- u"""elegant command parser. :copyright: Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern.pkcollections import PKDict from pykern.pkdebug import pkdc,...
apache-2.0
-7,543,986,354,780,968,000
31.757353
105
0.54119
false
arindam31/Multi-File-Renamer
setup.py
1
1168
#Full working with icon working too. from distutils.core import setup import py2exe import os MFCDIR = r"C:\Python27\Lib\site-packages\pythonwin" MFCFILES = ["mfc90.dll", "mfc90u.dll", "mfcm90.dll", "mfcm90u.dll", "Microsoft.VC90.MFC.manifest"] mfcfiles = map(lambda x: os.path.join(MFCDIR, x), MFCFILES) ...
gpl-3.0
251,931,449,424,868,740
28.2
78
0.543664
false
smartboyathome/Wonderland-Engine
tests/WhiteRabbitTests/test_master.py
1
2034
''' Copyright (c) 2012 Alexander Abbott This file is part of the Cheshire Cyber Defense Scoring Engine (henceforth referred to as Cheshire). Cheshire 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 Sof...
agpl-3.0
-5,287,805,744,160,156,000
36.685185
79
0.683382
false
rohithkodali/numword
numword/numword_en_gb.py
1
1036
#This file is part of numword. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. ''' numword for EN_GB ''' from .numword_en import NumWordEN class NumWordENGB(NumWordEN): ''' NumWord EN_GB ''' def currency(self, val, longval=True): ...
lgpl-2.1
786,346,942,397,314,000
17.175439
71
0.617761
false
ensemblr/llvm-project-boilerplate
include/llvm/tools/lld/docs/conf.py
1
8301
# -*- coding: utf-8 -*- # # lld documentation build configuration file. # # 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 have a default; values that are commented ...
mit
1,174,032,416,981,189,000
31.552941
80
0.702084
false
JensRantil/http-trigger-trigger
release.py
1
1521
"""Script for creating releases.""" import os import sys import shutil if len(sys.argv) != 2: print "Usage: ./" + sys.argv[0] + " <tag/version>" sys.exit(1) version = sys.argv[1] if 'GOPATH' not in os.environ: print "GOPATH not set." sys.exit(1) VARIANTS = [('linux', ['386', 'amd64', 'arm']), ...
mit
-53,057,553,182,827,090
32.8
77
0.5595
false
NeilBryant/check_mk
web/htdocs/metrics.py
1
47008
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
gpl-2.0
7,823,285,372,340,483,000
35.666927
147
0.495054
false
sostenibilidad-unam/posgrado
posgradmin/posgradmin/management/commands/exporta_cursos.py
1
3459
# coding: utf-8 from django.core.management.base import BaseCommand from posgradmin.models import Curso from django.template.loader import render_to_string from os import path from datetime import datetime import random from sh import mkdir from django.utils.text import slugify import argparse class Command(BaseComma...
gpl-3.0
7,672,059,377,457,798,000
31.904762
110
0.4822
false
balanced/balanced-python
setup.py
1
2182
""" Balanced Python client library. See ``README.md`` for usage advice. """ import os import re try: import setuptools except ImportError: import distutils.core setup = distutils.core.setup else: setup = setuptools.setup def _get_version(): path = os.path.join(PATH_TO_FILE, 'balanced', '__init...
mit
4,966,423,551,292,434,000
24.670588
77
0.600825
false
zengchunyun/s12
day10/homework/twisted_fram/EchoServer.py
1
2339
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun """ from twisted.internet import protocol from twisted.internet import reactor class EchoServer(protocol.Protocol): # 创建Protocol的派生类EchoServer def dataReceived(self, data): # 重写父类dataReceived方法,当有接收到客户端发来数据时,会调用此方法,并将用户数据传入 self.tr...
gpl-2.0
-6,804,515,873,428,824,000
44.394737
105
0.78087
false
mandeepdhami/neutron
neutron/tests/unit/api/test_extensions.py
1
32843
# Copyright (c) 2011 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...
apache-2.0
-2,762,023,589,588,214,000
39.951372
79
0.62135
false
AhmedHani/acmASCIS-ML-Hack-2017
Session_1/dev/server/datasets_processing/manager.py
1
7728
___author__ = 'acmASCIS' ''' by ahani at {9/22/2016} ''' import random from dev.server.datasets_generator._sort import Sort from dev.server.datasets_generator._matmul import Matmul from dev.server.datasets_processing.validator import Validator class Manager(object): def __init__(self): super(Manage...
mit
-4,601,814,935,475,399,700
42.421348
154
0.566123
false
sam-m888/gprime
gprime/filters/rules/citation/_matchespagesubstringof.py
1
1934
# # gPrime - A web-based genealogy program # # Copyright (C) 2011 Helge Herz # # 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 la...
gpl-2.0
2,667,130,032,348,129,000
36.921569
79
0.537229
false
Hitachi-Data-Systems/org-chart-builder
pptx/dml/line.py
1
2249
# encoding: utf-8 """ DrawingML objects related to line formatting """ from __future__ import absolute_import, print_function, unicode_literals from ..enum.dml import MSO_FILL from .fill import FillFormat from ..util import Emu, lazyproperty class LineFormat(object): """ Provides access to line properties ...
apache-2.0
-2,358,455,342,825,472,500
28.592105
77
0.600711
false
ChristianTremblay/BAC0
BAC0/core/proprietary_objects/jci.py
1
6165
#!/usr/bin/env python """ Johnson Controls Proprietary Objects for FX/FEC Line """ from bacpypes.primitivedata import ( Real, Boolean, CharacterString, Enumerated, Unsigned, Atomic, ) from bacpypes.object import ( Object, DeviceObject, AnalogValueObject, AnalogInputObject, A...
lgpl-3.0
5,717,510,765,979,427,000
34.431034
86
0.560908
false
tf198/pycart
pycart/git_repo.py
1
7009
from jinja2 import Environment, FileSystemLoader import os from datetime import datetime import git, renderer, utils, settings import web, logging import cPickle as pickle from cache import cache logger = logging.getLogger(__name__) def render_template(template_name, **context): extensions = context.pop('extens...
gpl-3.0
3,639,235,360,990,462,000
29.081545
105
0.54002
false
reclaro/castel
castel/advcounter.py
1
5902
""" Advanced counter. This script is used to get some statistics from a text file. The script parse a file and returns the number of words, line, the most commom letter and the average number of letters per word. The script has a mandatory argument which is the file to parse. It is possible to pass different options t...
gpl-2.0
-5,990,204,540,903,453,000
32.344633
73
0.618096
false
NicolasHug/Surprise
surprise/prediction_algorithms/random_pred.py
1
1319
""" Algorithm predicting a random rating. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from .algo_base import AlgoBase class NormalPredictor(AlgoBase): """Algorithm predicting a random rating based on the distribution of the...
bsd-3-clause
7,401,184,946,207,124,000
28.311111
79
0.582259
false
franciscomoura/data-science-and-bigdata
introducao-linguagens-estatisticas/mineracao-dados-python/codigo-fonte/code-06.py
1
2285
# -*- coding: utf-8 -*- # code-06.py """ Dependência: Matplotlib, NumPy Executar no prompt: pip install matplotlib Executar no prompt: pip install numpy Executar no prompt: pip install scikit-learn Executar no prompt: pip install scipy *** Atenção: Este arquivo deverá executado no mesmo diretório do arquivo iris.csv ...
apache-2.0
-8,049,449,182,533,556,000
31.371429
96
0.700353
false
mozaik-association/mozaik
odoo_addons/mozaik_sample_accounting/__openerp__.py
1
1795
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of mozaik_sample_accounting, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # mozaik_sample_accounting is free software: # you can redistribute it and/...
agpl-3.0
5,638,437,834,411,976,000
31.053571
78
0.558217
false
ctb/pygr
tests/oldtests/annotation_hg18_megatest.py
1
51599
import ConfigParser, sys, os, string from pygr.mapping import Collection import pygr.Data try: import hashlib except ImportError: import md5 as hashlib config = ConfigParser.ConfigParser({'testOutputBaseDir' : '.', 'smallSampleKey': ''}) config.read([ os.path.join(os.path.expanduser('~'), '.pygrrc'), os.path...
bsd-3-clause
5,233,328,099,987,706,000
58.998837
139
0.532646
false
wengzhilai/family
iSoft/dal/QueryDal.py
1
3612
from iSoft.entity.model import db, FaQuery import math import json from iSoft.model.AppReturnDTO import AppReturnDTO from iSoft.core.Fun import Fun import re class QueryDal(FaQuery): def __init__(self): pass def query_findall(self, pageIndex, pageSize, criterion, where): relist, is_succ = Fun...
bsd-3-clause
4,524,635,679,267,799,000
32.557692
79
0.547564
false
heromod/migrid
mig/mig-xsss/jobmanager.py
1
4660
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # jobmanager - [insert a few words of module description on this line] # Copyright (C) 2003-2009 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 o...
gpl-2.0
4,537,091,169,991,236,600
27.242424
101
0.674893
false
rjfarmer/mesaTest
main.py
1
1816
#!/usr/bin/env python #Note its this is both python2.7 and 3 compatible (other versions may work) #Copyright (c) 2015, Robert Farmer rjfarmer@asu.edu #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 Foundatio...
gpl-2.0
-4,912,147,528,989,903,000
28.290323
105
0.764317
false
YACOWS/opps-polls
opps/polls/admin.py
1
3227
# -*- coding: utf-8 -*- from django.contrib import admin from django import forms from django.utils.translation import ugettext_lazy as _ from .models import (Poll, Choice, PollPost, PollBox, PollBoxPolls, PollConfig) from opps.core.admin import PublishableAdmin from redactor.widgets import Reda...
mit
2,595,985,477,295,994,400
29.733333
85
0.579795
false
softwaresaved/SSINetworkGraphics
Fellows/Python/map_fellows_network.py
1
3548
import os import ast import requests, gspread import numpy as np import matplotlib.pyplot as plt from oauth2client.client import SignedJwtAssertionCredentials from mpl_toolkits.basemap import Basemap #Google Authorisation section and getting a worksheet from Google Spreadsheet def authenticate_google_docs(): f =...
bsd-3-clause
2,741,477,577,881,294,300
35.958333
176
0.721251
false
klahnakoski/JsonSchemaToMarkdown
vendor/mo_hg/hg_mozilla_org.py
1
28441
# encoding: utf-8 # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __fu...
mpl-2.0
-8,912,115,382,508,336,000
37.800819
159
0.53451
false
matthewbentley/teenlink
callhandler.py
1
5899
import webapp2 import jinja2 import os from twilio import twiml from twilio.rest import TwilioRestClient from twilio.util import RequestValidator from google.appengine.ext import ndb import logging import json from private import account_sid, auth_token from common import make_template class Call(ndb.Model): """Mo...
mit
6,147,632,002,842,502,000
39.129252
149
0.577556
false
gusnaughton/CTFd
CTFd/admin.py
1
24338
from flask import render_template, request, redirect, abort, jsonify, url_for, session from CTFd.utils import sha512, is_safe_url, authed, admins_only, is_admin, unix_time, unix_time_millis, get_config, set_config, get_digitalocean, sendmail, rmdir from CTFd.models import db, Teams, Solves, Challenges, WrongKeys, Keys,...
apache-2.0
8,646,510,302,047,544,000
39.631052
181
0.567138
false
BeyondTheClouds/rome
test/nova/tests/compute_nodes_tests.py
1
10676
__author__ = 'jonathan' from misc import ModelsObjectComparatorMixin from nova import test from oslo.serialization import jsonutils from test.nova import _fixtures as models from lib.rome.core.orm.query import Query as RomeQuery from lib.rome.core.session.session import Session as RomeSession from sqlalchemy.sql imp...
mit
8,735,583,337,094,786,000
45.220779
81
0.550019
false
kalmanolah/nite
nite/logging.py
1
1361
"""Logging module.""" import logging import logging.config default_config = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'extended': { 'format': '%(asctime)s %(name)s.%(levelname)s[%(process)s]: %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S' }, ...
mit
6,925,608,377,581,118,000
25.173077
94
0.50698
false
google/nerfactor
third_party/xiuminglib/xiuminglib/io/objmtl.py
1
21250
# pylint: disable=len-as-condition from os.path import basename, dirname, join from shutil import copy import numpy as np from .. import os as xm_os from ..imprt import preset_import from ..log import get_logger logger = get_logger() class Obj: """Wavefront .obj Object. Face, vertex, or other indices here...
apache-2.0
-7,813,962,791,409,773,000
40.830709
104
0.438729
false
pybursa/homeworks
s_shybkoy/hw5/hw5_task1.py
1
2975
#!/usr/bin/env python # -*- coding: utf-8 -*- u""" Задание 1: классный Человек. УСЛОВИЕ: Реализовать класс Person, который отображает запись в книге контактов. Класс имеет 4 атрибута: - surname - строка - фамилия контакта (обязательный) - first_name - строка - имя контакта (обязательный) - nickname - строк...
gpl-2.0
-1,922,213,597,879,849,000
32.814286
77
0.60197
false
pmisik/buildbot
master/buildbot/changes/gitpoller.py
1
17640
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
-7,909,465,922,960,029,000
37.940397
100
0.579762
false
tboyce1/home-assistant
homeassistant/helpers/template.py
2
17501
"""Template helper methods for rendering strings with Home Assistant data.""" from datetime import datetime import json import logging import math import random import re import jinja2 from jinja2 import contextfilter from jinja2.sandbox import ImmutableSandboxedEnvironment from homeassistant.const import ( ATTR_...
apache-2.0
3,488,710,536,227,762,000
30.994516
79
0.602366
false
garrettkatz/directional-fibers
dfibers/experiments/levy_opt/levy_opt.py
1
6952
""" Measure global optimization performance of Levy function """ import sys, time import numpy as np import matplotlib.pyplot as pt import multiprocessing as mp import dfibers.traversal as tv import dfibers.numerical_utilities as nu import dfibers.logging_utilities as lu import dfibers.fixed_points as fx import dfiber...
mit
6,812,665,237,747,678,000
32.423077
98
0.597957
false
pedro-aaron/stego-chi-2
embeddingRgb.py
1
2081
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Watermarkero, Mario, Ariel """ from PIL import Image import random import matplotlib.pyplot as plt import numpy as np def rgb2gray(rgb): return np.dot(rgb[...,:3], [0.299, 0.587, 0.114]) def marcarPixel(color, bitporinsertar): if (color%2)==1: ...
mit
1,626,415,533,977,255,400
28.309859
80
0.658818
false
RodericDay/MiniPNM
test_minipnm.py
1
2708
#!/usr/bin/env python from __future__ import division import os import itertools as it import pytest import numpy as np import minipnm as mini def test_print(): network = mini.Delaunay.random(100) print( network ) def test_prune(): delaunay = mini.Delaunay(np.random.rand(100,3)) original_size = dela...
mit
-6,733,002,228,057,733,000
28.11828
97
0.632939
false
akshaykr/oracle_cb
RegretExp.py
1
6615
import numpy as np import sklearn.linear_model import sklearn.tree import Simulators, Logger, Evaluators, Semibandits, Metrics import warnings import argparse import pickle import sys class RegretExp(object): def __init__(self, weight=None, link="linear", K=10, L=5, T=1000, dataset="synth", feat_noise=0.25, reward...
mit
1,477,917,713,475,098,000
41.133758
160
0.503099
false
eallik/spinoff
spinoff/util/logging/logging.py
1
7740
# coding: utf8 from __future__ import print_function, absolute_import import datetime import inspect import re import sys import time import traceback import types import os import multiprocessing from collections import defaultdict from spinoff.util.python import dump_method_call try: import colorama except Impo...
bsd-2-clause
-4,722,331,085,763,889,000
27.043478
181
0.555297
false
hsghost/ntm
ntm/sentiment/sa.py
1
1863
#!/usr/bin/python import nltk import nltk.data from nltk.util import ngrams from nltk.tokenize import word_tokenize import MySQLdb mHost = "10.240.119.20" mUser = "root" mPasswd = "cis700fall2014" mDb = "cis700" mCharset = "utf8" conn = MySQLdb.connect(host=mHost,user=mUser,passwd=mPasswd,db=mDb,charset=mCharset) c...
mit
-4,181,793,751,906,841,000
21.719512
116
0.618894
false
mat128/netman
tests/adapters/configured_test_case.py
1
4519
# Copyright 2015 Internap. # # 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, so...
apache-2.0
-730,102,936,339,714,300
33.496183
98
0.66143
false
mementum/backtrader
samples/observer-benchmark/observer-benchmark.py
1
7280
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-3.0
5,036,608,712,308,105,000
34.339806
80
0.542308
false
ecreall/nova-ideo
novaideo/content/processes/novaideo_abstract_process/behaviors.py
1
8566
# -*- coding: utf8 -*- # Copyright (c) 2014 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi import pytz import datetime from pyramid.httpexceptions import HTTPFound from persistent.list import PersistentList from dace.objectofcollaborat...
agpl-3.0
-7,422,076,832,301,350,000
31.082397
79
0.681882
false
edwardekstrom/BZRflag
bzagents/pf_agent.py
1
10127
#!/usr/bin/python -tt # An incredibly simple agent. All we do is find the closest enemy tank, drive # towards it, and shoot. Note that if friendly fire is allowed, you will very # often kill your own tanks with this code. ################################################################# # NOTE TO STUDENTS # This is...
gpl-3.0
-4,527,369,260,058,859,000
34.533333
92
0.530661
false
planetarymike/IDL-Colorbars
IDL_py_test/018_Pastels.py
1
5628
from matplotlib.colors import LinearSegmentedColormap from numpy import nan, inf cm_data = [[1., 0., 0.282353], [1., 0., 0.282353], [1., 0., 0.290196], [1., 0., 0.298039], [1., 0., 0.305882], [1., 0., 0.313725], [1., 0., 0.321569], [1., 0., 0.329412], [1., 0., 0.337255], [1., 0., 0.345098], [1., 0., 0.352941], [1., 0.,...
gpl-2.0
6,271,818,433,585,241,000
19.540146
69
0.465885
false
jlublin/landpatterngen
target_svg.py
1
4266
#!/usr/bin/env python3 import xml.etree.ElementTree as ET def get_target(): return SVG() class SVG: def __init__(self): self.svg = ET.parse('skeleton.svg') self.mmpx = 3.543307 def output(self, path): self.svg.write(path) def add_package(self, package): ''' Target SVG only handles one drawing at a t...
gpl-3.0
-2,957,371,261,297,704,000
23.517241
217
0.61158
false
GaretJax/ipd
ipd/metadata/resource.py
1
7569
import json from uuid import UUID from twisted.internet import defer from twisted.web import resource, server class RecursiveResource(resource.Resource, object): isLeaf = False def getChild(self, name, request): if name == '': child = self else: try: ...
mit
9,081,998,082,272,325,000
27.454887
79
0.608271
false
yen223/mclass-sky
mclearn/photometry.py
1
10079
""" Procedures specific to photometric data. """ import os import numpy as np from urllib.request import urlopen from urllib.parse import urlencode from .tools import load_results def reddening_correction_sfd98(extinction_r): """ Compute the reddening values using the SFD98 correction set. Parameters ...
bsd-3-clause
-5,552,300,325,919,544,000
27.882521
134
0.580613
false
weka511/bioinformatics
nwck.py
1
1881
# Copyright (C) 2017 Greenweaves Software Pty Ltd # This 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 software is distribut...
gpl-3.0
8,854,605,071,501,078,000
29.852459
81
0.643275
false
eriksonJAguiar/TCC-UENP-Codigos
My_codes/module_sentiment/mensure.py
1
2797
from sent_classification_module import * from class_roc import Roc if __name__ == '__main__': sent = SentClassifiers('dataset-portuguese') nv_roc = Roc() svm_roc = Roc() dt_roc = Roc() rf_roc = Roc() gd_roc = Roc() rl_roc = Roc() cm_roc = Roc() fpr = [] tpr = [] auc = [] acuracias = [] nv_ac,_,nv_p,n...
gpl-3.0
-1,176,213,288,249,679,600
19.873134
79
0.584406
false
anderson1008/NOCulator
hring/src/Script/sim_batch.py
1
1964
#!/usr/bin/python import sys import os import re import fnmatch import string workload_dir = "/Users/xiyuexiang/GoogleDrive/NOCulator/hring/src/bin/" workload = "mix_app" insns_count = 1000000 ipc_alone = [2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91] ip...
mit
6,003,752,314,014,478,000
32.45614
197
0.623727
false
zhuangjun1981/retinotopic_mapping
retinotopic_mapping/examples/analysis_retinotopicmapping/batch_MarkPatches.py
1
1417
# -*- coding: utf-8 -*- """ Created on Thu Oct 30 14:46:38 2014 @author: junz """ import os import matplotlib.pyplot as plt import corticalmapping.core.FileTools as ft import corticalmapping.RetinotopicMapping as rm trialName = '160208_M193206_Trial1.pkl' names = [ ['patch01', 'V1'], ['patch02', '...
gpl-3.0
4,602,845,023,401,263,600
24.321429
57
0.617502
false
zmarvel/slowboy
test_roms/scripts/gentilemap2.py
1
2654
import string import sys TWIDTH = 8 THEIGHT = 8 TSWIDTH = 128 TSHEIGHT = 128 TSWIDTH_TILES = TSWIDTH // TWIDTH TSHEIGHT_TILES = TSHEIGHT // THEIGHT SCREEN_WIDTH = 160 SCREEN_HEIGHT = 144 SWIDTH_TILES = SCREEN_WIDTH // TWIDTH SHEIGHT_TILES = SCREEN_HEIGHT // THEIGHT BACKGROUND_WIDTH = 256 BACKGROUND_HEIGHT = 256 BG...
mit
-4,803,830,658,140,106,000
28.164835
83
0.609646
false
dmlloyd/openjdk-modules
hotspot/.mx.jvmci/mx_jvmci.py
1
31696
# # ---------------------------------------------------------------------------------------------------- # # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify ...
gpl-2.0
4,158,647,016,580,874,000
41.20506
202
0.608941
false
guykisel/inline-plz
inlineplz/linters/shellcheck.py
1
1627
# -*- coding: utf-8 -*- import dirtyjson as json from ..decorators import linter from ..parsers.base import ParserBase @linter( name="shellcheck", install=[ ["cabal", "update"], ["cabal", "install", "shellcheck"], ["apt-get", "install", "shellcheck"], ["dnf", "install", "shel...
isc
-6,519,408,518,040,228,000
32.204082
68
0.454825
false
sternshus/arelle2.7
svr-2.7/arelle/CntlrGenVersReports.py
1
23340
u''' Created on Dec 14, 2010 Use this module to start Arelle in command line non-interactive mode (This module can be a pattern for custom use of Arelle in an application.) In this example a versioning report production file is read and used to generate versioning reports, per Roland Hommes 2010-12-10 @au...
apache-2.0
-3,449,562,717,907,046,000
58.623377
154
0.466024
false
AffilaeTech/niav
niav/helpers/mongo/mongo.py
1
6645
import logging import pendulum from pymongo import MongoClient from bson.objectid import ObjectId from niav.ssh_tunnel import SshTunnel class Mongo(object): """ MongoDB helper - MongoDB wrapper - load configurations - open SSH tunnel if needed """ def __init__(se...
mit
4,294,171,752,109,502,000
33.252577
137
0.567344
false
Vijaysai005/KProject
vijay/DBSCAN/main_3.py
1
2729
# usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Jul 12 13:15:05 2017 @author: Vijayasai S """ # Use python3 import Cluster as cl from pymongo import MongoClient import numpy as np from datetime import datetime def centroid(lati=[],longi=[]): x = sum(lati) / len(lati) y = sum(longi) / len(longi) r...
gpl-3.0
5,728,580,436,739,454,000
31.488095
248
0.599487
false
vitan/django-guardian
guardian/shortcuts.py
1
27452
""" Convenient shortcuts to manage or check object permissions. """ from __future__ import unicode_literals from django.contrib.auth.models import Group from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import...
bsd-2-clause
-398,339,219,573,541,500
39.075912
179
0.623998
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/testing/layers.py
1
66650
# Copyright 2009-2012 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Layers used by Launchpad tests. Layers are the mechanism used by the Zope3 test runner to efficiently provide environments for tests and are documented in the lib/zope/tes...
agpl-3.0
8,982,281,586,918,893,000
31.655561
78
0.633593
false
UASLab/ImageAnalysis
scripts/archive/4b-simple-matches-reset.py
1
2626
#!/usr/bin/python import sys sys.path.insert(0, "/usr/local/opencv3/lib/python2.7/site-packages/") import argparse import commands import cPickle as pickle import cv2 import fnmatch import math import numpy as np import os.path from progress.bar import Bar import scipy.spatial sys.path.append('../lib') import Matche...
mit
6,323,647,680,881,667,000
31.02439
139
0.690023
false
undoware/neutron-drive
google_appengine/google/appengine/api/search/search_util.py
1
4254
#!/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...
bsd-3-clause
-5,943,355,562,431,053,000
25.5875
78
0.681711
false
inveniosoftware/invenio-indexer
invenio_indexer/api.py
1
16034
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """API for indexing of records.""" from __future__ import absolute_import, print_fun...
mit
-9,200,436,251,405,704,000
34.631111
79
0.601971
false
Hybrid-Cloud/cinder
cinder/tests/unit/test_falconstor_fss.py
1
38330
# Copyright (c) 2016 FalconStor, 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 requir...
apache-2.0
-2,721,745,136,575,598,600
42.115861
79
0.584086
false
Vicaris/ModPro
moviepy/video/fx/resize.py
1
4949
resize_possible = True try: # TRY USING OpenCV AS RESIZER #raise ImportError #debugging import cv2 import numpy as np def resizer (pic, newsize): lx, ly = int(newsize[0]), int(newsize[1]) if lx > pic.shape[1] or ly > pic.shape[0]: # For upsizing use linear for good quali...
mit
-1,627,818,066,893,388,500
28.993939
82
0.503536
false
vitan/blaze
blaze/expr/broadcast.py
1
5871
from __future__ import absolute_import, division, print_function from datashape.predicates import iscollection, isscalar, isnumeric from toolz import partial, unique, first import datashape from datashape import dshape, DataShape, Record, Var, Option, Unit from .expressions import ElemWise, Label, Expr, Symbol, Field...
bsd-3-clause
5,816,400,818,536,924,000
23.982979
79
0.577755
false
boppreh/bayesian
bayesian/tests.py
1
7654
import sys sys.path.append('../') import unittest from bayesian import Bayes, classify, classify_normal class TestBayes(unittest.TestCase): def test_empty_constructor(self): with self.assertRaises(ValueError): b = Bayes() def test_list_constructor(self): self.assertEqual(Bayes([]...
mit
2,979,042,622,111,361,000
38.864583
83
0.482362
false
danyill/rdb-tool
rdb_section_extract.py
1
13782
#!/usr/bin/env python3 """ This tool extracts a pile of settings based on the hierachy of Quickset """ import collections import os import re import olefile import sel_logic_count LINE_INFO = ['Lines Used (w/ comment lines)', 'Lines Used (w/o comment lines)'] LOGIC_INFO = [ 'PSV', 'PMV', 'PLT', 'PCT', 'PST', 'P...
gpl-3.0
-2,976,571,120,079,492,000
31.658768
225
0.567117
false
vortex-ape/scikit-learn
sklearn/tree/export.py
4
17978
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Trevor...
bsd-3-clause
-4,032,309,513,680,093,700
37.008457
79
0.518356
false
rdezavalia/ansible
lib/ansible/cli/galaxy.py
1
30060
######################################################################## # # (C) 2013, James Cammarata <jcammarata@ansible.com> # # 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 ...
gpl-3.0
-1,375,117,498,538,847,500
43.865672
197
0.559015
false
jwodder/javaproperties
docs/conf.py
1
1147
from javaproperties import __version__ project = "javaproperties" author = "John T. Wodder II" copyright = "2016-2020 John T. Wodder II" extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx_copybutton", ] autodoc_default_options = { ...
mit
7,820,110,847,402,805,000
22.895833
67
0.668701
false
rgmining/fraudar
fraudar/__init__.py
1
1871
# # __init__.py # # Copyright (c) 2016-2017 Junpei Kawamoto # # This file is part of rgmining-fraudar. # # rgmining-fraudar 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
8,293,524,928,972,505,000
41.522727
82
0.780866
false
goldsborough/euler
13.py
1
6006
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. """ n = """37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 9194221336357416...
mit
-4,324,106,769,971,052,500
39.863946
65
0.919414
false
lierwing/yecrypto
yecrypto.py
1
1966
import random class Yecrypto: @staticmethod def ascii_encryption(new_file, normal_string): num = 0 ns_dic = {} for i in normal_string: num = num + 1 ns_dic[num] = i ns_dic_keys = [] for i in ns_dic.keys(): ns_dic_keys.append(i) ...
mit
3,042,574,561,103,298,600
30.709677
87
0.503561
false
carefree0910/MachineLearning
f_NN/Networks.py
1
12872
import os import sys root_path = os.path.abspath("../") if root_path not in sys.path: sys.path.append(root_path) import matplotlib.pyplot as plt from f_NN.Layers import * from f_NN.Optimizers import * from Util.Bases import ClassifierBase from Util.ProgressBar import ProgressBar class NNVerbose: NONE = 0 ...
mit
2,093,484,184,977,920,800
38.606154
116
0.535736
false
Code4SA/odac-ford-housing
msg_handler/admin.py
1
7116
from flask import Flask, url_for, redirect, render_template, request from wtforms import form, fields, validators from wtforms.fields import SelectField, TextAreaField from flask.ext import admin, login from flask.ext.admin.contrib import sqla from flask.ext.admin import helpers, expose from flask.ext.admin.model.templ...
apache-2.0
-4,220,745,175,959,475,000
29.676724
119
0.607926
false
olgadoronina/LES_ABC
abc_code/utils.py
1
8359
import logging import abc_code.global_var as g import numpy as np import scipy as sp import scipy.stats from numpy.fft import fftfreq, fftn, ifftn from time import time from abc_code.sobol_seq import i4_sobol_generate from fast_histogram import histogram1d import abc_code.distance as dist import itertools def timer(...
gpl-3.0
2,585,686,329,948,227,000
30.78327
120
0.569685
false
icists/ams2
django/registration/migrations/0001_initial.py
1
4035
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-10-25 01:44 from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.db import migrations, models import django.db.models.deletion import djmoney.models.fields class Migration(migrations.Migration): ...
mit
3,841,872,372,975,416,000
51.402597
165
0.602974
false
tm-softworks/OrderGetterR
src/OrderList.py
1
28480
import os import sys from collections import OrderedDict from datetime import datetime, timedelta import calendar from argparse import ArgumentParser import configparser import traceback import time import csv import io import copy import hashlib import logging import logging.handlers import pytz from rakuten_ws impo...
mit
-3,231,433,813,791,966,000
37.228188
289
0.608216
false