text
stringlengths
8.04k
46.5k
# -*- coding: utf-8 -*- # """*********************************************************************************************""" # FileName [ upstream/mockingjay/model.py ] # Synopsis [ Implementation of the transformer models ] # Author [ <NAME> (https://github.com/andi611) / Hugging Face ] # Copyri...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 <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 limitati...
"""tests for passlib.apache -- (c) Assurance Technologies 2008-2011""" #============================================================================= # imports #============================================================================= from __future__ import with_statement # core from logging import getLogger import...
#!/usr/bin/env python # MIT License # # Copyright (c) 2019 <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...
#!/usr/bin/env python3 # Copyright (C) 2018-2019 Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted for any purpose (including commercial purposes) # provided that the following conditions are met: # # 1. Redistributions of sourc...
import os import pprint import re import shutil import argparse import hashlib import urllib.request import k3down2 import yaml from k3color import green from k3color import darkyellow from k3handy import pjoin from k3handy import cmd0 from k3handy import to_bytes from k3handy import cmdpass from .. import mistune ...
import os import shutil from datetime import timedelta from functools import partial from itertools import chain from operator import is_not import numpy as np import pandas as pd import pytz from catalyst import get_calendar from catalyst.assets._assets import TradingPair from catalyst.constants import DATE_TIME_FORM...
# -*- coding: utf-8 -*- """ Module for PNSqlQuery class. """ from pineboolib.core.utils import logging from pineboolib.application.utils import sql_tools from pineboolib import application from pineboolib.application import types from typing import Union, List, Dict, Optional, Any, TYPE_CHECKING if TYPE_CHECKING: ...
# -------------------------------------------------------------------------- # Source file provided under Apache License, Version 2.0, January 2004, # http://www.apache.org/licenses/ # (c) Copyright IBM Corp. 2015, 2016 # -------------------------------------------------------------------------- import os # docplex f...
from __future__ import division, print_function import os, time, sys sys.path.insert(0,'../') # path.abspath(path.join(__file__ ,"..")) from io_util import make_dir, remove_dir, tree_to_json, write_json, myopen import numpy as np import math from subprocess import CalledProcessError, check_call, STDOUT from pprint impo...
import ipaddress import json import weakref from collections import defaultdict from operator import itemgetter from moto.core import get_account_id from moto.core import CloudFormationModel from .core import TaggedEC2Resource from ..exceptions import ( CidrLimitExceeded, UnsupportedTenancy, DependencyViol...
import numpy as np from scipy import signal import matplotlib.pylab as plt from ephysiopy.common.ephys_generic import PosCalcsGeneric from ephysiopy.common.spikecalcs import SpikeCalcsGeneric class CosineDirectionalTuning(object): """ Produces output to do with Welday et al (2011) like analysis of rhythmi...
#!/usr/bin/python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
import wx import wx.propgrid as wxpg import os, inspect import logging logfile = "cfgslicer.log" loglevel = logging.INFO cmdFolder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0])) from settings import Settings from cfgslicer import CfgSlicer from inifile import IniFile...
import asyncio import inspect from collections import OrderedDict from typing import ( Any, Callable, Coroutine, Mapping, NoReturn, Optional, OrderedDict, Union, ) import nextcord from nextcord.ext import commands from nextcord.permissions import Permissions from .constants import DEFA...
from asyncio import proactor_events import copy import random from itertools import combinations_with_replacement import time import matplotlib.pyplot as plt import networkx as nx import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import math import pandas as pd imp...
# -*- coding: utf-8 -*- """ Created on Fri Nov 2 21:33:22 2018 @author: kunal """ #%% import networkx as nx from networkx.algorithms import isomorphism from .merge_nodes import merge_nodes, merged_value from .util import get_next_level from .write_constraint import FindSymmetry from .common_centroid_cap_constraint i...
import sys import torch.nn as nn import torch import math from packaging import version from .utils import act2fn, apply_chunking_to_forward import torch.nn.functional as F from torch.autograd import Variable class FocalLoss(nn.Module): """来自 https://github.com/clcarwin/focal_loss_pytorch """ def __init__...
import uuid import json import time import random import urllib3 import datetime import contextlib import subprocess import concurrent.futures from threading import Thread, Lock from collections import defaultdict import boto3 import requests from botocore.client import Config from botocore.exceptions import ClientErr...
#!/usr/bin/env python # Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode) from __future__ import print_function, division, absolute_import import argparse import os import sys import time import cv2 import matplotlib....
import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm from scipy.optimize import maximize from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import (RBF, Matern, RationalQuadratic, ExpSineSquared, Do...
""" ## =========================================================================== ## MIT 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, inc...
import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter import os import numpy as np import pandas as pd from math import ceil from collections import OrderedDict import higl.utils as utils import higl.higl as higl from higl.models import ANet import gym from goal_env import * from...
#!/usr/bin/env python # -*- coding: UTF-8 # Word Embedding Models: Preprocessing and Model Training # Project title: Charter school identities # Creator: <NAME>, PhD Candidate # Institution: Department of Sociology, University of California, Berkeley # Date created: July 20, 2018 # Date last edited: November 8, 2018 ...
import abc import inspect import math import re from esphome.yaml_util import ESPHomeDataBase # pylint: disable=unused-import, wrong-import-order from typing import Any, Generator, List, Optional, Tuple, Type, Union, Sequence from esphome.core import ( # noqa CORE, HexInt, ID, Lambda, TimePeriod,...
import codecs import json import os import subprocess import time from threading import Lock from typing import List, Tuple, Optional # ========================== Of course from hexbytes import HexBytes from web3 import Web3, HTTPProvider from web3.contract import Contract as Web3Contract from web3.datastructures impo...
# -*- coding: utf-8 -*- # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
from datasets import load_dataset, Dataset, load_metric import numpy as np, pandas as pd from lexicalrichness import LexicalRichness import functools import string import psutil from collections import defaultdict from spacy_wordnet.wordnet_annotator import WordnetAnnotator import operator import spacy import textstat...
# # gemini_python # # primitives_visualize.py # ------------------------------------------------------------------------------ import json import numpy as np import time import urllib.request from co...
# Copyright 2017 <NAME> and <NAME> '''Python reimplementation of SEER for bacterial GWAS''' import os import sys import warnings import itertools import operator import re import pickle from collections import deque from decimal import Decimal from .utils import set_env # avoid numpy taking up more than one thread wi...
import random import numpy as np import numpy as np import cv2 import random import os import json import time import gym env = gym.envs.make("BreakoutDeterministic-v4") import tensorflow as tf from tensorflow.keras.initializers import VarianceScaling from tensorflow.keras.layers import ( Add, ...
import random import time import warnings import numpy as np import torch import torch.nn.functional as F import torch.nn.init as init from torch import nn, optim from ....modules.prediction.generation.TreeBasedDecoder import StdTreeDecoder, create_mask from ....modules.utils.tree_utils import DataLoader, Tree, to_cud...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' To run the antisaccade demo: * Open an External Presenter project in Tobii Pro Lab. Go to the Record tab. * Run anti_saccades.py (this script). The first time you run it, set upload_stimuli = True (see below), to upload relevant stimuli to lab. You...
############################################################################## # Copyright (c) 2013, AMERICAN INSTITUTES FOR RESEARCH # All rights reserved. # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # 1. Redistributio...
""" Copyright 2018 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, software dis...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import math class BasicBlock(nn.Module): expansion = 1 def __init__(self, in_planes, planes, stride=1): super(BasicBlock, self).__init__() self.conv1 = nn.Conv2d( in_planes, planes, kernel_size=3...
"""Provide tensorflow functionality. The module provides the different TensorFlow version (if available) as: * `tensorflow_v1` * `tensorflow_v2` Intended Usage -------------- This module (`dltb.thirdparty.tensorflow`) should be imported before the actual `tensorflow` module is imported. One way to achieve this is t...
import asyncio import collections import logging import logging.config import shlex import shutil import unittest from pathlib import Path import acme.messages import acmetk.util from acmetk import AcmeCA from acmetk.client import ( AcmeClient, DummySolver, ) from acmetk.main import load_config from acmetk.mo...
#!/usr/bin/env python2 '''This is a template for making DST from an EventNumber in a local Gauss build. It will generate MC, put it through the detector, run the trigger on it, and strip it. ''' import os from os.path import join as opj, basename import argparse import __main__ # -- essential parameters -- # parser =...
import time import lmdb import struct import logging import hashlib import itertools import synapse.glob as s_glob import synapse.common as s_common import synapse.eventbus as s_eventbus import synapse.lib.net as s_net import synapse.lib.cell as s_cell import synapse.lib.lmdb as s_lmdb import synapse.lib.const as s_c...
import numpy as np from pysedsim.data_processing.data_processing import Load_Input_File from pysedsim.data_processing.data_processing import Excel_Data_Import from pysedsim.visualization.processing_reference_set import Initial_Processing import matplotlib.pyplot as plt import matplotlib from matplotlib.backends import ...
# Copyright 2018 Delft University of Technology # # 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 agr...
# Copyright 2020 Broadband Forum # # 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 writi...
""" Generate figures and RST documents from the HDMF YAML specification for the format specification documentation """ # TODO Make SpecToRST.render_namespace.type_hierarchy_include_html and type_hierarchy_include_latex configurable from hdmf.spec import GroupSpec, DatasetSpec, NamespaceCatalog, SpecNamespace import ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Usage: latex_log.py {tex_log_file} # Produces a "._log" file. # Author: <NAME> # http://atp-vim.sourceforge.net # # Copyright Statement: # This file is a part of Automatic Tex Plugin for Vim. # # Automatic Tex Plugin for Vim is free software: you can redistribute i...
""" domonic.html ==================================== Generate HTML using python 3 """ import copy from domonic.javascript import URL from domonic.dom import Element, Document html_tags = [ "figcaption", "blockquote", "textarea", "progress", "optgroup", "noscript", "fieldset", "datalist", ...
import sys, os sys.path.insert(0, '..') import numpy as np import pymysql import datetime import torch, random import os, psutil from collections import OrderedDict from tqdm import tqdm import pickle, json, h5py from deepctr_torch.inputs import (DenseFeat, SparseFeat, VarLenSparseFeat, ...
""" Copyright 2015 <NAME>, 2017 <NAME>, 2018 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
import multiprocessing import pickle as pkl import sys import time import torch from torch.autograd import Variable as Var from torch.nn import functional TRAIN_FLAG = 0 TEST_FLAG = 1 from scipy.linalg import block_diag stop_words = [',', '.', 'to', 'the', '<\\s>', '<s>'] def schedule(epo): # return 400, 90, 1...
# -*- coding: utf-8 -*- # # Copyright 2015 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 requi...
# ----------------------------------------------------- # Person Search Dataset for Both Training and Testing # # Author: <NAME> # Creating Date: Mar 28, 2018 # Latest rectified: Apr 16, 2018 # ----------------------------------------------------- import os import os.path as osp import time import pandas as pd import...
''' miRNA-lncRNA interactions :argument: DATA_FILE: http://www.bio-bigdata.com/miRSponge/apps/download1.jsp?fileName=Experimentally_validated_miRNA_targets_in_miRSponge.txt ''' # Imports from SLKlib.SQLiteDBApi.sqlite_db_api import PsimiSQL import re # Defining constants SQL_SEED = '../../../../../SLKlib/SQLi...
from PyQt5.QtCore import * from qgis.utils import iface from os import path import processing import os from qgis.core import ( QgsVectorLayer ) import requests import json import pandas as pd import time import requests, zipfile, io from datetime import datetime folder_path = f'/home/sam/Desktop/SNAPSHOT/GIS/' # Thr...
from utils import * from parameters import par, update_dependencies from stimulus import Stimulus class NetworkController: def __init__(self): """ Load initial network ensemble state """ self.make_constants() self.make_variables() if par['use_adam']: self.m...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 1 12:06:39 2019 @author: alankar pressure-driven cooling flow in cylindrical, spherical geometry runfile('/home/alankar/Documents/cool-flow/new-profile/cooling-flow-MHD-model.py', args='fields ./output-2048/', wdir='/home/alankar/Documents/cool-f...
#!/usr/bin/env python # -*- coding: <encoding name> -*- """ CSData.py: Collection of tools for cgn-data-21-1 Capstone Project: Product Clustering Functions: KMeans_clustering(dict_begin, images, PATH, DATA, CLUST...
""" Pre-train a network on Approximate Convex Decompisitions using a pairwise contrastive loss. Author: AruniRC Date: Feb 2020 """ import argparse import os import os.path as osp from data_utils.ShapeNetDataLoader import PartNormalDataset, SelfSupPartNormalDataset, ACDSelfSupDataset from tensorboard_logger import co...
#!/usr/bin/env python3 import shutil import os import javaobj.v2 as javaobj import sys import re #Global dictionaries Def_serv = { 5000:"6/80" #http } # ISO 3166-1 country number to 2 letter codes Country_ISO = { "4":"AF", "8":"AL", "12":"DZ", "16":"AS", "20":"AD", "24":"AO", "660":...
""" <NAME> (2009) Colour Appearance Model ===================================================== Defines the *Kim, Weyrich and Kautz (2009)* colour appearance model objects: - :class:`colour.appearance.InductionFactors_Kim2009` - :attr:`colour.VIEWING_CONDITIONS_KIM2009` - :class:`colour.appearance.MediaParamete...
""" Actor model in a single-file module for simple and effective python pipelines, based on queues and threading and/or multiprocessing. See :class:`Actor` """ __all__ = [ 'ActorStats', 'Actor', 'MapActor', 'ActorSystem', ] import logging import multiprocessing import queue import signal import threa...
import argparse import csv import io import os import shutil import sys import textwrap def import_csv(filename): lookup = {} try: with open(filename, encoding='utf8') as in_file: reader = csv.reader(in_file, lineterminator='\n') for row in reader: if (len(row) ...
import pandas import numpy import asyncio import scipy.stats import ipywidgets as widget from plotly import graph_objects as go from ..scope.scope import Scope from ..model import AbstractCoreModel from ..viz import colors from .. import styles DEFAULT_BACKGROUND = 100 _plotly_blue = '#1f77b4' _plotly_orange = '#ff7...
""" Transforms a json file containing data which describes the bazel build configuration, into a simple archive of intellij configuration files. Of note, because this script executes as part of a bazel build, it is subject to the rules of the sandbox, so this code can't know the actual path to the execution root direct...
from systemtools.basics import * from systemtools.logger import * from systemtools.file import * from systemtools.location import * from selenium import webdriver try: from hjwebbrowser.browser import * except: pass import random import time try: from datastructuretools.setqueue import * except: pass def get...
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
"""Implementation of Zero-Intelligence Models of Limit Order Book Author: <NAME> Date: 11/09/2020 Notes: - The following model can be used for price prediction in the limit order market assuming agent orders follow poisson arrivals - Need to finish up the continued fractions when i have time """ from functools imp...
import sys if len(sys.argv) != 8: print ('usage : python mangastyle.py gpu-id [-1 : cpu] sketch reference hint version denoise output') sys.exit() if sys.argv[1] != '-1': chainer_GPU_ID = sys.argv[1] chainer_ID = chainer_GPU_ID tensorflow_GPU_ID = sys.argv[1] k_between_tf_and_chainer = 0.8...
#!/usr/bin/env python3 """ Generate artefacts (Makefile, default ontology edit file, imports) from a project configuration See https://github.com/ontodev/robot/issues/37 For help on command line usage: odk.py """ from typing import Optional, Set, List, Union, Dict, Any import json from dataclasses import dataclass...
''' GPU/CUDAMat backend for GMM training and inference ''' # Author: <NAME> <<EMAIL>> # Based on gmm.py from sklearn # python2 compatibility from __future__ import print_function from future.utils import iteritems from builtins import range import cudamat as cm import logging import numbers import num...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
"""My implementation for Codingame Ultimate TicTacToe.""" from __future__ import annotations from abc import ABC, abstractmethod import datetime from functools import lru_cache from math import log, sqrt from random import choice, shuffle import sys # RAND_INDEX = 0 # RANDOM_MOVES = [ # randrange(0, 1000) for _ in...
"""Test prtecan module.""" import functools import os import os.path as path import numpy as np import pandas as pd import py import pytest from clophfit import prtecan # Tecan test file folder __file__=this file tests_dir = path.dirname(path.abspath(__file__)) ttff = functools.partial(path.join, tests_dir) def t...
# coding: utf-8 import collections import itertools import logging from typing import Dict, Iterator, List, Tuple import cached_property import pulp from haoda import ir, util _logger = logging.getLogger().getChild(__name__) class SuperSourceNode(ir.Module): """A node representing the super source in the dataflo...
"""Device, context and memory management on PyCUDA and scikit-cuda. Chainer uses PyCUDA facilities (with very thin wrapper) to exploit the speed of GPU computation. Following modules and classes are imported to :mod:`cuda` module for convenience (refer to this table when reading chainer's source codes). =============...
from __future__ import print_function, division INPUT_LAYERS = ['Data', 'ImageData'] # Layers that only support elwise ELWISE_LAYERS = ['Deconvolution'] # Layers that support parameters PARAMETER_LAYERS = ['Convolution', 'InnerProduct']+ELWISE_LAYERS # All supported layers SUPPORTED_LAYERS = ['ReLU', 'Sigmoid', 'LRN',...
# plot triggered FRB candidates # <EMAIL> & <EMAIL> # 25/02/2021 import os import os.path import sys import scipy.signal from scipy import stats import numpy as np import matplotlib as mpl import h5py mpl.use('Agg') # hack import matplotlib.pyplot as plt import json import glob import optparse from mpl_toolkits.axe...
import generateMaze import StructureGrid import random from past.utils import old_div import generateItems import ClassCraftStructure import craftTasks import numpy as np # copy from Malmo source code def GenCuboid(x1, y1, z1, x2, y2, z2, blocktype): return '<DrawCuboid x1="' + str(x1) + '" y1="' + str(y1) + '" z1...
#!/usr/bin/env python3 # # This script is used to run the yaml test cases for morphology & morphophonology # tests. # # License: CC0 (see LICENSE) from subprocess import Popen, PIPE from argparse import ArgumentParser from io import StringIO from collections import OrderedDict, namedtuple import os import os.path imp...
# Copyright (c) 2020 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
#!/usr/bin/python from __future__ import absolute_import from __future__ import division from __future__ import print_function ''' CONFIGURE FIREWALLD with a saltstack/makina-states.services.firewall.firewalld:settings compatible file. Only the following sections are used:: - zones - services We use only ric...
import numpy as np import csv import matplotlib.pyplot as plt from matplotlib import rc rc('text', usetex=True) from scipy.special import gamma as scigamma from scipy.special import gammaln as scigammaln from collections import OrderedDict def split_into_tasks(reader): out = list() tmp = OrderedDict() la...
import numpy as np import scipy as sp import scipy.special from climpy.utils.diag_decorators import time_interval_selection, normalize_size_distribution_by_point, derive_size_distribution_moment from climpy.utils.netcdf_utils import convert_time_data_impl from climpy.utils.wrf_chem_utils import get_aerosols_keys, get_...
from __future__ import print_function, absolute_import import argparse import time import random import torch import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import _init_paths from pose import Bar from pose.utils.logger import Logger from pose.utils.evaluation import accuracy, Avera...
# Our goal is to learn mortality outcomes. Our training data must be previously known mortality outcomes, therefore, # Learning from patients whose mortality outcomes are unknown and coerce the goal to be zero vector is unreasonable. # This is unreasonable for training, testing and validation. # This is unreasonable fo...
from typing import Tuple import torch from torch import nn from torch.nn import functional as F from utils import Tensor, assert_shape, build_grid, conv_transpose_out_shape, \ conv_bn_relu, deconv_bn_relu class SlotAttention(nn.Module): """Slot attention module that iteratively performs cross-attention.""" ...
import sys, csv, itertools, math, random import smilesParser import scipy, scipy.sparse import sklearn, sklearn.svm, sklearn.calibration def ExpandSubset(G, nodeSet): """This function yields all the sets that can be obtained by expanding 'nodeSet' with a neighbour of one of its current members.""" # To red...
import collections import re import csv import gzip import sys import itertools try: import pysam except ImportError: pysam = None # Metadata parsers/constants RESERVED_INFO = { 'AA': 'String', 'AC': 'Integer', 'AF': 'Float', 'AN': 'Integer', 'BQ': 'Float', 'CIGAR': 'String', 'DB': 'Flag', 'DP': 'I...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 18 17:54:14 2020 # Tout d'abord demandez la génération d'une API_KEY (une clé) dans votre compte SketchEngine : # https://www.sketchengine.eu/documentation/api-documentation/#toggle-id-1 (Authentification) # Pour plus d'infos sur les méthodes disp...
import cStringIO, gzip, pickle, re, operator, sys from re import sub from itertools import groupby from werkzeug.datastructures import CallbackDict from jinja2 import Markup from flask import abort, current_app, make_response, Flask, jsonify, request, Response, session from functools import update_wrapper from datetime...
import datetime import platform import sys from typing import List, Mapping, Optional, Union import discord import psutil from discord.ext import commands, menus from .utils.flag_check import get_flag_and_voice_server_for_guild from .utils.roles_string import role_string from .utils.sizer import get_size from .utils....
import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from param import args class ProgressIndicator(nn.Module): def __init__(self): super(ProgressIndicator, self).__init__() h...
from nltk.tokenize import WordPunctTokenizer import random import time import timeout_decorator from utils.csqa import load_json, get_ent_int_id import copy random.seed(2018) def tokenize(sentence): sentence=WordPunctTokenizer().tokenize(sentence.lower()) return ' '.join(sentence) #defind base a...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2020-2021 <NAME> <<EMAIL>> # # Distributed under terms of the BSD 3-Clause license. """Data models. """ # imports related to type hinting from __future__ import annotations as _annotations # allows us not using quotation marks for hints f...
import numpy as np import os, sys, glob, time import pickle # biopython SeqRecord from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord # biopython blast from Bio.Blast.Applications import NcbiblastnCommandline from Bio.Blast import NCBIXML # import library designer from . import LibraryDesi...
""" Script for running hyperparameter optimization and getting predictions from an sklearn model. """ import json import argparse import os import pickle import copy from hyperopt import fmin, hp, tpe from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem.rdMolDescriptors import GetHashedAtomPairFinger...
""" A transform gizmo to manipulate world objects. """ import numpy as np from ..objects import Line, Mesh from ..geometries import Geometry, sphere_geometry, cone_geometry, box_geometry from ..materials import MeshBasicMaterial, LineMaterial from ..objects import WorldObject from ..linalg import Vector3, Quaternion ...
# -*- coding: utf-8 -*- """ :author: <NAME> :url: https: // github.com / LiJinfen """ from flask import render_template, redirect, url_for, request, Blueprint, current_app, abort, session, jsonify from flask_login import current_user, login_required from flask_socketio import emit, join_room, leave_room from da...
import matplotlib.pyplot as plt import matplotlib as mpl import pandas as pd import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import copy import os from torchvision import transforms import pickle as pkl import sklearn.manifold as manifold import sklearn.metrics as skmetrics from it...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ **Project Name:** MakeHuman **Product Home Page:** http://www.makehumancommunity.org/ **Github Code Home Page:** https://github.com/makehumancommunity/ **Authors:** <NAME>, <NAME> **Copyright(c):** MakeHuman Team 2001-2019 **Licensing:** ...
#! /usr/bin/env python """ Compare two entities: Maps, map sets, pipelines, or distribution makers. One kind can be compared against another, so long as the resulting map(s) have equivalent names and binning. The result each entity specification is formatted into a MapSet and can be stored to disk so that e.g. re-runn...