text
stringlengths
6.04k
39.5k
""" MIT License Copyright (c) 2022, Lawrence Livermore National Security, LLC Written by <NAME> et al. 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 limit...
import os import sys import pprint import tempfile import itertools import subprocess from collections import defaultdict from contextlib import contextmanager from datetime import datetime import luigi import ujson import numpy as np from numpy.random import RandomState import pandas as pd import torch from torch imp...
# This source code is part of the Hydride package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. __name__ = "hydride" __author__ = "<NAME>" __all__ = ["FragmentLibrary"] from os.path import join, dirname, abspath import warnings import pickle from biotite.stru...
import argparse import tqdm import os import pickle as pkl import scipy as sp import torch from pprint import pprint import utils as ut from torchvision import datasets, transforms from model import Classifier, CD_Simu, Cycle_Cons, Encoder, Decoder, Discriminator from unet_model_cond_warp import Cycle_Con...
#!/usr/bin/env python3 # Copyright (c) 2020 Graphcore Ltd. All rights reserved. import enum import argparse from ctypes.util import find_library import logging import os import re import clang.cindex logger = logging.getLogger("PopParse") parser = argparse.ArgumentParser() parser.add_argument("-c", ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script enables merging of existing building entities into a single building entity within a city object instance. The new building object instance is saved on an existing building node within the city. The building nodes, where buildings have been extracted for merge, a...
# -*- cofing: utf-8 -*- # MIT License # # Copyright (c) 2021 - Present nxtlo # # 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 # t...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Collection of functions for loudspeaker beamforming. """ import numpy as np import scipy.signal import scipy.io.wavfile import os import sys import shutil import pickle as pkl import wave import pyaudio as pa import matplotlib.pyplot as plt from typing import Tuple #...
import itertools from typing import Optional, Callable, Type, Tuple, List, Union import torch from .utils import get_jacobian from abc import ABC, abstractmethod import numpy as np class CouplingBase(torch.nn.Module, ABC): def __init__( self, dim: int, dim_condition: int, nr_layer...
"""Control actions triggered by the GUI.""" # atbswp: Record mouse and keyboard actions and reproduce them identically at will # # Copyright (C) 2019 <NAME> <<EMAIL>> # # 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 Fr...
import datetime import logging import os import queue import threading import typing from functools import partial from io import StringIO import pandas as pd import psycopg2 from dateutil import tz from dateutil.relativedelta import relativedelta from atpy.data.cache.lmdb_cache import write from atpy.data.ts_util im...
""" Recursive Cascaded Networks modified from https://github.com/microsoft/Recursive-Cascaded-Networks/blob/master/network/recursive_cascaded_networks.py """ import tensorflow as tf import tflearn import numpy as np from .utils import Network from .base_networks import VTN, VTNAffineStem, VoxelMorph, \ ...
from collections import OrderedDict from itertools import product import numpy as np from typing import Dict, Tuple, Iterator, List from ndstructs.utils import JsonSerializable INT = np.int64 FLOAT = np.float64 class Point5D(JsonSerializable): LABELS = "txyzc" SPATIAL_LABELS = "xyz" LABEL_MAP = {label:...
import torch from torch import nn import torch.nn.functional as F from typing import Optional, Iterable, Union, Type, Tuple import warnings from gliomagrowth.util.util import ( match_shapes, stack_batch, unstack_batch, tensor_to_loc_scale, ) class ImageProcess(nn.Module): """ A Neural Process...
import numpy as np import healpy as hp import matplotlib.pyplot as plt from scipy.stats import norm, multivariate_normal from scipy.signal import convolve, convolve2d from scipy.interpolate import interp1d from iminuit import Minuit def diffuse_model(x, c0, theta_d): fd = 2*np.pi * np.sin(np.deg2rad(x)) * c0 / the...
# Copyright (c) 2018 <NAME> # Copyright (c) 2019 <NAME> # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import ast import numpy as np from itertools import chain from string import Template from .utils import d...
############################################################################# # $Id: formatters.py,v 1.1 2011/08/16 16:00:36 reids Exp $ # $Revision: 1.1 $ # $Date: 2011/08/16 16:00:36 $ # $Author: reids $ # $State: Exp $ # $Locker: $ # # PROJECT: IPC # # FILE: formatters.py # # DESCRIPTION: Functions...
""" Copyright (c) 2016 <NAME> 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, merge, publish, distribute, sublice...
# coding=utf-8 # Copyright 2022 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...
import itertools from . import features ####### CONSTANTS ####### EMPTY = 0 BLACK_PAWN = 1 BLACK_KING = 3 WHITE_PAWN = -1 WHITE_KING = -3 class Board: ''' Board class This class represents the checkers board and provides all the functionality that allows to play the game, like computing the lega...
#!/bin/python3 import json import os import rdflib as r from rdflib import Graph, Namespace from rdflib.namespace import RDF from rdflib.term import Literal import click WN30 = Namespace("https://w3id.org/own-pt/wn30/schema/") WN30EN = Namespace("https://w3id.org/own-pt/wn30-en/instances/") WN30PT = Namespace("https:...
import re import os import sys import json import pickle import humanize import datetime import inspect import logging from time import time from functools import wraps from datetime import datetime from typing import Tuple, Callable, Union, Dict, List from .utils import get_params, parse_time, random_string from .bac...
"""Plots frames according to settings. """ import math import operator from . import midani_annotations from . import midani_colors from . import midani_misc_classes from . import midani_r from . import midani_score from . import midani_time def _rect_or_its_shadow_in_frame(now, note, settings, voice_i): retur...
# LICENSE # Copyright (c) 2020 <NAME> # 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, merge, publ...
from Bio import pairwise2 from Bio.pairwise2 import format_alignment from Bio import SeqIO from Bio.Blast import NCBIWWW from Bio.Blast import NCBIXML import sys, getopt # function to calculate gc precentage in DNA def gc(DNA): """This command takes a seq as a string and returns the gc percentage of it.""" fo...
# -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2012-2020 iSolver Software Solutions (C) 2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). from __future__ import division, print_function, absolute_import from collections import namedtuple import...
import argparse import time import sys import os import json import csv import matplotlib.pyplot as plt import numpy as np import torch import torch.nn as nn import torchvision.transforms as transforms from torch.optim.lr_scheduler import MultiStepLR, ReduceLROnPlateau import torch.optim as optim from torch.utils.data...
"""Provide useful and simple classes to manage Directed graphs. Provide useful and simple classes to manage Directed graphs. It contains the three classes `DirectedGraph`, `DirectedNode` and `Arc`. To build a graph, use the `DirectedGraph` class. It is not recommended to manually instantiate a node, an arc as it is n...
from turtle import forward import numpy as np import torch import torch.nn as nn import util import copy class ActorVMPO(nn.Module): def __init__(self, action_dim, mid_dim, device, shared_net): super(ActorVMPO, self).__init__() self.device = device self.action_dim = action_dim sel...
import torch import torch.nn as nn import torch.nn.functional as F from multi_head_att.submodules import MultiHeadAttention, PositionwiseFeedForward, PositionalEncoding def masked_mean(input, mask=None, dim=1): # input: [batch_size, seq_len, hidden_size] # mask: Float Tensor of size [batch_size, seq_len], whe...
# Copyright (c) 2009-2011 testtools developers. See LICENSE for details. """Matchers, a way to express complex assertions outside the testcase. Inspired by 'hamcrest'. Matcher provides the abstract API that all matchers need to implement. Bundled matchers are listed in __all__: a list can be obtained by running $ p...
import discord from discord.ext import commands from .utils import helper_functions as hf import asyncio from datetime import datetime, timedelta import re import os dir_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) SP_SERV = 243838819743432704 JP_SERVER_ID = 189571157446492161 class Submod(c...
import itertools import hashlib import ast from ecdsa import SigningKey, VerifyingKey, SECP112r2 import node from ecdsa.util import randrange_from_seed__trytryagain import os import validator import copy # from numba import jit import pickle import time import random def priv_key_gen(): seed = os.urandom(SECP112r...
from . import errors from .struct_def import (SQLDataValueDef, SQLValueListDef, Header, ExecuteReply, FetchReply, PrepareReply) from .constants.TRANSPORT import Transport from .converters import Convert class Statement: def __init__(self, conn, cursor): self._connection = conn self._cursor = curs...
from django.db import models # 员工信息 可能需要添加到字段 :登录时间,上次登录时间,登录次数 class User(models.Model): gender = ( ('male', '男'), ('female', '女'), ) year = ( ("thisyear", '应届'), ("laseyear", '往届'), ) uname = models.CharField(u'姓名', max_length=40 ,primary_ke...
"""Module for astropy coordinate frames representing external galaxies. Specific examples for M31, M33, and the LMC are provided, with reasonable (but not necessarily up-to-date) parameter defaults. Also provided are routines for transforming between sky coordinates and galaxy disk plane, and between SkyCoord and tange...
#!/usr/bin/env python # %% """ Relief family algorithm implementations. ===== Copyright 2017 <NAME> <<EMAIL>> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the ab...
"""Tests for the numerical lifting line grid.""" # pylint: disable=redefined-outer-name import pytest import numpy as np import machup.geometry as geom from machup import LLGrid PLANE_DIR = "test/geometry/testairplanes/" @pytest.fixture def single_wing_grid(): """Get a LLGrid for the single_wing.json example."...
# This module is part of Hypatia and is released under the # MIT License: http://opensource.org/licenses/MIT """Why stuff is drawn; logic flow for the game. Game logic, game component interaction. Glues various modules/game components together with behaviors defined in methods belonging to Game(). Note: ...
import math from modules.graph_data import GraphData from modules.gas_table_data import TableData import modules.graph_save_data as gs def add_variables(f): f.add_variable("cz*" + s(f.v["i_int"] + 1), 1.0, "") for i in range(1, f.v["i_int"] + 2): f.add_variable("pt2D_ср" + s(i), 1.0, "") f.add...
import json from typing import Dict, List, Tuple, Optional from kobo.rpmlib import parse_nvr from tenacity import retry, stop_after_attempt, wait_fixed from urllib import request from urllib.error import URLError from doozerlib.util import brew_suffix_for_arch, isolate_el_version_in_release from doozerlib import exe...
# Copyright 2015 gRPC 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...
# 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 tensorflow as tf #NEED if int(tf.__version__[0])>1: import tensorflow.compat.v1 as tf tf.disable_v2_behavior() from functools import partial #NEED #slim = tf.contrib.slim import numpy as np #NEED #import pandas as pd import math #NEED #from scipy import stats #from sklearn import preprocess...
# Copyright 2016 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...
# 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...
from pathlib import Path from os import PathLike, fspath from types import MappingProxyType from typing import Union, Optional, Mapping, Tuple from typing import Iterable, Iterator, Generator from collections import OrderedDict import gzip import bz2 from warnings import warn import h5py import numpy as np import pand...
from typing import List, Tuple, Optional import math import torch from torch import Tensor from torch import nn import torch.nn.functional as F __all__ = [ "ResBlock", "MelResNet", "Stretch2d", "UpsampleNetwork", "WaveRNN", ] class ResBlock(nn.Module): r"""ResNet block based on *Efficient Ne...
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
"""Multimedia Extensible Git (MEG) configuration Configuration for runtime """ import os import re import copy import json import errno import shutil import pathlib import requests from pathlib import Path from meg_runtime.logger import Logger # Runtime configuration exception class ConfigException(Exception): ...
# Copyright 2022 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2003-2010 <NAME> <<EMAIL>> # All Rights Reserved. # Simplified BSD License (see LICENSE.txt for full text) """\ ELF object file reader. """ import struct import msp430.memory import msp430.memory.error # size alignment # Elf32_Addr 4 4 ...
# -*- coding: utf-8 -*- # # Read the Docs Template documentation build configuration file, created by # sphinx-quickstart on Tue Aug 26 14:19:49 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenera...
# <NAME> # November 9, 2018 import cmath from math import * ########################################################################################################################## # functions ########################################################################################################################## ...
from typing import List, Dict, Any, Type, Generator, Optional, Union, TYPE_CHECKING, Tuple from types import FunctionType from inspect import signature, Signature from MFramework import ( Snowflake, GuildID, ChannelID, UserID, RoleID, Channel, User, Role, Guild_Member, Message, ...
""" Author: KeKe Please install tiger-api before use. pip install tigeropen """ from copy import copy from datetime import datetime from multiprocessing.dummy import Pool from queue import Empty, Queue import functools import traceback import pandas as pd from pandas import DataFrame from tigeropen.tiger_open_config...
import argparse import os from tqdm import tqdm import numpy as np from path import Path from tensorboardX import SummaryWriter import torch import torch.nn as nn from torch.autograd import Variable import pandas as pd import csv import custom_transforms from inverse_warp_summary import pose2flow from datasets.valida...
"""Unittests for heapq.""" import random import unittest from test import support from unittest import TestCase, skipUnless from operator import itemgetter py_heapq = support.import_fresh_module('heapq', blocked=['_heapq']) c_heapq = support.import_fresh_module('heapq', fresh=['_heapq']) # _heapq.nlargest/nsmallest...
import argparse import warnings from math import ceil from pathlib import Path import torch import torchvision.models.optical_flow import utils from presets import OpticalFlowPresetTrain, OpticalFlowPresetEval from torchvision.datasets import KittiFlow, FlyingChairs, FlyingThings3D, Sintel, HD1K def get_train_datase...
''' Leaf nodes of document hierarchy. Created on 6 Feb 2018 @author: <NAME> @copyright: 2018 <NAME> @license: MIT License ''' from __future__ import division import os.path import sys import re from subprocess import Popen, PIPE from beamr.lexers import imageLexer from beamr.parsers import imageParser from b...
# Webhooks for external integrations. import re from functools import partial from typing import Any, Callable, Dict, List, Optional from inspect import signature from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.decorator import api_key_only_webhook_view...
# Copyright 2013 OpenStack Foundation # 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 requ...
# coding=utf-8 # Copyright 2022 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...
import argparse import contextlib import logging as log import os import shutil import sys from collections import namedtuple import backup import translate # KUBERNETES CLI kubectl = os.getenv("KUBECTL", "kubectl") # Edit/Update as needed Mapping = namedtuple("Mapping", ["DCOS_VERSION", "JENKINS_VERSION", "KUBERNE...
#!/usr/bin/env python3 # Produces various CMB map realizations. Requires orphics package installation # with all associated dependencies. from __future__ import division, print_function import sys import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp1d from orphics import maps, io, s...
import copy import datetime import locale import os import pickle import sys from ._compat import PY2, string_types, pjoin, iteritems, to_bytes, exists from ._load import portalocker from .helpers.classes import SQLCustomType, DatabaseStoredFile class Migrator(object): def __init__(self, adapter): self.ad...
# Copyright 2021 AI Redefined Inc. <<EMAIL>> # # 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 ...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # ### ### ### ### ##...
import re import pickle import base64 # from mycroft import intent_file_handler from mycroft.audio.services.vlc import VlcService # mplayer stutters every 10sec when playin Amzn-Music's chunked mp3 streams # from mycroft.audio.services.mplayer import MPlayerService from mycroft.skills.common_play_skill import CommonPla...
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this f...
import os import logging import json import glob import collections import yaml import pandas as pd import numpy as np from matplotlib import pyplot as plt from mathtools import utils logger = logging.getLogger(__name__) def load_vocabs(vocab_fn): def get_part_name(event_name): return utils.remove_pre...
import html import os import sublime import sublime_plugin from .core.logging import debug from .core.panels import ensure_panel from .core.protocol import Diagnostic, DiagnosticSeverity, DiagnosticRelatedInformation, Point, Range from .core.settings import settings, PLUGIN_NAME from .core.views import range_to_region...
# protoc plugin to map from FileDescriptorProtos to a canonicaly formatted # proto. # # protoxform is currently only a formatting tool, but will act as the basis for # vN -> v(N+1) API migration tooling, allowing for things like deprecated field # removal, package renaming, field movement, providing both .proto and .cc...
import os, glob import numpy as np import pandas as pd import pickle import torch from torch.utils.data import TensorDataset, DataLoader from numpy.random import rand, randn from scipy.spatial.distance import pdist, squareform from matplotlib import pyplot as plt from collections import defaultdict from shape...
import traceback import json import os import logging import asyncio import concurrent.futures import aiohttp from aiohttp import web import aiohttp_session import uvloop from gidgethub import aiohttp as gh_aiohttp, routing as gh_routing, sansio as gh_sansio from hailtop.utils import collect_agen, humanize_timedelta_ms...
import copy import niftiutils.helper_fxns as hf import niftiutils.transforms as tr import niftiutils.registration as regs import itertools import nibabel as nib import numpy as np import os import shutil import time ########################### ### File I/O ########################### def check_dcm_paths(patient_id, p...
from collections import OrderedDict from enum import Enum from .lightning import LightningRpc, Millisatoshi from threading import RLock import inspect import json import os import re import sys import traceback class MethodType(Enum): RPCMETHOD = 0 HOOK = 1 class RequestState(Enum): PENDING = 'pending'...
import asyncio import logging import os import threading import serial # type: ignore from queue import Queue try: import select except ModuleNotFoundError: select = None # type: ignore from time import sleep from collections import deque from typing import Callable, Optional, Mapping, Tuple, Deque, TYPE_CHEC...
import argparse import glob import gzip import threading from itertools import repeat from pprint import pprint import simplejson as json import multiprocessing as mp from multiprocessing.pool import Pool radical_dict = { 0: "no_radical", 1: "singlet", 2: "doublet", 3: "triplet" } charge_dict = { ...
""" Path tracking simulation with iterative linear model predictive control for speed and steer control author: <NAME> (@Atsushi_twi) """ import matplotlib.pyplot as plt import cvxpy import math import numpy as np import sys import csv import pandas as pd sys.path.append("../../PathPlanning/CubicSpline/") try: ...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from itertools import chain from . import composite_modules as modules from .questionEncoder import BiGRUEncoder from .controller import Controller # noinspection PyIncorrectDocstring,PyProtectedMember,GrazieInspection class XNMNet(...
#!/usr/bin/env python # -*- coding: utf-8 -*- from . import _parametrization from . import _knots from . import _helpers from . import _algebra import numpy as np import math import scipy.integrate import scipy.optimize class Spline(object): """Definition of a B-Spline curve in 2D. Parameters ----------...
# # Copyright © 2019 <NAME> # Licensed under Apache License, Version 2.0, January 2004 # # # displays the results of a job, either to the terminal or a file # # # some handy lists of masses, in integer milliDaltons # #from __future__ import print_function #from libcpp cimport bool as bool_t import re import json imp...
import sys, re from subprocess import \ check_output, PIPE, STDOUT, DEVNULL, CalledProcessError, TimeoutExpired from os.path import abspath, basename, dirname, exists, join, splitext, isdir from getopt import getopt, GetoptError from os import chdir, environ, getcwd, mkdir, remove from shutil import copyfile, rmtre...
import numpy as np from scipy import sparse from scipy.sparse.linalg import lobpcg import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.datasets import Planetoid from torch_geometric.utils import get_laplacian import math import argparse import os.path as osp torch.set_default_dtype(t...
# Django Imports import django django.setup() from celery import shared_task, task from celery.task.schedules import crontab from celery.decorators import periodic_task from django.db.models import F from django.core.urlresolvers import reverse # Python Imports import random, datetime import decimal import json # WaW...
"""Some methods to work with pre-existing Semantic Vectors spaces""" import struct import copy from typing import List import numpy as np from bitarray import bitarray import sys def getvector(wordvecs, term): """ Retrieve the vector for a term Parameters are a pair of lists, wordvecs[0] - the terms, word...
import os import pickle import sys import numpy as np import scipy.stats from sklearn.metrics import f1_score from ..tools.decorator import override try: import tensorflow.compat.v1 as tf tf.disable_v2_behavior() except ImportError: tf = None from .h5py_mixin import H5pyMixin from .train_test_model impo...
"""Main library entrypoint.""" import copy import os import sys import random import math import subprocess import time import tempfile import yaml import numpy as np import tensorflow as tf from opennmt import evaluation from opennmt import models from opennmt import training as training_util from opennmt.utils imp...
#################################################################################### # # Program dependancies the IMU must circuit must be placed either facing up # or facing down for accurate initialization process. Depending on up/down # several lines of codes need to be commented out or used. The...
# -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from __future__ import print_function as _ from __future__ import division as _ from...
#!/usr/bin/env python # # Downloaded from https://github.com/trgibbons/BlastGraphMetrics/blob/master/blast2graphs.py # 19 Sept 2017. # Standard Python libraries from sys import stderr import sys import argparse from decimal import Decimal # Third-party libraries import networkx as nx def main(argv=None): """Whe...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from six import string_types import frappe, copy, json from frappe import _, msgprint from frappe.utils import cint import frappe.share rights = ("read", "write", ...
import os import discord from discord.ext import commands from dotenv import load_dotenv # Library for google search from googlesearch import search #Stock market info libraries import pandas as pd import yfinance as yf from datetime import date,timedelta import numpy as np #Plotting libraries impor...
# This file is to preprocess the annotation file to keep the alternative # exons with high quality, by using the following criteria: # 1. surronding introns are no shorter than 100bp # 2. not overlapped by any SE triplets or AS-exon # 3. the length of the alternative exon within a given region, e.g. 50~450bp # 4. with ...
# Common tests for test_tkinter/test_widgets.py and test_ttk/test_widgets.py import unittest import sys import tkinter from tkinter.ttk import Scale from tkinter.test.support import (AbstractTkTest, tcl_version, requires_tcl, get_tk_patchlevel, pixels_conv, tcl_obj_eq) import ...
# Copyright (C) 2013 by <NAME> (<EMAIL>) # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Unit tests for the Bio.codonalign modules. """ import warnings import tempfile import unittest from Bio imp...
# -*- coding: utf-8 -*- """ test_celllab_cts.py: Unit-test function for CellLabCTS. Created on Thu Jul 9 08:20:06 2015 @author: gtucker """ import numpy as np from numpy.testing import assert_array_equal, assert_raises from landlab import HexModelGrid, RasterModelGrid # For dev from landlab.ca.celllab_cts import ...
from collections import deque import numpy as np from scipy.interpolate import splprep, splev from skimage.measure import marching_cubes from distance import getDistance, getNormVector from params import getCurveParams def _calcBarycenter(verts, no...
# # Copyright (c) 2019 ISP RAS (http://www.ispras.ru) # Ivannikov Institute for System Programming of the Russian Academy of Sciences # # 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 # # h...