repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
yochow/autotest | client/bin/harness_autoserv.py | 1 | 1566 | import os, tempfile
from autotest_lib.client.bin import harness
class harness_autoserv(harness.harness):
"""
The server harness for running from autoserv
Properties:
job
The job object for this job
"""
def __init__(self, job):
"""
job
... | gpl-2.0 | -135,579,399,745,352,400 | 28 | 72 | 0.565134 | false | 3.866667 | true | false | false |
comptelfwd/dcos-commons | frameworks/hdfs/tests/test_shakedown.py | 1 | 14141 | import time
import pytest
import shakedown
import sdk_cmd as cmd
import sdk_install as install
import sdk_marathon as marathon
import sdk_tasks as tasks
import sdk_utils as utils
import sdk_spin as spin
import json
import traceback
from tests.config import (
PACKAGE_NAME,
DEFAULT_TASK_COUNT
)
TEST_CONTENT_S... | apache-2.0 | -6,297,192,325,673,040,000 | 33.830049 | 117 | 0.678877 | false | 3.101096 | true | false | false |
bsnacks000/IPySigma-Demo | ipysig/sigma_addon_methods.py | 1 | 8440 | '''
this is a module of add-on methods that get injected into the nx.Graph class within IPySig
Sigma calls these on graph object instances stored in the IPySig data store
'''
import pandas as pd
import networkx as nx
from numpy import cos, sin, pi
from numpy.random import randint
import json
import logging
logger =... | mit | -2,448,531,696,320,950,300 | 30.259259 | 145 | 0.643483 | false | 3.658431 | false | false | false |
jean/ZopeSkel | zopeskel/vars.py | 1 | 5488 | import sys
from paste.script.templates import var as base_var
##########################################################################
# Mode constants
# keep these lowercased, as choicesvars are lowercased
EXPERT = 'expert'
EASY = 'easy'
ALL = 'all'
##############################################################... | mit | 2,057,983,955,637,375,000 | 26.034483 | 123 | 0.547376 | false | 4.280811 | false | false | false |
dabrahams/0install | tests/testdownload.py | 1 | 25039 | #!/usr/bin/env python
from __future__ import with_statement
from basetest import BaseTest, StringIO
import sys, tempfile, os
import unittest
import logging, warnings
from logging import getLogger, WARN, ERROR
from contextlib import contextmanager
sys.path.insert(0, '..')
os.environ["http_proxy"] = "localhost:8000"
f... | lgpl-2.1 | 715,511,657,318,916,100 | 33.680055 | 140 | 0.712808 | false | 3.056145 | true | false | false |
anandology/pyjamas | pyjs/src/pyjs/lib/string.py | 1 | 7090 | """The code is taken from the python2.6 tring module.
Only the non-depricated is copied.
Public module variables:
whitespace -- a string containing all characters considered whitespace
lowercase -- a string containing all characters considered lowercase letters
uppercase -- a string containing all characters conside... | apache-2.0 | -6,639,913,017,851,248,000 | 33.585366 | 77 | 0.588858 | false | 4.286578 | false | false | false |
jingriver/stocktracker | pytoolkit/yahoo_eod/screener.py | 1 | 12742 | from testsqlite3 import OHLCV, getSymList, dailyUpdate
from config import *
import sqlite3
from TaLib import *
from businessday import *
from sector import findSectorFromSymbol
from operator import itemgetter
class Screener:
def __init__(self, dbo):
self.dbo = dbo
self.cursor = dbo.curso... | mit | 2,824,681,905,165,494,300 | 41.494881 | 153 | 0.483519 | false | 3.437281 | false | false | false |
jankeromnes/depot_tools | download_from_google_storage.py | 2 | 11913 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Download files from Google Storage based on SHA1 sums."""
import hashlib
import optparse
import os
import Queue
import re
impo... | bsd-3-clause | 8,414,124,268,537,949,000 | 34.144543 | 80 | 0.613112 | false | 3.627588 | false | false | false |
eeue56/PyGeo2 | pygeo/examples/complex/jelle_triangle.py | 1 | 2389 |
from pygeo import *
import pygeo.base.abstract_elements_complex as Complex
v=display(scale=8)
#we are working on the complex plane - allowing us to play with the Mobius transformation
#the required (approx) angles, converted to radians
rads = PI/180
a1=115.*rads
a2=35.*rads
a3=30.*rads
#a class so that we set ma... | gpl-2.0 | -8,413,777,733,010,618,000 | 30.853333 | 90 | 0.729594 | false | 2.781141 | false | false | false |
maazsq/Algorithms_Example | AStarSearch/python/astar.py | 9 | 5569 | # Copyright (c) 2008 Mikael Lind
#
# 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, distrib... | apache-2.0 | 3,191,623,371,112,691,000 | 36.884354 | 79 | 0.5949 | false | 4.561016 | false | false | false |
hanguokai/youku | youku/youku_schemas.py | 1 | 1808 | """Youku Open API V2 Python Client
doc: http://open.youku.com/docs/tech_doc.html
"""
import requests
from .util import check_error
class YoukuSchemas(object):
"""Youku Schemas API.
"""
def __init__(self, client_id):
super(YoukuSchemas, self).__init__()
self.client_id = client_id
d... | apache-2.0 | 4,495,296,846,759,103,000 | 26.815385 | 78 | 0.570796 | false | 3.188713 | false | false | false |
beproud/beproudbot | tests/test_redmine.py | 1 | 5912 | from unittest.mock import MagicMock, Mock, patch
from urllib.parse import urljoin
import pytest
import requests_mock
from haro.plugins.redmine import (
show_ticket_information,
REDMINE_URL,
RESPONSE_ERROR,
NO_CHANNEL_PERMISSIONS,
)
from tests.factories.redmine import ProjectChannelFactory, RedmineUse... | mit | -1,280,351,110,576,468,700 | 33.573099 | 99 | 0.557341 | false | 3.933466 | true | false | false |
qdm8t2/capstone-autonomous-car | DataHandler.py | 1 | 3095 | import glob
import numpy
# from scipy.misc import imread, imresize, imshow
from PIL import Image
class DataHandler:
"""
Handles the neural network data
"""
def __init__(self, files=glob.glob('data/**/*.jpg'), initialize_files=True, debug_enabled=False):
"""
Constructor
:param ... | mit | -943,433,912,772,633,500 | 23.768 | 101 | 0.519225 | false | 4.511662 | false | false | false |
xrg/SpiffGtkWidgets | src/SpiffGtkWidgets/Calendar/CanvasGrid.py | 1 | 2047 | # Copyright (C) 2008-2011 Samuel Abels
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License
# version 3 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WA... | agpl-3.0 | 6,174,907,598,727,735,000 | 30.015152 | 76 | 0.631656 | false | 3.876894 | false | false | false |
snigirevstepan/py-ws7 | wlm.py | 1 | 3385 | """
Module to work with Angstrom WS7 wavelength meter
"""
import argparse
import ctypes, os, sys, random, time
class WavelengthMeter:
def __init__(self, dllpath="C:\Windows\System32\wlmData.dll", debug=False):
"""
Wavelength meter class.
Argument: Optional path to the dll. Default: "C:\Wi... | mit | 7,733,281,528,259,245,000 | 30.055046 | 125 | 0.595273 | false | 3.639785 | false | false | false |
F1ashhimself/robotframework-selenium2library | src/Selenium2Library/keywords/_waiting.py | 26 | 4678 | import time
import robot
from keywordgroup import KeywordGroup
class _WaitingKeywords(KeywordGroup):
# Public
def wait_for_condition(self, condition, timeout=None, error=None):
"""Waits until the given `condition` is true or `timeout` expires.
`code` may contain multiple lines of code but mu... | apache-2.0 | -149,972,381,438,124,260 | 41.144144 | 133 | 0.641941 | false | 4.331481 | false | false | false |
RedHatInsights/insights-core | insights/parsers/sap_hana_python_script.py | 1 | 2986 | """
SapHanaPython - Commands
========================
Shared parser for parsing output of the SAP HANA python support scripts.
The following parsers are included in this module:
HanaLandscape - landscapeHostConfiguration.py
---------------------------------------------
"""
from insights import parser, CommandParser
... | apache-2.0 | 8,638,958,436,451,421,000 | 34.547619 | 154 | 0.526457 | false | 3.903268 | false | false | false |
chaosmaker/pyload | module/plugins/hoster/BezvadataCz.py | 3 | 3629 | # -*- coding: utf-8 -*-
"""
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... | gpl-3.0 | -6,586,512,459,768,244,000 | 35.27 | 113 | 0.597463 | false | 3.573399 | false | false | false |
zinic/pyzmqache | pyzmqache/server.py | 1 | 3575 | import zmq
import time
import msgpack
import threading
from pyzmqache.log import get_logger
_LOG = get_logger(__name__)
_DEFAULT_CACHE_TTL = 120
class CacheItem(object):
def __init__(self, value, expires_at):
self.expires_at = expires_at
self.value = value
class SimpleCache(object):
def... | mit | 7,153,874,443,889,564,000 | 24.535714 | 72 | 0.525035 | false | 3.954646 | false | false | false |
tgbugs/pyontutils | nifstd/development/sparc/mis.py | 1 | 1829 | from sparcur.utils import want_prefixes
import rdflib
import requests
mis = rdflib.Graph().parse(data=requests.get('https://cassava.ucsd.edu/sparc/exports/curation-export.ttl').content, format='turtle')
graph = mis
def reformat(ot):
return [ot.label if hasattr(ot, 'label') and ot.label else '', ot.curie]
objects ... | mit | -805,804,245,213,930,900 | 34.862745 | 132 | 0.552761 | false | 3.355963 | false | false | false |
ngageoint/scale | scale/recipe/messages/supersede_recipe_nodes.py | 1 | 10620 | """Defines a command message that supersedes recipe nodes"""
from __future__ import unicode_literals
import logging
from job.messages.cancel_jobs import create_cancel_jobs_messages
from job.messages.unpublish_jobs import create_unpublish_jobs_messages
from messaging.messages.message import CommandMessage
from recipe.... | apache-2.0 | -3,463,266,877,579,864,600 | 40.322957 | 119 | 0.654426 | false | 3.990981 | false | false | false |
Eagles2F/sync-engine | inbox/models/util.py | 3 | 6308 | import time
import math
from collections import OrderedDict
CHUNK_SIZE = 1000
def reconcile_message(new_message, session):
"""
Check to see if the (synced) Message instance new_message was originally
created/sent via the Inbox API (based on the X-Inbox-Uid header. If so,
update the existing message w... | agpl-3.0 | -3,593,411,109,105,316,400 | 34.044444 | 83 | 0.629201 | false | 4.141825 | false | false | false |
tkchafin/mrbait | tests/benchmark_gff.py | 1 | 11663 | #!/usr/bin/python
from collections import Counter
from collections import defaultdict
import time
import unicodedata
import os
import sys
import pandas as pd
from collections import namedtuple
"""
Benchmarking two different structures for yielding GFF Records
Results:
-At small numbers, namedtuples and native lists... | gpl-3.0 | 3,216,536,529,601,294,000 | 32.22792 | 98 | 0.690217 | false | 3.26329 | true | false | false |
OCA/l10n-spain | l10n_es_aeat_partner_check/models/res_partner.py | 1 | 5469 | # Copyright 2019 Acysos S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import requests
from odoo import fields, models, api, _
RESULTS = [
('NO IDENTIFICADO', _('No identificado')),
('IDENTIFICADO', _('Identificado')),
('NO PROCESADO', _('No procesado')),
('NO IDENTIFICABLE', _(... | agpl-3.0 | -5,820,312,906,826,708,000 | 36.958333 | 84 | 0.536407 | false | 3.777471 | false | false | false |
qitan/icomments | example/icomments/models.py | 1 | 1315 | # -*- coding:utf8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.contrib import admin
# Create your models here.
APPROVED_TYPE=(
(0,u'通过'),
(1,u'未审核'),
(2,u'垃圾'),
(3,u'隐藏')
)
class Comments(models.Model):
post_id = models.Bi... | gpl-3.0 | -3,266,319,826,446,654,500 | 32 | 99 | 0.693694 | false | 2.756208 | false | false | false |
kornai/pymachine | src/pymachine/sentence_parser.py | 3 | 1271 | from pymachine.machine import Machine
from pymachine.control import KRPosControl as Control
class SentenceParser:
"""This class will create machines from analyzed and chunked text"""
def parse(self, sentence):
"""
input sentence is a list of tokens and chunk in the following format:
... | mit | -848,661,438,381,931,000 | 32.447368 | 85 | 0.504327 | false | 4.428571 | false | false | false |
abo-abo/edx-platform | cms/djangoapps/contentstore/views/checklist.py | 1 | 6085 | import json
import copy
from util.json_request import JsonResponse
from django.http import HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from django.core.urlresolvers import reverse
from django_future.csrf import ensure_cs... | agpl-3.0 | -9,174,328,466,409,892,000 | 42.156028 | 124 | 0.65719 | false | 4.419027 | false | false | false |
pidah/st2contrib | packs/dimensiondata/actions/create_firewall_rule.py | 6 | 3294 | from lib import actions
from libcloud.compute.drivers.dimensiondata import (
DimensionDataFirewallRule,
DimensionDataFirewallAddress)
__all__ = [
'CreateFirewallRuleAction',
]
class CreateFirewallRuleAction(actions.BaseAction):
def run(self, **kwargs):
network_domain_id = kwargs['network_dom... | apache-2.0 | 1,161,470,284,548,863,000 | 34.042553 | 72 | 0.538859 | false | 4.445344 | false | false | false |
iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert/util/matrix.py | 1 | 5898 | # Copyright (C) 2011 Statoil ASA, Norway.
#
# The file 'matrix.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 th... | gpl-3.0 | 727,603,489,766,150,100 | 37.54902 | 108 | 0.644964 | false | 3.693175 | false | false | false |
cherry-wb/viper | modules/image.py | 1 | 1559 | try:
import requests
HAVE_REQUESTS = True
except ImportError:
HAVE_REQUESTS = False
from viper.common.out import *
from viper.common.abstracts import Module
from viper.core.session import __session__
class Image(Module):
cmd = 'image'
description = 'Perform analysis on images'
def ghiro(self)... | bsd-3-clause | -6,014,709,269,526,425,000 | 26.350877 | 103 | 0.56703 | false | 4.224932 | false | false | false |
seanbrant/django-queued-storage | queued_storage/backends.py | 1 | 15196 | import urllib
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import SimpleLazyObject
from queued_storage.conf import settings
from queued_storage.utils import import_attribute
class LazyBackend(SimpleLazyObject):
def __init__(self, impor... | bsd-3-clause | 2,004,813,054,480,847,400 | 34.92435 | 93 | 0.629639 | false | 4.203596 | false | false | false |
jpvanhal/cloudsizzle | cloudsizzle/studyplanner/common/forms.py | 1 | 4923 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009-2010 CloudSizzle Team
#
# 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 | 8,493,164,067,195,529,000 | 33.426573 | 74 | 0.624213 | false | 4.459239 | false | false | false |
jo-tez/python-linode-api | linode/objects/linode/stackscript.py | 1 | 2445 | from __future__ import absolute_import
from enum import Enum
from linode.objects import Base, Image, Property
class UserDefinedFieldType(Enum):
text = 1
select_one = 2
select_many = 3
class UserDefinedField():
def __init__(self, name, label, example, field_type, choices=None):
self.name = n... | bsd-3-clause | 5,733,562,470,057,309,000 | 32.958333 | 88 | 0.586912 | false | 4.008197 | false | false | false |
JoeJimFlood/RugbyPredictifier | 2019SuperRugby/ranking.py | 5 | 1568 | import pandas as pd
import numpy as np
import os
from scipy.stats.distributions import norm
#from subprocess import Popen
#wd = r'D:\RugbyPredictifier\2018SuperRugby\teamcsvs'
def rank(wd, roundno):
pf = {}
pa = {}
scores = np.array([5, 2, 3, 3])
for team in os.listdir(wd):
data = pd.read_c... | mit | 3,430,725,592,137,578,500 | 36.357143 | 103 | 0.588648 | false | 3.009597 | false | false | false |
mgoffin/36-chambers | chambers/strings.py | 1 | 1747 | #!/usr/bin/env python
from vocabulary import V_BinaryViewTypes
class Strings(object):
"""Base class for methods/functions dealing with Strings."""
bv = None
def __init__(self, bv=None):
self.bv = bv
def stack_strings(self):
"""
Parse out stackstrings. This is a very crude i... | mit | -3,001,862,428,143,940,000 | 32.596154 | 79 | 0.423583 | false | 3.616977 | false | false | false |
thibault/django-zipview | zipview/tests/test_views.py | 1 | 2101 | import os
import zipfile
from io import BytesIO
from django.test import TestCase
from django.core.files import File
from django.http import HttpResponse
from django.test.client import RequestFactory
from zipview.views import BaseZipView
class ZipView(BaseZipView):
"""Test ZipView basic implementation."""
_f... | mit | 3,532,220,413,168,886,300 | 31.828125 | 94 | 0.616373 | false | 4.06383 | true | false | false |
HubbleStack/Hubble | hubblestack/extmods/grains/systemuuid.py | 1 | 1320 | # -*- coding: utf-8 -*-
'''
Gather the system uuid via osquery
'''
import salt.utils.path
import salt.modules.cmdmod
__salt__ = {'cmd.run': salt.modules.cmdmod._run_quiet}
def get_system_uuid():
'''
Gather the system uuid via osquery
If osquery can't get a hardware-based value, it'll just randomly gener... | apache-2.0 | 8,109,279,264,628,518,000 | 31.195122 | 100 | 0.578788 | false | 3.557951 | false | false | false |
avisingh599/visual-qa | scripts/features.py | 1 | 2630 | import numpy as np
from keras.utils import np_utils
def get_questions_tensor_timeseries(questions, nlp, timesteps):
'''
Returns a time series of word vectors for tokens in the question
Input:
questions: list of unicode objects
nlp: an instance of the class English() from spacy.en
timesteps: the number of
Ou... | mit | -1,117,902,325,200,640,000 | 28.233333 | 67 | 0.726616 | false | 3.076023 | false | false | false |
redhataccess/redhat-support-tool | src/redhat_support_tool/plugins/list_cases.py | 1 | 17874 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2012 Red Hat, 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 a... | apache-2.0 | -6,836,297,967,316,706,000 | 39.995413 | 80 | 0.514155 | false | 4.619798 | true | false | false |
our-city-app/oca-backend | src/rogerthat/bizz/location.py | 1 | 26451 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | apache-2.0 | -4,970,041,766,552,287,000 | 49.096591 | 181 | 0.691543 | false | 3.679883 | false | false | false |
klusta-team/kwiklib | kwiklib/dataio/tests/test_tools.py | 1 | 2034 | """Unit tests for dataio.tools module."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os
import tempfile
import numpy as np
from kwiklib.dataio import (normalize, find_filename, save_t... | bsd-3-clause | -7,505,220,866,420,326,000 | 27.263889 | 79 | 0.517699 | false | 3.94186 | true | false | false |
aaronkl/RoBO | robo/util/output_reader.py | 1 | 1311 | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 23 17:00:02 2015
@author: aaron
"""
import csv
import numpy as np
class OutputReader(object):
def __init__(self):
pass
def read_results_file(self,filename,
fieldnames=['iteration', 'config', 'fval',
... | bsd-3-clause | -8,539,329,281,205,670,000 | 27.5 | 98 | 0.509535 | false | 4.632509 | false | false | false |
PeqNP/GameKit | bin/gamekit/interpolator.py | 1 | 1830 | #
# @copyright 2015 Upstart Illustration LLC. All rights reserved.
#
import os
import re
import shutil
class Interpolator (object):
# @param PathBuilder
# @param IGraphicsPathBuilder
# @param StagePathBuilder
# @param dict - contains key/values to interpolate within template
def __init__(self, pro... | mit | 2,959,074,642,995,301,000 | 30.551724 | 86 | 0.603279 | false | 3.986928 | false | false | false |
denniskempin/safetynet | safetynet.py | 1 | 16074 | import re
import inspect
import collections
import abc
__all__ = [
"typecheck",
"List",
"Dict",
"Optional",
"Typename",
"Any",
"Tuple",
"TypeChecker",
"TypecheckMeta",
"InterfaceMeta"
]
param_regexp_str = "^\s*:param\s([^:\n\r]+).*$"
param_regexp = re.compile(param_regexp_str, re.MULTILINE)
retu... | mit | -3,814,634,578,213,426,700 | 31.806122 | 80 | 0.668906 | false | 3.804497 | false | false | false |
mapzen/vector-datasource | integration-test/358-merge-same-roads.py | 2 | 2701 | from . import FixtureTest
def _freeze(thing):
if isinstance(thing, dict):
return frozenset([(_freeze(k), _freeze(v)) for k, v in thing.items()])
elif isinstance(thing, list):
return tuple([_freeze(i) for i in thing])
return thing
class MergeSameRoads(FixtureTest):
def test_roads_m... | mit | 6,572,470,095,026,517,000 | 32.7625 | 78 | 0.471677 | false | 4.220313 | false | false | false |
modc08/nectar-ubuntu-zfs-image | coordinate/builder.py | 1 | 4285 | #!/usr/bin/env python
# pylint: disable=invalid-name,line-too-long,broad-except
"""Initiate and follow the progress of image creation. Post progress to Slack. Note: This is a fault-intolerant, quick-and-dirty prototype!"""
import datetime, json, os, random, socket, time
import glanceclient, swiftclient
import keyst... | unlicense | 8,035,354,305,504,613,000 | 36.26087 | 217 | 0.667211 | false | 3.609941 | true | false | false |
iwm911/plaso | plaso/parsers/winfirewall.py | 1 | 5362 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | apache-2.0 | 6,134,447,438,290,178,000 | 31.895706 | 79 | 0.674189 | false | 3.810945 | false | false | false |
josephsnyder/VistA | Packages/Scheduling/Patches/SD_5.3_707/SD_5.3_707.py | 2 | 2422 | #---------------------------------------------------------------------------
# Copyright 2019 The Open Source Electronic Health Record Alliance
#
# 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... | apache-2.0 | 8,080,133,541,141,436,000 | 45.576923 | 111 | 0.64038 | false | 4.595825 | false | false | false |
dceresoli/AtomPy | Atomic/solve.py | 1 | 3511 | # AtomPy - atomic calcalations in python
# Copyright (C) 2010 Davide Ceresoli <dceresoli@gmail.com>
#
# 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 version 3 of the License.
#
# This program i... | gpl-2.0 | -1,988,687,651,461,772,800 | 28.258333 | 106 | 0.573056 | false | 3.445535 | false | false | false |
jessedhillon/batteries | batteries/model/recordable.py | 1 | 1197 | import sys
from datetime import datetime
from dateutil.tz import tzutc
from sqlalchemy.schema import Column
from sqlalchemy import event
from batteries.model.types import UTCDateTime
class Recordable(object):
ctime = Column(UTCDateTime, index=True)
mtime = Column(UTCDateTime, index=True)
ctime._creatio... | bsd-3-clause | -5,922,860,482,826,490,000 | 31.351351 | 76 | 0.75188 | false | 3.449568 | false | false | false |
Sendhub/drow | drow/tests/mockriak.py | 1 | 1948 | __author__ = 'max'
from mock import MagicMock
from time import time
def create_mock_riak_object(key=None, update_time=None):
riak_object = MagicMock()
riak_object.key = key
riak_object.exists = True
riak_object.data = None
riak_object.encoded_data = None
riak_object.content_type = 'applicatio... | mit | -5,606,370,837,211,962,000 | 26.828571 | 64 | 0.648357 | false | 3.364421 | false | false | false |
ntolazzi/pyjones | pyjones/opticalelements.py | 1 | 5447 | """This module provides optical elements which influence the polarization of light. The basic class is
JonesMatrix from which all predefined optical elements inherit from. Predefined optical elements are:
* PolarizerHorizontal
* PolarizerVertical
* Polarizer(angle)
* QuarterWavePlate(angle)
* HalfWavePlate(angle)
"""... | mit | 1,761,431,577,925,473,500 | 43.284553 | 119 | 0.586011 | false | 3.887937 | false | false | false |
JesseTeK/archive-framework | archive-framework/config.py | 1 | 7809 | """This module handles finding, loading, and validating the configuration file."""
import configparser
import logging
import os.path
import platform
import docopt
import cli
logger = logging.getLogger(__name__)
dictionary = None
class Test(object):
"""Base class for configuration tests."""
def __init__... | mit | 5,563,566,566,695,770,000 | 24.271845 | 120 | 0.587911 | false | 4.469948 | true | false | false |
jhl667/galaxy_tools | tools/exomiser/exomiser.py | 1 | 7267 | #!/usr/bin/env python
# USAGE: exomiser.py <vcf> <outfile> <java8_path> <exomiser_jar> [optional args]
# CODED BY: John Letaw
from __future__ import print_function
import argparse
import os
import sys
# https://docs.python.org/2/library/subprocess.html
# https://github.com/google/python-subprocess32
if os.name == '... | apache-2.0 | 1,312,369,241,226,847,700 | 32.8 | 127 | 0.604238 | false | 3.391041 | false | false | false |
mahajrod/MACE | scripts/old/draw_heterozygous_snps.py | 1 | 6145 | #!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import sys
import argparse
from BCBio import GFF
from MACE.Parsers.VCF import CollectionVCF, ReferenceGenome
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input_file", action="store", dest="input", required=True,
help="Input ... | apache-2.0 | 4,151,780,383,988,263,400 | 60.45 | 126 | 0.554434 | false | 4.279248 | false | false | false |
mobarski/sandbox | space/old/formula4.py | 1 | 1178 | #from const import *
## EX4 ########################
class formula:
def __init__(self,hint,g={},info='',**formulas):
self.hint=hint
self.info=info
self.formula=formulas
self.globals=g
def copy(self):
f = formula(self.hint,**self.formula)
f.__dict__=self.__dict__.copy()
return f
def expand(self,x):
... | mit | 6,423,114,011,824,501,000 | 20.436364 | 68 | 0.519525 | false | 2.389452 | false | false | false |
speters/cyrf6936_sigrokdecode | regs.py | 1 | 18026 | ##
## Copyright (C) 2016 Soenke J. Peters
##
## 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 d... | gpl-3.0 | -8,980,826,188,408,648,000 | 28.168285 | 109 | 0.478642 | false | 2.483262 | false | false | false |
jimmycallin/master-thesis | utils/misc_utils.py | 1 | 1646 | """
Contains miscellaneous helper functions
"""
import logging
import logging.config
import yaml
import spacy
from time import time
def get_config(path):
"""
Returns YAML configuration from path.
"""
with open(path) as file_:
return yaml.load(file_)
def get_logger(module_name, config=None):
... | mit | -2,196,539,392,404,936,000 | 23.939394 | 74 | 0.577764 | false | 4.104738 | true | false | false |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/skimage/data/_binary_blobs.py | 13 | 1995 | import numpy as np
from ..filters import gaussian
def binary_blobs(length=512, blob_size_fraction=0.1, n_dim=2,
volume_fraction=0.5, seed=None):
"""
Generate synthetic binary image with several rounded blob-like objects.
Parameters
----------
length : int, optional
Linear... | mit | -2,827,572,092,473,553,000 | 36.641509 | 78 | 0.614035 | false | 3.62069 | false | false | false |
WebShark025/TheZigZagProject | plugins/mp3tag.py | 1 | 1475 | import requests
awaiting_audio = {"981": "hi"}
@bot.message_handler(commands=['mp3tag', 'Mp3tag'])
def mp3tag(message):
userlang = redisserver.get("settings:user:language:" + str(message.from_user.id))
userid = message.from_user.id
banlist = redisserver.sismember('zigzag_banlist', '{}'.format(userid))
if banl... | mit | -2,966,446,670,219,468,300 | 42.382353 | 135 | 0.702373 | false | 2.961847 | false | false | false |
babelsberg/babelsberg-r | tests/modules/ffi/test_type.py | 1 | 15371 | from tests.modules.ffi.base import BaseFFITest
from topaz.modules.ffi.type import (type_names, rw_strategies,
W_TypeObject, VOID)
from topaz.modules.ffi import type as ffitype
from rpython.rlib import clibffi
from rpython.rtyper.lltypesystem import rffi, lltype
# XXX maybe move to ... | bsd-3-clause | -2,304,615,273,059,239,000 | 40.655827 | 79 | 0.590658 | false | 3.340795 | true | false | false |
marcore/edx-platform | lms/djangoapps/commerce/migrations/0002_commerceconfiguration.py | 59 | 1477 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('commerce... | agpl-3.0 | -2,513,075,621,352,625,700 | 45.15625 | 198 | 0.631009 | false | 4.281159 | false | false | false |
persandstrom/home-assistant | homeassistant/components/media_player/vizio.py | 3 | 6432 | """
Vizio SmartCast TV support.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.vizio/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant import util
from homeassistant.components.media_player impo... | apache-2.0 | 3,024,991,834,985,052,700 | 31.816327 | 75 | 0.619558 | false | 3.886405 | true | false | false |
mjvakili/ccppabc | ccppabc/code/plotting.py | 1 | 15241 | '''
Plotting modules
'''
import os
import h5py
import corner
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.ticker import MaxNLocator
# --- local ---
import util
import data as Data
from prior import PriorRan... | mit | 3,954,959,015,432,341,500 | 31.42766 | 110 | 0.528246 | false | 3.046981 | false | false | false |
ishankhare07/multi-language-ide | core/dir_core.py | 1 | 1747 | import sys
import os
class Directory:
"""
directory to scan can be provided as a string
example:
Directory('/home/<user>/Desktop')
or None to scan the current working directory
example:
Directory()
is equivalent to:
Directory(None)
... | mit | -3,219,552,223,337,967,000 | 40.595238 | 119 | 0.527762 | false | 4.683646 | false | false | false |
tatsuhirosatou/JMdictDB | tools/mkperms.py | 1 | 2238 | #!/usr/bin/env python3
#######################################################################
# This file is part of JMdictDB.
# Copyright (c) 2009 Stuart McGraw
#
# JMdictDB 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 S... | gpl-2.0 | 4,429,742,830,975,895,600 | 39.690909 | 85 | 0.582216 | false | 3.767677 | false | false | false |
vincentchevrier/dataquick | dataquick/plugins/loaders/ta_instruments.py | 1 | 7703 | import numpy as np
import struct
from dataquick.loaders import Loader, register_loaders
from dataquick.plugins.structures.dsc import DSC
from dataquick.plugins.structures.tga import TGA
# Dictionary for unit conversion
# note that all keys are lower case
unit_conversion = {
's': ('min', lambda x: x/60.),
'sec'... | mit | 2,856,058,423,865,827,300 | 31.196653 | 102 | 0.555945 | false | 3.830264 | false | false | false |
estefanniegg/estefannieExplainsItAll | makes/bbCake/bb8cake.py | 1 | 1294 | # BB-Cake
#
# Have fun =)
#
# This file is part of the Estefannie Explains It All repo.
#
# (c) Estefannie Explains It All <estefannieexplainsitall@gmail.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
import RPi.GPIO as GPIO
import... | mit | -4,286,148,329,605,209,600 | 20.932203 | 117 | 0.700927 | false | 2.577689 | false | false | false |
fenexomega/DjangoBookExercises | example_app/views/create_project.py | 1 | 1274 | from django.shortcuts import render
from example_app.models import Project
from django.http import HttpResponseRedirect, HttpResponse
from django.forms import forms,ModelForm
from django.core.urlresolvers import reverse
class Form_project_create(ModelForm):
# title = forms.CharField(label='Title',max_length=30)
# de... | gpl-3.0 | -1,799,027,009,359,987,200 | 36.5 | 86 | 0.734694 | false | 3.443243 | false | false | false |
arne-cl/discoursegraphs | src/discoursegraphs/readwrite/rst/rs3/rs3filewriter.py | 1 | 11679 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Arne Neumann <discoursegraphs.programming@arne.cl>
"""This module converts `DGParentedTree`s into .rs3 files."""
from __future__ import absolute_import, division, print_function
import codecs
from collections import defaultdict, OrderedDict
from lxml import etr... | bsd-3-clause | -5,998,558,766,021,111,000 | 38.060201 | 94 | 0.59363 | false | 3.873632 | false | false | false |
inkah-trace/inkah-python | inkah/flask/__init__.py | 1 | 2163 | from __future__ import absolute_import
import wrapt
from flask import request, g
from inkah import Span, TRACE_ID_HEADER, SPAN_ID_HEADER, PARENT_SPAN_ID_HEADER
from inkah.utils import is_installed, generate_id
class Inkah(object):
def __init__(self, app=None, **kwargs):
self._options = kwargs
i... | mit | -7,070,654,243,881,186,000 | 39.055556 | 93 | 0.6454 | false | 3.47191 | false | false | false |
vodkina/GlobaLeaks | backend/globaleaks/handlers/admin/files.py | 1 | 1898 | # -*- coding: utf-8 -*-
#
# /admin/files
# *****
#
# API handling db files upload/download/delete
import base64
from twisted.internet.defer import inlineCallbacks
from globaleaks import models
from globaleaks.handlers.base import BaseHandler
from globaleaks.orm import transact
from globaleaks.rest.apicache import GL... | agpl-3.0 | -6,501,970,904,984,590,000 | 21.595238 | 71 | 0.638567 | false | 3.469835 | false | false | false |
fw1121/bcbio-nextgen | bcbio/rnaseq/sailfish.py | 4 | 3667 | import tempfile
import os
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
from bcbio.utils import file_exists, get_in, safe_makedir
def run_sailfish(sample):
names = sample["rgnames"]
if len(sample["files"]) == 2:
fq1, fq2 = sample["files"]
else:
f... | mit | 3,287,670,137,494,374,400 | 40.202247 | 83 | 0.627761 | false | 3.091906 | false | false | false |
Harmon758/Harmonbot | units/time.py | 1 | 1484 |
import datetime
from .errors import UnitExecutionError
def duration_to_string(duration: datetime.timedelta, weeks: bool = True,
milliseconds: bool = False, microseconds: bool = False,
abbreviate: bool = False, separator: str = ' ') -> str:
# TODO: Support colon format
# TODO: Default output for durat... | mit | 6,470,010,638,553,378,000 | 28.078431 | 73 | 0.672286 | false | 3.362812 | false | false | false |
TribeMedia/synapse | synapse/push/baserules.py | 2 | 11092 | # Copyright 2015, 2016 OpenMarket Ltd
#
# 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 ... | apache-2.0 | 2,557,556,694,945,457,000 | 28.112861 | 81 | 0.487378 | false | 4.023214 | false | false | false |
felixfontein/ansible | test/lib/ansible_test/_internal/commands/sanity/ansible_doc.py | 13 | 4902 | """Sanity test for ansible-doc."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections
import os
import re
from ... import types as t
from . import (
SanitySingleVersion,
SanityFailure,
SanitySuccess,
)
from ...target import (
TestTarget,
)
fro... | gpl-3.0 | -1,324,739,888,795,564,800 | 32.121622 | 159 | 0.585271 | false | 4.307557 | true | false | false |
Hydrosys4/Master | serialcmdmod.py | 1 | 10085 | # -*- coding: utf-8 -*-
#to kill python processes use -- pkill python
from __future__ import print_function
from builtins import str
from builtins import range
from builtins import object
import time
import datetime
import sys,os
import serial
import logging
# variable below is a flag to avoid send procedure to run... | gpl-3.0 | 7,535,597,968,916,699,000 | 26.256757 | 118 | 0.622806 | false | 3.360546 | false | false | false |
openstack/networking-plumgrid | networking_plumgrid/neutronclient/policy/endpoint_group.py | 1 | 4792 | # Copyright 2016 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 | 7,605,898,518,192,998,000 | 33.978102 | 78 | 0.586394 | false | 4.384263 | false | false | false |
c0decat/mpris-remote | app.py | 1 | 1258 | #!/usr/bin/env python2
import json, os
from flask import Flask, Response, Markup, send_from_directory
import playercontrols
app = Flask(__name__, static_url_path='/static')
# Temp definitions
HTTP_HOST = "0.0.0.0"
HTTP_PORT = 9876
@app.route("/action/toggle")
def mprisToggle():
control = playercontrols.PlayerContro... | mit | 5,121,575,974,416,708,000 | 22.735849 | 62 | 0.711447 | false | 3.168766 | false | false | false |
OaklandPeters/pyinterfaces | pyinterfaces/enum/test_iterclass.py | 1 | 1811 | """
"""
from __future__ import absolute_import
import unittest
from .iterclass import IterableClassMeta, IterableClass
class IterClass(object):
__metaclass__ = IterableClassMeta
@classmethod
def __iter__(cls):
yield 1
yield 2
yield 3
class IterInstanceable(object):
__metacla... | mit | -347,548,702,940,702,100 | 22.828947 | 60 | 0.510768 | false | 4.144165 | true | false | false |
Benjamin-Marks/mit-tab | mittab/libs/data_import/import_scratches.py | 2 | 2234 | #Copyright (C) 2011 by Julia Boortz and Joseph Lynch
#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, p... | mit | 7,207,508,321,715,372,000 | 39.618182 | 78 | 0.65667 | false | 3.891986 | false | false | false |
zivia/grove | simulation/behaviors.py | 1 | 6236 | import entity
from utils import Point, rand
def move_north(agent=None, entities=None, environment=None):
"""
Behavior that causes an agent to move north one unit.
:param agent: The agent to perform the behavior.
:param entities: A list of entities in the simulation.
:param environment: The envir... | mit | 1,669,448,570,366,879,200 | 27.737327 | 124 | 0.658435 | false | 3.814067 | false | false | false |
mr-uuid/snippets | python/instantiating_defaults.py | 1 | 2512 | import unittest
def fun(a, l=[]):
l.append(a) # mutables are passed by reference
return l
def fun1(a, l=[]):
l.append(a) # mutables are passed by reference
# print l
x = l
del l
return x
def fun2(a, l=3):
yield l
l = a # makes a copy of l and sets it to a
yield l
class... | mit | 8,197,844,269,500,588,000 | 28.209302 | 79 | 0.553344 | false | 3.931142 | true | false | false |
AraNaldinho/E-flashcards | e-flashtemplate1.py | 2 | 6822 | # This is a template for e-flashcard for Vidyasagar (Formerly called Spastic Society of India)
# Developed by Dr.Bama Srinivasan - bama@annauniv.edu, chorse@gmail.com
#------------------------------------------------------------------------------
import wx
import os
import wx.lib.agw.gradientbutton
class eflashframe(... | gpl-3.0 | 7,208,397,871,058,811,000 | 44.178808 | 116 | 0.496042 | false | 4.112116 | false | false | false |
medspx/QGIS | tests/src/python/test_qgsauthsystem.py | 21 | 35590 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for bindings to core authentication system classes
From build dir: LC_ALL=en_US.UTF-8 ctest -R PyQgsAuthenticationSystem -V
.. note:: 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... | gpl-2.0 | -4,037,347,230,760,985,600 | 45.16083 | 255 | 0.651419 | false | 3.881981 | true | false | false |
betterlife/flask-psi | psi/app/views/__init__.py | 2 | 7698 | # coding=utf-8
from psi.app.models.product_inventory import ProductInventory
from psi.app.models.supplier_sales import OverallSupplierSales
from psi.app.models.product_sales import OverallProductSales
from psi.app.views.supplier_sales_report import SupplierSalesReportAdmin
from psi.app.views.product_sales_report import... | mit | 4,869,166,469,368,474,000 | 32.911894 | 72 | 0.658872 | false | 3.792118 | false | false | false |
GETLIMS/LIMS-Backend | lims/shared/monkeypatch.py | 1 | 1633 | import inspect
from django.apps import apps
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.utils import six
from rest_framework.utils import model_meta
from gm2m.helpers import GM2MTo
"""
Monkey patch the _resolve_model function to deal with
gm2m returning an instanc... | mit | -1,320,287,268,100,638,700 | 31.66 | 72 | 0.703613 | false | 3.815421 | false | false | false |
vaideesg/omsdk | omdrivers/iDRAC.py | 1 | 85129 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# Copyright © 2017 Dell Inc. or its subsidiaries. All rights reserved.
# Dell, EMC, and other trademarks are trademarks of Dell Inc. or its
# subsidiaries. Other trademarks may be trademarks of their respective owners.
#
# This program is free software: you can redistr... | gpl-3.0 | -7,381,505,383,478,571,000 | 49.944943 | 117 | 0.493357 | false | 3.018545 | false | false | false |
DataONEorg/d1_python | lib_scimeta/src/d1_scimeta/lxml_validate.py | 1 | 1280 | #!/usr/bin/env python
import argparse
import logging
import sys
import d1_scimeta.util
import d1_scimeta.validate
import d1_client.command_line
log = logging.getLogger(__name__)
def main():
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
... | apache-2.0 | -2,256,056,004,643,454,700 | 25.122449 | 97 | 0.649219 | false | 3.368421 | false | false | false |
DavidRueter/Theas | TheasServerSvc.py | 1 | 11678 | #!/usr/bin/env python
import servicemanager
import sys
import win32event
import win32service
import win32serviceutil
import win32evtlogutil
import os
# import winreg
import TheasServer
__author__ = 'DavidRueter'
'''
Theas web application server Windows service wrapper.
Author: David Rueter (drueter@assyst.com)
Date... | mit | -8,021,089,366,144,931,000 | 37.668874 | 130 | 0.651481 | false | 4.033851 | false | false | false |
qiqi/numpad | test/navierstokes.py | 1 | 8774 | import time
import sys
from pylab import *
sys.path.append('../..')
from numpad import *
def extend(w_interior, geo):
'''
Extend the conservative variables into ghost cells using boundary condition
'''
w = zeros([4, Ni+2, Nj+2])
w[:,1:-1,1:-1] = w_interior.reshape([4, Ni, Nj])
# inlet
rho,... | gpl-3.0 | 4,387,610,411,765,184,000 | 27.957096 | 79 | 0.436631 | false | 2.256687 | false | false | false |
drewdru/AOI | imageFilters/adaptiveFilter.py | 1 | 2344 |
import sys
import os
import numpy
from PIL import Image
from PyQt5.QtCore import QCoreApplication
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))
def adpmedf(image, size, window, threshold=0):
## set filter window and image dimensions
W = 2*window + 1
xlength, ylength = size
... | gpl-3.0 | 8,320,927,186,858,953,000 | 37.42623 | 89 | 0.606655 | false | 3.673981 | false | false | false |
hpcuantwerpen/easybuild-easyconfigs | setup.py | 1 | 4193 | ##
# Copyright 2012-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 | -7,353,361,003,927,786,000 | 37.118182 | 115 | 0.688767 | false | 3.559423 | true | false | false |
AMICI-developer/AMICI | tests/generateTestConfig/example_dirac.py | 3 | 1301 | #!/usr/bin/env python3
import sys
import numpy as np
from example import AmiciExample
class ExampleDirac(AmiciExample):
def __init__(self):
AmiciExample.__init__( self )
self.numX = 2
self.numP = 4
self.numK = 0
self.modelOptions['theta'] = np.log10([1, 0.5, 2, 3])
... | bsd-2-clause | -5,513,600,523,273,289,000 | 23.092593 | 76 | 0.614143 | false | 3.277078 | false | false | false |
rizar/attention-lvcsr | libs/blocks/blocks/graph/bn.py | 1 | 10802 | """Implements the batch normalization training graph transform.
Specifically, this module contains the implementation for the
transformation of a batch-normalized inference graph into training graph,
which uses minibatch statistics in place of population statistics.
"""
import collections
import contextlib
from funct... | mit | 3,043,093,368,433,693,700 | 38.713235 | 79 | 0.665062 | false | 4.407181 | false | false | false |
Joshwoo70/Horizons-2 | src/UniverseGen/Spiral.py | 1 | 8885 | from PIL import Image
from PIL import ImageDraw
import random
import logging
import math
from src.UniverseGen import Globals as gl
# Generation parameters:
# raw_input the user's desired values
# Background color of the created PNG
PNGBGCOLOR = (0, 0, 0)
# Quick Filename
RAND = gl.RAND
NAME = gl.Name
HSB = gl.hsb
... | gpl-3.0 | -2,493,562,441,659,506,700 | 29.118644 | 87 | 0.564434 | false | 3.106643 | false | false | false |
OpenBfS/dokpool-plone | Plone/src/elan.esd/elan/esd/testdata.py | 1 | 4649 | # -*- coding: utf-8 -*-
from docpool.elan.config import ELAN_APP
from docpool.localbehavior.localbehavior import ILocalBehaviorSupport
from elan.policy.chomsky import chomsky
from loremipsum import get_paragraphs
from plone.app.textfield.value import RichTextValue
from Products.CMFCore.utils import getToolByName
# fr... | gpl-3.0 | -1,667,692,878,739,039,200 | 31.739437 | 79 | 0.620564 | false | 3.398392 | false | false | false |
DarthMaulware/EquationGroupLeaks | Leak #1 - Equation Group Cyber Weapons Auction - Invitation/EQGRP-Free-File/Firewall/EXPLOITS/ELCO/fosho/requests/compat.py | 2 | 1697 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
import sys
##
##
##
##
_ver = sys.version_info
##
is_py2 = (_ver[0] == 2)
##
is_py3 = (_ver[0] == 3)
##
is_py30 = (is_py3 and _ver[1] == 0)
##
is_py31 = (is_py3 and _ver[1] == 1)
##
is_py32 = (is_py3 and _ver[1] == 2)
##
is_py33 = (is_py3 and _ver[1] == ... | unlicense | -9,062,028,216,764,329,000 | 11.759398 | 95 | 0.592811 | false | 2.647426 | false | true | false |
kevenli/FeedIn | tests/modules/xpathfetchpage/xpathfetchpagetests.py | 1 | 3616 | # -*- coding: utf-8 -*-
'''
Created on 2014��11��12��
@author: ���
'''
import unittest
from feedin.modules import XPathFetchPageBuilder
from feedin.model import Context
class XPathFetchPageTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_xpath(self):
... | apache-2.0 | 9,213,188,293,979,165,000 | 34.633663 | 163 | 0.540022 | false | 3.860515 | true | false | false |
ibisek/raspiups | piups.py | 1 | 15674 | #!/usr/bin/python3
#
# piUps python interface and control script
#
# @author ibisek
# @version 2017-11-08
# @see https://github.com/ibisek
#
################# [ CONFIGURATION ] ###################
# To enable system shutdown run you need to add this to /etc/sudoers:
# <your username> ALL=(ALL) NOPASSWD: /sbin/shutdow... | gpl-3.0 | 3,145,756,612,425,454,000 | 33.372807 | 176 | 0.570882 | false | 3.801601 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.