text stringlengths 4 1.02M | meta dict |
|---|---|
"""
LICENCE
-------
Copyright 2015 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
"""
import cPickle
import logging
import multiprocessing.pool
import numpy
import os.path as os... | {
"content_hash": "4ce6a29818e22d5110df0ea0c4b99ce1",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 92,
"avg_line_length": 40.18818380743983,
"alnum_prop": 0.5980071871937276,
"repo_name": "anguoyang/SMQTK",
"id": "dc6fe6209c16e69291da8c07ce47059ad595b777",
"size": "1836... |
from melta.dynamic.propertyMaker import PropertyMaker
property_maker = PropertyMaker()
class Person:
pass
person1 = Person()
property_maker.buildProperty(person1, "edad", 20) \
.buildProperty(person1, "altura", 180) \
.buildProperty(person1, "sexo", "male")
class House:
pass
house1 = House()
p... | {
"content_hash": "245d406cbc50e194b811fcc49034a80e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 58,
"avg_line_length": 21.96551724137931,
"alnum_prop": 0.695447409733124,
"repo_name": "bossiernesto/melta",
"id": "d28a29efc70a7d2411d043c08d1caf4cddbaa722",
"size": "637... |
"""ThreatConnect TI Campaign"""
# standard library
from typing import TYPE_CHECKING
# first-party
from tcex.api.tc.v2.threat_intelligence.mappings.group.group import Group
if TYPE_CHECKING:
# first-party
from tcex.api.tc.v2.threat_intelligence.threat_intelligence import ThreatIntelligence
class Campaign(Gro... | {
"content_hash": "4f04395b4c1debe0ecaa591be0443a98",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 95,
"avg_line_length": 36.93181818181818,
"alnum_prop": 0.648,
"repo_name": "ThreatConnect-Inc/tcex",
"id": "b5ba8d4ab51a0424d35396298372d71b1244c88b",
"size": "1625",
"b... |
from __future__ import print_function
from helper_functions import *
from munkres import Munkres
import numpy as np
import scipy.spatial.distance as dist
import time
import cPickle as pickle
from collections import defaultdict
# Returns formatted string from list of tuples
def pt_str(pt):
return "({0:.4},{1:.4... | {
"content_hash": "3c027c89e08d239e792eee3ef908b860",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 66,
"avg_line_length": 25.11111111111111,
"alnum_prop": 0.599803343166175,
"repo_name": "adfriedm/Geometric-K-Server-Experiments",
"id": "b6b454dbef4a5c098d07906e9c7607a4131d... |
from __future__ import print_function, division, absolute_import
import unittest
import os
import tempfile
from ..db import Database
class DBTests(unittest.TestCase):
def setUp(self):
self._db = os.path.join(tempfile.gettempdir(), 'pigar_test.db')
self._conn = Database(db=self._db)
def tea... | {
"content_hash": "ea053753d879a66a4e5a812b670fea57",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 71,
"avg_line_length": 29.93103448275862,
"alnum_prop": 0.6071428571428571,
"repo_name": "Damnever/pigar",
"id": "9457612559cf0ef6de1170986145f164911b0e50",
"size": "893",
... |
import math
import pdb
import numpy as np
import Orange
from Orange.feature import Type as OType
class OverlapPenalty(object):
def __init__(self, domain, cdists, ddists, granularity=100):
"""
Args:
domain: Orange.Domain object
"""
self.domain = domain
self.cdists = cdists
self.ddists ... | {
"content_hash": "04146b8f2714e5a6abbd4a2bf2f5ef2d",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 72,
"avg_line_length": 26.76439790575916,
"alnum_prop": 0.6171752738654147,
"repo_name": "sirrice/scorpion",
"id": "bafc153915b1931bcb96c24ee61a774ee4794dae",
"size": "511... |
from voicebase import settings
from voicebase.api.base import BaseApiEndpoint
class VoicebaseToken(object):
def __init__(self, user, token=None, obj=None):
if obj is None:
obj = {}
self.user = user
self._obj = obj
self.token = token
self.type = None
self... | {
"content_hash": "faaff5af9fa959398f5207357da4d588",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 80,
"avg_line_length": 25.71551724137931,
"alnum_prop": 0.5477707006369427,
"repo_name": "gdoermann/voicebase",
"id": "86cbc76c267fcd219ed2acca76bff62d7f914921",
"size": "... |
import argparse, yaml, sys
from glob import glob
from fru import load
parser = argparse.ArgumentParser(description='print fru data of SOM/CC eeprom')
parser.add_argument('-b','--board', action='store', choices=['som','cc'], type=str, help='Enter som or cc')
parser.add_argument('-f','--field', action='store', nargs="+"... | {
"content_hash": "40b81cf6d33e1ed3c4f8a81e12151680",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 175,
"avg_line_length": 42.92,
"alnum_prop": 0.6453867660764212,
"repo_name": "Xilinx/meta-petalinux",
"id": "eba2d7a1b58c8bb2510b2b117b3c7a793d584b49",
"size": "2170",
"... |
'''
"compile" plugin for cocos command line tool
'''
__docformat__ = 'restructuredtext'
import multiprocessing
import cocos
from MultiLanguage import MultiLanguage
import cocos_project
import os
import re
import sys
import shutil
import json
import build_web
import utils
class CCPluginCompile(cocos.CCPlugin):
""... | {
"content_hash": "5bb139718c11a97c02116b5fcc17d610",
"timestamp": "",
"source": "github",
"line_count": 1552,
"max_line_length": 146,
"avg_line_length": 42.0444587628866,
"alnum_prop": 0.5541354420486414,
"repo_name": "tianxiawuzhei/cocos-quick-cpp",
"id": "0e3550d64c091d69d3f2c58500bc8190d69b76c5",
... |
from kay.routing import (
ViewGroup, Rule
)
view_groups = [
ViewGroup(
Rule('/', endpoint='index', view='config.views.index'),
)
]
| {
"content_hash": "9b791cb691889571ae5e714d96446dcd",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 63,
"avg_line_length": 16.88888888888889,
"alnum_prop": 0.5855263157894737,
"repo_name": "yosukesuzuki/deep-link-app",
"id": "2097fba1a2462e417da65eac95f5e5594023d55f",
"siz... |
from collections import defaultdict
import re
from StringIO import StringIO
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext as _
from commcare_translations import load_translations
from corehq.a... | {
"content_hash": "60915b0bc44260de8bc2beebdd765db5",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 109,
"avg_line_length": 36.881443298969074,
"alnum_prop": 0.643885394828791,
"repo_name": "qedsoftware/commcare-hq",
"id": "cb04c8e0a327572f845f0b70d64420dbf9d55554",
"siz... |
"""
Run variety of evaluation metrics on Logistic Regression classifier.
@copyright: The Broad Institute of MIT and Harvard 2015
"""
import argparse, sys, os
from utils import gen_predictor
sys.path.append(os.path.abspath('./utils'))
from evaluate import design_matrix, run_eval, get_misses
def prefix():
return "... | {
"content_hash": "662672258788533c79b3cfc0b4d9764d",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 104,
"avg_line_length": 39.675,
"alnum_prop": 0.6493383742911153,
"repo_name": "broadinstitute/ebola-predictor",
"id": "2177411c60dfce04cd7d4cdc1b4c2351e1f784f4",
"size": "... |
"""
Shortest path algorithms for unweighted graphs.
"""
import networkx as nx
__all__ = ['bidirectional_shortest_path',
'single_source_shortest_path',
'single_source_shortest_path_length',
'single_target_shortest_path',
'single_target_shortest_path_length',
'all_p... | {
"content_hash": "f33ef769a33438903bf1a6f88db34799",
"timestamp": "",
"source": "github",
"line_count": 521,
"max_line_length": 79,
"avg_line_length": 27.52591170825336,
"alnum_prop": 0.5664876926295237,
"repo_name": "sserrot/champion_relationships",
"id": "c10666cbdc7b85fff979ed862478f064842c5cb1",
... |
from Crypto.Cipher import AES
import base64
import hashlib
import pkcs7
from AesCiphers import Ciphers
class ECB(Ciphers):
def __init__(self):
pass
def Encrypt(self, PlainText, SecurePassword):
pw_bytes = SecurePassword.encode('utf-8')
text_bytes = PlainText.encode('utf-8')
h... | {
"content_hash": "fb6a4c80cecdf195b8edae5e35a7dfad",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 65,
"avg_line_length": 26.976744186046513,
"alnum_prop": 0.6163793103448276,
"repo_name": "PanagiotisDrakatos/Light_IoT_CryptoDevice",
"id": "17d3b57f6302be4d739d111083869d17... |
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_keys... | {
"content_hash": "8831adeca84227f1a8419ceaa7ee6a13",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 73,
"avg_line_length": 31.42222222222222,
"alnum_prop": 0.5671852899575672,
"repo_name": "PrzemyslawUrbanczyk/pu_zadanie1",
"id": "3d34c0a7b6b7097929cfa716b005fe7d8d7b52a8",
... |
import time
import pypinyin
from pinyindict import *
'''
node|[0] |[1] |[2] |[3] |[4] |[5] |[6] |[7]
----|-------|------|-----|------|----|-----|-------|-------
|keyword|weight|mtime|parent|type|level|weight2|children
note: only leaf node has weight and mtime, other node's is 0 and 0
'''
KEYWORD = 0
WE... | {
"content_hash": "b122a497a233d59bcc2ab214a34d1173",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 100,
"avg_line_length": 30.405940594059405,
"alnum_prop": 0.5403777271247151,
"repo_name": "zhaochl/python-utils",
"id": "9e4fde1a1354b2026b951169a89c3914d91e4630",
"size"... |
from django.core import mail
from kitsune.kbadge.tests import AwardFactory, BadgeFactory
from kitsune.sumo.tests import TestCase
class AwardNotificationTests(TestCase):
def test_notification(self):
# Note: Need to do this import here so the
# notify_award_recipient function handles the
# ... | {
"content_hash": "9bf915e408b6d6730d1f839104beffa4",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 70,
"avg_line_length": 33.65384615384615,
"alnum_prop": 0.6845714285714286,
"repo_name": "mozilla/kitsune",
"id": "0f789bd811814b2d105331a76a05eb8659728955",
"size": "875",... |
# Documentation:
# qute://help/configuring.html
# qute://help/settings.html
# Don't load autoconfig.yml (this is required as of v2.0.0)
config.load_autoconfig(False)
# Name of the session to load by default
c.session.default_name = "default"
# Automatically save the current session
c.auto_save.session = True
# ... | {
"content_hash": "9627afa35afd764b55e85929fe3d4368",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 101,
"avg_line_length": 38.1436170212766,
"alnum_prop": 0.6053549016873518,
"repo_name": "bddenhartog/dotfiles",
"id": "0fdce9aa2870e591365e526011096e45de2185cb",
"size": ... |
from django.shortcuts import render
import social.apps.django_app.default.models as sm
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponse
def home(request):
#logout(request)
uname=""
if request.method == 'POST' and 'submit' in request.POST:
submit = request.PO... | {
"content_hash": "8a935193f2edad6c39c2e04a80cc07c3",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 61,
"avg_line_length": 34.9,
"alnum_prop": 0.7106017191977078,
"repo_name": "wasit7/PythonDay",
"id": "253b301b47792dee20b00a142f854d6066e6de58",
"size": "698",
"binary":... |
from collections import defaultdict
from urllib.parse import unquote
from colander import All, Boolean as BaseBoolean, drop, Length, Mapping, null, Number, OneOf, required, Sequence, Tuple
from pyramid.compat import is_nonstr_iter
from pyramid.settings import asbool
from translationstring import TranslationString
from... | {
"content_hash": "419d0af4c5998970905380e3e0ee6ab8",
"timestamp": "",
"source": "github",
"line_count": 484,
"max_line_length": 119,
"avg_line_length": 40.14462809917355,
"alnum_prop": 0.5086978898610396,
"repo_name": "hugobranquinho/ines",
"id": "8710b3b1a93109982a4efb8f28006e9298f82285",
"size": ... |
import os
import sys
import platform
import time
import aiml
import marshal
import glob
import time
import operator
import csv
# AIML Directory
saiml = "/PATH/sam/aiml/"
#saiml = "C:\\PATH\\sam\\aiml\\"
# brain
k = aiml.Kernel()
# setpreds() function
def setpreds():
with open(saiml + 'preds.csv') as csvfile:
... | {
"content_hash": "a2af6bdfdc14394d366d12fae3cbc31c",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 68,
"avg_line_length": 25.448275862068964,
"alnum_prop": 0.6147244805781391,
"repo_name": "theneverworks/Sam",
"id": "33cc7effbe7b93a4a503915db9702217557a65cb",
"size": "28... |
import csv
import random
import glob
import os
import sys
import time
import math
import numpy
import pylab
N_MONTH = 4
N_DAY_PER_MONTH = 31
BASE_MONTH = 4
TYPE_LENGTH = 4
class User(object):
def __init__(self, id, info):
self.id = id;
self.brands = info.keys()
self.data = dict()
... | {
"content_hash": "9e7be9785a75e15cfe238f2f26463076",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 104,
"avg_line_length": 30.104575163398692,
"alnum_prop": 0.5019539730785931,
"repo_name": "wait4pumpkin/tmall",
"id": "848ddb1779b076a8546795a571b7954f34af5d13",
"size": ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu... | {
"content_hash": "311b484e25601db1f41061e06d2ec3cb",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 148,
"avg_line_length": 32.100558659217874,
"alnum_prop": 0.6406195614340411,
"repo_name": "thaim/ansible",
"id": "e6e55691100fc5de0aed791d41c87b9c013c1f9a",
"size": "1222... |
"""Show apps report."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import click
import pandas as pd
from treadmill import cli
from treadmill.cli.scheduler import fetch_report, print_report
from treadmill import... | {
"content_hash": "b055b4908558d62179c203e52fd7b560",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 75,
"avg_line_length": 31.520833333333332,
"alnum_prop": 0.6100462656972901,
"repo_name": "bretttegart/treadmill",
"id": "4cdf2f68940022bc418529909c08b2c4c4ee0f1c",
"size":... |
import numpy
import os
import sys
# This script depends on a SJSON parsing package:
# https://pypi.python.org/pypi/SJSON/1.1.0
# https://shelter13.net/projects/SJSON/
# https://bitbucket.org/Anteru/sjson/src
import sjson
if __name__ == "__main__":
if sys.version_info < (3, 4):
print('Python 3.4 or higher needed to... | {
"content_hash": "c55754b808bbb5590a35448480461c93",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 123,
"avg_line_length": 43.7906976744186,
"alnum_prop": 0.6909187466808284,
"repo_name": "nfrechette/acl",
"id": "49611c5c6e4db501534ed257e2b9053fe90a441e",
"size": "5649"... |
class LoginResult(object):
"""
Enum class so everyone can agree on a common language for logging in
"""
LOGGED_IN = 0
NO_SUCH_USER = 1
INCORRECT_PASSWORD = 2
| {
"content_hash": "5f2cadef217dc0277fd15b0895e5a670",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 72,
"avg_line_length": 26,
"alnum_prop": 0.6373626373626373,
"repo_name": "pbraunstein/trackercise",
"id": "06395d1f4cfca1daf4b6869607763859383f4973",
"size": "182",
"bina... |
__author__ = "Simone Campagna"
__all__ = ['COLORMAPS']
from mayavi.core.lut_manager import lut_mode_list
COLORMAPS = lut_mode_list()
| {
"content_hash": "0b7e287d4487775739cf0719383d7fc3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 49,
"avg_line_length": 19.428571428571427,
"alnum_prop": 0.6838235294117647,
"repo_name": "simone-campagna/rubik",
"id": "9f34f349527e26d53e607d1632d4350dd85d61e2",
"size": ... |
import datetime
import warnings
from sys import getsizeof
import numpy as np
from pandas._libs import algos as libalgos, index as libindex, lib, Timestamp
from pandas.compat import range, zip, lrange, lzip, map
from pandas.compat.numpy import function as nv
from pandas import compat
from pandas.core.dtypes.dtypes im... | {
"content_hash": "3bf263d590f8cbb456bda5462b872772",
"timestamp": "",
"source": "github",
"line_count": 2964,
"max_line_length": 79,
"avg_line_length": 35.47402159244265,
"alnum_prop": 0.5303152789005658,
"repo_name": "ryfeus/lambda-packs",
"id": "9a4aa15f4cc25d46d5743626a6e0975bb3b13105",
"size": ... |
from PyQt5.QtCore import QObject
from duniterpy.api import errors
from sakia.errors import NoPeerAvailable
from sakia.data.processors import IdentitiesProcessor, ContactsProcessor
import logging
class SearchUserModel(QObject):
"""
The model of Navigation component
"""
def __init__(self, parent, app)... | {
"content_hash": "0f93eea7cb6c2e862fe3a27a566b54a0",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 89,
"avg_line_length": 27.82894736842105,
"alnum_prop": 0.5839243498817966,
"repo_name": "ucoin-io/cutecoin",
"id": "2afcabe9bf9865f7e9439bdf60bebc083fca113e",
"size": "211... |
import sys
import magicbot
class Injectable:
def __init__(self, num):
self.num = num
def test_simple_inject():
class Component1:
intvar = int
tupvar = tuple
injectable = Injectable
def execute(self):
pass
clas... | {
"content_hash": "054b65bda12ed3c52254de7e61a8d770",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 92,
"avg_line_length": 24.158163265306122,
"alnum_prop": 0.5978880675818374,
"repo_name": "Twinters007/robotpy-wpilib-utilities",
"id": "72c9649a95d92d09fcbdef45146ecab0d46d... |
import sys
# Local imports
from seisflows.tools import msg
from seisflows.tools import unix
from seisflows.config import ParameterError, custom_import
from seisflows.workflow.base import base
PAR = sys.modules['seisflows_parameters']
PATH = sys.modules['seisflows_paths']
optimize = sys.modules['seisflows_optimize']
... | {
"content_hash": "89c72fe1537aba85f5a0bfc4786c53ba",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 78,
"avg_line_length": 28.37704918032787,
"alnum_prop": 0.6302715193529752,
"repo_name": "rmodrak/seisflows",
"id": "d4814df4fbc67e901dbee4cd915794ca603bcbc7",
"size": "188... |
from pyfbsdk import *
def CopyBlendShapeAnimation(srcmodel, dstmodel):
for lSrcProp in srcmodel.PropertyList:
if lSrcProp.IsAnimatable() and lSrcProp.GetDataTypeName().lower()=="shape":
lDstProp = dstmodel.PropertyList.Find( lSrcProp.Name )
if... | {
"content_hash": "c2794d143948ff1a06a5ba2d09f3dc58",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 99,
"avg_line_length": 26.023255813953487,
"alnum_prop": 0.5308310991957105,
"repo_name": "Neill3d/MoPlugs",
"id": "53b2b8f381e7a4fa765e646957b65dfc8fbab913",
"size": "1293... |
"""make dictionary of reverse descriptions"""
import sys
import os
import re
import shutil
import StringIO
import simplejson
import gzip
import tempfile
from optparse import OptionParser
from normalize_pdb import normalize_pdb
from itertools import combinations
from utils import *
CMD_PYTHON="/usr/bin/python"
if os.p... | {
"content_hash": "cc745462d37c3b2e674897cad8b50764",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 135,
"avg_line_length": 32.92156862745098,
"alnum_prop": 0.5122096486003573,
"repo_name": "m4rx9/rna-pdb-tools",
"id": "9e41e7992bce23ca23385aa0e36022092e906f65",
"size": ... |
import os
from uliweb import settings
from uliweb.contrib.upload import FileServing, UUIDFilenameConverter
from uliweb.orm import get_model
from uliweb.i18n import ugettext as _
class DBFileServing(FileServing):
def __init__(self, default_filename_converter_cls=UUIDFilenameConverter):
super(DBFileServing, ... | {
"content_hash": "3ad50cf03da07c0d28d5906adde2b463",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 106,
"avg_line_length": 41.228813559322035,
"alnum_prop": 0.6197327852004111,
"repo_name": "wwfifi/uliweb",
"id": "aa20cd9d37c0f7741ad73f247ea10eec736c433f",
"size": "4865... |
import codecs
from os import environ, path
from sys import argv, path as sys_path
from setuptools import find_packages, setup
import versioneer
data_files = []
deps = [
"requests>=2.26.0,<3.0",
"isodate",
"lxml>=4.6.3",
"websocket-client>=0.58.0",
# Support for SOCKS proxies
"PySocks!=1.5.7,... | {
"content_hash": "d4c10a0baf73b4a2a69c0e2e4da0eadc",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 96,
"avg_line_length": 33.6910569105691,
"alnum_prop": 0.5912162162162162,
"repo_name": "melmorabity/streamlink",
"id": "6f79f045db816ac2566fca4ee9407efd075611ff",
"size":... |
import os
from lxml import etree
from shapely.wkt import loads
from operator import attrgetter
from django.db import models
from django.db.models import Q
from django.conf import settings
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django.db.models.signals import... | {
"content_hash": "885ccec3476b0591ace34a7b6fede412",
"timestamp": "",
"source": "github",
"line_count": 369,
"max_line_length": 176,
"avg_line_length": 37.84823848238482,
"alnum_prop": 0.6331805814120006,
"repo_name": "azavea/Open-Data-Catalog",
"id": "4dec7cae3864aa2233fd639d88e6658af01b75cc",
"si... |
"""
EventWall
Application Configuration
"""
# Allowed file extensions for upload
allowed_extensions = ['jpg', 'jpeg', 'png', 'gif', 'tiff']
# Azure Storage
azure_account_name = ""
azure_account_key = ""
# SparkPost
sparkpost_api_key = "" | {
"content_hash": "1dd3a36b3cb1b89601f22e9b9f6060b1",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 58,
"avg_line_length": 17.142857142857142,
"alnum_prop": 0.6833333333333333,
"repo_name": "stevenmirabito/eventwall",
"id": "76675afa8ccb96ac932e13f314fdf2cfeb23a216",
"siz... |
import copy
import shutil
import os
import sys
import click
from .inenv import (InenvManager, INENV_ENV_VAR, EVAL_EXIT_CODE, InenvException,
autojump_enabled, toggle_autojump)
from .utils import override_envars_and_deactivate
from . import version
def activator_warn(inenv):
click.secho("Plea... | {
"content_hash": "1fd67ebbf067d35cfcbf578b2d972a3e",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 99,
"avg_line_length": 30.585635359116022,
"alnum_prop": 0.6150650289017341,
"repo_name": "pnegahdar/inenv",
"id": "5b6883492534918166ae3593de17b9d93092c66d",
"size": "553... |
from __future__ import absolute_import, division, print_function
from os import path
from subprocess import PIPE
from subprocess import Popen
from subprocess import STDOUT
from .compat import bytes_to_str
import os
def compile_less(less_filename, css_filename, minify=False, source_map=True):
cmd = ['lessc', '--s... | {
"content_hash": "784503f9b345da7e6f2cf6678d7dff60",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 77,
"avg_line_length": 25.506172839506174,
"alnum_prop": 0.6190706679574056,
"repo_name": "CorverDevelopment/Pandora",
"id": "0a633ee78e3d5900ff628ecebe53f70565466c56",
"si... |
from sys import argv
script, name, age, color, food = argv
print("Your name is...", name)
print(f"You are {age} years old.")
print("Your favorite color is...", color)
print("Your favorite food is...", food)
| {
"content_hash": "b1e5ced4c07daedae84de89d158db24a",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 41,
"avg_line_length": 26.125,
"alnum_prop": 0.6746411483253588,
"repo_name": "dadavidson/Python_Lab",
"id": "5ce44a0d75ae5856c7d4a0dc4f98218b53c616dd",
"size": "468",
"bi... |
import numpy as np
import tensorflow as tf
from tensorflow_privacy.privacy.estimators import multi_label_head
from tensorflow_privacy.privacy.estimators import test_utils
from tensorflow_privacy.privacy.optimizers.dp_optimizer_keras import DPKerasSGDOptimizer
from tensorflow_estimator.python.estimator import estimator
... | {
"content_hash": "829ddc72482f4d8472e61dd779bad7ce",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 88,
"avg_line_length": 36.15492957746479,
"alnum_prop": 0.6595247370471368,
"repo_name": "tensorflow/privacy",
"id": "2a35c64697a948bdcf9b2a4db5357e3e8f95b644",
"size": "31... |
from flask import render_template, Blueprint
from common import get_app_list, get_query_list
from application.common.util import translate
from os.path import dirname, join
import json
exhibition_consumption = Blueprint('exhibition_consumption', __name__, template_folder='templates')
@exhibition_consumption.route('/... | {
"content_hash": "137dab2723b7d7fbe7f34b5f90be7698",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 105,
"avg_line_length": 50.68518518518518,
"alnum_prop": 0.6039459261965656,
"repo_name": "petchat/senz.dashboard.backend",
"id": "e24bff2dd8aea35af35ee570491b423829c0469e",
... |
PROGRAM_VERSION = "scculs.py, part of SCCULS preview-1"
import libscculs
import argparse
import os
import csv
def safe_open(file_path, overwrite):
if (overwrite == False) and os.path.exists(file_path):
if os.path.isfile:
raise Exception("This file already exists: " + file_path)
elif os.path.isfolder:
raise... | {
"content_hash": "30227c34f181115896e3400e6339eb29",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 378,
"avg_line_length": 62.41818181818182,
"alnum_prop": 0.7571608894067385,
"repo_name": "genomescale/scculs",
"id": "aee4bf8dfda54af5db69f08ed9e217114c4d2f7e",
"size": "... |
"""Test Library for OneConvergencePlugin."""
import contextlib
import uuid
import mock
from oslo.config import cfg
from neutron import context
from neutron.extensions import portbindings
from neutron.manager import NeutronManager
from neutron.plugins.oneconvergence import plugin as nvsd_plugin
from neutron.tests.uni... | {
"content_hash": "a207ffa485bddecc4527b4a2b4bfbdb5",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 76,
"avg_line_length": 37.9051724137931,
"alnum_prop": 0.6443029338185127,
"repo_name": "zhhf/charging",
"id": "02b0fef1d72fe14e7ac7431616419f183e861602",
"size": "5033",
... |
"""
Routines to create questions.
"""
import pdb
import json
import logging
from hashlib import sha1
from tqdm import tqdm
from . import db
from . import api
from . import turk
from .util import stuple
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
QUESTION_VERSION=0.2
# TODO: allow us to 'over... | {
"content_hash": "2da786e5286a5b7f4e6fb07ba6856a6b",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 125,
"avg_line_length": 40.71283783783784,
"alnum_prop": 0.607916355489171,
"repo_name": "arunchaganty/kbp-online",
"id": "2fd415ce52cd4a5a77946c8f7cb28cd1389c2a9d",
"size... |
""" Astronomy related functions """
from functools import wraps
import numpy as np
try:
import dask
except ImportError:
dask = None
def dask_compatibility(fn):
""" Make functions transparent to using dask delayed objects """
@wraps(fn)
def wrapped(*args, **kwargs):
try:
retur... | {
"content_hash": "08a01d1e0c5966a6125189106d0ad3bc",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 79,
"avg_line_length": 30.34825870646766,
"alnum_prop": 0.5832786885245902,
"repo_name": "mfouesneau/ezdata",
"id": "97ed6fffdf6a6bf938986e7c78b8850a6212ba0a",
"size": "12... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import argparse
import collections
import json
import os.path
import re
import sys
DEFAULT_TOOLCHAIN_PREFIX = "xtensa-esp32-elf-"
CHIP_SIZES = {
"esp32": {
"total_iram": 0x20000,
"total_ir... | {
"content_hash": "2c2761b5d2dabafbd664dff966296b7d",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 146,
"avg_line_length": 37.9320987654321,
"alnum_prop": 0.5615947925142393,
"repo_name": "espressif/ESP8266_RTOS_SDK",
"id": "e89312dd448421194ede4160482831075886228f",
"s... |
import unittest
import lob
# Setting the API key
lob.api_key = 'test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc'
class BankAccountFunctions(unittest.TestCase):
def setUp(self):
lob.api_key = 'test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc'
self.addr = lob.Address.list(count=1).data[0]
def test_list_bankAcc... | {
"content_hash": "ed2e7703df1894cd1bcebca40895d079",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 93,
"avg_line_length": 38.7816091954023,
"alnum_prop": 0.6253704801422644,
"repo_name": "ami/lob-python",
"id": "90de583a20623bee102c582c7e4dc9b01c0ca12f",
"size": "3374",
... |
from contextlib import contextmanager
from .termui import get_terminal_size
from .parser import split_opt
from ._compat import term_len
def measure_table(rows):
widths = {}
for row in rows:
for idx, col in enumerate(row):
widths[idx] = max(widths.get(idx, 0), term_len(col))
return tupl... | {
"content_hash": "7d4a4eaf2253015429e744be1096632b",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 81,
"avg_line_length": 34.11297071129707,
"alnum_prop": 0.5686250459953391,
"repo_name": "untitaker/click",
"id": "7b9fa7bc9fb8d6124f456fd9121750d2c710b38d",
"size": "8153... |
"""
Compute zonal statistics for every feature in a vector datasource across every
band in a raster datasource.
"""
import pprint
import warnings
import click
import fiona as fio
from fiona.transform import transform_geom
import numpy as np
import rasterio as rio
from rasterio.features import rasterize
from shapely.... | {
"content_hash": "6633174b3083d8849f4351f00e62fb3b",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 93,
"avg_line_length": 30.525547445255473,
"alnum_prop": 0.580703012912482,
"repo_name": "geowurster/Geoprocessing-Examples",
"id": "933aecfa0387f6ad3889c92bc7915486128e6529... |
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
from urllib.parse import parse_qs, urljoin, urlparse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotF... | {
"content_hash": "93b2508cc6ba971523af5b719f476552",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 117,
"avg_line_length": 44.19642857142857,
"alnum_prop": 0.6484848484848484,
"repo_name": "Azure/azure-sdk-for-python",
"id": "eda95b8d8884dba910517bcdba7e2ef7534dca85",
"... |
from .annotation_payload import (
AnnotationPayload,
)
from .annotation_spec import (
AnnotationSpec,
)
from .classification import (
ClassificationAnnotation,
ClassificationEvaluationMetrics,
VideoClassificationAnnotation,
ClassificationType,
)
from .column_spec import (
ColumnSpec,
)
from ... | {
"content_hash": "e03f31f55ffb898cdeca3cd10144845d",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 50,
"avg_line_length": 25.224422442244226,
"alnum_prop": 0.7440795499149548,
"repo_name": "googleapis/python-automl",
"id": "d7edffcb250265166df1dba0f7d500cdb59af199",
"si... |
"""Mock tests
Unit tests for the Mocks.
"""
from __future__ import absolute_import
__author__ = "jcgregorio@google.com (Joe Gregorio)"
import os
import unittest
import httplib2
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError, UnexpectedBodyError, UnexpectedMethodError
from ... | {
"content_hash": "c13c4c6c8a58757f832888e833a0be03",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 88,
"avg_line_length": 29.323383084577113,
"alnum_prop": 0.5130641330166271,
"repo_name": "googleapis/google-api-python-client",
"id": "1f542b594c4323104f9d7f3e43b0eda95ddc4... |
import argparse
import os
import subprocess
import sys
def setup():
global args, workdir
programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget']
if args.kvm:
programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils']
elif args.docker:
dockers = ['docker.io', 'docker-ce']
fo... | {
"content_hash": "c9529e49e3556f583968cdad1aeba007",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 232,
"avg_line_length": 57.93119266055046,
"alnum_prop": 0.6428062396072531,
"repo_name": "digibyte/digibyte",
"id": "d188da11728730b8c159683b31822d71592adac8",
"size": "1... |
def noop(*args):
pass
def dumpmesg():
print "Hi!"
# Try canceltimer with a handle, expects failure
def tryjunk(handle):
try:
canceltimer(handle)
except:
pass
else:
print "Expected canceltimer to fail with handle:",handle
if callfunc == "initialize":
# Try to set 2 timers
handle1 = settimer(... | {
"content_hash": "1fc7038f5df3000a518186d764a3ef7f",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 96,
"avg_line_length": 23.472727272727273,
"alnum_prop": 0.6955848179705655,
"repo_name": "sburnett/seattle",
"id": "94ab3434107aae69a86cd9e5fd90b7b84a90cbce",
"size": "151... |
__author__ = 'Amin'
class MouseButton:
def __init__(self):
self.previous_x = 0
self.previous_y = 0
self.is_pressed = False
def update_previous_location(self, x, y):
self.previous_x = x
self.previous_y = y
def get_previous_location_x(self):
return self.prev... | {
"content_hash": "d3b597b8a5583f999e1e8bd17e1c5c10",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 47,
"avg_line_length": 24,
"alnum_prop": 0.5905172413793104,
"repo_name": "Michal-Fularz/database_marking_tool",
"id": "8f0f9682e167e9d4322aa1b4523a9fcc334e0384",
"size": "... |
import numpy as np
import tensorflow as tf
from dnc.controller import BaseController
"""
A 2-Layers feedforward neural network with 128, 256 nodes respectively
"""
class FeedforwardController(BaseController):
def network_vars(self):
initial_std = lambda in_nodes: np.min(1e-2, np.sqrt(2.0 / in_nodes))
... | {
"content_hash": "1b5befb19f1941ee76e4c6632c3c4e37",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 141,
"avg_line_length": 38.891304347826086,
"alnum_prop": 0.6383454443823365,
"repo_name": "Mostafa-Samir/DNC-tensorflow",
"id": "608daadc4ae54ad8330b8ee2338377bc48f7e3bf",
... |
"""`get_route` returns a Manhattan route between two ports.
`get_route` only works for an individual routes. For routing groups of ports you need to use `get_bundle` instead
To make a route, you need to supply:
- input port
- output port
- bend
- straight
- taper to taper to wider straights and reduce straight ... | {
"content_hash": "74db1770f016df5e7e3952df7fd2c7f9",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 113,
"avg_line_length": 28.567901234567902,
"alnum_prop": 0.6211106309420916,
"repo_name": "gdsfactory/gdsfactory",
"id": "a1084253f5565940d2e30d294452ecaf483f6c56",
"size... |
from os import environ as env
import datetime
import pytz
# dev mode?
DEBUG = env.get("FLASK_ENV", "development") != "production"
TEST = env.get("FLASK_ENV") == "test"
DEBUG_CACHE = env.get("FLASK_DEBUG_CACHE", "false") == "true"
RUN_PERIODIC_TASKS = env.get("RUN_PERIODIC_TASKS") == "true"
WTF_CSRF_ENABLED = False ... | {
"content_hash": "0ffba6420d811916e08b61fb7c3fe41b",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 92,
"avg_line_length": 32.29370629370629,
"alnum_prop": 0.7039844088349935,
"repo_name": "Code4SA/pmg-cms-2",
"id": "1c7c4ae194435af3d87ce462e7e34c71496793b3",
"size": "46... |
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'ironic_inventory.api.controllers.root.RootController',
'modules': ['ironic_inventory'],
'static_root': '%(confdir)s/../../public',
'template_path': '%(confdir)s/../templates',
'debug': True,
... | {
"content_hash": "f37bb5feda9cf83fb54bfc1693dff4b0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 67,
"avg_line_length": 22.75,
"alnum_prop": 0.5860805860805861,
"repo_name": "softlayer/ironic-inventory-integrator",
"id": "b0ed831f32972767271a96e07d5ed2bece2f420a",
"siz... |
"""createNewDatabase.py: Creates new database in the R2DM service."""
__author__ = "Filip Lemic"
__copyright__ = "Copyright 2015, EVARILOS Project"
__version__ = "1.0.0"
__maintainer__ = "Filip Lemic"
__email__ = "lemic@tkn.tu-berlin.de"
__status__ = "Development"
import sys
import urllib2
import json
# The URL whe... | {
"content_hash": "c39ae78c0a335d188bd87ae43037aa8e",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 125,
"avg_line_length": 25.541666666666668,
"alnum_prop": 0.6949429037520392,
"repo_name": "evarilos/R2DM-EVARILOS",
"id": "26703e509eb067e3267ac2f4eb1e1c4f12f8fa4e",
"size... |
from django.apps import AppConfig
class cookie_app_Config(AppConfig):##change the verbose name of cookie_app
name = 'cookie_app'
verbose_name = "Business Database" | {
"content_hash": "4fa712c74170e586b20a0dae1f66549e",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 74,
"avg_line_length": 34.4,
"alnum_prop": 0.75,
"repo_name": "nathanielbecker/business-contacter-django-app",
"id": "db6499f740adfffe1076f1e4848055de94ce3376",
"size": "172... |
import argparse
import json
import os
import re
import zipfile
import torch
####################################################################################################
def recursive_print(name, val, spaces=0):
# Format the message.
if name is None:
msg = None
else:
fmt = "." * ... | {
"content_hash": "9b4acca39c576a7ffa98da2626d945fa",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 110,
"avg_line_length": 35.72874493927125,
"alnum_prop": 0.5858356940509915,
"repo_name": "huggingface/pytorch-transformers",
"id": "3d7f03dcbb767c5ecb53c6dfa00f5b6e9c063757... |
import asyncio
import logging
log = logging.getLogger(__name__)
class Coworker(object):
""" Generic worker to perform concurrent tasks using coroutine IO loop. """
def __init__(self, max_concurrency=10, sliding_window=True):
"""
Initialize worker
:param int max_concurrency: How man... | {
"content_hash": "2763ae2969a7f78f4ee1fb1e49145cc9",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 118,
"avg_line_length": 34.78512396694215,
"alnum_prop": 0.5927773818009028,
"repo_name": "maxzheng/coworker",
"id": "04faf042068807e5a025b2161a408ec2ce8fd7cb",
"size": "8... |
from juju.client.facade import Type, ReturnMapping
from juju.client.old_clients._definitions import *
class UniterFacade(Type):
name = 'Uniter'
version = 18
schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False,
'properties': {'serve... | {
"content_hash": "70430ffb33c859382d06e481fbd64a2a",
"timestamp": "",
"source": "github",
"line_count": 3918,
"max_line_length": 192,
"avg_line_length": 54.59060745278203,
"alnum_prop": 0.3822737346062856,
"repo_name": "juju/python-libjuju",
"id": "43c5c9a04201aff1e9507d715559f4195c0fe994",
"size":... |
import datetime
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Sum
from django.db.models.functions import ExtractYear
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from django.views.generic import ListView
from clarityv2.... | {
"content_hash": "df31d80980e2fab6960ca3ddf7676391",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 100,
"avg_line_length": 40.58139534883721,
"alnum_prop": 0.642406876790831,
"repo_name": "Clarity-89/clarityv2",
"id": "580c548b4ec38f9869e83bfb98da3d1f33cf9d96",
"size": "... |
from __future__ import absolute_import, unicode_literals
import os
from django.utils.translation import ugettext_lazy as _
######################
# MEZZANINE SETTINGS #
######################
# The following settings are already defined with default values in
# the ``defaults.py`` module within each of Mezzanine's a... | {
"content_hash": "148f77ee74eed7571b7d47fa8845213b",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 79,
"avg_line_length": 35.38622754491018,
"alnum_prop": 0.6948980455199255,
"repo_name": "gungorbudak/evrimagaciorg",
"id": "67b9977c220a34643b9cb12d9f06ce32b6fccc96",
"si... |
from bisect import bisect
import hashlib
from math import ceil
import sys
if sys.version_info[0] >= 3:
_ord = lambda x: x
else:
_ord = ord
class NodeRing(object):
def __init__(self, nodes, weights=None, virtual_count=None):
assert nodes
self.ring = {}
self.sorted_keys = []
... | {
"content_hash": "d4ea5895cf6a213ae16c0189a594782c",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 95,
"avg_line_length": 30,
"alnum_prop": 0.5985507246376811,
"repo_name": "tobgu/qcache-client",
"id": "28ebe7dea9b068f9d8d9c96341a2b12be481dd21",
"size": "2070",
"binary... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
from .utils import ensure_asyncio
ensure_asyncio()
import asyncio
from .ddp_client import DDPClient
from .pubsub.future import Future
__all__ = ['ConcurrentDDPClient']
class ConcurrentDDPC... | {
"content_hash": "e10f79786b2e28e6df609c84b2f8d231",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 73,
"avg_line_length": 27.523809523809526,
"alnum_prop": 0.5963091118800461,
"repo_name": "foxdog-studios/pyddp",
"id": "223f45d1c15f74969bccb6790f811d42f303aa9e",
"size": ... |
import math
import time
from monotonic import monotonic as _now
class SpeedLimit(object):
"""Speed/limiting iterator wrapper object.
A wrapper object that uses the `token bucket`_ algorithm to limit the
rate at which values comes out of an iterable. This can be used to limit
the consumption speed of... | {
"content_hash": "f2eae0f77fcf6f2e3dc31a1958eeea6b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 40.50704225352113,
"alnum_prop": 0.5458970792767733,
"repo_name": "harlowja/speedlimit",
"id": "0d68511048da9c739fafea84c298cfc663e38b5d",
"size": "3... |
from vsa.model.extent import Extent
from vsa.infra.infra import printsz, txt2size, tstint
from vsa.infra.params import ObjState
class SanVolume(Extent):
child_obj=['inluns']
set_params=Extent.set_params+['size','dr','stripes','stripesize']
newonly_fields=['readahead','stripes','stripesize']
#show_colum... | {
"content_hash": "f6eee0ec8fa293e711b0248bf13288b8",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 171,
"avg_line_length": 32.614583333333336,
"alnum_prop": 0.525710635579687,
"repo_name": "mellanox-openstack/vsa",
"id": "103416e906397f0ed78c9b9ba4218219f83b9e0d",
"size... |
"""Fichier contenant le contexte d'édition d'une carte d'étendue d'eau."""
import re
from primaires.interpreteur.contexte import Contexte
# Constantes
RE_SIMPLE_REL = re.compile(r"^([A-Pa-p])([0-9]+)")
RE_SIMPLE_ABS = re.compile(r"^(-?[0-9]+)\.(-?[0-9]+)")
class CarteEtendue(Contexte):
"""Contexte permettant ... | {
"content_hash": "cfa91f37e59a5ce9def3b4d91945f1e1",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 79,
"avg_line_length": 33.68111455108359,
"alnum_prop": 0.49646107178968657,
"repo_name": "stormi/tsunami",
"id": "4660de60ece1d4bab6a69594f4b6d3968f548251",
"size": "1250... |
from __future__ import print_function
from cloudmesh.util.config import read_yaml_config
from cloudmesh.config.cm_config import cm_config_server
from cloudmesh.provisioner.baremetal_status import BaremetalStatus
import requests
import json
from time import sleep
import threading
from cloudmesh_base.logger import LOGGE... | {
"content_hash": "6f7d61a32aa7b3921b36ca38c7c75573",
"timestamp": "",
"source": "github",
"line_count": 452,
"max_line_length": 211,
"avg_line_length": 43.075221238938056,
"alnum_prop": 0.6029275808936826,
"repo_name": "rajpushkar83/cloudmesh",
"id": "317010d38344a04c5fda5afac329359666064a56",
"siz... |
"""Script to evaluate a dataset fold under a model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from magenta.models.coconet import lib_data
from magenta.models.coconet import lib_evaluation
from magenta.models.coconet import lib_graph
from ... | {
"content_hash": "a2a85de5a150c3b111e6a7e26fd7a2b0",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 80,
"avg_line_length": 40.82802547770701,
"alnum_prop": 0.672386895475819,
"repo_name": "adarob/magenta",
"id": "6003e9c7bf9569028d9df4ab34f78a0968b1c310",
"size": "6995",... |
from oslo_log import log as logging
from designate import exceptions
from designate import utils
from designate.schema import validators
from designate.schema import resolvers
from designate.schema import format
LOG = logging.getLogger(__name__)
class Schema(object):
def __init__(self, version, name):
s... | {
"content_hash": "08e52f98b6c13dcebc0012617dca2aeb",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 76,
"avg_line_length": 33.08571428571429,
"alnum_prop": 0.581174438687392,
"repo_name": "cneill/designate",
"id": "fe0fc7089b7facf0933e04f1ef92922457fe5557",
"size": "4100... |
u"""F5 Networks® LBaaSv2 Driver Implementation."""
# Copyright (c) 2016-2018, F5 Networks, 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.... | {
"content_hash": "3c9352c818e49ec79c43456d58b5d053",
"timestamp": "",
"source": "github",
"line_count": 573,
"max_line_length": 78,
"avg_line_length": 36.05584642233857,
"alnum_prop": 0.5998547918683447,
"repo_name": "jputrino/f5-openstack-lbaasv2-driver",
"id": "1a7bac7a5fc998e40d0864bf8ebc0d352201d... |
from __future__ import print_function
import os
import numpy as np
np.random.seed(1234) # for reproducibility?
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import lasagne
os.environ["THEANO_FLAGS"] = "cuda.root=/usr/local/cuda,device=gpu,float... | {
"content_hash": "16512e0d932c9c744351c72c65638dd2",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 152,
"avg_line_length": 39.625,
"alnum_prop": 0.6382201560684044,
"repo_name": "matthijsvk/multimodalSR",
"id": "86c7c093ba7dda0fa44db0f71ab16d2f768cac25",
"size": "12046"... |
import re
import inspect
from pymongo import MongoClient
class MongoDBService(object):
ID_FIELD = "_id"
KEY_FUNC = "unique_key"
def __init__(self, db_uri=""):
self.client = MongoClient(db_uri if db_uri else "mongodb://localhost:27017/default")
def get_collection(self, cls_or_instance):
... | {
"content_hash": "693ecd818a5043f2b4a37ce05f45d454",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 92,
"avg_line_length": 32.38235294117647,
"alnum_prop": 0.555858310626703,
"repo_name": "icoxfog417/kanaria",
"id": "c1d5779cecd64929027cfa0be9abc458d38fafb8",
"size": "220... |
from boto.connection import AWSAuthConnection
from boto.exception import BotoServerError
import boto
import boto.jsonresponse
import urllib
import base64
class SESConnection(AWSAuthConnection):
ResponseError = BotoServerError
DefaultHost = 'email.us-east-1.amazonaws.com'
APIVersion = '2010-12-01'
d... | {
"content_hash": "43484d28cb753bf1a93ac03553071536",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 115,
"avg_line_length": 37.94982078853047,
"alnum_prop": 0.5917075935020778,
"repo_name": "canvasnetworks/canvas",
"id": "ec1f881d03a83a86658c7d6de59d8d700068f001",
"size"... |
''' COSMO-VIEW
Script: drawing.py
Changes:
J. Ballabrera, December 2017
EGL, 06/2020:
No more support to python 2.7
Support to Basemap deprecated and updated to cartopy
A consola can be added to the main window (it requires
to change all prints and use instead the tools.toconsola()
functio... | {
"content_hash": "a3a44aef3495d6ee52efe3973f6c0049",
"timestamp": "",
"source": "github",
"line_count": 13185,
"max_line_length": 266,
"avg_line_length": 36.009859689040574,
"alnum_prop": 0.5715495271593757,
"repo_name": "quimbp/cosmo",
"id": "52c2c4a78f36ed7d30921663c4c64b1b19233a1a",
"size": "474... |
from __future__ import division, print_function, unicode_literals
import os
DEBUG = True
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
},
}
LANGUAGE_CODE =... | {
"content_hash": "16097deab778613b6867a2ec82458748",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 23.6,
"alnum_prop": 0.6412429378531074,
"repo_name": "theeluwin/mashiro",
"id": "05f1c6ba07b83cda8013f56cb5d37f571f65a103",
"size": "379",
"binary"... |
"""
Check to see if this program is a valid program for the iocc
2) The size of your program source must be <= 4096 bytes in length.
The number of characters excluding whitespace (tab, space,
newline, formfeed, return), and excluding any ; { or } immediately
followed by whitespace or end of fi... | {
"content_hash": "802edd98736baf37ffeed31a61de5aef",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 73,
"avg_line_length": 25.927272727272726,
"alnum_prop": 0.5638148667601683,
"repo_name": "ncw/ioccc2012",
"id": "89fae477bfabbb36df7a327b728effe7d96f5ca6",
"size": "1444",... |
from ajenti.api import plugin
from ajenti.plugins.dashboard.api import ConfigurableWidget
from ajenti.ui import on
from api import ServiceMultiplexor
@plugin
class ServiceWidget (ConfigurableWidget):
name = _('Service')
icon = 'play'
def on_prepare(self):
self.mgr = ServiceMultiplexor.get()
... | {
"content_hash": "96ca2f8b1a937e7f4d753ecd65922b8a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 88,
"avg_line_length": 29.294117647058822,
"alnum_prop": 0.6224899598393574,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "7f6e588b1f6c8224e273be9b286e2d8aeb81a2ef",
"siz... |
import sys
sys.path.insert(0, '../..')
import test_harness
test_harness.register_generic_assembly_tests(['memory_test.S'], ['fpga'])
test_harness.execute_tests()
| {
"content_hash": "430bb6c6f0afc7e0d4c564c4a5e1e246",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 73,
"avg_line_length": 23.428571428571427,
"alnum_prop": 0.7134146341463414,
"repo_name": "jbush001/NyuziProcessor",
"id": "9e8b39c1109f8a74e501cee464e2f19789807bbf",
"size"... |
"""
Title: Semi-supervised image classification using contrastive pretraining with SimCLR
Author: [András Béres](https://www.linkedin.com/in/andras-beres-789190210)
Date created: 2021/04/24
Last modified: 2021/04/24
Description: Contrastive pretraining with SimCLR for semi-supervised image classification on the ST... | {
"content_hash": "6b2b789271ee30343c6f613005a2105d",
"timestamp": "",
"source": "github",
"line_count": 665,
"max_line_length": 129,
"avg_line_length": 41.65263157894737,
"alnum_prop": 0.7004585003068703,
"repo_name": "keras-team/keras-io",
"id": "c6d48337523219cf375d6ac8192b9b92b6a3af73",
"size": ... |
import io
import os
from os.path import join as pjoin
from setuptools import setup, find_packages
def get_version(file, name='__version__'):
"""Get the version of the package from the given file by
executing it and extracting the given `name`.
"""
path = os.path.realpath(file)
version_ns = {}
... | {
"content_hash": "9cb17377ceef3dcea8bcfe73cc1bd709",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 60,
"avg_line_length": 23.52,
"alnum_prop": 0.6224489795918368,
"repo_name": "yarden-livnat/regulus",
"id": "b7c966edaccd17f3578cb626995becb01cd04620",
"size": "1198",
"b... |
import os
from webtest import TestApp
import tg
import tests
from tg.util import DottedFileNameFinder
from tg.configuration import AppConfig
class TestConfig(AppConfig):
def __init__(self):
AppConfig.__init__(self)
self.renderers = ['json', 'genshi', 'mako']
tg.config['renderers'] = ['json... | {
"content_hash": "a4bee8ecf18cb023fbe02bca07126239",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 36.608695652173914,
"alnum_prop": 0.5542359461599367,
"repo_name": "TurboGears/tgext.admin",
"id": "b1ddecf958033cedbafc249c6315271cdebc2ee0",
"size"... |
"""
WSGI config for rwf project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
import sys
from django.core.wsgi import get_wsgi_application
# This allows easy placemen... | {
"content_hash": "8c3a993cec57b3645b28e7a2f707bedd",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 80,
"avg_line_length": 28.045454545454547,
"alnum_prop": 0.7504051863857374,
"repo_name": "ianmilliken/rwf",
"id": "6bf97ec05b155ab14c88278aedeacf8dc3ffacf9",
"size": "617"... |
from django.conf.urls import url
#from discounts.views import SolicitarDescuentoView
from discounts.views import CrearSolicitudView
from discounts.views import TipoDescuentoCreateView
from discounts.views import AprobarDescuentoView
from discounts.views import DetalleDescuentoView
from discounts.views import TipoDescue... | {
"content_hash": "23787714cb99afe8baf51091812115d0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 112,
"avg_line_length": 59.23809523809524,
"alnum_prop": 0.7781350482315113,
"repo_name": "furthz/colegio",
"id": "f8fab0a9c0678f4291730fffa7d90476cd2c0d90",
"size": "1244"... |
from rpython.jit.metainterp.test.test_recursive import RecursiveTests
from rpython.jit.backend.ppc.test.support import JitPPCMixin
class TestRecursive(JitPPCMixin, RecursiveTests):
# for the individual tests see
# ====> ../../../metainterp/test/test_recursive.py
pass
| {
"content_hash": "48fcaa913fd15ab6e7a4293b626c9948",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 40.142857142857146,
"alnum_prop": 0.7580071174377224,
"repo_name": "jptomo/rpython-lang-scheme",
"id": "84fa0baeaec92be3893a748e979f05d718fb56ed",
"si... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AuthProfile'
db.create_table(u'fastapp_authprofile', (
(u'id', self.gf('django.db.models.fields.AutoFiel... | {
"content_hash": "a9e2c14cf9f59a3e721d23155d43067d",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 187,
"avg_line_length": 62.211009174311926,
"alnum_prop": 0.5617165609792066,
"repo_name": "fatrix/django-fastapp",
"id": "86c21629f0dddfab6dd71f691a5fbacdf24c303d",
"size... |
import sys
import webbrowser
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
HandlerClass = SimpleHTTPRequestHandler
ServerClass = BaseHTTPServer.HTTPServer
Protocol = "HTTP/1.0"
if sys.argv[1:]:
port = int(sys.argv[1])
else:
port = 10960
server_address = ('127.0.0.1', port)
Handle... | {
"content_hash": "72a21d42441cfcbea2fceba1909bcb5a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 53,
"avg_line_length": 27,
"alnum_prop": 0.7425044091710759,
"repo_name": "Revolution1/ID_generator",
"id": "9bf6bf9193c600c3957d46339562396fc25df2f0",
"size": "567",
"bi... |
"""
Cloud Controller: Implementation of EC2 REST API calls, which are
dispatched to other nodes via AMQP RPC. State is via distributed
datastore.
"""
import base64
import time
from oslo.config import cfg
from nova.api.ec2 import ec2utils
from nova.api.ec2 import inst_state
from nova.api.metadata import password
from... | {
"content_hash": "9d7dfa6f83a502999993e9c920e4576b",
"timestamp": "",
"source": "github",
"line_count": 1708,
"max_line_length": 79,
"avg_line_length": 43.290983606557376,
"alnum_prop": 0.5494515897810417,
"repo_name": "gspilio/nova",
"id": "0d06dde33db916e6c0563c087404b4b2f9063e12",
"size": "74718... |
"""
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | {
"content_hash": "e3cc12d11a5399624fe9e3fc9978ae06",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 75,
"avg_line_length": 26.925925925925927,
"alnum_prop": 0.6263182026593306,
"repo_name": "DailyActie/Surrogate-Model",
"id": "d9c64cdc37c1e64f7135543ef2eb9fe0db6e537e",
"s... |
"""Support for Tasmota sensors."""
from __future__ import annotations
from datetime import datetime
from typing import Any
from hatasmota import const as hc, sensor as tasmota_sensor, status_sensor
from hatasmota.entity import TasmotaEntity as HATasmotaEntity
from hatasmota.models import DiscoveryHashType
from homea... | {
"content_hash": "ba468a8f4499be197573d5dc23748c2b",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 93,
"avg_line_length": 34.59561128526646,
"alnum_prop": 0.6629213483146067,
"repo_name": "home-assistant/home-assistant",
"id": "ece45b9dfd75a1e501484cf5dfa0b457b689f138",
... |
import ConfigParser
import os
class OccamConfig:
def __init__(self, fn=None):
self._cfg = ConfigParser.SafeConfigParser(allow_no_value=True)
if not (fn is None):
self._cfg.read(fn)
def getRoot(self):
if self._cfg.has_section('fs') and self._cfg.has_option('fs', 'root'):
... | {
"content_hash": "c4e696298c1273f9fe3fc2649529c292",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 78,
"avg_line_length": 26.9672131147541,
"alnum_prop": 0.5781155015197569,
"repo_name": "Wajihulhassan/SelfContainedPrevirt",
"id": "1664c7e0bce2c4fbc70342fea7db33c2b280d6a7"... |
"""
"""
from xml.sax import make_parser
from xml.sax.handler import ErrorHandler
from xml.sax.saxutils import handler, quoteattr, escape
from urlparse import urljoin, urldefrag
from rdflib.namespace import RDF
from rdflib.term import URIRef
from rdflib.term import BNode
from rdflib.term import Literal
from rdflib.exce... | {
"content_hash": "40b54c779519269791ec14a6fc52d5b7",
"timestamp": "",
"source": "github",
"line_count": 543,
"max_line_length": 103,
"avg_line_length": 36.98526703499079,
"alnum_prop": 0.5575362246676293,
"repo_name": "alcides/rdflib",
"id": "6376f594119067c73ba98a3308faafbf419ff156",
"size": "2163... |
from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ
from zerver.models import UserProfile
from zerver.lib.validator import check_int
from zerver.lib.response import json_success
from zerver.lib.attachments import user_attachments, remove_attachment, \
access_attachment_by_id
def li... | {
"content_hash": "832059d45f8ed1c26fc3ce456ba1ed8a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 74,
"avg_line_length": 39.19047619047619,
"alnum_prop": 0.732685297691373,
"repo_name": "amanharitsh123/zulip",
"id": "c4f0d598d68d5ebe79ff29815aa699b6f5edb4e3",
"size": "8... |
"""
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import sys
import warnings
from collections import OrderedDict, deque
from django.conf import settings
from django.core import exceptions
from django.db import (
DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ... | {
"content_hash": "ed4b47871535ba07715a468c21e9f965",
"timestamp": "",
"source": "github",
"line_count": 1747,
"max_line_length": 115,
"avg_line_length": 40.66227819118489,
"alnum_prop": 0.5881723608823571,
"repo_name": "koniiiik/django",
"id": "ee59103017a6aad4fd040dbdcc24da6ac59cfdd6",
"size": "71... |
from PySide import QtCore, QtGui
import webbrowser
import FloatGetter
from totp import generateAuthCode
import time
from gevent import sleep
from collections import OrderedDict
from decimal import Decimal
import sys
from errno import WSAEHOSTUNREACH
from socket import error as socket_error
import itemIndex
sys.setrec... | {
"content_hash": "7ae4383a83220f13b13b3751ea2953ea",
"timestamp": "",
"source": "github",
"line_count": 1226,
"max_line_length": 281,
"avg_line_length": 50.41598694942904,
"alnum_prop": 0.6514479857628216,
"repo_name": "adamb70/CSGO-Market-Float-Finder",
"id": "06d9806f2200031e5ca0247f9b60341664b05a9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.