text
stringlengths
6.04k
39.5k
import abc import numpy as np from typing import List from numba import jit, njit from scipy.spatial import cKDTree from gym_guppy.guppies import TurnBoostAgent, ConstantVelocityAgent, Agent, Guppy from gym_guppy.tools import Feedback from gym_guppy.tools.math import rotation, row_norm _ZOR = 0.005 # zone of repul...
"""Given a config file, runs tests""" import os import subprocess import time import shutil from argparse import ArgumentParser from testsuite_common import processLogLine def parse_cmd(): """Parse the command line arguments""" description = "A python based speedtest suite for moses." parser = ArgumentPars...
# -*- coding: utf-8 -*- from datetime import datetime, date, timedelta from sys import exit import pandas as pd import time from selenium import webdriver from datetime import date, timedelta from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By from selenium.webdri...
####### hqz exporter for maya V0.6.1 ############## # <NAME> 2014 # # HQZ by <NAME> - http://scanlime.org/ # # Usage: # - run script # - select objects to setup # - click "Prepare scene" and switch viewport to front view # - change settings according to your needs # - write materials to the materials list ...
''' Pcap file parser for AMR / AMR-WB / EVS with RFC4867 or Iu framing. This script parses a pcap file to extract rtp amr, amr-wb or evs data, encapsulated using the bandwidth efficient mode described in RFC4867 or using Iu framing (3GPP TS25.415), and stores it in a file with the storage format defined in section 5...
import asyncio, logging, re, string from pushbullet import PushBullet import plugins from utils import remove_accents logger = logging.getLogger(__name__) nicks = {} def _initialise(bot): _migrate_mention_config_to_memory(bot) plugins.register_handler(_handle_mention, "message") plugins.register_us...
from nnf import Var from lib204 import Encoding import ast import nnf import time """ Battleship Group 31 <NAME>: 18etc4 <NAME>: 14cpm3 <NAME>: 15ss190 <NAME>: 18rl50 """ # Ship objects where properties inside are propositions class Ship(object): """ Names and sizes of ships for referencing: Battleship = 4,...
#! /usr/bin/env python3 from helper.easierlife import BASE_DIR # Load an example dictionary # 1st column is doc id, 2nd is sentence ids (separated by '|'), 3rd is entity def load_examples_dictionary(filename): examples = dict() with open(filename, 'rt') as examples_dict_file: for line in examples_dic...
import os import json import time import tracemalloc import tensorflow as tf import numpy as np from utils import ( hash_, percent_array, write_summaries, freeze_save_graph, ) from fasttext_utils import ( parse_txt, batch_generator, ) from fasttext_model import FastTextModel def run_train(da...
# Copyright 2020 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # # 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...
# <NAME> import sys sys.dont_write_bytecode = True #from __future__ import division from kivy.app import App from kivy.uix.tabbedpanel import TabbedPanel from kivy.lang import Builder from kivy.uix.image import Image from kivy.graphics.texture import Texture from kivy.clock import Clock from kivy.uix.button import Bu...
''' 处理stream 而不是一次读取全部数据 同时出音频,视频帧,并回调而不是直接保存 ''' import struct from io import BytesIO #from pydub import AudioSegment #from bitarray import bitarray #from flv_decoder import pares_FLVTAGHeader from enum import Enum import cv2 import numpy as np import av from av.audio.fifo import AudioFifo import simpleaudio as sa...
# ███╗░░░███╗░█████╗░██████╗░████████╗██╗░░░██╗ # ████╗░████║██╔══██╗██╔══██╗╚══██╔══╝╚██╗░██╔╝ # ██╔████╔██║███████║██████╔╝░░░██║░░░░╚████╔╝░ # ██║╚██╔╝██║██╔══██║██╔══██╗░░░██║░░░░░╚██╔╝░░ # ██║░╚═╝░██║██║░░██║██║░░██║░░░██║░░░░░░██║░░░ # ╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░░░░╚═╝░░░ # IMPORTS from imp import creat...
#run_models.py import os import copy import itertools import numpy as np import pandas as pd from tqdm import tqdm from sklearn import model_selection #Custom imports from . import cv_agg from . import ensemble_agg from . import reformat_output ##################################################################### #...
# --------------------------------------------------------------- # vctree.py # Set-up time: 2020/6/4 上午10:22 # Copyright (c) 2020 ICT # Licensed under The MIT License [see LICENSE for details] # Written by Kenneth-Wong (Wenbin-Wang) @ VIPL.ICT # Contact: <EMAIL> [OR] <EMAIL> # ----------------------------------...
import collections import configparser import logging import sys import psycopg2 import psycopg2.extras import db_functions OldAdRecord = collections.namedtuple( "AdRecord", [ "archive_id", "page_id", "page_name", "image_url", "text", "sponsor_label", "...
# Load data import tools as tl import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy import stats # from scipy.stats import rankdata # from mpl_toolkits.mplot3d import Axes3D import os import seaborn as sns import benchmark_func as bf sns.set(context="paper", font_scale=1, palette="husl", st...
#!/usr/bin/env python # # Copyright 2015 British Broadcasting 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 requ...
#!/usr/bin/env python from __future__ import print_function import argparse import glob import sys import numpy as np import pysam import time from contextlib import closing import bam_stats TAG_HAPLOTYPE = "ht" TAG_CHUNK_ID = "mp" PB_HAP1_READS = "pb_hap1" PB_HAP2_READS = "pb_hap2" PB_LENGTH = "pb_len" PB_BLOCK_I...
import abc import base64 import contextlib from functools import partial import gc import os import random import signal import time from typing import Iterable, Tuple, Union from attrdict import AttrDict from dataclasses import dataclass import IPython from IPython import get_ipython from IPython.core.interactiveshel...
#!/usr/bin/env python # coding: utf-8 # # Determining the rate law of chemical reactions # # #### I. Definition of a rate law # For a general chemical reaction described by # # <center>$\nu_{A}A + \nu_{B}B \longrightarrow \nu_{Y}Y + \nu_{Z}Z,$</center><br/> # # the *rate of reaction*, $v(t)$, is defined as # # <ce...
# coding: utf-8 from sqlalchemy import BigInteger, CHAR, Column, DECIMAL, DateTime, Float, ForeignKey, Index, Integer, String, Text, text from sqlalchemy.dialects.mysql import TINYINT, DOUBLE from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() metad...
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # Documentation is intended to be processed by Epydoc. """ Introduction ============ The Munkres module provides an implementation of the Munkres algorithm (also called the Hungarian algorithm or the Kuhn-Munkres algorithm), useful for solving the Assignment Problem....
# Copyright 2020 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# -*- coding: utf-8 -*- """ Created on Sat Mar 27 13:34:21 2021 @author: <NAME> """ import os import time import logging import random import numpy as np import pandas as pd import torch import torch.nn as nn from scipy import ndimage from tqdm import tqdm, trange from transformers import AutoTok...
#!/usr/bin/env python """ This file defines a class for controlling the scope and heterogeneity of parameters involved in a maximum-likelihood based tree analysis. """ import pickle import warnings import numpy from cogent3.align import dp_calculation from cogent3.align.pairwise import AlignableSeq from cogent3.cor...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test for L{twisted.web.proxy}. """ from twisted.trial.unittest import TestCase from twisted.test.proto_helpers import StringTransportWithDisconnection from twisted.test.proto_helpers import MemoryReactor from twisted.web.resource import Reso...
#!/usr/bin/env python3 """Mypy test runner.""" if False: import typing if True: # When this is run as a script, `typing` is not available yet. import sys from os.path import join, isdir def get_versions(): # type: () -> typing.List[str] major = sys.version_info[0] minor = sys.ver...
#!/usr/bin/python # # Copyright 2022 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
# pyOCD debugger # Copyright (c) 2019-2020 Arm Limited # Copyright (c) 2021 <NAME> # 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.apa...
# -*- coding: utf-8 -*- import logging import time from typing import List, Union, Type, Tuple import pandas as pd from zvt.api.trader_info_api import AccountStatsReader from zvt.contract import IntervalLevel, TradableEntity, AdjustType from zvt.contract.drawer import Drawer from zvt.contract.normal_data import Norma...
# Copyright (c) 2021, 2022, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, # as published by the Free Software Foundation. # # This program is also distributed with certain software (including # ...
try: from pycorenlp import StanfordCoreNLP except: pass from subprocess import call import numpy as np from get_args import * import os UNK = "$UNK$" NUM = "$NUM$" NONE = "O" def get_iso_lang_abbreviation(): iso_lang_dict = {} lang_iso_dict = {} with open("iso_lang_abbr.txt") as file: lin...
# coding=utf-8 # Copyright 2019 The Google Research 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 applicab...
# Copyright 2016 The Kubernetes 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 ...
#!/usr/bin/env python3 from collections import namedtuple import contextlib import io import json import logging import os from pathlib import Path import shlex import signal import subprocess import sys import tempfile import uuid import zmq from .simplesetup import RemoteTeamPlayer, SimpleController, SimplePublish...
from distutils.core import setup from distutils.command.build_ext import build_ext from distutils.command.build_py import build_py from distutils.command.install import install from distutils.errors import DistutilsOptionError import os, string import config # Instantiate a configurations class for this OpenMOC build...
from dataset.transforms import TransformTwice, transpose, load_transforms import os import cv2 import torch import numpy as np import torchvision import random import sys import dataset.cifar10 as dataset import torchvision.transforms as transforms import torch.utils.data as data from torch.utils.data impo...
from vpython import * #GlowScript 2.7 VPython from vpython import * #Totally accurate ball game #RodrigoQueirós e MiguelMelo #January 2019 scene.range = 40 scene.forward = vec(0,-1,-1) scoreBoard = box(canvas = scene, size = 15*vec(2.4, 1.45, 0.1), texture = "https://i.imgur.com/3n1UAgM.png", color = color.white) sc...
"""Animate mobjects.""" from __future__ import annotations from .. import config, logger from ..mobject import mobject, opengl_mobject from ..mobject.mobject import Mobject from ..mobject.opengl_mobject import OpenGLMobject from ..utils.rate_functions import smooth __all__ = ["Animation", "Wait", "override_animatio...
import os.path from os import makedirs import click import json import sys import copy import glob import cjio from cjio import cityjson #-- https://stackoverflow.com/questions/47437472/in-python-click-how-do-i-see-help-for-subcommands-whose-parents-have-required class PerCommandArgWantSubCmdHelp(click.Argument): ...
# -*- coding: utf-8 -*- import sys import curses import logging from argparse import ArgumentParser, SUPPRESS as SUPPRESS from os import path, getenv, environ from sys import platform, version_info from contextlib import contextmanager from platform import system from .radio import PyRadio from .config import PyRadioC...
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from math import pi from copy import deepcopy from compas.data import Data __all__ = [ 'Configuration', 'FixedLengthList', ] # These joint types known to configuration are a match # to the ones defin...
import os import sys import glob import random import numpy as np np.random.seed(23087) import pandas as pd import tensorflow as tf from keras import backend as k from keras.utils import np_utils from keras.optimizers import Adam from keras.models import Sequential, load_model from matplotlib import pyplot as plt from ...
# Copyright (c) 2013-2014 Rackspace, 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 ...
import json import os import torch import random import xml.etree.ElementTree as ET import torchvision.transforms.functional as FT device = torch.device("cuda" if torch.cuda.is_available() else "cpu") # Label map voc_labels = ('speed limit (20)', 'speed limit (30)', 'speed limit (50)...
#!/usr/bin/python from __future__ import print_function import sys import os import warnings import itertools import textwrap import numpy as np import matplotlib import matplotlib.pyplot as plt from scipy.stats import f_oneway, gamma, norm from scipy.optimize import curve_fit from ..triqler import __version__, __c...
import torch import glob import os from argparse import ArgumentParser from PIL import Image from torchvision.transforms import functional as F from tqdm import tqdm from utilities.print_utils import * from utilities.data_transforms import MEAN, STD from utilities.utils import model_parameters, compute_flops import tor...
# 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, ...
""" This is a ISAPI extension for a wsgi with 2 handlers classes. - ISAPISimpleHandler which creates a new IsapiWsgiHandler object for each request. - ISAPIThreadPoolHandler where the wsgi requests are run on worker threads from the thread pool. Dependecies: - python 2.2+ - win32...
#!/usr/bin/env python3 from datetime import date from string import Template import os import re import subprocess import sys from tree_sitter import Language, Parser HEADER = """ // Copyright (C) [$YEAR] World Wide Web Consortium, // (Massachusetts Institute of Technology, European Research Consortium for // Infor...
# -*- coding: utf-8 -*- """ This module contains functions and helper functions relating to the reading and writing of ROOT files. Note that this module uses root_numpy (and root_pandas, which depends on it) for ROOT interop. root_numpy must be recompiled every time the ROOT version is changed, or there may be issues...
def get_header(): return """ ;--------------------------------------------------------- ; Drum Kit ; Coded by <NAME> January 2001 ;--------------------------------------------------------- sr = 44100 ; Sample rate kr = 4410 ; Kontrol rate ksmps = 10 ; Samples/Kontrol period nchnls = 2 ; Normal stereo zakin...
import bmesh import mathutils import numpy as np from mathutils import Vector from bmesh.types import BMVert, BMFace from ...utils import ( equal, select, FaceMap, validate, edge_vector, skeletonize, filter_geom, map_new_faces, add_faces_to_map, calc_edge_median, set_roof_typ...
from abc import ABCMeta, abstractmethod, abstractproperty from collections import OrderedDict import six from dagster import check from dagster.config.field_utils import check_user_facing_opt_config_param from dagster.core.definitions.config import ConfigMapping from dagster.core.definitions.config_mappable import IC...
#encoding: utf-8 """ Time: 2018-4-25 Brief: python code for confidence estimation using random walks. support 2d image and 3d volume Ref1: Ultrasound confidence maps <NAME>, <NAME>, <NAME>, <NAME>: Ultrasound Confidence Maps using Random Walks, Medical Image Analysis, 16, 6, 1101 - 1112, 2012 ...
"""WRITEME Defines the `Type` class.""" __docformat__ = "restructuredtext en" from theano.compat import PY3 from theano.gof import utils from theano.gof.utils import MethodNotDefined, object2 from theano.gof import graph ######## # Type # ######## from theano.gof.op import CLinkerObject class CLinkerType(CLinkerOb...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.b (the "License"); # you may not use this file except in compliance with the License. # # """ Userbot module for having some fun with people. """ import asyncio import random import re import time from coll...
""" Generic ALF I/O module. Provides support for time-series reading and interpolation as per the specifications For a full overview of the scope of the format, see: https://ibllib.readthedocs.io/en/develop/04_reference.html#alf """ import json import copy import logging import re from uuid import UUID from datetime i...
# -*- coding: utf-8 -*- """ Copyright ©2017. The Regents of the University of California (Regents). All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement, is he...
# pylint: disable=unused-wildcard-import,wildcard-import import inspect import logging import time import contextlib import mlflow from mlflow.entities import Metric from mlflow.tracking.client import MlflowClient from mlflow.utils.validation import MAX_METRICS_PER_BATCH # Define the module-level logger for autologg...
import os import random import numpy as np from tqdm import tqdm from utils import (record_population, evaluate_ind, load_history, store_history, store_checkpoint) import matplotlib # select matplotlib backend matplotlib.use('pdf') import matplotlib.pyplot as plt class Archive: """ Mu...
''' Created on August 2, 2016 This file is subject to the terms and conditions defined in the file 'LICENSE.txt', which is part of this source code package. @author: <NAME> ''' # Time conversions to ms ONE_SECOND_MS = 1000 ONE_MINUTE_MS = 60 * ONE_SECOND_MS ONE_HOUR_MS = ONE_MINUTE_MS * 60 ONE_DAY_MS = ONE_HOUR_MS *...
# This file is part of the MapProxy project. # Copyright (C) 2010, 2011 Omniscale <http://omniscale.de> # # 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/L...
# @name: ont_struct.py # @title: Imports ontology tree and calculates hierarchical level per ontology term # @description: Pulls ontology tree from EBI's Ontology Lookup Service (OLS) API (https://www.ebi.ac.uk/ols/index); # then parses into individual terms and creates the parents for each individual te...
import os import sys import socket import select import urllib import zipfile import Queue from code.tools.xml import XMLParser from code.utils.common import log, log2, logn, coalesce, ensure_path_exists, get_flag_value from code.constants.states import STATUS_ACTIVE, STATUS_INACTIVE # This request object sends...
# Copyright 2018 The TensorFlow Probability 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 o...
#!/usr/bin/env python # -*- coding: utf-8 -*- from .shell import RED_B, RESET, GREEN_B, BLUE_B, BLACK_B, YELLOW_B, GREEN, RED def get_types(thing): try: import types _all_types = types.__all__ thing_type = type(thing) return [t for t in _all_types if thing_type is getattr(types,...
# Copyright(c) 2017-2021 CloudNetEngine. All rights reserved. # Copyright (c) 2021 Cisco and/or its affiliates. # 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/l...
# The controller for the crazyflie. # # Author: <NAME>, <NAME>, <NAME>, Marcus? import time from tf import transformations as trans from cflib.crazyflie.log import LogConfig from threading import Thread from src.path import * from requests import post from json import dumps # cons...
# # 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 us...
from Jumpscale import j from redis.exceptions import ConnectionError import nacl from .protocol import RedisCommandParser, RedisResponseWriter from nacl.signing import VerifyKey import binascii JSBASE = j.baseclasses.object from .UserSession import UserSession, UserSessionAdmin def _command_split(cmd, author3botnam...
""" PV Data Source """ import datetime import functools import io import logging from dataclasses import dataclass from numbers import Number from pathlib import Path from typing import List, Optional, Tuple, Union import fsspec import numpy as np import pandas as pd import xarray as xr import nowcasting_dataset.fil...
#!/usr/bin/env python3 import matplotlib.pyplot as plt import cartopy.crs as ccrs from gcgridobj import regrid import numpy as np import warnings import cartopy.io.shapereader as shpreader from . import atmos_isa_mini __all__ = ['plot_zonal','plot_layer', 'plot_cs','plot_latlon', 'plot_state','pl...
#! /usr/bin/env python3 # Copyright 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 applicabl...
# -*- coding: utf-8 -*- import tempfile from copy import deepcopy from pathlib import Path import os from pydefect.core.defect_entry import DefectType from pydefect.core.irreducible_site import IrreducibleSite from pydefect.input_maker.defect_initial_setting import ( default_charge_set, get_electronegativity, get_...
# Copyright 2021 Sony Semiconductors Israel, 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 b...
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # ''' Non-relativistic unrestricted Kohn-Sham g-tensor (In testing) Refs: JPC, 101, 3388 JCP, 115, 11080 JCP, 119, 10489 ''' from functools import reduce import numpy from pyscf import lib from pyscf.lib import logger from pyscf.dft import numint from py...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- try: # Change main dir to this (need for Pentest Box) import os os.path.abspath(__file__) from Classes import (Credits, finderadminClass, MessengerClass) import argparse from colorama import Fore, B...
################################################################# # # Ising model simulation # # If you run this without an X server, set MPLBACKEND to AGG: # export MPLBACKEND="AGG" # MIT license # # Copyright (c) 2018 christianb93 # Permission is hereby granted, free of charge, to # any person obtaining a copy of t...
""" This file contains several helper functions to manipulate 1D and 2D EEG data. """ import logging import numpy as np from scipy.interpolate import interp1d from .numba import _slope_lstsq, _covar, _corr, _rms logger = logging.getLogger('yasa') __all__ = ['moving_transform', 'trimbothstd', 'sliding_window', ...
import sys import asyncio if sys.version_info >= (3, 7): from asyncio import get_running_loop else: from asyncio import get_event_loop as get_running_loop import concurrent import copy import functools import inspect import logging import os import os.path import re import tempfile import threading from importl...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import division import argparse from os.path import join as pjoin from os import makedirs import time, datetime # the usual suspects import numpy as np import matplotlib as mpl #mpl.use('Agg') #mpl.use('GTK') import m...
################################################################################################### # # GRBLocalizer.py # # Copyright (C) by <NAME> & <NAME>. # All rights reserved. # # Please see the file LICENSE in the main repository for the copyright-notice. # #####################################################...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.py's code parsing.""" import os.path import textwrap import warnings import pytest from coverage import env from coverage.exceptions import...
import os import time import asyncio import shutil import json from bs4 import BeautifulSoup import re from html import unescape from re import findall from urllib.parse import quote_plus from urllib.error import HTTPError from wikipedia import summary from wikipedia.exceptions import DisambiguationError, PageError fro...
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union, cast import dagster._check as check from dagster.core.definitions.events import AssetKey, AssetObservation from dagster.core.definitions.metadata import MetadataEntry, PartitionMetadataEntry from dagster.core.definitions.op_definition import...
#!/usr/bin/env python3 __author__ = 'konradk' import argparse from hail.linalg import BlockMatrix # from gnomad.utils import slack from ukbb_pan_ancestry import * import math def get_final_sumstats_mt_for_export(): mt0 = load_final_sumstats_mt(filter_sumstats=False, filter_varian...
#!/usr/bin/env python3 import argparse import sys from kubernetes import client, config def get_uniq_group_ids(groupids): # Specific correct identification of the group ID: tf1 => -tf1- to prevent getting tf1sf groupId. if groupids is None: exact_groupids = list() else: exact_groupids = [...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
"""Library for analytic solutions.""" import numpy as np import re from scipy.special import jv, factorial as fac, gammaincc, gamma, sici, hyp0f1 from mpmath import hyp1f2 import warnings from typing import Optional @np.vectorize def vhyp1f2(a0, b0, b1, x): """Vectorized hyp1f2 function.""" return complex(hyp...
from src.slu.datareader import PAD_INDEX from src.utils import load_embedding, load_embedding_from_npy import torch from torch import nn from torch.nn import functional as F from torch.nn.parameter import Parameter from torch.autograd import Variable import numpy as np import math class Lstm(nn.Module): def __ini...
# Author: <NAME> # Copyright (c) 2019, <NAME> # All rights reserved. import argparse import os from tqdm import tqdm import numpy as np from path import Path from tensorboardX import SummaryWriter import torch from torch.autograd import Variable import models import custom_transforms from inverse_warp import pose2flow...
# Copyright (c) 2021, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root # or https://opensource.org/licenses/BSD-3-Clause from datetime import datetime import numpy as np from ai_economist.foundation.base.base_component ...
# Copyright 2019-present MongoDB, 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 wri...
# Copyright 2016 128 Technology, Inc. """ Parses the YINsolidated model into an lxml.etree.ElementTree containing custom lxml.etree.Element subclasses for each type of YANG statement. These custom classes provide convenient methods and properties for accessing YANG-specific data without interacting with the XML direct...
# Copyright 2012-2014 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 "license" file ac...
from keras.utils import multi_gpu_model from keras import backend from systemtools.logger import * from numpy import array from keras.preprocessing.text import one_hot from keras.preprocessing.sequence import pad_sequences from keras.models import Sequential from keras.layers import Dense, LSTM, Flatten from keras.laye...
import sys, os from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QProgressBar, QAction, QTableView, QTableWidget,QTableWidgetItem, QGridLayout, QHeaderView, QAbstractItemView, QTextEdit, QHBoxLayout, QMenu, QFileDialog from PyQt5.QtGui import QIcon, QFont, QDrag, QPixmap, QPainter, QColor, QBrush from PyQ...