text
stringlengths
3.07k
22.1k
import argparse import re from datetime import datetime, timedelta import foomodules.Base as Base import foomodules.utils as utils import hintmodules.weather.stanza as weather_stanza import hintmodules.sensor.stanza as sensor_stanza import hintmodules.weather.utils OFFSET_RE = re.compile( r"^(\+|-)(([0-9]+)d)?\...
""" Tests for setting request properties of servers """ import json import pytest import classla.server as corenlp from classla.protobuf import Document from tests import TEST_WORKING_DIR, compare_ignoring_whitespace pytestmark = pytest.mark.client EN_DOC = "<NAME> lives in California." # results with an example p...
#!/usr/env/bin python3 import pandas as pd from commit_l import Commit from commit_m import CommitM import curses from silence_tensorflow import silence_tensorflow import tensorflow as tf from curseXcel import Table from nltk.stem import PorterStemmer import pdb import pyperclip import pickle import signal from commit_...
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors. # Copyright 2021 Phonetics and Speech Laboratory, Trinity College, Dublin # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may...
import torch import numpy as np from typing import Any, Dict, Union, Optional from tianshou.data import Batch from tianshou.policy import BasePolicy class PSRLModel(object): """Implementation of Posterior Sampling Reinforcement Learning Model. :param np.ndarray trans_count_prior: dirichlet prior (alphas), w...
"""Functions to assist in plotting images.""" import os as os import subprocess from collections import defaultdict from operator import itemgetter from itertools import zip_longest, groupby import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import matplotlib.patheffects as pe from matplotlib imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_wandb ---------------------------------- Tests for the `wandb.InternalApi` module. """ import datetime import pytest import os import yaml from .api_mocks import * from click.testing import CliRunner import git from .utils import git_repo import requests import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import ctypes def get_file_icon(path, large=True): import ctypes SHGetFileInfo = ctypes.windll.shell32.SHGetFileInfoW SHGFI_ICON = 0x100 SHGFI_SYSICONINDEX = 0x4000 SHGFI_LARGEICON = 0x0 SHGFI_SMALLICON = 0x1 class...
import numpy as np import pandas as pd from nnaps.mesa import fileio, common_envelope, evolution_phases, evolution_errors def extract_parameters(data, parameters=[], phase_flags=[], n_ml_phases=0): phases = [] for parameter in parameters: pname, phase, func = evolution_phases.decompose_parameter(p...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############## # GPathFinder: Identification of ligand pathways by a multi-objective # genetic algorithm # # https://github.com/insilichem/gpathfinder # # Copyright 2019 <NAME>, <NAME>, # <NAME>, <NAME>, # <NAME> and <NAME> # # Licensed under the Apache License, Version...
import os import random import pytest import copy from easydict import EasyDict import torch from ding.league import create_league one_vs_one_league_default_config = dict( league=dict( league_type='one_vs_one', import_names=["ding.league"], # ---player---- # "player_category" is j...
#!/usr/bin/env python3 # # This file is part of LUNA. # # Copyright (c) 2020 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-3-Clause from amaranth import * from amaranth.hdl.xfrm import DomainRenamer from lambdasoc.periph import Peripheral from lambdasoc.periph.timer ...
import datetime from django import template from django.contrib.admin.templatetags.admin_list import ( DOT, ResultList, _coerce_field_name, result_hidden_fields, ) from django.contrib.admin.templatetags.admin_urls import add_preserved_filters from django.contrib.admin.utils import ( display_for_fie...
from ctypes import c_int from contextlib import contextmanager from typing import Tuple, List, TYPE_CHECKING import weakref from pyglet import gl from .texture import Texture from .types import pixel_formats if TYPE_CHECKING: # handle import cycle caused by type hinting from arcade.gl import Context class Fr...
import random import re import sys import time import urllib import xml.etree.ElementTree import time import pdb import validators __author__ = "<NAME>" __copyright__ = "Copyright (C) 2018 <NAME>" __license__ = "MIT" __version__ = "2.2" __email__ = "<EMAIL>" """ Supporting methods. See docs in fea...
import csv import os import pickle import sys import torch from collections import Counter from torch.utils.data import TensorDataset pos_tag_labels = ['X', '.', '\'\'', 'ADD', 'AFX', 'CC', 'CD', 'DT', 'EX', 'FW', 'GW', 'IN', 'JJ', 'JJR', 'JJS', 'LS', 'MD', 'NFP', 'NN', 'NNS', 'NNP', 'NNPS', 'PDT', '...
from abc import ABC, abstractmethod from concurrent.futures import process import datetime from flask import render_template, url_for, redirect, request import pandas as pd import logging import math from services import inputs from tools import web_app_tools logger = logging.getLogger('web_app_moddels') class Mod...
''' MIT License Copyright (c) 2021 <NAME>, <NAME>, <NAME>, <NAME> and <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, c...
import argparse from datetime import datetime from hashlib import md5 import mimetypes import os import sys from textwrap import dedent import time import boto3 from flask import Flask, make_response, redirect, request, send_from_directory from jinja2 import Template from sectile import Sectile from werkzeug.exception...
""" The Python engine for kastore. The file format layout is as follows. +===================================+ + Header (64 bytes) +===================================+ + Item descriptors (n * 64 bytes) +===================================+ + Keys packed densely. +===================================+ + Arrays packed ...
import pygrib import bisect import numpy as np import math from dataset_manager import find_datasets, get_sample_dataset """ Major credits to https://github.com/stanford-ssi/valbal-trajectory/blob/master/atmo/atmotools.py, where much of this code was adapted from """ opened_cache = {} cache = {} latitudes = None lon...
#!/usr/bin/env python import os import sys import subprocess import datetime import logging import logging.handlers import argparse import distutils.util fmt_string = 'smf::fmt %(levelname)s:%(asctime)s %(filename)s:%(lineno)d] %(message)s' logging.basicConfig(format=fmt_string) formatter = logging.Formatter(fmt_stri...
# # Unity ML-Agents Toolkit import logging from typing import Dict, List, Deque, Any import os import tensorflow as tf import numpy as np from collections import deque, defaultdict from mlagents.envs.action_info import ActionInfoOutputs from mlagents.envs.exception import UnityException from mlagents.envs.timers impor...
# /data/TaxiBJ/Pro/all_data.npy import argparse import numpy as np import os time_interval = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'] def proWOHoliday(train_mode, ho_type): ...
""" Utility code for drawing arms and arm configuration spaces. Author: <NAME> """ import shapely import shapely.geometry from shapely.geometry import Point, MultiPoint, MultiPolygon import shapely.affinity import shapely.ops import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.pat...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # 08.09 change pad import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Function from models.networks.base_network import BaseNetwork from models.networks.normalization import get_nonspa...
#coding=utf-8 from api.document.doc_tools import * from api.view.base import BaseHandler import time from api.view.base import * from app.customer.models.tools import * from api.convert.convert_user import * from app.customer.models.activity import * from app.customer.models.user import VideoManagerVerify from app.cust...
# Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs") # and others. 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://w...
#!/usr/bin/env python3 """ ./QA/telegram.py - main QA script for telegram This script performs a bunch of telegram tests under censored network conditions and verifies that the measurement is consistent with the expectations, by parsing the resulting JSONL. """ import contextlib import json import os im...
# TODO: # - Rework definition parsing, maybe pycparser? # - Change expression implementation # - Lazy reading? from __future__ import print_function import ctypes as _ctypes import sys from io import BytesIO from dissect.cstruct.exceptions import ResolveError from dissect.cstruct.types.base import Array from dissect.c...
import os class IndexNode: def __init__(self): self.values = [] self.left = None self.center = None self.right = None class LeafNode: def __init__(self): self.values = [] self.next = None class Tuple: def __init__(self, PK, data): self.PK = PK ...
import numpy as np import pytest from numpy.testing import ( assert_, assert_allclose, assert_equal, assert_warns, assert_raises) from statsmodels.tsa.arima.datasets.brockwell_davis_2002 import lake, oshorts from statsmodels.tsa.arima.estimators.gls import gls @pytest.mark.low_precision('Test against Example 6....
# -*- coding: utf8 -*- import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math from .submodule import convbn_3d, feature_extraction, disparityregression from .submodule import convbn group_norm_group_num = 32 class supe...
import os import time import json import yaml import cv2 import numpy as np from easydict import EasyDict as edict import torch import torch.nn.functional as F import torchvision.transforms as transforms import emoji from transformers import AutoTokenizer from src.models import get_encoder_decoder def read_json(j...
#!/usr/bin/env python """Docstring for module.""" import sys import argparse import json from os.path import expanduser # ============================================================================== __version__ = "0.1" __copyright__ = "Copyright 2018, devops.center" __credits__ = ["<NAME>", "<NAME>"] __license__ = ...
# ***************************************************************** # Copyright 2013 MIT Lincoln Laboratory # Project: SPAR # Authors: ATLH # Description: Represents a equality query batch # Modifications: # Date Name Modification # ---- ---- ...
import numpy as np import tensorflow as tf from t3f import ops from t3f import batch_ops from t3f import initializers class _BatchOpsTest(): def testConcatMatrix(self): # Test concating TTMatrix batches along batch dimension. first = initializers.random_matrix_batch(((2, 3), (3, 3)), batch_size=1, ...
# coding=utf-8 import hashlib import logging import random import re from urllib import parse from lib.Requests import Requests from lib.cli_output import console from lib.url import parse_host apps = None ports = ['CDN:0'] vuln = ['27017', 'Mongodb'] def verify(vuln, port, apps): if vuln[0] == 'True': ...
# **************************************************************************** # # # # ::: :::::::: # # Animal-Mashing.py :+: :+: :+: ...
# # This file is part of m.css. # # Copyright © 2017, 2018 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # t...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020/9/28 # @Author : <NAME> # @File : .py # @Role : import csv import decimal from datetime import datetime, timedelta from websdk.consts import const from sqlalchemy import or_ from libs.base_handler import BaseHandler from models.elasticache_ri_db imp...
import cv2 import math import numpy as np from PIL import Image import pytesseract """ List of helper, enhancement and transformation funcs commonly used for OCR and CV processing given image or bounding box information. N.B. bbox format in Tensorflow Object Detection format, i.e. [y_min, x_min, y_max, x_max]...
# Copyright (C) 2014 Universidad Politecnica de Madrid # # 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...
from tqdm import tqdm import os import sys import pickle import logging import numpy as np import random import torch import json from torch.utils.data import DataLoader from torch.nn import CrossEntropyLoss from transformers import AdamW, get_linear_schedule_with_warmup # from pytorch_transformers import XLNetConfig, ...
# A simple Python script to generate the code for odd-sized optimized DFTs # The generated code is simply printed in the terminal. # This is only intended for prime lengths, where the usual tricks can't be used. # The generated code is O(n^2), but for short lengths this is still faster than fancier algorithms. # Exampl...
import os import math import pickle import numpy as np import transforms3d as t3d import pose_estimation.directories as dirs import pose_estimation.tools.math as tm import pose_estimation.blender.render as br import pose_estimation.gramian.functions as gf from pose_estimation.blender.render_properties import RenderPro...
#!/usr/bin/env python #-*- coding:utf-8 -*- from PyQt5.QtWidgets import QWidget, QLabel, QPushButton, QVBoxLayout from PyQt5.QtCore import Qt, QPoint from PyQt5.QtGui import QFont, QCursor class QTitleLabel(QLabel): """ 新建标题栏标签类 """ def __init__(self, *args): super(QTitleLabel, self).__init_...
# -*- coding: utf-8 -*- import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from collections import Counter from wordcloud import WordCloud, STOPWORDS import holoviews as hv hv.extension('bokeh') import warnings warnings.filterwarnings("ignore") def extract_data(file_name): STATUS ...
"""Functors are functions that take typically one or more other PDF. Prominent examples are a sum, convolution etc. A FunctorBase class is provided to make handling the models easier. Their implementation is often non-trivial. """ # Copyright (c) 2021 zfit import functools import operator from collections import Ord...
# *************************************************************** # Copyright (c) 2022 Jittor. All Rights Reserved. # Maintainers: <NAME> <<EMAIL>>. # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this source code package. # ****************************************...
import builtins import math import sys from typing import Any from lark import Lark, InlineTransformer, LarkError, Token, Tree # Constantes (algumas tarefas pedem para incluir variáveis específicas nesta # parte do arquivo) NAME = "<NAME>" MATRICULA = "01/2345678" ... # Gramática do Ruspy. (não modifique o nome dest...
from enum import Enum, auto from typing import ( Any, Iterator, NamedTuple, Optional, List, NoReturn, Type, Union, ) from httpie.cli.dicts import NestedJSONArray from httpie.cli.constants import EMPTY_STRING, OPEN_BRACKET, CLOSE_BRACKET, BACKSLASH, HIGHLIGHTER class HTTPieSyntaxError(V...
#!/usr/bin/env python import xlutil, sys from lxml import etree import re import unicodedata class XML: NUMBER_REQUIRED_COLUMNS = 9 REQUIRED_COLUMNS = { 'availability': 'availability', 'brand': 'brand', 'condition': 'condition', 'description': 'description', 'gtin': 'gtin', 'id': 'id', 'image_link':...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ score.py A script to count proofread and validated pages for the Wikisource anniversary contest. This script is part of wscontest-votecounter. (<https://github.com/CristianCantoro/wscontest-votecounter>) --- usage: score.py [-h] [--booklist-cache BOOKLIST_CACHE] [--c...
# Copyright (c) 2020 PaddlePaddle 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 app...
import numpy as np from scipy.misc import imresize import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torchvision import datasets from torchvision import transforms import torchvision as tv if __name__ == '__main__': # argparse settings import argparse pars...
from discord.ext import commands from discord import Message from re import compile from typing import Union from time import time from collections import defaultdict from json import loads from source import Bot from source.utils.defaults import ( INCREMENT, MODIFIERS, COOLDOWN, ALGORITHM, LEVELUP...
from dataset_utils import int64_feature, float_feature, bytes_feature import voc_common import math import os import xml.etree.ElementTree as ElementTree import shutil import tensorflow as tf tf.app.flags.DEFINE_string( 'path_to_voc', '~/Data/VOC/VOCdevkit/', 'path to Pascal VOC dataset') tf.app.flags.DEFINE_strin...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) IBM Corporation 2018 # # 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 # # U...
# C3D, AlexNet type model with 3D convolutions (for video processing). # From "Learning Spatiotemporal Features with 3D Convolutional Networks" # # Pretrained weights from https://s3.amazonaws.com/lasagne/recipes/pretrained/c3d/c3d_model.pkl # and the snipplet mean from # https://s3.amazonaws.com/lasagne/recipes/pretra...
""" Serialization methods. """ import abc import json import os from enum import Enum from typing import IO, Dict, Optional, Tuple, Union import yaml from pydantic import BaseModel from openff.qcsubmit.exceptions import UnsupportedFiletypeError __all__ = [ "Serializer", "DeSerializer", "register_seriali...
from io import StringIO import logging import os from typing import Iterable import pandas as pd from peerscout.utils.collection import force_list, applymap_dict from ..shared.database import Database from ..shared.database_schema import PersonMembership from .dataNormalisationUtils import normalise_subject_area fr...
import json import logging import math import os from xia2.Driver.DriverFactory import DriverFactory from xia2.Handlers.Phil import PhilIndex logger = logging.getLogger("xia2.Wrappers.Dials.Integrate") try: from typing import Optional except ImportError: pass class DIALSIntegrateError(RuntimeError): ""...
import logging from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404, redirect from django.urls import reverse_lazy from django.views import generic from blog.forms import ContactForm , CommentForm, BlogCreateForm # ReplyForm from django.contrib import m...
# Copyright 2018 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 argparse import h5py import multiprocessing as mp import os import random import time import tokenizers from pathlib import Path class TrainingSample(object): def __init__(self, seq_tokens, next_seq_tokens=None, is_random_next=False): self.seq_tokens = seq_tokens self.next_seq...
""" Component that will perform object detection and identification via deepstack. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/image_processing.deepstack_object """ import base64 import datetime import io import json import logging import os from date...
"""Provide a Python wrapper for the Postmark DMARC API. See the documentation at https://dmarc.postmarkapp.com/api/ """ import json import os from collections import defaultdict from datetime import datetime from typing import DefaultDict, NamedTuple, Optional, Type, Union import fire import requests from dateparser ...
#!/usr/bin/env python from io import StringIO import re class INDENT: pass class DEDENT: pass class IndentingPrinter(object): def __init__(self, stream, indent): self.stream = stream self.indent = indent self.level = 0 def __call__(self, text): if text is INDENT: ...
# -*- coding: utf-8 -*- # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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 # # ...
""" Argus module to create facts from argus events """ import re from collections import defaultdict from ipaddress import AddressValueError, IPv4Address from logging import debug, error, info, warning from typing import Dict, List, Text, cast import act.api import act.api.helpers HASH_MD5_RE = re.compile(r'^[0-9a-f...
# SPDX-FileCopyrightText: Copyright 2021, <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-3-Clause # SPDX-FileType: SOURCE # # This program is free software: you can redistribute it and/or modify it under # the terms of the license found in the LICENSE.txt file in the root directory # of this source tree. # ======= #...
# # HDG-from -- Generate HDG files for GEMSS # # Copyright (C) 2017 <NAME> # All rights reserved. # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. # # Compatibility with Pyhton 2.7 from __future__ import absolute_import, division, print_function...
from nutils.testing import TestCase from nutils import _graph import itertools, unittest, sys class DummyNode(_graph.Node): def __init__(self, label='', metadata=None): assert '\n' not in label self.label = label super().__init__(metadata) def __bool__(self): return bool(self.label) def _gener...
""" Statistical operations on the model: * Creation of priors from posteriors. """ from copy import copy import numpy as np from scipy.interpolate import RectBivariateSpline, UnivariateSpline from cascade.core.log import getLoggers from cascade.dismod.constants import IntegrandEnum, RateEnum from cascade.model.pri...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2018 <EMAIL> # Licensed under the MIT license (http://opensource.org/licenses/MIT) from __future__ import absolute_import, division, print_function, unicode_literals from PySide.QtCore import QSize, Qt, QRectF, QPointF, QPoint, QLine, QObject, \ QTimer fro...
""" New CCS report, for running on dataset import or generation in new auto-CCS pipeline (including demultiplexed datasets) """ from collections import namedtuple import tempfile import zipfile import os.path as op import os import sys import logging from pprint import pformat import numpy as np from pbcommand.mode...
#!/usr/bin/env python # -*- coding: utf-8 -*- """CARLA Enhance dataset and datamodule. """ from __future__ import annotations import glob import os import random from typing import Callable from typing import Optional import matplotlib.pyplot as plt from torch.utils.data import random_split from onevision.cv impor...
# -*- encoding: 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...
import argparse import pegasusio as io import numpy as np import pandas as pd from collections import namedtuple from typing import List, Dict, Tuple demux_type_dict = {'SNG': 'singlet', 'DBL': 'doublet', 'AMB': 'unknown'} SNP = namedtuple('SNP', ['CHROM', 'POS', 'REF', 'ALT']) def check_colnames(fields: List[str]...
import torch import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import sys from gpsa import VariationalGPSA, rbf_kernel from gpsa.plotting import callback_twod sys.path.append("../../..") from data.st.load_st_data import load_st_data from data.warps import apply_gp_warp # f...
#!/usr/bin/env python3 # ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # ...
# -*- coding: utf-8 -*- """ Created on Tue Jul 02 17:50:32 2019 @author: ongunuzaymacar Script containing an example and guideline for training machine translation models using the implemented @Attention() layer. This script is adapted from https://www.tensorflow.org/beta/tutorials/text/nmt_with_attention Usage: #...
# Copyright (c) 2021 <NAME>. All rights reserved. # This code is licensed under Apache 2.0 with Commons Clause license (see LICENSE.md for details) """Adapter class for quantstats. !!! note Accessors do not utilize caching. We can access the adapter from `ReturnsAccessor`: ```pycon >>> import numpy as np >>> im...
# -*- coding: utf-8 -*-import re import datetime import re from collections import OrderedDict from logbook import Logger from scrapy import Selector from bangumi import db from bangumi.Item.bangumi.animate import * from bangumi.Item.bangumi.pic import * from bangumi.spiders import SpiderDebug logging = Logger("Ani...
# Scale -- dual channel version # Cedar Grove NAU7802 FeatherWing # scale_code.py 2022-01-29 v3.029 Cedar Grove Studios # uncomment the following import line to run the load cell calibration method # (this may eventually become part of a setup process) # import cedargrove_scale.load_cell_calibrator import board imp...
#!/usr/bin/env python """ vpk - command line utility for working with Valve Pak files """ from __future__ import print_function import re import sys from fnmatch import fnmatch import argparse from binascii import hexlify import os import vpk def make_argparser(): parser = argparse.ArgumentParser(description='Ma...
# -*- coding: utf-8 -*- # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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 # # ...
import discord from discord.ext import tasks, commands import sqlite3 import re import json from extensions.BlacklistCog import checkBlacklist from disputils import BotEmbedPaginator dir = CURRENT_WORKING_DIRECTORY con = sqlite3.connect(f'{dir}/data/items/smmo.db') cur = con.cursor() regexmatch=["[[", "]]"] with open...
""" Title: Dense Passage Retriever on TPU Author: [<NAME>](https://twitter.com/ankur310794) Date created: 2021/06/24 Last modified: 2021/06/24 Description: Implement a Dense Passage Retriever using NQ-Wikipedia Dataset. """ """ ## Introduction Open-domain question answering relies on efficient passage retrieval to sele...
from __future__ import print_function # Modified by Microsoft Corporation. # Licensed under the MIT license. ############################################################################### # PyDial: Multi-domain Statistical Spoken Dialogue System Software ###############################################################...
# -*- coding: utf-8 -*- # # Copyright (c) 2011, <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, m...
from textwrap import dedent import pytest from dnaio import Sequence from cutadapt.adapters import Where, LinkedAdapter from cutadapt.parser import AdapterParser, AdapterSpecification def test_expand_braces(): expand_braces = AdapterSpecification.expand_braces assert expand_braces('') == '' assert expand...
import os import re import socket import sys import time from tox import hookimpl from tox.config import SectionReader import py from docker.errors import ImageNotFound from docker.types import Mount import docker as docker_module # nanoseconds in a second; named "SECOND" so that "1.5 * SECOND" makes sense SECOND = ...
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
import sys import tempfile import skbio import pandas as pd import qiime2 from qiime2.plugin import ( Plugin, Metadata, Int, Range, Choices, Str, MetadataColumn, Categorical, Float, List, Citations, Bool, TypeMatch, ) from q2_types.feature_data import ( FeatureDa...
import numpy as np import gym import tensorflow as tf import gpflow from gpflow import autoflow from gym.wrappers import Monitor from pilco import PILCO from controller import RbfController from reward import ExponentialReward import time import matplotlib import matplotlib.pyplot as plt float_type = gpflow.settings...
import sys, os file_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, file_dir + '/../mednickdb_pysleep/') from sleep_features import detect_spindles, \ detect_slow_oscillation, assign_stage_to_feature_events, \ sleep_feature_variables_per_stage, detect_rems, \ load_and_slice_data_for_feat...
"""Generic trainer class that stores all state. Author: <NAME> """ import numpy as np import random import torch import torch.nn as nn import os import trainer.util as util from torch.utils.tensorboard import SummaryWriter from json import dumps import queue import shutil class Trainer: def __init__(self, i...
import os from setuptools import setup, Extension from distutils.sysconfig import customize_compiler try: from Cython.Distutils import build_ext HAS_CYTHON = True except ImportError: from distutils.command.build_ext import build_ext HAS_CYTHON = False def get_path_to_eigen(): try: eigen_pa...