text stringlengths 2 999k |
|---|
################################################################################################################################
# *** Copyright Notice ***
#
# "Price Based Local Power Distribution Management System (Local Power Distribution Manager) v1.0"
# Copyright (c) 2016, The Regents of the University of Calif... |
"""Yearly sunspots data 1700-2008"""
from sm2.datasets import utils as du
__docformat__ = 'restructuredtext'
COPYRIGHT = """This data is public domain."""
TITLE = __doc__
SOURCE = """
http://www.ngdc.noaa.gov/stp/solar/solarda3.html
The original dataset contains monthly data on sunspot activity in the file
./src/sun... |
__all__ = ["SNSTopic"]
from .api import SNSTopic # noqa
|
""" Implementation of the command line interface.
"""
import pprint
from argparse import ArgumentParser
from sanic.log import logger
from ci_hooks_app import __version__
from ci_hooks_app.config import config
def main(argv=None):
""" Execute the application CLI.
:param argv: argument list to parse (sys.ar... |
import pytest
from schemathesis import fixups
def test_global_fixup(testdir, fast_api_schema):
# When all fixups are enabled globally
testdir.makepyfile(
"""
import schemathesis
from hypothesis import settings
schemathesis.fixups.install()
schema = schemathesis.from_dict({schema})
def teardown_modu... |
#===============================================
# Written by enddl22@gmail.com on 7/Jun/2019
# Extracting images from a bag file
#===============================================
from __future__ import print_function
import os,sys
import argparse
from ros import rosbag
#import roslib
import rospy
from sensor_msgs.... |
import torch
from torch import nn
import MinkowskiEngine as ME
from mmdet.core import BaseAssigner, reduce_mean, build_assigner
from mmdet.models.builder import HEADS, build_loss
from mmdet.core.bbox.builder import BBOX_ASSIGNERS
from mmcv.cnn import Scale, bias_init_with_prob
from mmdet3d.core.bbox.structures import ... |
import maya.mel as mm
import maya.cmds as mc
import glTools.nrig.rig.mocap
import glTools.nrig.rig.bipedMocap
import glTools.utils.characterSet
import glTools.utils.clip
import glTools.utils.reference
import os
import os.path
def createMocapClipsFromFbxWip(sourceDir,targetDir,skipUpToDate=False,skipExistsing=False)... |
# -*- coding: utf-8 -*-
import requests
from openprocurement.integrations.edr.timeout_handler import TimeoutHandler
from logging import getLogger
logger = getLogger(__name__)
class EdrClient(object):
"""Base class for making requests to EDR"""
def __init__(self, host, token, port=443, timeout_min=1, timeout... |
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Simple PB Words client demo
This connects to a server (host/port specified by argv[1]/argv[2]),
authenticates with a username and password (given by argv[3] and argv[4]),
joins a group (argv[5]) sends a simple message, ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 18 22:51:57 2016
@author: yxl
"""
# -*- coding: utf-8 -*
import scipy.ndimage as ndimg
import numpy as np
from imagepy.core.engine import Filter
from skimage.morphology import convex_hull_object
class Closing(Filter):
"""Closing: derived from imagepy.core.engine.Fil... |
from typing import List, Union
from ..utils import get, post
BASE_URL = "https://api.live.bilibili.com"
async def get_rooms_info_by_uids(
uids: List[Union[int, str]], *, auth=None, reqtype="both", **kwargs
):
"""根据 UID 批量获取直播间信息"""
url = f"{BASE_URL}/room/v1/Room/get_status_info_by_uids"
data = {"ui... |
"""
全局变量local_school就是一个ThreadLocal对象,每个Thread对它都可以读写student属性,但互不影响。
你可以把local_school看成全局变量,但每个属性如local_school.student都是线程的局部变量,
可以任意读写而互不干扰,也不用管理锁的问题,ThreadLocal内部会处理。
"""
#解决线程间变量相互影响的问题
import threading
thread_local =threading.local()
class Student(object):
def __init__(self,name):
self.name=name... |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# 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 ... |
{% block meta %}
name: StateMachine
description: SMACH template containing code common to all state templates.
language: Python
framework: SMACH
type: None
tags: [core]
includes: []
extends: []
variables: []
input_keys: []
output_keys: []
{% endblock meta %}
{% from "Utils.tpl.py" import render_input_keys, render_outp... |
# -*- coding: utf-8 -*-
'''
Manage RabbitMQ Virtual Hosts
=============================
Example:
.. code-block:: yaml
virtual_host:
rabbitmq_vhost.present:
- user: rabbit_user
- conf: .*
- write: .*
- read: .*
'''
from __future__ import absolute_import
# I... |
# coding=utf-8
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import os
import re
from builtins import open
from pants.backend.native.conf... |
import things
import unittest
from queue import Queue
class TestPutOperator(unittest.TestCase):
def test_put(self):
'''
Send a message to an actor using the put sugar syntax.
'''
# use a queue
queue = Queue()
message = "hello world"
class Actor(things.Acto... |
import os
import pickle
import time
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 13})
plt.rcParams['figure.figsize'] = 10, 8
def prRed(prt): print("\033[91m {}\033[00m" .format(prt))
def prGreen(prt): print("\033[92m {}\033[00m" .format(prt))
def prYellow(prt): print("\033[93m {}\033[00m" .format... |
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
## SPDX-License-Identifier: MIT-0
import boto3
from botocore.client import Config
import os
import io
class AwsHelper:
def getClient(self, name, awsRegion=None):
config = Config(
retries = dict(
max_attempts... |
from django.db import models
from django.contrib.auth.models import User
import PIL.Image
from django.urls import reverse
from cloudinary.models import CloudinaryField
# Create your models here.
class Image(models.Model):
''' a model for Image posts '''
image = CloudinaryField('image')
caption = models.Tex... |
# Copyright (c) 2017 Huawei, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from hierarkey.forms import HierarkeyForm
from i18nfield.forms import I18nFormMixin, I18nModelForm
from pretalx.common.mixins.forms import ReadOnlyFlag
from pretalx.submission.models import AnswerOption, CfP, Question, SubmissionType, Tra... |
# Copyright 2020 Huawei Technologies Co., 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... |
# model settings
model = dict(
type='GFL',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style... |
"""
Django settings for harmonization_project project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""... |
#!/usr/bin/python
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "l... |
from json import JSONEncoder
class BaseContext(JSONEncoder):
def __init__(self):
super(BaseContext, self).__init__()
self.instance = None
def __repr__(self):
if self.instance is not None:
return self.instance.__repr__()
else:
return ""
def json(se... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-23 08:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('echobot', '0001_initial'),
]
operations = [
... |
#!/usr/bin/env python3
import requests, argparse
from datetime import datetime
from AMPConfig import APIKey, ClientID
# Add the argument parsers and help menu
ap = argparse.ArgumentParser(add_help=False)
ap.add_argument("-h", "--help", action="help", default=argparse.SUPPRESS,
help="Shows this help me... |
'''
--- Day 6: Chronal Coordinates ---
The device on your wrist beeps several times, and once again you feel like you're falling.
"Situation critical," the device announces. "Destination indeterminate. Chronal interference detected. Please specify new target coordinates."
The device then produces a list of coordinat... |
from __future__ import unicode_literals
from java.util import EventListener
_wrapperClassMap = {} # event interface name -> wrapper class
def _noOp(self, event):
pass
def _createListenerWrapper(eventInterface, eventNames, listener, args, kwargs,
removeMethod):
eventNames = ((ev... |
#! /usr/bin/env python3
import os
import re
import sys
import sysconfig
import platform
import subprocess
from distutils.version import LooseVersion
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
from setuptools.command.test import test as TestCommand
from shu... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Identity(nn.Module):
def __init__(self, channel):
super(Identity, self).__init__()
def forward(self, x):
return x
class MobileBottleneck(nn.Module):
def __init__(self, exp, se=False):
super(MobileBottleneck... |
"""TensorFlow V1 API __init__.py files."""
# keep sorted
TENSORFLOW_API_INIT_FILES_V1 = [
# BEGIN GENERATED FILES
"__init__.py",
"app/__init__.py",
"audio/__init__.py",
"autograph/__init__.py",
"autograph/experimental/__init__.py",
"bitwise/__init__.py",
"compat/__init__.py",
"confi... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# This is a part of CMSeeK, check the LICENSE file for more information
# Copyright (c) 2018 - 2020 Tuhinshubhra
import cmseekdb.basic as cmseek
import json
def start(version,ua):
if version == "0":
cmseek.warning("Skipping version vulnerability scan as WordPress... |
# /usr/bin/env python
# -*- coding: utf-8 -*-
from loguru import logger
from typing import Union
from pathlib import Path
def repo_status_to_dict(
repodir: Union[Path, str], reponame: str = None, diff: bool = False
):
"""
:param repodir:
:param reponame:
:param diff: Add diff string if true and ... |
import floto
from floto.decider import Decider
import json
class DynamicDecider(Decider):
"""DynamicDecider reads the execution logic defined by activity tasks from the workflow
input."""
def __init__(self, decider_spec, identity=None):
super().__init__(decider_spec=decider_spec, identity=identity... |
import sys
import time
import json
import asyncio
import requests
import urllib3
from PIL import Image
import websockets.legacy.client
from captcha.chaojiying import ChaoJiYing
from captcha.tujian import TuJian
from captcha.jd_captcha import JDcaptcha_base64
from captcha.jd_yolo_captcha import JDyolocaptcha
from utils... |
from sqlalchemy.dialects import registry
registry.register(
"bigquery",
"sqlalchemy_bigquery.pyodbc",
"BigQueryDialect_pyodbc"
)
registry.register(
"bigquery.pyodbc",
"sqlalchemy_bigquery.pyodbc",
"BigQueryDialect_pyodbc"
)
# from sqlalchemy.testing.plugin.pytestplugin import *
|
import tempfile
import shutil
from yenerate import yenerate
from unittest import TestCase, main
class TestYenerate(TestCase):
def setUp(self):
self.root = tempfile.mkdtemp(prefix="yenerate_test")
def tearDown(self):
shutil.rmtree(self.root)
def test_yenerate(self):
output = yene... |
#!/bin/env python
# -*- coding: utf-8 -*-
##
# test_streaming_problem.py: Checks correctness of azure.quantum.StreamingProblem.
##
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
##
import json
from typing import List
from azure.quantum.aio.optimization import (
Probl... |
# Copyright 2018 Mathias Burger <mathias.burger@gmail.com>
#
# SPDX-License-Identifier: MIT
class Layer:
def __init__(self, properties: dict) -> None:
super().__init__()
self.name = properties['name']
self.visible = properties['visible']
self.opacity = float(properties['opacity'])
... |
# Copyright (c) 2018, Arm Limited and affiliates.
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
#... |
from constants import LDA_DIR, FEAT_DATA_DIR
from utils import series_to_str
import pickle
import pandas as pd
from time import time
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
#n_topics = [20, 50, 100]
#n_topics = [10, 30, 50, 70, 90]
n_top... |
from core.composer.chain import Chain
from core.composer.node import NodeGenerator
from core.composer.optimisers.gp_operators import nodes_from_height
from core.repository.model_types_repository import ModelTypesIdsEnum
def chain_example():
# XG
# | \
# XG KNN
# | \ | \
... |
from typing import List
import re
from .types import Components
from .util import need_edition
version_regexp = re.compile(r"Release Version:\s*v?(\S+)", re.IGNORECASE)
hash_regexp = re.compile(r"Git Commit Hash:\s*(\w{40})", re.IGNORECASE)
edition_regexp = re.compile(r"Edition:\s*(Community|Enterprise)")
class Mat... |
from __future__ import annotations
from typing import Type, Optional, List
from Exceptions.BranchHaveDiverged import BranchHaveDiverged
from Exceptions.BranchNotExist import BranchNotExist
from Exceptions.GitMergeConflictError import GitMergeConflictError
from Exceptions.NoBranchSelected import NoBranchSelected
from ... |
# Welcome to your Focus Day Project. Replace this comment with something that introduces the user to your project. Be sure to mention the Focus Day and your initials and graduation year. (ie This game is for Pool Volume Day and is written by ML '23.)
# Also, be sure to use comments throughout your program. Use good pro... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import pandas as pd
from typing import Union
from pathlib import Path
from nameparser import HumanName
class ExtractData:
def __init__(self, filename: Union[str, Path], drop_columns=None):
# """Extract Training Data from file or Path
# Arguments:
# filename {[str]} -- Filename of CSV... |
# Generated by Django 3.2.4 on 2021-06-28 03:42
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... |
import sym_lis2
from sym_lis2 import GlobalEnv as Env
import pytest, mock
'''
@pytest.mark.parametrize("test_input,expected", [
("(+ 1 2)", 3),
("(+ (+ 11 28) 2)", 41),
("(+ (+ 11 28) (* 1 2))", 41),
])
def test_calc1(test_input, expected):
g = Env()
assert g.eval_str(test_input) == expected
'''
... |
from django import forms
from django.forms.models import modelform_factory
from django.utils.translation import ugettext as _
from wagtail.wagtailadmin import widgets
from wagtail.wagtailadmin.forms import (
BaseCollectionMemberForm, collection_member_permission_formset_factory)
from wagtail.wagtailimages.fields i... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyNodeenv(PythonPackage):
"""Node.js virtual environment"""
homepage = "https://githu... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import beanmachine.ppl as bm
from beanmachine.ppl.inference import BMGInference
from torch import tensor
from torch.distrib... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for working with audio data.
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
__all__ = [
'AudioClip',
... |
"""TensorFlow V2 API __init__.py files."""
# keep sorted
TENSORFLOW_API_INIT_FILES = [
# BEGIN GENERATED FILES
"__init__.py",
"audio/__init__.py",
"autograph/__init__.py",
"autograph/experimental/__init__.py",
"autodiff/__init__.py",
"bitwise/__init__.py",
"compat/__init__.py",
"con... |
# -*- coding: utf-8 -*-
# Copyright © 2014, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in section and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from nixio.exceptions.except... |
import os
import shutil
def getTestFontPath(fileName='TestFont.ufo'):
testDirectory = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))), 'testData')
return os.path.join(testDirectory, fileName)
def getTestFontCopyPath(testFontPath=None):
if testFontPath is None:
... |
import unittest
# We have to do some weird stuff to import the file due to the name
import imp
train = imp.load_source('train.5m', 'train.5m.py')
class TestTrain(unittest.TestCase):
def test_can_get_ontime(self):
status = 'On time'
self.assertEqual(train.shorten(status), '0')
def test_can_ge... |
import json
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import EmailMessage
from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redir... |
import os
import sys
import pickle
import argparse
import numpy as np
from numpy.lib.format import open_memmap
training_subjects = [
1, 2, 4, 5, 8, 9, 13, 14, 15, 16, 17, 18, 19, 25, 27, 28, 31, 34, 35, 38
]
training_cameras = [2, 3]
max_body = 2
num_joint = 25
max_frame = 300
toolbar_width = 30
def read_skelet... |
from prelude import *
#! the mean image having a black background is what gives black cats? or maybe its what the encoder learned
#! try to truncate towards the initial cat instead of towards the mean
#! the left half looks good initially. what happens to it?
# todo generic method for fading a mask (gaussian blur?... |
from cereal import car
from selfdrive.car.volkswagen.values import CAR, BUTTON_STATES, CANBUS, NetworkLocation, TransmissionType, GearShifter
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config
from selfdrive.car.interfaces import CarInterfaceBase
E... |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... |
#!/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.
"""Uploads files to Google Storage content addressed."""
import hashlib
import optparse
import os
import Queue
import re
import st... |
from contextlib import contextmanager
import time
@contextmanager
def timeit(name="code-block"):
"""
Execute the codeblock and measure the time.
>> with timeit('name') as f:
>> # Your code block
"""
try:
start = time.time()
yield
finally:
# Execution is over.
... |
# Copyright (c) 2020 Huawei Technologies Co., Ltd.
# foss@huawei.com
#
# 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 requi... |
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The UFO Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of -maxuploadtarget.
* Verify that getdata requests for old blocks (>1week) are dropped
if u... |
from typing import Type, Dict
from easyagents.backends import core as bcore
import easyagents.backends.tfagents
#import easyagents.backends.kerasrl
class BackendAgentFactory(bcore.BackendAgentFactory):
"""Backend which redirects all calls to the some default implementation."""
backend_name = 'default'
d... |
_base_ = 'shufflenet-v1-1x_16xb64_in1k.py'
_deprecation_ = dict(
expected='shufflenet-v1-1x_16xb64_in1k.py',
reference='https://github.com/open-mmlab/mmclassification/pull/508',
)
|
# !/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Filename: models.py
# Project: core
# Author: Brian Cherinka
# Created: Saturday, 12th September 2020 12:55:22 pm
# License: BSD 3-clause "New" or "Revised" License
# Copyright (c) 2020 Brian Cherinka
# Last Modified: Saturday, 12th September 2020 12:55:22 pm
# Modifie... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
def render_graph_testGaussianBlur():
testGaussianBlur = RenderGraph("Gaussian Blur")
DepthPass = RenderPass("DepthPass", {'depthFormat': ResourceFormat.D32Float})
testGaussianBlur.addPass(DepthPass, "DepthPass")
SkyBox = RenderPass("SkyBox")
testGaussianBlur.addPass(SkyBox, "SkyBox")
ForwardLigh... |
from django.urls import path
from .views import DepositMoneyView, WithdrawMoneyView, TransactionRepostView, TransactionForMFB
app_name = 'transactions'
urlpatterns = [
path("<slug:slug>/withdraw-deposit-transactions/", DepositMoneyView.as_view(), name="deposit_money"),
path("<slug:slug>/list/", Transaction... |
"""Test printing ObjC objects that use unbacked properties - so that the static ivar offsets are incorrect."""
from __future__ import print_function
import os
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestObjCIvar... |
from django.contrib import admin
from .models import *
admin.site.register(Drug)
admin.site.register(DrugForm)
admin.site.register(Manufacturer)
admin.site.register(Category)
admin.site.register(Buying)
admin.site.register(Selling)
admin.site.register(SiteConfig)
admin.site.register(GlobalChecker)
admin.site.register... |
import math
import types
import matplotlib.pyplot as P
import numpy as N
def plotres(psr, deleted=False, group=None, **kwargs):
"""Plot residuals, compute unweighted rms residual."""
res, t, errs = psr.residuals(), psr.toas(), psr.toaerrs
if (not deleted) and N.any(psr.deleted != 0):
res, t, er... |
"""
Xena Robot Framework library.
This module should contain ONLY wrapper methods. All logic should be implemented inside xenamanager package.
Wrappers should follow:
- short and meaningful name
- minimal number of parameters and with simple order
- its better to create new wrapper than complicating parameters or add ... |
import asyncio
import io
import logging
import pathlib
from typing import Awaitable, List
import click
from click.exceptions import ClickException
from pandablocks._control import interactive_control
from pandablocks.asyncio import AsyncioClient
from pandablocks.commands import GetState, SetState, T
# Default prompt... |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# 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 requi... |
import json
from pathlib import Path
from blspy import AugSchemeMPL, PublicKeyMPL, SignatureMPL
from chia.util.byte_types import hexstr_to_bytes
from chia.util.hash import std_hash
def validate_alert_file(file_path: Path, pubkey: str) -> bool:
text = file_path.read_text()
validated = validate_alert(text, pu... |
from os import system, getcwd, listdir
from os.path import exists
from sys import argv
import datetime
from colorama import Fore, Back
pwd=getcwd()
currentTime = str(datetime.datetime.now())
def move(src:str, dest:str)->int:
return system(f"mv {src} {dest}")
def checkArgs(minNo:int=-1, maxNo:int=-1)-> tuple:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class MybankCreditSupplychainInventoryOutApplyResponse(AlipayResponse):
def __init__(self):
super(MybankCreditSupplychainInventoryOutApplyResponse, self).__init__()
... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "faceRecog.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportErro... |
"""Emoji
Available Commands:
.support
"""
from telethon import events
import asyncio
from userbot.utils import admin_cmd
@borg.on(admin_cmd("wolfuserbot"))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.1
animation_ttl = range(0,36)
#input_str = event.pattern_match.grou... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# https://msdn.microsoft.com/en-us/library/windows/desktop/ms680383(v=vs.85).aspx
class MINIDUMP_LOCATION_DESCRIPTOR:
def __init__(self):
self.DataSize = None
self.Rva = None
@staticmethod
def parse(buff):
mld = MINIDUMP_LOCATION_DESCRIPTOR()
mld.DataSize = int.from_bytes(buff.read(4), byteorder='little'... |
"""
Retrain the YOLO model for your own dataset.
"""
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from yolo3.model import p... |
import numpy as np
import copy
from mygrid.grid import Section,TransformerModel, Auto_TransformerModel
import pandas as pd
"""
This scripts allows the user to calculate the unbalanced short-circuits on radial distribution
systems modeled on mygrid.
"""
def biphasic(distgrid, node_name, fs='Higher',Df=False, zc=0+0j)... |
"""iWear URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... |
"""
File: annotation.py
Author: Nrupatunga
Email: nrupatunga.s@byjus.com
Github: https://github.com/nrupatunga
Description: Bounding box annotations
"""
import sys
from loguru import logger
try:
from goturn.helper.BoundingBox import BoundingBox
except ImportError:
logger.error('Please run $source settings.sh... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
# Copyright: (c) 2017, Sébastien DA ROCHA <sebastien@da-rocha.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_... |
# Copyright 2020 The TensorTrade Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
import railrl.misc.hyperparameter as hyp
from experiments.murtaza.multiworld.skew_fit.reacher.generate_uniform_dataset import generate_uniform_dataset_reacher
from multiworld.envs.mujoco.cameras import sawyer_init_camera_zoomed_in
from railrl.launchers.launcher_util import run_experiment
from railrl.torch.grill.launche... |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import spearmanr as sr
from scipy.cluster import hierarchy as hc
from typing import List, Any, Union, Tuple, Optional, Dict
import random, math
# TODO: Remove Dependencies, starting with Sklearn
from sklearn.metrics import roc_curve... |
/home/runner/.cache/pip/pool/6f/79/0f/8599f6c360fdc1e9e096d5f99c621943711150e43953e2b9bc728f75e8 |
import aiohttp
import os
OOTR_BASE_URL = os.environ.get('OOTR_BASE_URL', 'https://ootrandomizer.com')
OOTR_API_KEY = os.environ.get('OOTR_API_KEY')
async def roll_ootr(settings, version='6.1.0', encrypt=True):
async with aiohttp.request(
method='post',
url=f"{OOTR_BASE_URL}/api/sglive/seed/create... |
import pickle, pprint, math
import sys
import pdb
from collections import defaultdict as ddict
import operator
import numpy
import operator
import time
import logging
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('EVAL-EMBED')
def incoming_neighbours(entity, graph):
relations_entity_is_tail = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.