text
stringlengths
2
999k
#!/usr/bin/env python from os import walk from os.path import join, splitext from ntpath import basename def get_images_labels_list(images_dir_path): """ Recursively iterates through a directory and its subdirectories to list the info all the images found in it. Returns a list of dictionary where each dic...
from copy import deepcopy import pytest from traw.models import CaseType ID = 1234 NAME = 'mock case type name' @pytest.fixture() def case_type(client): content = {"id": ID, "is_default": True, "name": NAME} return CaseType(client, deepcopy(content)) def test_id(case_type): ...
# IMPORTATION STANDARD # IMPORTATION THIRDPARTY import pytest # IMPORTATION INTERNAL from openbb_terminal.stocks.government import quiverquant_model @pytest.fixture(scope="module") def vcr_config(): return { "filter_headers": [("Authorization", "MOCK_TOKEN")], } @pytest.mark.vcr @pytest.mark.param...
from scipy.stats import norm import numpy as np import pandas as pd from . import common_args from ..util import (read_param_file, compute_groups_matrix, ResultDict, extract_group_names, _check_groups) from types import MethodType from multiprocessing import Pool, cpu_count from funct...
from __future__ import division, absolute_import, print_function from numpy.testing import * import numpy.distutils.fcompiler g77_version_strings = [ ('GNU Fortran 0.5.25 20010319 (prerelease)', '0.5.25'), ('GNU Fortran (GCC 3.2) 3.2 20020814 (release)', '3.2'), ('GNU Fortran (GCC) 3.3.3 20040110 (prerel...
class PublicDiskCaseConstants: CORRECT_URL = 'https://yadi.sk/d/FMbYkNAfcOYAzg?w=1' BAD_URL = '' CORRECT_OUT_PATHS = ['/folder_1/avo.jpg', '/folder_1/file_2.txt', '/folder_2/file_3.txt', '/folder_2/file_4.txt', ...
from tkinter import Tk, Canvas, Frame, simpledialog, messagebox from Board import Board from AI import AI, Network, Node, ConnectionWeight from func import opposite_color, int2loc, int2color, is_last_rank from PIL import ImageGrab import time class ChessGui(Frame): def __init__(self, root): self.root = root Fra...
from typing import Optional, Sequence from pydicom.dataset import Dataset class CodingSchemeResourceItem(Dataset): """Class for items of the Coding Scheme Resource Sequence.""" def __init__(self, url: str, url_type: str) -> None: """ Parameters ---------- url: str ...
#!/bin/env python3 # # Decodes JWT from stdin # # Install dependencies on ubuntu # apt-get install python3-jwt # # or with virtual env # python3 -m venv venv # . venv/bin/activate # pip install jwt # import jwt import time import sys import pprint t = jwt.decode(sys.stdin.read().rstrip(), verify=False) pprint...
from setuptools import setup from Cython.Build import cythonize ext_options = {"compiler_directives": {"profile": True}, "annotate": True} setup( name='Weighted-Levenshtein', version='', packages=[''], url='', license='', author='Team bluebird', author_email='', description='', install...
from setuptools import setup, find_packages setup( name = "django-mass-edit", version = "3.3.1", author = "David Burke", author_email = "david@burkesoftware.com", description = ("Make bulk changes in the Django admin interface"), license = "BSD", keywords = "django admin", url = "https:...
""" Leetcode 230 """ # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def kthSmallest(self, root: TreeNode, k: int) -> int: if not root: retu...
# Copyright (c) 2021 Hashz Software. version = "1.1.0-dev" cmds = { "help": "usage: (yamlmake) [ARGUMENTS] ..." }
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import keras from keras import models, Model from matplotlib import pyplot from keras.preprocessing.image import load_img from keras.preprocessing.image import img_to_array from keras.models import Model from matplotlib import pyplot as plt from numpy import expand_dims import sys model = keras.models.load_model('a...
def convert_to_squad(source_data): """ Converts QAngaroo data (hoppy_data) into SQuAD format. The SQuAD-formatted data is written to disk at write_file_name. Note: All given support documents per example are concatenated into one super-document. All text is lowercased. """ squad_formatte...
#!/usr/bin/env python3 import numpy as np from pylab import * import matplotlib.pyplot as plt from sys import stdin import argparse import os from pathlib import Path import shutil import sys from absl import app,flags from pfoparams import Params FLAGS = flags.FLAGS flags.DEFINE_string("results_dir", "pfotemp", "...
__author__ = 'Aaron Yang' __email__ = 'byang971@usc.edu' __date__ = '8/11/2020 6:29 PM' import sys def get_num_of_one(num): count = 0 for i in bin(num)[2:]: if i == '1': count += 1 return count def has_same_one(val, size): val_size = get_num_of_one(val) if val_size >= size: ...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 2 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_7_2 from isi...
""" WSGI config for CS_project 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/3.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SE...
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-06 15:03 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Patien...
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from scrapy.loader import ItemLoader from ..items import LagouJobItem from ..items import LagouItem class LagoujobSpider(CrawlSpider): name = 'lagoujob' allowed_domains = ['lagou.c...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # unless required by applicable law or a...
"""Olivia package metrics for network vulnerability analysis.""" import numbers from olivia.lib.aggregators import AscendentAggregator, DescendentAggregator import numpy as np class Reach(AscendentAggregator): """ Olivia Reach Metric. REACH(n) is the number of transitive descendants for a package 'n', ...
import dhnx import matplotlib.pyplot as plt # initialize a thermal network thermal_network = dhnx.network.ThermalNetwork() # load data from csv thermal_network.from_csv_folder('data_csv_input') # save thermal network to csv thermal_network.to_csv_folder('data_csv_output') # get graph of thermal network graph = ther...
import warnings from typing import Any, Dict, Optional, Type, Union import numpy as np import torch as th from mod_gym.gym import spaces from torch.nn import functional as F from mod_stable_baselines3.stable_baselines3.common.on_policy_algorithm import OnPolicyAlgorithm from mod_stable_baselines3.stable_baselines3.co...
""" Support for monitoring NZBGet NZB client. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.nzbget/ """ import logging from datetime import timedelta import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_...
#!/usr/bin/env python3 ''' Created on 02.01.2019 @author: ED ''' if __name__ == '__main__': pass import time from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.evalboards.TMC4671_eval import TMC4671_eval from PyTrinamic.ic.TMC4671.TMC4671 import TMC4671 as TMC4671_I...
# -*- coding: utf-8 -*- # ################# # This script takes as an input the supplementary global data # from Friedlingstein et al. (2019), imported in csv format from # the original .xlsx file, and returns a csv file with # historical global emissions and sinks since 1959. # Data is provided in Tg C /year and Tg C...
import torch import os, json, random, sys from params import params import numpy as np from gensim.models import Word2Vec from torch.utils import data import pandas as pd import re import string np.random.seed(params.seed) random.seed(params.seed) torch.manual_seed(params.seed) custom_embeds_limit = 40000 do_lowerca...
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import py...
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
import csv import mock import os import sys import unittest import pycoin.tx try: # Python 2 import StringIO as io except ImportError: # Python 3 import io from garecovery.recoverycli import main from garecovery import clargs TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'test_data') de...
from helmnet.source_module import SourceModule import torch import torch.nn as nn from torch.utils.data import DataLoader from torch.nn.functional import hardtanh from random import choice import pytorch_lightning as pl from torchmetrics.regression import MeanAbsoluteError import numpy as np from helmnet.architectures ...
from morseapi import MorseRobot import logging import sys import os from robots.concurrency import action from robots.concurrency.signals import ActionCancelled from robots.resources import lock, Resource def run(bot_address): with MorseRobot(bot_address) as robot: robot.connect() robot.reset() ...
#!/usr/bin/env python # coding=utf-8 import MySQLdb, sys from collections import OrderedDict class MysqlPython(object): """ Python Class for connecting with MySQL server and accelerate development project using MySQL Extremely easy to learn and use, friendly construction. """ __instance ...
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# 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 ...
# -*- coding: utf-8 -*- # This script splits a repository of OBS-tQ story-specific markdown files from old # OBS-tQ version 3.2.1, into a collection of frame-specific markdown files as in v.4. # The file splits are based on the information contained in frame links, e.g. [02:01], # on each question in the story-specific...
import torch from torch import mean, nn from collections import OrderedDict from torch.nn import functional as F import numpy as np from numpy import random from se_block import SEBlock def setup_seed(seed): torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) np.random.seed(seed) random.seed(s...
import numpy as np import matplotlib.pyplot as plt time = np.arange(0, 10, 0.1) amplitude = np.cos(time) plt.plot (time, amplitude) plt.title('Cosine curve') plt.xlabel('Time') plt.ylabel('Amplitude') plt.show()
from pyrep.robots.arms.panda import Panda from pyrep.robots.end_effectors.panda_gripper import PandaGripper from pyrep.robots.configuration_paths.arm_configuration_path import ArmConfigurationPath from pyrep.errors import ConfigurationError, ConfigurationPathError, IKError from pyrep.const import ConfigurationPathAlgor...
import asyncio import os import random import sys import aiohttp import aiofiles import hashlib import nextcord import yaml from nextcord.ext import commands import requests import uuid import inspirobot import uwuify if "CompsciBot" not in str(os.getcwd()): os.chdir("./CompsciBot") with open("config.yaml") as fi...
''' Copyright 2020 The Ray Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software d...
from .diff import Diff from .revision_oriented import Revision __all__ = [Revision, Diff]
# -*- coding: utf-8 -*- # # Unless explicitly stated otherwise all files in this repository are licensed # under the Apache 2 License. # # This product includes software developed at Datadog # (https://www.datadoghq.com/). # # Copyright 2018 Datadog, Inc. # """github_members/__init__.py github_member module initiali...
import os from flask import Flask from flask import request from flask import render_template from flask import send_from_directory import db import abstractDriver import messageAnnouncer from api import dbAPI from story import Story from api import adminAPI from api import streamAPI from api import scrapeAPI from dash...
import math from typing import * import numpy as np from torch.jit import ScriptModule from torch.utils.hooks import RemovableHandle from . import core, nn, random from .core import Tensor, Module, no_grad, rank, jit, assign_data __all__ = [ # utilities 'calculate_fan_in_and_fan_out', 'get_activation_gain', ...
# Copyright 2016 PLUMgrid Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, soft...
########################################################################## # Copyright (c) 2014-2016 ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Universitaetstr 6, CH...
import logging logger=logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) def func1a_1_1(): logger.debug({"message" : "debug log"}) logger.error("error log")
# Generated by Django 2.1 on 2018-08-10 04:42 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('accounts', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='employee', name='email', ), ]
import matplotlib.pyplot as plt import numpy as np from autoins.common import common, io class RewardShapingTester(): def __init__(self, env, exp_dir, ccl_id, data_name): self.env = env self.exp_dir = exp_dir self.ccl_id = ccl_id self...
# -*- coding: utf-8 -*- from typing import Tuple from recc.rule.naming_base import merge_naming, split_naming from recc.variables.naming import ( PREFIX_RECC, NAME_DELIMITER, NAME_CONTAINER, NAME_VOLUME, NAME_NETWORK, ) def naming_task(group: str, project: str, task: str) -> str: return merge...
# Copyright (c) 2012, 2019 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the function...
"""Role testing files using testinfra""" def test_data_directory(host): """Check data directory""" d = host.file("/var/lib/home-assistant") assert d.is_directory assert d.user == "home-assistant" assert d.group == "root" assert d.mode == 0o775 def test_backup_directory(host): """Check ba...
# -*- coding: utf-8 -*- ''' Use a git repository as a Pillar source --------------------------------------- .. note:: This external pillar has been rewritten for the :doc:`2015.8.0 </topics/releases/2015.8.0>` release. The old method of configuring this external pillar will be maintained for a couple relea...
# Copyright 2021 Spencer Phillip Young # # 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 app...
"""Conversion tool from SQD to FIF. RawKIT class is adapted from Denis Engemann et al.'s mne_bti2fiff.py. """ # Authors: Teon Brooks <teon.brooks@gmail.com> # Joan Massich <mailsik@gmail.com> # Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) from collections import defaul...
# # Description: Edison robot plays "Turkish March" by Wolfgang Amadeus Mozart. # Notes: You can listen result here: https://www.youtube.com/watch?v=1Cfpv6s_xrY # You can upload program to Edison robot by online EdPy environment http://edpyapp.com/# # This is the first voice only. I ...
# Copyright 2016 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# 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...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# Copyright 2018 Tsinghuanet, Inc. # # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
#!/usr/bin/env python3 import datetime import os import time from pathlib import Path from typing import Dict, Optional, Tuple import psutil from smbus2 import SMBus import cereal.messaging as messaging from cereal import log from common.filter_simple import FirstOrderFilter from common.numpy_fast import clip, interp...
# coding=utf8 from twisted.application import internet, service from twisted.internet import interfaces from twisted.python import usage from finger import fingercore class Options(usage.Options): optParameters = [ ['file', 'f', '/etc/users'], ['templates', 't', '/usr/share/finger/templates'], ...
# Copyright 2019 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
class DataSource: '''The base class of data sources. The class defines the defaulkt behavior for data sources.''' def getUpdateItems(self): '''Returns a dictionary of items determined by the source for updates as opposed to add (to sinks)''' '''The dictionary contains key/values that represent t...
#----------------------------------------------------------------------------- # Copyright (c) 2013-2022, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software consists of vo...
import time import threading import configparser class SingletonType(type): _instance_lock = threading.Lock() def __call__(cls, *args, **kwargs): if not hasattr(cls, "_instance"): with SingletonType._instance_lock: if not hasattr(cls, "_instance"): cls._...
import unittest import doctest class Example(unittest.TestCase): def test(self): self.assertTrue(True) def load_tests(loader, tests, pattern): tests.addTests(doctest.DocTestSuite()) return tests if __name__ == '__main__': unittest.main()
from conans import ConanFile, CMake, tools import os, platform named_type_version = os.getenv('NAMED_TYPE_VERSION', '1.0') class NamedTypeConan(ConanFile): name = "named-type" license = "MIT" url = "https://github.com/BentouDev/conan-named-type" version = named_type_version description = "NamedTy...
from gazette.spiders.base.fecam import FecamGazetteSpider class ScHervalDoesteSpider(FecamGazetteSpider): name = "sc_herval_doeste" FECAM_QUERY = "cod_entidade:109" TERRITORY_ID = "4206702"
""" Copyright (c) Facebook, Inc. and its affiliates. """ import unittest from droidlet.lowlevel.minecraft.cuberite_process import CuberiteProcess, create_workdir, repo_home from os import path from droidlet.lowlevel.minecraft.craftassist_cuberite_utils.ping_cuberite import ping class CuberiteBasicTest(unittest.TestCa...
from django import template register = template.Library() @register.simple_tag(takes_context=True) def render(context, obj, args): """ Try to render an attribute from an object. It will first look for a function called 'render_<attr_name>' on the view, If this doesnt exist it will look for an attribute w...
import warnings from functools import partial from typing import Any, Optional from torchvision.transforms.functional import InterpolationMode from ...models.mnasnet import MNASNet from ..transforms.presets import ImageNetEval from ._api import Weights, WeightEntry from ._meta import _IMAGENET_CATEGORIES __all__ = ...
import streamlit as st from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine, Column, String, Integer, Float import pandas as pd from database import Image as ImageModel, Mask as MaskModel import cv2 from PIL import Image from object_movement import Object_Tracker import base64 from datetime impo...
#!/usr/bin/python3 # ================================================================= # SPDX-License-Identifier: MIT # # Copyright (C) 2020-2021 Government of Canada # # Main Authors: Drew Rotheram <drew.rotheram-clarke@canada.ca> # Joost van Ulden <joost.vanulden@canada.ca> # ===========================...
# coding: utf-8 """ Gate API v4 Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 Contact: support@mail.gate.io Gen...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Run Regression Test Suite This module calls down into individual test cases via subprocess. It will ...
#!/usr/bin/env python import argparse import json import logging import os import sys import avi.migrationtools import yaml import avi.migrationtools.f5_converter.converter_constants as conv_const from avi.migrationtools.vs_filter import filter_for_vs from avi.migrationtools.avi_migration_utils import get_count from re...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 13 14:50:24 2021 @author: kunal001 """ import pathlib import pprint import json import logging logger = logging.getLogger(__name__) pp = pprint.PrettyPrinter(indent=4) class ConstraintParser: def __init__(self, pdk_dir: pathlib.Path, input_dir...
import os import pytest from common.features import featurize_file from common.predictions.datarobot import DataRobotV1APIPredictionService from common.predictions.dummy import DummyPredictionService from common.predictions.embedded import EmbeddedPredictionService @pytest.fixture def saved_audio_file(): return...
from __future__ import unicode_literals, division, absolute_import import datetime import logging import random from sqlalchemy import Column, Integer, DateTime, Unicode, Index from flexget import options, plugin from flexget.event import event from flexget.plugin import get_plugin_by_name, PluginError, PluginWarning...
# -*- coding:utf-8 -*- import logging import os import pandas as pd from beem import Steem from beem.instance import set_shared_steem_instance from utils.logging.logger import logger_ctl pd.options.mode.chained_assignment = None STEEM_HOST = "https://steemit.com" STEEMD_HOST = "https://steemd.com" # more API node...
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http.response import HttpResponseRedirect, HttpResponse from myAPI.videoURL import video_url_list from blog.models import Video, Browse from myAPI.pageAPI import djangoPage,PAGE_NUM #观看视频网站 http://localhost:8000/blog/videoplay def videoplay(reques...
import urllib2 import json import MySQLdb # Function to fetch json of reddit front page def fetch(): link = "https://www.reddit.com/.json" # Get the text version text = urllib2.urlopen(link).read() # Turn it into a dictionary data = json.loads(text) return data # Returns a list of tuples of ...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, erpnext from frappe.utils import flt, today from frappe import msgprint, _ from frappe.model.document import Document from erpnext.accounts.utils...
import toml from pathlib import Path #: Path of the configuration file from an unpacked Path list. conf_file: Path (conf_file,) = list(Path.cwd().glob("**/conf.toml")) class Settings: """ Creates an object containing application configuration from a deserialized file. The class will attempt to recursiv...
from jd.api.base import RestApi class OrderJdOrderQueryRequest(RestApi): def __init__(self,domain='gw.api.360buy.com',port=80): RestApi.__init__(self,domain, port) self.jdOrderId = None def getapiname(self): return 'biz.order.jdOrder.query'
# # # from __future__ import absolute_import, division, print_function, \ unicode_literals from collections import defaultdict from dyn.tm.errors import DynectGetError from dyn.tm.services.dsf import DSFARecord, DSFAAAARecord, DSFCNAMERecord, \ DSFFailoverChain, DSFMonitor, DSFNode, DSFRecordSet, DSFResponseP...
import pytest from django.contrib.auth import get_user_model from django.core.paginator import Page, Paginator def get_field_context(context, field_type): for field in context.keys(): if field not in ('user', 'request') and type(context[field]) == field_type: return context[field] return ...
import torch import torch.nn as nn import torch.utils.model_zoo as model_zoo from itertools import chain import torch.utils.checkpoint as cp from ..util import _Upsample, SpatialPyramidPooling __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152'] model_urls = { 'resnet18': 'https://d...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import logging from typing import Dict, List, Optional, Tuple import torch from torch import Tensor from torch.nn import Module from .compressor import Compressor, LayerInfo _logger = logging.getLogger(__name__) __all__ = ['Pruner'] class P...
import base64 import os from typing import Iterator, List, Tuple from lms.extractors.base import Extractor, File from lms.models.errors import BadUploadFile from lms.utils.files import ALLOWED_IMAGES_EXTENSIONS class Imagefile(Extractor): def __init__(self, **kwargs): super().__init__(**kwargs) s...
#!/usr/bin/env python3 ########################################################################################## #### THIS SCRIPT WAS USED TO GENERATE DEPTH vs COVERAGE FIGURES in the IN VIVO PAPER #### ########################################################################################## # Accept S3 dir for re...
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # The colorzero color library # # Copyright (c) 2016-2021 Dave Jones <dave@waveform.org.uk> # # SPDX-License-Identifier: BSD-3-Clause """ Defines all conversion functions used by colorzero to convert between the various color systems implemented. References used in the de...