text
stringlengths
3.07k
22.1k
# coding:utf-8 # This file is part of Alkemiems. # # Alkemiems is free software: you can redistribute it and/or modify # it under the terms of the MIT License. __author__ = '<NAME>' __version__ = 1.0 __maintainer__ = '<NAME>' __email__ = "<EMAIL>" __date__ = '2021/05/25 09:01:54' import numpy as n...
def input_data_processing( inputfilefolder ): #This function takes input data that is need from the files supplied #Function extracts input coords and hessian from .fchk file, bond and angle #lists from .log file and atom names if a z-matrix is supplied import numpy as np import os.path #Gets...
import uuid from flask import render_template, current_app, request, \ flash, redirect, url_for, jsonify from flask_security import roles_accepted, current_user from sqlalchemy import func from . import group from .forms import GroupForm from pgscm import sqla from pgscm.db import models from pgscm.utils import ...
#!/usr/bin/env python # Authors: <NAME> <<EMAIL>> # # License: MIT """Raw MEG data preprocessing script for resting state component of Adolescent project. Pipeline does.. 1. write MNEFUN prebads for ACQ file 2. process ACQ file as per MNEFUN:PARAMS""" import os.path as op import janitor # noqa impor...
import torch import torch.nn.functional as F import numpy as np import random from tqdm import tqdm import json import re import rouge def get_movie(movie): movie = movie.replace('-', '_').split('_') if len(movie) > 1: if len(movie[-1]) == 4: try: int(movie[-1]) movie = movie[:-1] ...
import tetris_boost as tetris import random import numpy as np from tqdm import tqdm class Tetris: def __init__(self): self.score = 0 self.previous_score = 0 self.move_columns = 4 self.board_height = 20 self.board_width = 10 self.state_shape = (self.board_height, se...
#!/usr/bin/python3.6 ''' Functions for translating SMV format to Anzu NOTE: 1. Run function from python (no main here). 2. Used from generate_specs.py ''' import os from os.path import isfile, join ''' Translate SMV format to altl format ''' def translate_file_altl(in_file, out_file): env_vars = [] sys_...
import lxml.etree as ET import csv from .models import SkosConcept, SkosConceptScheme, SkosLabel class Csv2SkosReader(object): """ extract SKOS-like objects from special structured CSV sheets and returns a list of dictionaries containing data needed to create vocabs-entries """ def __init__(s...
############################################################################### # Utilities for simplification of lines used by pyroSAR for border noise removal # Copyright (c) 2017-2020, the pyroSAR Developers. # This file is part of the pyroSAR Project. It is subject to the # license terms in the LICENSE.txt file f...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import time slim = tf.contrib.slim DEBUG = False def current_time_millis(): return int(round(time.time() * 1000)) EMBEDDING_SIZE = 128 EPSILON, PERTURB_LOSS_COEFF = 10, .5 def ...
"""To extract ion channel mechanisms information from static parameter files.""" # Copyright 2020-2021 Blue Brain Project / EPFL # 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://...
# 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, ...
import numpy as np import keras import random import unet.utils.patches as patches import unet.utils.augment as augments import cv2 import itertools from main import config import os import pickle def get_generator(img_data, idx_list, batch_size=2, patch_shape=None, key_file=None): generator = batch_generator( ...
# evaluation from data_loading import ColonDataset from architecture import UNet, ResNetUNet from loss import calc_loss, print_metrics, dice_coef from utils import overlay_plot import random import argparse import _osx_support import copy import time import os from collections import defaultdict import matplotlib.p...
import os.path import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib import pyplot from pandas.api.types import is_string_dtype from sklearn import metrics from sklearn.decomposition import PCA from sklearn.ensemble import BaggingClassifier, AdaBoostClassifier, RandomForestClassifier, ...
''' Create or access a Neptune Graph database. Permissions Required: iam:GetAccountSummary on resource: * iam:ListAccountAliases on resource: * iam:PassRole on resource: * with iam:PassedToService restricted to rds.amazonaws.com iam:CreateRole rds:DescribeDBClusters rds:CreateDBClusters ''' import os import time impor...
import pmpmanager.db_devices as model import logging from base_calls import job_exec as bass_job_exec import json import datetime import uuid def Property(func): return property(**func()) class job_exec(bass_job_exec): def __init__(self): self.remotePrefix = None self.log = logging.getLogge...
''' * @author [<NAME>] * @email [<EMAIL>] * @create date 2017-05-19 03:06:43 * @modify date 2017-05-19 03:06:43 * @desc [description] ''' from data_generator.image import ImageDataGenerator import scipy.misc as misc import numpy as np import os import glob import itertools from PIL import ImageFile ...
import re import requests import pprint import json from pathlib import Path import urllib.request MAX = 500 BASE_URL = 'https://dragalialost.gamepedia.com/api.php?action=cargoquery&format=json&limit={}'.format( MAX) ABBR_FIELDS = { 'HP': 'HP', 'strength': 'STR', 'strength and HP': 'Hybrid', 'defen...
import numpy as np import tensorflow as tf from numba import njit from tensorflow.keras.losses import sparse_categorical_crossentropy from graphadv.attack.targeted.targeted_attacker import TargetedAttacker from graphadv.utils.surrogate_utils import train_a_surrogate from graphgallery.nn.layers import SGConvolution fr...
# This tool takes the raw usage data and splits it into session files from google.cloud import storage import os import time import gzip import json import base64 import sys import traceback import time storage_client = storage.Client() DATA_FILES_BUCKET = "dynamo_instrumentation_archive_dra_eu" COMPLETED_DATA_FILES...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import copy from dataclasses import dataclass from typing import Any, List, Mapping, Opt...
from Qt import QtCore, QtWidgets, QtGui from PyQt5.QtCore import QVariant from .models import LogModel class SearchComboBox(QtWidgets.QComboBox): """Searchable ComboBox with empty placeholder value as first value""" def __init__(self, parent=None, placeholder=""): super(SearchComboBox, self).__init__...
from contextlib import suppress from datetime import datetime import pytest from unittest import mock from bacpy.core import ( Difficulty, Digits, draw_number, GuessRecord, is_number_valid, is_player_name_valid, MIN_NUM_SIZE, NumberParams, Round, ScoreData, score_saver_facto...
#! /usr/bin/python3 # -*- coding: utf-8 -*- """This `translator.py` provides the classes `BasicTranslator`, and `Translator`. These two classes enable the functionality to initialize a `DimQuant` with a string representation of a dimensional quantity, e.g. '1 m.s', instead of the more cumbersome `BaseDimQuant` init wi...
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Reusable functional retry patterns. Certain kinds of operations are not always reliable, such as accessing a network (the network may be down), or communicating with a remote service (the service may be busy). These operations can fail with "transient" errors. ...
#!/usr/bin/python #-*- coding: utf-8 -*- # >.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>. # Licensed under the Apache License, Version 2.0 (the "License") # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # --- File Name: training_loop_infernet.py # --- Creation Date: 26-05-2020 # --- Last Modi...
import numpy as np import random import sys sys.path.append('../') from enum import Enum from copy import copy from gym_snake.core.render import Renderer, RGBifier """ Setting """ SCREEN_RESOLUTION = 300 """ Set snake as an agent in this environment. Initially starts with length = 3, and direction towards ...
# Copyright (c) 2005 Intel Corporation # All rights reserved. # # This file is distributed under the terms in the attached INTEL-LICENSE # file. If you do not find these files, copies can be found by writing to # Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, # 94704. Attention: Intel ...
# Tabulon # Copyright (c) 2015-2017 BeaconHill <<EMAIL>> # See `LICENSE.txt` for license terms. #################### ## Mergeable Vote ## #################### from copy import copy, deepcopy class IVSet(object): def __init__(self, ivs=[]): self.set = set(ivs) def __deepcopy__(self, memo): new = IVSet.__...
""" Title: Image segmentation with a U-Net-like architecture Author: [fchollet](https://twitter.com/fchollet) Date created: 2019/03/20 Last modified: 2020/04/20 Description: Image segmentation model trained from scratch on the Oxford Pets dataset. """ """ ## Download the data """ """shell curl -O http://ww...
from enum import Enum from typing import Any, Dict, List, Optional import attr import matplotlib.pyplot as plt import numpy as np import torch import torch.nn.functional as F import torch.optim as optim from einops import rearrange from hydra.utils import instantiate from IPython.display import clear_output from tqdm ...
#!/usr/bin/python2.7 # -*- coding:utf-8 -*- # Author: NetworkRanger # Date: 2018/12/9 下午8:54 # 6.8 用TensorFlow基于神经网络实现井字棋 # 1. 导入必要的编程库 import tensorflow as tf import matplotlib.pyplot as plt import csv import random import numpy as np # 2. 声明训练模型的批量大小 batch_size = 50 # 3. 为了让棋盘看起来更清楚,我们创建一个井字棋的打印函数 def print_boar...
"""Wrapper objects for working with ImportAsset commandlet.""" # Future Standard Library from __future__ import annotations # Standard Library import json import os import string from dataclasses import asdict, dataclass, field, is_dataclass from typing import TYPE_CHECKING, ClassVar, Iterable, List, Optional, Set #...
# coding: utf-8 # # This code is part of cmpy. # # Copyright (c) 2022, <NAME> import numpy as np from scipy import sparse from bisect import bisect_left from typing import Iterable, Callable, Optional, Sequence from cmpy.models import ModelParameters from cmpy.basis import Basis, overlap, occupations, binstr def pro...
from __future__ import absolute_import import boto3 import datetime from dateutil.parser import parse as parse_time import logging import mimetypes import os import flask # a bit of a lie here - retains compatibility with consumers that were importing boto2's S3ResponseError from here. this # is the exception boto3 ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import logging import time import queue import asyncio from PyQt5.QtWidgets import QMainWindow, QMessageBox, QFileDialog from PyQt5.QtCore import QThread, pyqtSignal from async_...
import torch import math import gpytorch import numpy as np from tqdm.notebook import tqdm from torch import nn import itertools from functools import partial import matplotlib.pyplot as plt import copy import os import time import pyro import pyro.contrib.gp as gp import pyro.distributions as dist from celluloid imp...
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Test adding followers to an existing viewpoint. """ __author__ = ['<EMAIL> (<NAME>)'] import mock from copy import deepcopy from functools import partial from viewfinder.backend.base import constants, util from viewfinder.backend.db.contact import Contact fro...
#!/usr/bin/env python # coding=utf-8 import os import shutil import tempfile import unittest from os.path import dirname import luigi from mock import MagicMock from openfda.adae.pipeline import ExtractXML, SyncS3, XML2JSONMapper from openfda.adae.annotate import normalize_product_ndc from openfda.tests.api_test_helpe...
import os import os.path as osp import pickle import random import json import argparse import copy import itertools import importlib import numpy as np import scipy.sparse as sp import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init import torch.optim as optim ...
import asyncio import dataclasses import itertools import logging from typing import Iterable, List, Optional import siderpy from pydantic import Field from arrlio import core from arrlio.backend import base from arrlio.exc import TaskNoResultError from arrlio.models import Message, TaskInstance, TaskResult from arrl...
import tensorflow as tf from tensorflow.contrib import rnn # # def get_state_variables(batch_size, cell): # zero_states = cell.zero_state(1, tf.float32) # if isinstance(zero_states, list): # state_variables = [] # for i, (state_c, state_h) in enumerate(zero_states): # init_state_c =...
import ctypes import ctypes.wintypes as wintypes from ctypes import windll from LibWin import get_admin_rights get_admin_rights() LPDWORD = ctypes.POINTER(wintypes.DWORD) LPOVERLAPPED = wintypes.LPVOID LPSECURITY_ATTRIBUTES = wintypes.LPVOID GENERIC_READ = 0x80000000 GENERIC_WRITE = 0x40000000 GENERIC_EXE...
"""Ensemble methods that create consensus calls from multiple approaches. This handles merging calls produced by multiple calling methods or technologies into a single consolidated callset. Uses the bcbio.variation toolkit: https://github.com/chapmanb/bcbio.variation """ import os import glob import copy import yaml ...
import tensorflow as tf import tensorflow.contrib.slim as slim from tensorflow.contrib.slim.nets import resnet_v2, resnet_v1 import numpy as np import pandas as pd import os, sys from datetime import datetime # TODO: output the results to file "results.csv" and compute the confusion matrix flags = tf.app.flags ERROR_...
import os import numpy as np import pandas as pd import json from utils.util import logging, sub_dict import traceback import analysis.report_painter as report_painter logger = logging.getLogger(__name__) def get_filelist(dir, Filelist): if os.path.isfile(dir): Filelist.append(dir) elif os.path.isd...
from random import sample, shuffle import os import pdb import pickle from typing import List import numpy as np from scipy.spatial.distance import cdist import matplotlib.pyplot as plt from src.models.predict import get_attested_order, get_prototype def shuffle_samples(vecs_dict_full: dict, num_samples:...
"""Functionality to distill a complex model knowledge to a simpler model""" from log_calls import record_history from ...automl.base import AutoML from ...automl.presets.tabular_presets import TabularAutoML from ...ml_algo.base import TabularMLAlgo from ...ml_algo.boost_cb import BoostCB from ...ml_algo.boost_lgbm imp...
import os import pickle as pkl import argparse import numpy as np import math import torch import torch.nn as nn import torch.optim as optim from derivable_models.derivable_generator import get_derivable_generator from utils.file_utils import create_transformer_experiments_directory, get_generator_info, prepare_test_z...
import sys import inspect import os.path as osp import numpy as np from copy import deepcopy from scipy.special import softmax import torch from smplx_optimization.pykinect.pose_init import initialize_pose_advanced from smplx_optimization.pykinect.smplx_model import ExpBodyModel from patched_smplx.utils import to_np ...
from __future__ import unicode_literals from future.builtins import super from datetime import timedelta from django.contrib.auth.models import User from django.contrib.messages import info, error from django.shortcuts import get_object_or_404, redirect from django.utils.timezone import now from django.views.generic...
""" Train a VAE model used to filter and enhance 3d points """ import json from datetime import datetime import matplotlib import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from tqdm import tqdm import cameras import data_utils import viz from top_vae_...
import asyncio import re import urllib.request import discord import requests from discord import FFmpegPCMAudio, TextChannel from discord.ext import commands from discord.utils import get from youtube_dl import YoutubeDL client = commands.Bot(command_prefix="!") class Music(commands.Cog): def __init__(self, bo...
import os import numpy as np import torch from torch import nn from torch.utils.data import Dataset class CrisCASDataTensor(Dataset): def __init__(self, X_feat, y_score, y_categ, indx_seqid_map): # B: batch elements; T: sequence length self.X_feat = X_feat # tensor.float32, B x T, (sequence chara...
import discord import time from database.DBHelper import create_connection, add_user, add_channel, add_server, remove_channel,\ get_channel_permission, update_channel, remove_user, get_prefix, get_blacklist_users, get_casino_channel, \ get_stream_channel from support.SettingsHandler import set_server_pre...
""" scaffoldgraph.analysis.representation Module contains an adaption of the Automated Identification of Over-Represented Scaffold Classes in HTS Data method from the paper: 'HierS: Hierarchical Scaffold Clustering Using Topological Chemical Graphs' """ from networkx import set_node_attributes from itertools import c...
# -*- coding: utf-8 -*- """ Single Molecule Molecular Dynamics Code Created 2018 by <NAME> Please Modify! """ from __future__ import print_function import os import sys import numpy as np # Global variables for unit conversions hartree = 4.35974465e-18 # J, atomic unit of energy emass = 5.486e-4 # kg dal...
#!/usr/bin/env python # -*- coding: utf8 -*- """ @file runner.py @author <NAME> @author <NAME> @date 2010-01-30 @version $Id$ This script runs the gaming GUI for the LNdW traffic light game. It checks for possible scenarios in the current working directory and lets the user start them as a game. Furthermore it...
""" Just Passing Through: Zone utility functions Grab zone and cluster information from dict structures obtained by the the Amazon json files. Common input parameters have the following meaning: routes == dict from route_data.json packages == dict from package_data.json sequences == d...
# Copyright 2011-2013 <NAME> # Copyright 2011-2013 <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...
# coding=utf8 import time import itertools import math from matplotlib import pyplot as plt import numpy as np import scipy.stats as stats import seaborn as sns import argparse from datetime import datetime, timedelta import matplotlib matplotlib.rcParams['agg.path.chunksize'] = 10000 def parse_datetime(datetimestri...
import math import random from copy import deepcopy from itertools import chain from typing import List, Tuple import numpy as np import torch from torch.utils.data import Dataset from parseridge.corpus.sentence import Sentence from parseridge.corpus.vocabulary import Vocabulary from parseridge.utils.logger import Lo...
"""Helper functions for MFA""" from __future__ import annotations import sys import textwrap from typing import TYPE_CHECKING, Any, Collection, List, Optional, Tuple, Type import numpy from colorama import Fore, Style if TYPE_CHECKING: from .config import ConfigDict from .corpus import CorpusMappingType, Scp...
import batoid import yaml import numpy as np from test_helpers import timer, do_pickle, init_gpu, rays_allclose @timer def test_prescreen(): """Add an OPDScreen in front of LSST entrance pupil. The OPD that comes out should be _negative_ the added phase delay by convention. """ lsst = batoid.Optic.fr...
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2018, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
#!/usr/bin/env python import sys,os,hashlib,csv from collections import defaultdict, OrderedDict import argparse #import shelve from Bio import SeqIO from Bio.SeqIO import FastaIO # requirements: biopython class HaplotypeSequence(object): def __init__(self,seq): self.seq=str(seq.seq) self.attribu...
# -*- coding: utf-8 -*- # Copyright (c) 2012-13, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of ...
# -*- coding: utf-8 -*- """Main self.file.""" from collections import OrderedDict from logging import getLogger, DEBUG from typing import Union, Dict, List from .cmd import (BEND, BENDR, EOT, FINE, GOTO, KEYSH, LFODL, LFOS, MEMACC, MOD, MODT, NOTE, PAN, PATT, PEND, PREV, PRIO, TEMPO...
import numpy as np from datadescriptor import KittiDescriptor from camera_utils import * from constants import WINDOW_HEIGHT, WINDOW_WIDTH, MAX_RENDER_DEPTH_IN_METERS, MIN_VISIBLE_VERTICES_FOR_RENDER, VISIBLE_VERTEX_COLOR, OCCLUDED_VERTEX_COLOR, MIN_BBOX_AREA_IN_PX from utils import degrees_to_radians import logging i...
from pytest import fixture, raises from grblas import op, monoid, Scalar, Vector, Matrix from grblas.exceptions import DimensionMismatch @fixture def v1(): return Vector.from_values([0, 2], [2.0, 5.0], name="v_1") @fixture def v2(): return Vector.from_values([1, 2], [3.0, 7.0], name="v_2") @fixture def A1...
import argparse import os import re import subprocess from copy import deepcopy # "backporting" for the sake of python 3.4.1 in lrz python 3.5 module... # source: https://stackoverflow.com/questions/40590192/getting-an-error-attributeerror-module-object-has-no-attribute-run-while def run(*popenargs, input=None, check=...
''' In this module, sampled data is analyzed eith respect to bounds and a convex Polytope is developed using a H-representation of the upper and lower bounds for each independent variable and the ratios in-between the independent variables. The V-representation can then be obtained using the package pyCDDLIB. Subseqeue...
import email import logging import mailbox import os import unittest import networkx as nx import pandas as pd from testfixtures import LogCapture import bigbang.archive as archive import bigbang.mailman as mailman import bigbang.parse as parse import bigbang.process as process import bigbang.utils as utils from bigb...
from ...ops import * from ..pipeline import * from .translator import * from .hashjoin import * from .thetajoin import * from .agg import * from .project import * from .scan import * from .orderby import * from .where import * from .limit import * from .root import * from .lindex import * class PyPipeline(Pipeline): ...
#!/usr/bin/python3 """ Clean up MTA Turnstile data generated from scraper: https://github.com/piratefsh/mta-turnstile-scraper """ import sqlite3 from util import trace import datetime as dt import sys import numpy as np # globals connection = None cursor = None index_cum_entries = 10 index_cum_exits = 11 index_entri...
#!/usr/bin/env vpython # Copyright 2022 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A helper tool for running Fuchsia's `ffx`. """ # Enable use of the print() built-in function. from __future__ import print_function...
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Colony Framework # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Colony Framework. # # Hive Colony Framework is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apach...
""" Copyright 2018 <NAME> <<EMAIL>> 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 ...
""" Helper interface and functions for higher level plugin module getter methods. Plugin configuration dictionaries take the following general format: .. code-block:: json { "type": "name", "impl_name": { "param1": "val1", "param2": "val2" }, "other_impl": ...
import numpy as np import fun_basicas as fun import loader as ld import seaborn as sn import pandas as pd import matplotlib.pyplot as plt from scipy.optimize import minimize from sklearn.metrics import confusion_matrix # Esta clase representa una red neuronal que se puede parametrizar # Nodos_capa : una lista de el...
from enum import Enum from Instruccion import * from random import * from six import * class TIPO_DATO(Enum) : ENTERO = 1 FLOTANTE = 2 CADENA = 3 ARREGLO = 4 CHAR = 5 UNDEFINED=6 REFERENCIA=7 class Simbolo() : def __init__(self, id, tipo,valor, dimension=[],ambito="",referencia=[]...
import unittest import torch import numpy as np from src.models.ulosd_layers import add_coord_channels, FeatureMapsToKeyPoints,\ KeyPointsToFeatureMaps from src.models.ulosd_encoders import make_encoder, make_appearance_encoder from src.models.ulosd_decoder import make_decoder class OpsTest(unittest.TestCase): ...
''' Varying implementations of Huffman's algorithm for optimal variable-length encoding. ''' from collections import deque import heapq import timeit import numpy as np import pandas as pd class HuffmanEncoder(): '''Optimal prefix-free encoding for a set of symbols. This finds and uses the optimal (min...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################## # Title : Hamster trading # Version : 1.0 # Date : Oct 2021 # <NAME> - @RoniBandini ############################################## from gpiozero import MotionSensor from datetime import datetime from RPi import GPIO from t...
""" Uses Tensorflow to create a generic DNN which learns on all of the features in a record. """ import os import pathlib from typing import List, Dict, Any, AsyncIterator import numpy as np os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" import tensorflow as tf from dffml.record import Record from dffml.model.model import...
#!/usr/bin/env python # coding: utf-8 import tensorflow as tf tf.__version__ # '2.0.0-alpha0' # 波士顿房价数据 from tensorflow.keras.datasets import boston_housing (train_data, train_targets), (test_data, test_targets) = boston_housing.load_data() # train_data的大小是(404, 13),test_data的大小是(404,) # test_labels的大小是(102, 13),...
#!/usr/bin/env python3 """ Adapted from https://github.com/DrrDom/crem https://doi.org/10.1186/s13321-020-00431-w """ #============================================================================== # author : <NAME> # date : 26-06-2019 # version : # python_version : # copyright : <N...
import pytorch_lightning as pl from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.loggers import TensorBoardLogger import argparse import pickle import naturalproofs.dataloaders as dataloaders import torch.nn.functional as F import torch import transformers import numpy as np from collection...
from pyrosetta import * from roseasy.movers import constraint def insert_alas(pose, position, length, insert_after=True, reset_fold_tree=True, fold_tree_root=1): '''Insert a poly-ALA peptide before or after a given position., Set the fold tree to have a cutpoint before or after inserted residues. Author: <...
import itertools import json import os import numpy as np import tensorflow as tf from my.tensorflow import average_gradients from read_data.r05 import DataSet from utils import get_pbar class BaseRunner(object): def __init__(self, params, sess, towers): assert isinstance(sess, tf.Session) self....
''' root/problem/problem_definition.py Overview: overview of what will/should be in this file and how it interacts with the rest of the code Rules: mention any assumptions made in the code or rules about code structure should go here ''' ### packages import os import glob import numpy as np from abc import ABC, abst...
import warnings import gensim import sklearn.metrics.pairwise import numpy as np from nltk import __maintainer__ warnings.filterwarnings("ignore", message="numpy.dtype size changed") from pliers.stimuli import TextStim, ComplexTextStim from pliers.extractors import WordEmbeddingExtractor from pliers.extractors.text_...
import os import numpy as np import pyqmc.mc as mc import sys import h5py def limdrift(g, tau, acyrus=0.25): """ Use Cyrus Umrigar's algorithm to limit the drift near nodes. Args: g: a [nconf,ndim] vector tau: time step acyrus: the maximum magnitude Returns: The vect...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import datetime import logging import os import pprint import sqlite3 import time from gt import database_utils from gt import utils logger = logging.getLogger(__name__) class EVENT(): CHECK_IN = 'check_in' ...
# -*- coding: utf-8 -*- import decimal from google.protobuf import struct_pb2 import six from . import issues, types, _apis _SHIFT_BIT_COUNT = 64 _SHIFT = 2 ** 64 _SIGN_BIT = 2 ** 63 _DecimalNanRepr = 10 ** 35 + 1 _DecimalInfRepr = 10 ** 35 _DecimalSignedInfRepr = -(10**35) _primitive_type_by_id = {} def _initiali...
import argparse, concurrent.futures, os, platform, re, regex, shutil, subprocess, sys from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.Align.Applications import ClustalOmegaCommandline work_dir = os.getcwd() + "/" parser = argparse.ArgumentParser(description='Predicts microRN...
# ****************************************************************************** # Copyright 2017-2018 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.apa...
from functools import wraps, reduce import numpy as np from tensorflow.keras import layers, models from .. import features from ..generators import ContinuousGenerator try: import tensorflow_addons as tfa InstanceNormalization = tfa.layers.InstanceNormalization GELU = layers.Lambda(lambda x: tfa.activa...
from x64dbgpy.pluginsdk import * import x64dbgpy import os import subprocess import yara import distorm3 from time import sleep import struct import sys sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) from x86devirt_jmp import decodeJumps def findLabelLocation(labels, searchLabel): ...