text
stringlengths
3.07k
12.6k
import os import ssl import time from elasticsearch.connection import create_ssl_context from dotenv import load_dotenv import contextlib import mmap import traceback import json import argparse from collections import OrderedDict from datetime import datetime from Evtx.Evtx import FileHeader from Evtx.Views import ...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for # full license information. import logging import platform import thief_secrets from thief_constants import CustomDimensions from opencensus.ext.azure.log_exporter import AzureEventHandler from ope...
import logging from datetime import datetime, timedelta from typing import List from discord import Colour, Member, Message, Object, TextChannel from discord.ext.commands import Bot from bot import rules from bot.cogs.moderation import Moderation from bot.cogs.modlog import ModLog from bot.constants import ( Anti...
from pycocotools.coco import COCO import os import shutil import json import cv2 as cv def main(): img_path = '/root/deng/dataset/coco/mine/others/person/' ann_path = '/root/deng/dataset/coco/mine/others/person.json' coco_api = COCO(ann_path) save_path = "/root/deng/dataset/coco/mine/others/save/" ...
import sys import os import numpy as np import pandas as pd import dill import torch sys.path.append("../../") from MPDM.HSFM import HSFM from Param import ROS_Param param = ROS_Param() force_model = HSFM(param) # SFM(param) def devide_by_steps(data): # find first/last frame min_frame = min([x['frame']["id...
import torch.nn as nn import torch import torch.autograd as autograd from torch.autograd import Variable import torch.optim as optim import torch.nn.functional as F import torch.utils.data as data from csfeatures import morphVec from config import * PAD = "<PAD>" # padding EOS = "<EOS>" # end of sequence SOS = "<SOS>...
from talon.voice import Key, press, Str, Context from ..utils import ( parse_word, numerals, optional_numerals, text_to_number, jump_to_target, ) ctx = Context("generic_editor") # actions and helper functions def jump_to_bol(m): line = text_to_number(m) press("ctrl-g") Str(str(line))(N...
# RPLIDAR Script from pyrplidar import PyRPlidar import time from tkinter import * from tkinter import font as tkFont from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2Tk) # Implement the default Matplotlib key bindings. from matplotlib.backend_bases import key_press_handler fro...
# -*- coding: utf-8 -*- """ BibTeX parser. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict import json import re from ..text.latex import latex_to_unicode class BibtexParser(...
""" Commands for the potential interface. ------------------------------------- Commandline util for dealing with potcar files. """ # pylint: disable=import-outside-toplevel import click from click_spinner import spinner as cli_spinner import tabulate from aiida.cmdline.utils.decorators import with_dbenv from aiida_...
from enum import Enum import io import pickle import PIL.Image import numpy as np import networkx as nx from pathlib import Path import matplotlib.cm as cm import matplotlib.pyplot as plt from PIL import Image, ImageOps import matplotlib.pyplot as plt from matplotlib.patches import Rectangle n_class_dict = { 'Mu...
import json import os import pandas as pd with open("results/results.json") as res: results = json.load(res) def parse_key(key): if "-" not in key: return key, "", "" if "-jumped-streams-" in key: base, n = key.split("-jumped-streams-") method = "Jumped" elif "-streams-" in k...
"""Events are linked to Trials""" import datajoint as dj import inspect import importlib from . import event schema = dj.schema() _linking_module = None def activate( trial_schema_name, event_schema_name, *, create_schema=True, create_tables=True, linking_module=None, ): """ activa...
#!/usr/bin/python3 import numpy as np import scipy.optimize import random import argparse import multiprocessing as mp import queue from utils.dataset import Dataset from utils.network import Trainer, Forwarder from utils.grammar import PathGrammar from utils.length_model import PoissonModel from utils.viterbi import ...
''' urlcanon/rules.py - url matching rules Copyright (C) 2017 Internet Archive 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 ap...
# -*- coding: utf-8 -*- # # changes.py — .changes file handling class # # This file was originally part of debexpo # https://alioth.debian.org/projects/debexpo/ # # Copyright © 2008 <NAME> <<EMAIL>> # Copyright © 2010 <NAME> <<EMAIL>> # Copyright © 2012 <NAME> <<EMAIL>> # Copyright © 2012 <NAME> <<EMAIL>...
""" Semi-Supervised Classification with Graph Convolutional Networks Paper: https://arxiv.org/abs/1609.02907 Code: https://github.com/tkipf/gcn GCN with batch processing """ import argparse import numpy as np import time import mxnet as mx from mxnet import gluon import dgl from dgl import DGLGraph from dgl.data impor...
import collections import importlib import itertools import warnings import dask import dask.array import entrypoints def discover_handlers(entrypoint_group_name="databroker.handlers", skip_failures=True): """ Discover handlers via entrypoints. Parameters ---------- entrypoint_group_name: str ...
r"""Continuously read and plot waveform data from an NI-SCOPE device using betterproto. The gRPC API is built from the C API. NI-SCOPE documentation is installed with the driver at: C:\Program Files (x86)\IVI Foundation\IVI\Drivers\niScope\Documentation\English\Digitizers.chm A version of this .chm is available onl...
#!/usr/bin/env python """ Clean up test objects created by test cases """ import logging import os import re import sys import time from concurrent.futures import ThreadPoolExecutor from itertools import chain from tests.base import get_tokens from wxc_sdk import WebexSimpleApi TO_DELETE = re.compile(r'^(?:(?:\w{2}|...
"""Tests nest_py.knoweng.flask.accounts.knoweng_authentication.CILogonAuthenticationStrategy""" # -*- coding: utf-8 -*- import responses import pytest from flask import Request from werkzeug.exceptions import UnsupportedMediaType from werkzeug.test import create_environ from nest_py.knoweng.flask.accounts.knoweng_authe...
from __future__ import annotations import asyncio import datetime import functools import re from typing import TYPE_CHECKING, Any, Callable, Coroutine, Optional, Tuple, Type, TypeVar, Union from urllib.parse import urlsplit, urlunsplit import base65536 import cachingutils import cachingutils.redis import disnake fr...
import random, os import argparse import numpy as np import torch import torch.optim as optim import torch.nn.functional as F from tqdm import tqdm from torch.autograd import Variable from transformers import * from models import inference_model from data_loader import DataLoader from torch.nn import NLLLoss import lo...
# -*- coding: utf-8 -*- ## # Copyright (C) 2007 Ingeniweb # 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; either version 2 of the License, or # (at your option) any later version. # This progr...
#coding: utf-8 import os import time import random import random import torch import torchaudio import numpy as np import soundfile as sf import torch.nn.functional as F from torch import nn from torch.utils.data import DataLoader import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) n...
import warnings warnings.filterwarnings("ignore") import math, random import gym import numpy as np import sys import os np.random.seed(123) import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.autograd as autograd import gym_malware from gym_malware.envs.utils...
"""Module to help create the epicsArch file that will be read by the DAQ.""" import argparse import logging import os import sys from .constants import EPICS_ARCH_FILE_PATH from .qs_load import get_qs_client logger = logging.getLogger(__name__) def _create_parser(): """Argument Parser Setup. Define shell comman...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Source code meta data __author__ = "<NAME>" __email__ = "<EMAIL>" # Import builtin python libraries import logging import os import sys # import external python libraries import click # Import custom (local) python packages from .config_handler import config_files, l...
import pandas as pd import cachetools.func import warnings from . import states @cachetools.func.ttl_cache(ttl=600) def load_and_massage(url): df = pd.read_csv(url) df = df.drop(columns=['Lat', 'Long']) df = df.rename(columns={'Province/State' : 'province', 'Country/Region' : 'country'}) df = df.drop(...
import os import ssl from six.moves import urllib import pandas as pd import numpy as np import torch import dgl import pickle # === Below data preprocessing code are based on # https://github.com/twitter-research/tgn # Preprocess the raw data split each features def preprocess(PATH, data_name): ...
# -*- coding: utf-8 -*- """ sphinxcontrib.libreoffice ~~~~~~~~~~~~~~~~~~~~~~~~~ Render LibreOffice drawings directly into your documentation See the documentation file for details. :author: <NAME> <<EMAIL>> :license: BSD, see LICENSE for details Inspired by ``sphinxcontrib-gnuplot``...
""" Created on Sept 10, 2020 modules of SASRec: attention mechanism, multi-head attention, self-attention block @author: <NAME> """ import numpy as np import tensorflow as tf from tensorflow.keras.regularizers import l2 from tensorflow.keras.layers import Layer, Dense, LayerNormalization, Dropout, Embedding, Conv1D ...
from LoopsListsW2.loops import tester from ClassyFunctionsW3 import factclass from ClassyFunctionsW3 import lcmclass # from ClassyFunctionsW3 import lcm2 # menuy.py - function style menu # Imports typically listed at top # each import enables us to use logic that has been abstracted to other files and folders # impor...
from __future__ import absolute_import, division, print_function import numbers from contextlib import contextmanager import torch.distributions as torch_dist from torch.distributions.utils import broadcast_all _VALIDATION_ENABLED = False def copy_docs_from(source_class, full_text=False): """ Decorator to ...
from math import sqrt import numpy as np def norm(x): return sqrt(x.dot(x)) def infinity_norm(x): return max(abs(x)) class Continuation: def __init__(self, interface, parameters): self.interface = interface self.parameters = parameters def newton(self, x0, tol=1.e-7, maxit=1000):...
import os import sys import time import argparse import numpy as np from scipy.misc import imshow import torch import torchvision from torch import nn from torch import autograd from torch import optim from torch.nn import functional as F import ops import plot import utils import datagen import encoders import gener...
from django.db import models from django.contrib.auth.models import AbstractBaseUser from django.contrib.auth.models import PermissionsMixin from django.contrib.auth.models import BaseUserManager from django.core.validators import MaxValueValidator, MinValueValidator import os import uuid class UserProfileManager(Bas...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import copy import functools from typing import Any, Dict, List, Set from lisa import schema from lisa.parameter_parser.runbook import RunbookBuilder from lisa.util import LisaException, constants, subclasses from lisa.util.logger import get_log...
#!/usr/bin/python3 # Copyright (c) 2015 SONATA-NFV, 5GTANGO, UBIWHERE, Paderborn University # 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....
#!/usr/bin/env python """Docker Compose Postgres dump and backup script This script can be used to easily create dumps of postgres databases in docker containers, upload them to rclone targets and restore them if needed. It can also simply create archives of any folder (for example a postgres volume mapping) and rest...
# -*- coding: utf-8 -*- """ Created on Tue Mar 17 14:33:33 2020 @author: puyul """ # Reference from: # https://www.hanshq.net/othello.html#bitboards # http://www.cs.cmu.edu/~mmaxim/211-s03/bitboards.html # int object are immutable in python # mypiece and oppiece are both size64 bit-array # If no lega...
# Benchmarking Suite # Copyright 2014-2017 Engineering Ingegneria Informatica S.p.A. # # 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 ...
import cv2 def get_roi(self, region_data): print('getting roi ') print(self.text_props) for text in self.text_props.keys(): text = self.__spell_check(text) # print(texts) for element in region_data: if any(text == x for x in self.crop_hints): # print(tex...
import os import math import shutil import click from veripress_cli import cli from veripress_cli.helpers import ( copy_folder_content, remove_folder_content, makedirs ) def get_deploy_dir(): from veripress import app return os.path.join(app.instance_path, '_deploy') @cli.command('generate', short_hel...
#!/usr/bin/env python3 import sys import argparse import os.path import wx class MainWindow(wx.Frame): def __init__(self, srcfiles, *args, **kwargs): super().__init__(*args, **kwargs) self.mark_mode = False self.marktool = None self.save_filepath = None # this can be set ...
#!/usr/bin/env python # # -*- coding: utf-8 -*- # # 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 # # ...
# -*- coding: utf-8 -*- from nomenclator.vendor.Qt import QtWidgets, QtCore, QtGui class EditableTable(QtWidgets.QWidget): """Widget representing a table with editable items.""" #: :term:`Qt Signal` emitted when items have changed. updated = QtCore.Signal(tuple) def __init__(self, headers, column_w...
import re import search_engine.utils as utils from search_engine import convert_str_to_list from search_engine import seq_list_numeric from search_engine import seq_list def parse_pattern(seq: str): """ A function to substitute RegEx in the sequence string sequence: A string that contains a comma seperate...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
import numpy as np import torch as t import random class QuadraticCost(object): # 二次损失 @staticmethod def fn(a, y): return 0.5 * np.linalg.norm(a - y) ** 2 @staticmethod def delta(z, a, y): """Return the error delta from the output layer.""" return (a - y) * sigmoid_prime(z) ...
import numpy as np import math import sys import random # Star position in parsecs class Star: velocity = np.array([0., 0., 0.]) force = np.array([0., 0., 0.]) def __init__(self, mass, x, y, z, origin): self.mass = mass self.pos = np.array([x, y, z]) self.origin = origin class Ga...
""" Interface to the SQLite db. Use SQLAlchemy to convert between DB tables and python objects. """ ## location of sqlite file - default is /tmp/data.db, unless ## overridden by an env var db_location = "/tmp/data.db" import os if "AIrsenalDB" in os.environ.keys(): db_location = os.environ["AIrsenalDB"] from sq...
# coding=utf-8 from datetime import datetime from typing import Optional, Any from sqlalchemy import Column, Integer, ForeignKey from sqlalchemy.orm import relationship from app.entities.activity import Activity from app.entities.activity_type import ActivityType from app.entities.country import Country from app.enti...
# -*- coding: utf-8 -*- """ Web data provider ~~~~~~~~~~~~~~~~ for sqlalchemy :copyright: 20180615 by <EMAIL>. """ import os import logging from sqlalchemy import func, and_ from sqlalchemy.orm import aliased from db.common import format_size from db.model import FileInfo, FileTag, SysInfo from db.se...
import os import os.path as osp from dbinspector.startup import DATA, REFSEQ, REFSEQ_FASTA, UNIPROT from dbinspector.utils import read_fasta, get_ncbi, get_uniprot from time import time from tqdm import tqdm import logging from typing import Dict import gzip import json from collections import defaultdict from lxml im...
from PIL import Image, ImageDraw import numpy as np def read_data(path = "star_data"): #function that read NASA HIP data with open(path) as f: lines = [s.strip() for s in f.readlines()] print(lines[4]) #show key lines = list(map(processing_data,lines)) lines = [line for line in lines if li...
import os import json import nltk from tqdm import tqdm import numpy as np args = { 'glove_corpus' : '840B', 'glove_vec_dim' : 300, 'glove_dir' : '../data/glove/', 'squad_dir' : '../data/squad/', 'train_ratio' : 0.9 } sent_tokenize = nltk.sent_tokenize def word_tokenize(tokens): return [token....
from typing import Dict, List, Callable from PIL import Image from service.inference import StyleGAN2, Models import numpy as np from io import BytesIO import base64 from service.ss58 import ss58_decode from fastapi import HTTPException _MAX_IMAGES = 10 def _project_a_onto_b(a: np.ndarray, b: np.ndarray) -> np.ndarr...
""" Module containing the factor and belief classes. """ # License: BSD 3 clause import numpy class DiscreteFactor(object): """ A factor containing only discrete variables. Factors are immutable and basically a container for a probability table and its metadata. """ def __init__(self, variables,...
import os import json import torch import numpy as np from PIL import Image from tqdm import tqdm from torch.utils.data import Dataset, IterableDataset import random import cv2 class FrameDiffDataset(Dataset): def __init__(self, dataroot=""): self.dataroot = dataroot frames = os.listdir(dataroot) ...
import numpy as np import os import pickle from exercise_code.networks.layer import affine_forward, affine_backward, Sigmoid, Tanh, LeakyRelu, Relu from exercise_code.networks.base_networks import Network class ClassificationNet(Network): """ A fully-connected classification neural network with configurable ...
from ivory.common.context import np def im2col(input_data, filter_h, filter_w, stride=1, pad=0): N, C, H, W = input_data.shape out_h = (H + 2 * pad - filter_h) // stride + 1 out_w = (W + 2 * pad - filter_w) // stride + 1 img = np.pad(input_data, [(0, 0), (0, 0), (pad, pad), (pad, pad)], "constant") ...
# -*- coding: utf-8 -*- __all__ = ["BlockedQuadPotential", "WindowedDiagAdapt", "WindowedFullAdapt"] import numpy as np from pymc3.step_methods.hmc.quadpotential import ( QuadPotential, _WeightedVariance, ) from scipy.linalg import LinAlgError, cholesky, solve_triangular from .estimator import _WeightedCovar...
import os from muscope.util import take from irods.keywords import FORCE_FLAG_KW from irods.session import iRODSSession from irods.exception import CAT_NO_ROWS_FOUND, CollectionDoesNotExist, DataObjectDoesNotExist def irods_session_manager(): return iRODSSession(irods_env_file=os.path.expanduser('~/.irods/irods...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import random import threading import cPickle as pickle import numpy as np import skimage.util import tensorflow as tf # Process images of this size. Note that this differs from the original CIFAR #...
"""Training functions for dcgan32 inverter""" import os import datetime as dt import torch import src.data.dcgan32.create_inversion_dataset as ds_create import src.data.dcgan32.load_inversion_dataset as ds_load from src.data.util import cycle from src.models.dcgan32 import DCGAN32Inverter,DCgan32ResnetInverter from ...
""" This module is helper module to load features other than DNase. All public functions returns dictionary object where the keys are chromosomes and values are according to specific data """ import logging import re import os try: import urllib.request urlret = urllib.request.urlretrieve except: import ur...
import re from program_constants import * from bs4 import BeautifulSoup from fb_results_parser import comments_from_post, shares_from_post, parse_ids_from_url, save_pandas # import codecs # import re # import pandas as pd # -*- coding: UTF-8 -*- __author__ = "KnifeF" # TODO - add tagged profiles, profile url. profil...
#%% import os os.chdir('/home/flower/github/Protein3D/Protein3D') from utils import * from torch.cuda import max_memory_allocated from torch.nn.functional import softmax from models import * # from pytorch_memlab import LineProfiler, MemReporter, profile, profile_every, set_target_gpu #%% NUM_FUNC = 384 # @profi...
from co2_diag.formatters.nums import my_round import pandas as pd from cycler import cycler import matplotlib as mpl from matplotlib import pyplot as plt, dates as mdates, ticker, colors as mcolors # import mpl_toolkits # from mpl_toolkits.axes_grid1 import make_axes_locatable from co2_diag.graphics import aesthetic_g...
import os import torch import torch.nn as nn import torch.nn.functional as F import torchvision from torchvision import transforms import tensorflow as tf from torchvision.utils import save_image import argparse # Device configuration device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # Create a dir...
import csv from datetime import datetime from io import StringIO from operator import add from typing import List from typing import Union from cerberus import TypeDefinition from cerberus import Validator from pyspark import RDD from pyspark.accumulators import AddingAccumulatorParam from pyspark.sql import DataFrame...
# Copyright (c) 2002-2011 IronPort Systems and Cisco Systems # # 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, mo...
# encoding:utf-8 # This is the main file. """ Author: yu,Zhang Time: 2020/09/16 """ import time import numpy as np import os import torch import torch as t import torchvision as tv import torch.nn as nn from torch.autograd import Variable from torch.utils.data import DataLoader import torch.optim as optim from torchvi...
# -*- coding: utf-8 -*- ## if SSL/HTTPS is properly configured and you want all HTTP requests to ## be redirected to HTTPS, uncomment the line below: # request.requires_https() ## app configuration made easy. Look inside private/appconfig.ini from gluon.contrib.appconfig import AppConfig from images import THUMB ##...
""" Script that gets the required commits from the source repository and logs it into the log file in another repository """ from __future__ import print_function import sys import argparse import datetime import openpyxl import config from git import Repo from termcolor import cprint from colorama import init from...
import time from enum import Enum import configparser import sys from datetime import timedelta import platform import os import __strings__ as strings class PomodoroType(Enum): WORK = 1 BREAK = 2 REST = 3 class Pomodoro: config = configparser.ConfigParser() current_pomodoro = PomodoroType.WORK ...
def player_ai(game_board, player_hand, first_move): print("Player 1 AI Called") moves = [] move_point_total = 0 # TODO: Fix offsets so we don't have tile value 1 in the position 0, etc # Create a 4 x 13 array with the values of the tiles in the player's hand # Ignores the possibility of dup...
import sqlite3 as sq3 import json import discord from typing import Optional, Tuple from .ReportParser import Report, GameType from util.exception import InvalidArgs GAMETYPE_TO_LOWERCASE = { GameType.BEGIN_FFA: "begin_ffa", GameType.FFA: "ffa", GameType.BEGIN_TEAMER: "begin_teamer", GameType.TEAMER: ...
# coding=utf-8 from datetime import datetime from flask_babelex import gettext from psi.app.reports import sqls from psi.app.service import Info from psi.app.utils import format_util, get_last_week, get_last_month def sales_amount_report(r_type, r_period): limit = get_limit(r_period) sql = sqls.SALES_AMOUNT...
import json import requests from requests.exceptions import RequestException from requests.packages.urllib3.exceptions import InsecureRequestWarning from . import exceptions, utils from .models import ( Epics, History, IssueAttachments, IssueAttributes, Issues, IssueStatuses, IssueTypes, Milestones, Points, P...
''' Reference: https://github.com/openai/imitation I follow the architecture from the official repository ''' import tensorflow as tf import numpy as np from baselines.common.mpi_running_mean_std import RunningMeanStd from baselines.common import tf_util as U, fmt_row from baselines.common.dataset_plus import Dataset,...
#!/usr/bin/python3 # number of output figures = 2 # dependencies = cpp/optimizeConstrained import functools import itertools import multiprocessing import numpy as np from helper.figure import Figure import helper.hpc import helper.plot @helper.hpc.cacheToFile @helper.hpc.executeRemotely def optimizeConstrained(f...
import numpy as np import pandas as pd from os.path import join as oj import os import pygsheets import pandas as pd import sys import inspect import datetime import requests currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.append(p...
# -*- coding: utf-8 -*- # # Licensed under the terms of the BSD 3-Clause or the CeCILL-B License # (see codraft/__init__.py for details) """ Application embedded test 1 CodraFT main window is destroyed when closing application. It is rebuilt from scratch when reopening application. """ from guidata.qthelpers import ...
""" Module for chemical informatic tasks """ import sys from io import StringIO import numpy as np import rdkit.Chem as Chem import rdkit.Chem.AllChem as AllChem import rdkit.Chem.ChemicalForceFields as ChemicalForceFields import rdkit.Chem.Draw as Draw Chem.WrapLogs() ATOM_LIST = [x.strip() for x in [ 'h ',...
#!/usr/bin/env python from __future__ import print_function import sys import string # Import third-party modules # import pybedtools import pysam import re class FormatError(Exception): """ Raised when an input file (FASTA or FASTQ) is malformatted. """ def internal_polyA_checker(seq, chrom, polya_st, polya_ed,...
#!/usr/bin/env python3 from flask import Flask, abort, json, render_template, request import flask from flask_sqlalchemy import SQLAlchemy import datetime import os MIME_TYPE_SVG = 'image/svg+xml;charset=utf-8' colormap = { 'green': '#97ca00', 'orange': '#fe7d37', 'red': '#e05d44', } app = Flask(__name...
import logging import datetime import chirun.filter import re import nbformat from jinja2 import Environment, FileSystemLoader, select_autoescape, contextfilter, TemplateNotFound from pyppeteer import launch from notedown import MarkdownReader from chirun.markdownRenderer import MarkdownRenderer from . import mkdir_p ...
# MIT License # # Copyright (c) 2017 <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, publi...
# Initial state s = [ 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19, ] k = [ 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, ...
import os import random import io from . import utils import tensorflow as tf def preprocess_nc(data_dir, dataset_prefix="train.full.tok", train_prefix="train.tok", dev_prefix="dev.tok", dev_size=2000): # full src = os.path.join(data_dir, "%s.en" % dataset_prefix) ref = os.path.join(data_dir, "%s.zh" ...
import pytest from greent.graph_components import KNode #from greent.services.biolink import Biolink #from greent.ontologies.mondo import Mondo #from greent.servicecontext import ServiceContext from greent import node_types from greent.util import Text from greent.conftest import rosetta @pytest.fixture() def biolink...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: utf-8 -*- """ Created on Tue May 31 17:03:56 2016 @author: rmondoncancel """ import copy def sign(a) : """Helper returning the sign of a """ return (a>0) - (a<0) def nextAction(state) : """Returns the state at the next action """ newState = copy.deepcopy(state) # Updates th...
# -*- coding: utf-8 -*- # 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, softw...
# Standard library imports import argparse import asyncio # 3rd party library imports import d1_scimeta.util # Local imports from .abds import AbdsIptHarvester from .arm import ARMHarvester from .bcodmo import BCODMOHarvester from .cuahsi import CUAHSIHarvester from .ieda import IEDAHarvester from .nkn import NKNHarv...
import cv2 import random import numbers import numpy as np def resize_image_points(image, key_points, center_points, ratio): """ Resize image, key points and center points according the ratio :param image: The image to be resized. :param key_points: The key points to be resized. :param center_points: The center ...
# -*- coding: UTF-8 -*- import pytest from put.fileutils import ( is_file_exist, is_file_empty, is_dir_exist, is_dir_empty, make_dir, remove_dir, join_path, load_lines, get_file_info, scan_dir, ) from tempfile import TemporaryDirectory def test_is_file_exist(): assert is_f...
from src.logger import setup_logger from functools import wraps from src.hotdog import GetSignalPerformance, check_cronjob, LoadHitSignal from src.util import parse_telegram_input, map_signal, print_df, random_print, \ format_input_date, print_history_df from telegram.ext import Updater, CommandH...