text
stringlengths
3.07k
22.1k
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, <NAME> and <NAME> # -------------------------------------------------------- from __future__ import absolute_import from __future__ imp...
# The classes used for data processing and convert_examples_to_features are very similar versions of the ones \ # found in Hugging Face's scripts in the transformers library. For more BERT or similar language model implementation \ # examples, we would highly recommend checking that library as well. from __future__ i...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
# Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ...
from collections import defaultdict from functools import partial from math import sqrt from statistics import mean from traceback import print_exc from typing import Dict import numpy as np from pandas import DataFrame, Series from sklearn.metrics import mean_squared_error from helpers.source import source_for_table...
"""process mask tools method: convert_one_hot extract_bbox dilation_mask erosion_mask remove_small_connected_object extract_largest_connected_object keep_KthLargest_connected_object smooth_mask extract_left_right_bbox """ import numpy as np from skimage import measure from skimage.morphology import label from scipy.n...
# -*- coding: utf-8 -*- # # Copyright (c) 2022 <NAME> <<EMAIL>> # Copyright (c) 2022 <NAME> <<EMAIL>> # # 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 ...
import paddle import random from PIL import Image import os import errno import numpy as np import sys import csv from paddleseg.transforms import Compose,Resize,Normalize,RandomHorizontalFlip,RandomDistort,ResizeStepScaling,RandomPaddingCrop from paddle.fluid.dataloader.collate import default_collate_fn from paddle.vi...
from .view_imports import * from .article_views import (ArticlesFilterSet, ReportArticlesView, LikeArticlesView, GetArticleBySlugApiView) def article_instance(param): query_article = Article.objects.get(slug=param) return query_article class ArticlesFilterSet(FilterSet): '...
import collections import torch import random import numpy as np import json from torch.utils import data import scipy.misc import scipy.io as io from skimage import draw import losses from PIL import ImageOps from bs4 import BeautifulSoup import pickle # Train Utils def fit(model, dataloader, opt, loss_function, epo...
from __future__ import unicode_literals import datetime import os import textwrap from django.conf import settings from django.contrib.auth.models import Group from django.contrib.auth import models as auth_models from cuser.models import AbstractCUser from django.db import DEFAULT_DB_ALIAS, models from django.db.tra...
""" CALM Copyright (c) 2021-present NAVER Corp. MIT license """ import argparse import munch import importlib import os from os.path import join as ospj import shutil from util import Logger _DATASET_NAMES = ('CUB', 'ILSVRC', 'OpenImages') _ARCHITECTURE_NAMES = ('vgg16', 'resnet50', 'inception_v3') _ATTRIBUTION_MET...
import math import random import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.distributions import Normal import matplotlib.pyplot as plt import pickle import gym from gym_brt.envs import QubeBeginDownEnv import time use_cuda = torch.cuda.is_...
from collections import namedtuple import pybullet as p from pybullet_planning.utils import get_client, CIRCULAR_LIMITS, UNBOUNDED_LIMITS, INF ##################################### # Joints JOINT_TYPES = { p.JOINT_REVOLUTE: 'revolute', # 0 p.JOINT_PRISMATIC: 'prismatic', # 1 p.JOINT_SPHERICAL: 'spherical...
from __future__ import absolute_import, unicode_literals import base64 import json import uuid from django.http import QueryDict from django.urls import reverse from django.utils.http import urlencode from casexml.apps.case.mock import CaseBlock from casexml.apps.case.models import CommCareCase from casexml.apps.cas...
# Copyright 2015 ETH Zurich # # 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, sof...
"""py.test fixtures for Pyramid. http://pyramid.readthedocs.org/en/latest/narr/testing.html """ import datetime as datetime_module import logging import os import pkg_resources import pytest import webtest from dcicutils.qa_utils import notice_pytest_fixtures, MockFileSystem from pyramid.request import apply_reques...
""" Tests the execution of forum notification tasks. """ import json import math from datetime import datetime, timedelta from unittest import mock import ddt from django.contrib.sites.models import Site from edx_ace.channel import ChannelType, get_channel_for_message from edx_ace.recipient import Recipient from edx...
"""Support for Sure PetCare Flaps/Pets sensors.""" from __future__ import annotations from typing import Any, cast from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( ATTR_VOLTAGE, DEVICE_CLASS_BATTERY, MASS_GRAMS,...
#!/usr/bin/env python3 import os, sys, re from argparse import ArgumentParser from difflib import unified_diff from json import load def dprint(msg): print('[DEBUG]: %s' % str(msg)) class HeaderChecker: def __init__(self, header, padding=1000, ignored_files=[], ignored_ext=[], ignored_patterns=[]): s...
import numpy as np import matplotlib.pyplot as plt import main.utils as utils import time # ---------------------------- 说明 ---------------------------------- # MCN的python复现 # ---------------------------- 说明 ---------------------------------- class MCNParams: """ a struct define the input params MCN class us...
# -*- coding: utf-8 -*- ''' feedgen.ext.dc ~~~~~~~~~~~~~~~~~~~ Extends the FeedGenerator to add Dubline Core Elements to the feeds. Descriptions partly taken from http://dublincore.org/documents/dcmi-terms/#elements-coverage :copyright: 2013-2017, <NAME> <<EMAIL>> :license: FreeBSD and L...
import os import subprocess import logging import filecmp import copy import base64 import json import pykube import kubernetes_validate from kubernetes_validate.utils import ( SchemaNotFoundError, VersionNotSupportedError, InvalidSchemaError, ValidationError, ) from toscaparser.tosca_template import T...
import pygame, time, math from pygame.locals import * class Box(pygame.sprite.Sprite): def __init__(self, x, y): # Call the parent class constructor pygame.sprite.Sprite.__init__(self) # Get the main window's display self.surface = pygame.display.get_surface() ...
import datetime import os import string from celery import Celery import praw import prawcore from textblob import TextBlob from django.core.cache import cache from .helpers import * from .models import * app = Celery('tasks') app.config_from_object('django.conf:settings') reddit = praw.Reddit(client_id=os.environ['P...
import pytest from mnamer.endpoints import ( tvdb_episodes_id, tvdb_login, tvdb_refresh_token, tvdb_search_series, tvdb_series_id, tvdb_series_id_episodes, tvdb_series_id_episodes_query, ) from mnamer.exceptions import MnamerException, MnamerNotFoundException from mnamer.providers import Tv...
# 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 u...
import copy import os import unittest import numpy as np import logger import disease_graph def DumpPosterior(out_path, samples, positions): num_loci = len(positions) with open(os.path.join(logger.LOG_OUT_DIR, out_path), 'w') as f: # Write posterior to file. for i in range(num_loci): ...
from random import randrange, randint from math import radians, sin, cos from collections import namedtuple class Coords(namedtuple('Coords', ['x', 'y'])): __slots__ = () ''' def __init__(self, x, y, round_co=True): """A class for storing two interiger or float values for use in a Cartesian ...
import numpy as np import cv2 import time # Identify pixels above the threshold # Threshold of RGB > 160 does a nice job of identifying ground pixels only def color_thresh(img, rgb_above=(160, 160, 160), rgb_below=(255,255,255)): # make sure all values are in range: rgb_above = np.clip(rgb_above,0,255) rgb...
import time from typing import Union, List, Type, Any, NoReturn import allure from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.r...
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
from typing import Callable, Dict, List, Optional, Tuple import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from torch import Tensor from accelRF.rep import Explicit3D from accelRF.render.nerf_render import volumetric_rendering from accelRF.rep.utils import offset_points def masked_s...
# -*- coding: UTF-8 -*- # Copyright (c) 2018 The ungoogled-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. """ Build configuration generation implementation """ import abc import configparser import collections import copy im...
from bisect import bisect_right from math import pi import numpy as np from .data_structs import TrajectoryPoint as Tp from .trajectory_phases import RampPhase, CruisePhase, DwellPhase from .trajectory_utils import IsGreater, SolveForPositiveRealRoots, NoSolutionError class Profile: def __init__(self, initial_p...
#!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
#python 3.9.2 #coding: utf-8 import discord from discord.ext import commands class RoleSystem(commands.Cog): def __init__(self, bot): self.bot = bot @commands.group(aliases=["r"]) async def role(self, ctx): if ctx.invoked_subcommand is None: return await ctx.send("⚠️ サブコマンドが必要です",delete_af...
from .configs import * from . import query from . import utils from . import parser from . import taglist from . import dtaglist from collections import OrderedDict import sys import multiprocessing ''' experiment table Table name: _tagit_exp_{name} Desc: The main table for an experiment that holds the data Layout:...
from typing import Dict, List, Union import networkx as nx import pandas as pd import partridge as ptg from fiona import crs from shapely.geometry import shape from .settings import WGS84 from .summarizer import (generate_edge_and_wait_values, generate_summary_edge_costs, ...
# -*- coding: utf-8 -*- # -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division fr...
""" FixLabelMapsTools.py ======================== Description: These are nodes used to fix-up label maps by merging information from various different sources. Author: <NAME> Usage: """ def fix_label_map_from_neuromorphemetrics_2012( fusionFN, FixedHeadFN, posteriorListOfTuples, LeftHemisphereFN, o...
from __future__ import absolute_import, division, print_function import os import sys from cctbx import sgtbx from cctbx import uctbx import libtbx.phil.command_line from libtbx.utils import Sorry, Usage, import_python_object from libtbx.phil import tokenizer from libtbx import Auto class unit_cell_converters(object...
''' # Commented out IPython magic to ensure Python compatibility. # %tensorflow_version 2.x import tensorflow as tf device_name = tf.test.gpu_device_name() if device_name != '/device:GPU:0': raise SystemError('GPU device not found') print('Found GPU at: {}'.format(device_name)) ''' import pandas as pd import numpy a...
from pprint import pprint import pytest import pandas as pd from dgs_fiscal.systems.sharepoint import BatchedChanges from dgs_fiscal.etl import ContractManagement from dgs_fiscal.etl.contract_management import ContractData, constants from tests.integration_tests.contract_management import data PO_COLS = list(consta...
# Copyright 2018-present Kensho Technologies, LLC. from collections import namedtuple import six from ..expressions import (BinaryComposition, Expression, LocalField, NullLiteral, SelectEdgeContextField, TrueLiteral, UnaryTransformation, ZeroLiteral) from ..helpers import Location, is_verte...
import numpy as np import cv2 from src.utils.train_utils import image_from_expressions, validity import json from typing import List class GenerateGroupings: def __init__(self, root_path, train_size, test_size, image_dim=64): """ Generates programs for Grouping task. It generates programs for a cl...
from Tkinter import * from scipy import ndimage import Image, ImageDraw import matplotlib.image as mpimg import numpy as np import cv2 # Variable initialization canvas_width = None canvas_height = None white = None black = None red = None master = None size = None user_close = None image1 = None draw = None w = None ...
""" This tool calibrates a set of inputs from CEA to minimize the error between model outputs (predicted) and measured data (observed) """ from __future__ import division from __future__ import print_function from hyperopt.pyll import scope import cea.config import cea.inputlocator from cea.utilities.dbf import dbf_to_...
import enum import io import struct from typing import List from .. import base from ..valve import source from . import titanfall FILE_MAGIC = b"rBSP" BSP_VERSION = 37 GAME_PATHS = {"Titanfall 2": "Titanfall2"} GAME_VERSIONS = {"Titanfall 2": 37} class LUMP(enum.Enum): ENTITIES = 0x0000 PLANES = 0x0001...
# Copyright (c) 2019 Intel 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 la...
import ast import logging import subprocess import concurrent.futures from pathlib import Path from shutil import which from cmd2.ansi import style import luigi import sqlalchemy from luigi.util import inherits from libnmap.parser import NmapParser from luigi.contrib.sqla import SQLAlchemyTarget import pipeline.model...
#!/usr/bin/env python ######################################################################################### # # Compute SNR in a given ROI according to different methods presented in Dietrich et al., # Measurement of signal-to-noise ratios in MR images: Influence of multichannel coils, # parallel imaging, and recon...
from http.cookiejar import CookieJar, Cookie import urllib.request, urllib.parse, urllib.error import re import os import http.client import datetime from ..utils import utils from .central import CentralBase class ChattisgarhWeekly(CentralBase): def __init__(self, name, storage): CentralBase.__init__(s...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
#!/usr/bin/env python from multiprocessing import Pool from singlecellmultiomics.bamProcessing.bamFunctions import mate_iter import argparse import pysam from glob import glob import pandas as pd from singlecellmultiomics.bamProcessing import get_contig_sizes from collections import Counter, defaultdict from singlece...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import time import decimal import psycopg2 # ------------------------------------------------------------------------------ def create_view(sql): """Creates a View in the database""" dbase = psycopg2.connect(dbname='news') cr = dbase.cursor() ...
import os from tqdm import tqdm import gzip import numpy as np import nibabel as nib import skimage.morphology as morph from scipy.ndimage import affine_transform from path_planning import generate_distance_map from util.nifti import load_nifti from util.freesurfer import extract_tissues def find_mask_edges(mask: np....
import numpy as np import warnings class Stat: def __init__(self, y, x, x_title="", y_title="", name="", plot=True, ymax=None, accumulator_freq=None, **kwargs): """ Args: y (list): iterable (e.g. list) for storing y-axis values of statistic x (list): iterable (e.g. list) fo...
#!/usr/bin/env python from __future__ import unicode_literals import argparse import collections import sys import cPickle as pickle import numpy as np from matplotlib import pyplot as plt import morfessor import flatcat from flatcat.exception import ArgumentException LICENSE = """ Copyright (c) 2015, <NAME> All ri...
# Original tool from https://github.com/erforschr/http-auth-bruteforcer import requests import requests_ntlm import grequests import validators import datetime import time import logging # Console colors W = '\033[0m' # white (normal) R = '\033[31m' # red G = '\033[32m' # green class ContinueBrute(Exception): ...
# pylint:disable=invalid-name import importlib import logging import random from datetime import datetime import time import pytz from celery import shared_task from django.conf import settings from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist from django.db import transaction f...
# -*- coding: utf-8 -*- # # ___ ___ _ _ # | _ \ _ _ / __|| |_ __ _ | |__ _ _ __ _ # | _/| || || (__ | ' \ / _` || / /| '_|/ _` | # |_| \_, | \___||_||_|\__,_||_\_\|_| \__,_| # |__/ # # PyChakra is a Python binding to Microsoft Chakra JavaScript engine. import ctypes import re import...
from collections import namedtuple import json import logging import os from typing import Any, Dict, List, Union, Optional from opentrons.config import CONFIG log = logging.getLogger(__name__) ROBOT_CONFIG_VERSION = 3 PLUNGER_CURRENT_LOW = 0.05 PLUNGER_CURRENT_HIGH = 0.05 MOUNT_CURRENT_LOW = 0.1 MOUNT_CURRENT_HI...
""" This module contains tools for handling evaluation specifications. """ import warnings from operator import itemgetter from ruamel.yaml import YAML from panoptic_parts.utils.utils import ( _sparse_ids_mapping_to_dense_ids_mapping as dict_to_numpy, parse__sid_pid2eid__v2) from panoptic_parts.specs.dataset_spec...
# -*- coding: utf-8 -*- """ Created on Tue Feb 25 19:39:13 2020 @author: fabian @version: 1.0 """ from .superimpose import Ensemble from . import errors from Bio import PDB from Bio import pairwise2 def _chain_id(): ''' The differents id the chains will have inside the model. Now supports a model up ...
import matplotlib.pyplot as plt from stats.db import ReadDB from sklearn.cluster import KMeans from yellowbrick.cluster import KElbowVisualizer from collections import Counter import seaborn as sns import pandas as pd import numpy as np from sklearn.metrics import mean_squared_error from math import sqrt class Visua...
from argparse import ArgumentParser, Namespace from pathlib import Path from pyzabbix import ZabbixAPI, ZabbixAPIException from requests import Session from enum import Enum from semantic_version import Version import urllib3 import logging import sys from typing import Optional logger = logging.getLogger(__name__) ...
# future imports from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals # stdlib imports import logging # third-party imports import requests # local imports from radiobabel.errors import TrackNotFound, PlaylistNotFound from .utils import random_pick lo...
import argparse import random import re import sys from collections import OrderedDict import sniffles.pcrecomp from sniffles.nfa import PCRE_OPT """petabi_rule_writer. This is a simple petabi rule writer. It takes a regex file and simple parameters to create petabi rule formatted file. The options on this programme...
from .abc_interpreter import Interpreter, InputGradientInterpreter from ..data_processor.readers import images_transform_pipeline, preprocess_save_path from ..data_processor.visualizer import explanation_to_vis, show_vis_explanation, save_image import numpy as np class GradShapCVInterpreter(InputGradientInterpreter)...
import init import pandas as pd import constants as cn from support import coordinate from dateutil import parser import datetime as dt import support.seamo_exceptions as se import numpy as np """ Trip base class. A trip is one of the base inputs for the Mobility Index. This class is created to facilitate the...
# ##### BEGIN GPL LICENSE BLOCK ##### # KeenTools for blender is a blender addon for using KeenTools in Blender. # Copyright (C) 2019 KeenTools # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ...
# -*- coding: utf-8 -*- # # Copyright 2020 Data61, CSIRO # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import operator import re from functools import reduce from django.contrib import admin, messages from django.contrib.admin import helpers from django.core.checks import Error from django.core.exceptions import ImproperlyConfigured, Vali...
# 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 # distributed under t...
# -*- coding: utf-8 -*- # Copyright 2018-2022 the orix developers # # This file is part of orix. # # orix is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) ...
import argparse import os import re import subprocess import sys import textwrap from enum import Enum from functools import partial from pathlib import Path from typing import List, Sequence from katana_requirements.data import KATANA_REQUIREMENTS_FILE_NAME, load from katana_requirements.model import OutputFormat, Pa...
"""Component is the building block for desmod models. Hierarchy --------- A desmod model consists of a directed acyclical graph (DAG) of :class:`Component` subclasses. Each Component is composed of zero or more child Components. A single top-level Component class is passed to the :func:`~desmod.simulation.simulate()`...
from dataclasses import dataclass from typing import Any, Callable, Dict, FrozenSet, Generator, Hashable, Iterable, Iterator, List, Optional, Set, Tuple, TypeVar, Generic from result import NotEnoughKnowns, Result1, Result2, Result3, Success, UncountablyInfinite, no_solutions, singleton1 from functools import cmp_to_ke...
#!/usr/bin/env python # coding: utf-8 # # Philippine Supreme Court decisions # # Source: https://elibrary.judiciary.gov.ph/ # # Background: The Supreme Court of the Philippines is the final arbiter of all constitutional petitions. It is composed of 15 magistrates appointed by the president from a list of candidates ...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import inspect import logging from functools import wraps from typing import Any, Callable, Optional from packaging.version import InvalidVersion, Vers...
import sys import os from qmla.exploration_strategies.nv_centre_spin_characterisation import ( nv_centre_full_access, ) import qmla.shared_functionality.probe_set_generation import qmla.shared_functionality.expectation_value_functions import qmla.shared_functionality.latex_model_names from qmla import model_buildi...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
""" Provides helping function for handling reputation. """ import logging from enum import Enum from typing import Optional import arrow from dbas.database import DBDiscussionSession from dbas.database.discussion_model import User, ReputationHistory, ReputationReason, sql_timestamp_pretty_print from dbas.lib import n...
"""" File : messaging.py Author : ian Created : 07-08-2016 Last Modified By : ian Last Modified On : 07-08-2016 *********************************************************************** The MIT License (MIT) Copyright © 2016 <NAME> <<EMAIL>> Permission is hereby granted, free of charge, t...
from django.db import DataError from django.shortcuts import get_object_or_404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from .models import Policy from agents.models import Agent from scripts.models import Script from clients.mod...
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- import time...
# TensorFlow Model ! import os import shutil import numpy as np import tensorflow as tf tf.reset_default_graph() from cell import ConvLSTMCell import sys module_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..") if module_path not in sys.path: sys.path.append(module_path) from datasets.batch_ge...
import uuid from datetime import datetime import bitstring from dataclasses import asdict from ray.exceptions import (InvalidReplayException, PlayerEliminationException, ReadStringException) from ray.logging import logger from ray.models import (BitTypes, ChunkTypes, Elimination, EventType...
# Note: import pywin32 as win32api, if needed, though subpackages are # directly available. # The top level has the "error" exception. import win32api # This has windows error codes. import winerror # This can open a pipe. import win32pipe # This reads/writes the pipe file. import win32file from .Misc import Client_...
import collections import io from typing import List import click from rich import print from rich.console import Console import ehrapy from ehrapy.cli.custom_cli.levenstein_distance import most_similar_command # ehrapy's main commands MAIN_COMMANDS = {"read"} class HelpErrorHandling(click.Group): """Customise...
import argparse import json import select import sys import colorlog import requests import MySQLdb # Database READ = {'main': "SELECT id FROM line WHERE name=%s", 'limages': "SELECT NULL,line,COUNT(1) FROM image_data_mv WHERE line=%s", 'lassays': "SELECT line,sessions FROM line_summary_vw WHERE line=%...
import time import logging import numpy as np from baseline.utils import export, optional_params, register, listify import math __all__ = [] exporter = export(__all__) BASELINE_LR_SCHEDULERS = {} logger = logging.getLogger('baseline') @exporter class LearningRateScheduler(object): def __init__(self, **kwargs)...
import re import linecache import os import subprocess import numpy as np import pandas as pd from functools import reduce from operator import mul from tempfile import NamedTemporaryFile def run(stan_binary_path: str, input_data: dict, method: str, init_data: dict=None, method_params:...
#!/usr/bin/env python # # Copyright 2019 DFKI GmbH. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merg...
#!/usr/bin/env python3 # # Copyright 2020 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Manage submitting a large number of CLs.""" import argparse import enum import os import re import sys import time import ansi i...
# Copyright 1999-2021 Alibaba Group Holding 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 a...
from .. import transform as tf from ..transform._utils import scalar_project, angle_between from numpy.typing import ArrayLike from typing import List, Callable import numpy as np from scipy.optimize import minimize_scalar from scipy.optimize import OptimizeResult from .targets import Target, PositionTarget, RotationTa...
# ********************************************************************************* # REopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions a...
# # works with polynomial (linear) fit # """ functions: goFromTo: calculates the phase shift matrix """ __author__ = "<NAME>" __contact__ = "<EMAIL>" __copyright = "ESRF, 2012" import numpy, math #from scipy import stats import Shadow as sh import Shadow.ShadowTools as st def goFromTo(source,i...