text
stringlengths
3.07k
22.1k
from turtle import forward from recstudio.model import basemodel, loss_func, scorer from recstudio.data import dataset from recstudio.ann import sampler import torch r""" Caser ###################### Paper Reference: <NAME>, et al. "Personalized Top-N Sequential Recommendation via Convolutional Sequence Embeddin...
import os import pandas as pd from typing import Union import numpy as np from collections import defaultdict import data_parser as mypars import seaborn as sns from matplotlib.colors import rgb2hex, colorConverter import bioinfo as mybio clusters = ['Opc', 'In', 'Ex', 'Mic', 'Ast', 'Oli'] cols = ['Healthy vs Earl...
# --- HYPERPARAMETERS MODEL_NAME = 'ternausv2_pretrained' RESIZE = False NORMALIZATION = 'default' LOAD_WEIGHTS = True BATCH_SIZE = 30 OPT = 'adam' LR = 1e-5 EPOCHS = 100 LOSS = 'bce_with_dice' METRICS = 'loss' def merge_options(custom_options={}): options = { 'augment': { ('image', 'mask'): [ ...
# -*- coding: utf-8 -*- import re from datetime import datetime from typing import Optional from urllib.parse import urlparse from uuid import uuid4 import six from flask import Request, current_app from eduid_userdb.exceptions import EduIDUserDBError, MultipleUsersReturned, UserDBValueError, UserDoesNotExist from ...
#Import necessary packages import discord from discord.ext import commands import yfinance as yf from regFunctions import * #Rounding and colour functions are in this file import plotly.graph_objs as plotter #Create discord client client = commands.Bot(command_prefix="$",help_command=None) #Create a price command @cl...
import threading, os, time, datetime, csv from tinkerforge.ip_connection import IPConnection from tinkerforge.brick_imu_v2 import BrickIMUV2 as IMU from tinkerforge.bricklet_gps_v2 import BrickletGPSV2 from tinkerforge.bricklet_temperature_v2 import BrickletTemperatureV2 from tinkerforge.bricklet_barometer_v2 import B...
#!/usr/bin/python from __future__ import print_function import argparse import bugzilla import dateutil.parser from datetime import timedelta, datetime from dateutil.tz import tzlocal import os import requests.exceptions import subprocess import sys import tempfile import yaml from xml.etree import cElementTree as ET...
import logging import numpy as np import scipy.ndimage as ndi import skimage.draw import skimage.io __all__ = ["realign"] def realign(microscope, new_image, reference_image): """Realign to reference image using beam shift. Parameters ---------- microscope : Autoscript microscope object new_imag...
from nltk import word_tokenize import numpy as np import os import torch from torch import nn from torch.autograd import Variable import torch.nn.functional as F from torch.nn.utils.rnn import pad_sequence from torch import optim import random import json from collections import Counter from datetime import date from t...
#!/usr/bin/env python import json, os import numpy as np import cv2 def splitfn(fname): path, fname = os.path.split(fname) name, ext = os.path.splitext(fname) return path, name, ext def main(image_files, pattern_size, square_size, threads, json_file=None, debug_dir=None): """ image_files: list...
""" RADCATr - RADCAT Review Interface <NAME> 2018 """ import sys import os import logging import csv import re import argparse from Tkinter import * import ttk # In case running from /examples folder in git sys.path.insert(0, os.path.abspath('../DixelKit')) from diana.apis.report import RadiologyReport __desc__ = ""...
import sys sys.path.append('../..') import os import pickle import numpy as np import tensorflow as tf #from pgmagick import Image import skimage as ski import skimage.data from tqdm import trange import datasets.dataset_helper as dataset_helper import models.model_helper as model_helper FLAGS = tf.app.flags.FLAGS ...
''' Author: <NAME> Project: GreenAi year: May,2021 ''' import argparse import subprocess import datetime import yaml from shutil import copyfile import os import shutil import tqdm import signal, sys import numpy as np import utils.utils as utils from dataset.learning_dataset import dataset_loader from datetime...
""" This is a prototype of a Raw-Plot based just on the Plotting-Capabilities of PyQt5/PySide2. It was originally created by <NAME> (https://github.com/cbrnr). """ import sys from collections import OrderedDict from PyQt5.QtCore import QRectF from PyQt5.QtWidgets import QGraphicsItem, QGridLayout, QWidget from qtpy.Qt...
from __future__ import annotations from enum import IntEnum from typing import List, Optional, Union, Tuple, Dict from pykotor.common.geometry import Vector3, Vector4, Vector2, SurfaceMaterial from pykotor.common.misc import Color class MDL: """ Represents a MDL/MDX file. Attributes: root: The ...
#!/usr/bin/env python """ Base Experiment Defines a representation of an experiment along with helper methods for making it easier to implement experiments. Experiments are defined by a set of controlled variables, an independent variable and a dependent variable. A list of values for the independent variable are alo...
import glob import traceback import settings import os import codecs import pandas as pd import csv import json import datetime import collections RESULT_SUCCESS = 'success' MSG_CANNOT_PARSE_FILENAME = 'Cannot parse filename' MSG_INVALID_TYPE = 'Type mismatch' MSG_INCORRECT_HEADER = 'Column not in table definition' M...
# Copyright (c) 2019, NVIDIA CORPORATION. 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 conditions a...
#!/usr/bin/env python3 import sys from os import mkdir import os.path as osp from typing import NoReturn, Union, Dict import torch as t from torch.utils.data import DataLoader import numpy as np import pandas as pd import stsc.models as M import stsc.datasets as D import stsc.utils as utils def fit(model : Union[...
from . import * from .baselines import * from .dataio import * from .other_hypernetworks import * #from .hyper import * from .hyperalexnet import * from .siren import * from .utility import * ######################################################################################################################## # HYPER...
import sys import os import functools from pathlib import Path import numpy as np from paderbox.io.audioread import load_audio def play( data, channel=0, sample_rate=16000, size=1024, shift=256, window='blackman', window_length: int=None, *, sc...
import math import torch import torch.nn as nn import torch.nn.functional as F class PadWithin(nn.Module): """ Pads the self-attention mask back to the original time frame """ def __init__(self, stride=2): super(PadWithin, self).__init__() self.stride = stride ...
import csv, sys, logging, os, os.path, re, datetime, configparser from simpletal import simpleTALES, simpleTAL logging.basicConfig(level = logging.INFO, filename="buildschemes.log") loginfo = lambda x: logging.info(x) textmatch = lambda x,y: str(x).lower()==str(y).lower() class UnicodeDictReader(csv.DictReader, objec...
import os import re import json import langdetect from dict.contractions import contractions_dict from dict.languages import languages # ************************ # *** GLOBAL VARIABLES *** # ************************ langList = languages template = { "empty": 0, "links": 0, ...
import os import re from collections import namedtuple import numpy as np from scipy.stats import rankdata from sklearn.utils import check_random_state from csrank.constants import OBJECT_RANKING from .util import sub_sampling_rankings from ..dataset_reader import DatasetReader __all__ = ['DepthDatasetReader'] cla...
import os import json import torch.nn as nn import torch.optim from collections import OrderedDict def conv_sampler( in_channels:int, layer_num:int, kernel_nums:tuple, kernel_sizes:tuple, strides:tuple, paddings:tuple, final_activation:str=None, up_sample:bool=False, output_pa...
""" Configuration for machines supported by Codar. """ from codar.savanna import exc import pdb # Note: not all schedulers support all options, the purpose of this is # just basic validation to catch mispelling or completely unsupported # options. Some options have different names, we favor PBS naming when # possible...
from __future__ import print_function import sys import os import numpy as np import pandas as pd import re import Bio import Bio.SeqIO import scipy.stats as scistat import argparse import glob """Find the statistical significance of the binding strength at each regulatory DNA by comparing the TF's foreground Calling...
import math import numpy as np import pandas as pd import torch import torch.nn as nn import torch.optim as optim from datetime import datetime from livelossplot import PlotLosses from scipy import stats from torch.utils.data import DataLoader from torchvision import transforms import amphibian.preprocess.preprocessi...
""" Summary: Contains the Culvert unit type classes. This holds all of the data read in from the culvert units in the dat file. Can be called to load in the data and read and update the contents held in the object. Author: <NAME> Copyright: <NAME> 2016 TODO: Updates: ...
"""SegmentTimeLine XML entry generator.""" # The copyright in this software is being made available under the BSD License, # included below. This software may be subject to other third party and contributor # rights, including patent rights, and no such rights are granted under this license. # # Copyright (c) 2015, Da...
import os from tkinter import * from tkinter import messagebox, filedialog, scrolledtext from tkinter.ttk import Combobox import time class App: def __init__(self, master): """ main window settings""" master.title("HTML Photogallery Generator") master.geometry("500x650+550+125") ma...
import time import pygame from math import log, sqrt from random import choice class Stat(object): __slots__ = ('value', 'visits') def __init__(self, value=0.0, visits=0): self.value = value self.visits = visits def __repr__(self): return u"Stat(value={}, visits={})".format(self....
# Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # This work is made available under the Nvidia Source Code License-NC. # To view a copy of this license, check out LICENSE.md import collections import os import torch import torch.nn as nn from imaginaire.config import Config from imaginai...
import qiskit import torch from torch.autograd import Function import torch.nn as nn import torch.nn.functional as F from qhana.backend.QNNCircuitGenerator import QNNCircuitGenerator from qhana.backend.QNNcircuitExecutor import CircuitExecutor import math import numpy as np # Adapted from # Some classes for the hybrid...
import tensorflow as tf import math import time import numpy as np import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(BASE_DIR) sys.path.append(os.path.join(ROOT_DIR, 'utils')) sys.path.append(os.path.join(BASE_DIR, '../models')) import tf_util def placeholder_inputs(...
import numpy as np import math from src.quantum_phase_estimation.quantumdecomp.decompose_4x4 import decompose_4x4_optimal from src.quantum_phase_estimation.quantumdecomp.gate import GateFC, GateSingle from src.quantum_phase_estimation.quantumdecomp.optimize import optimize_gates from src.quantum_phase_estimation.quant...
import sublime import sublime_plugin import threading from .backends import db from contextlib import contextmanager from time import sleep from copy import deepcopy from os.path import realpath breakpoints = {} curlang = "python3s" DB = db.Client(curlang) class languageCommand(sublime_plugin.WindowCommand): def...
from nose.tools import assert_equal from nose import SkipTest import tempfile import pypeflow.data import pypeflow.task import os PypeLocalFileCollection = pypeflow.data.PypeLocalFileCollection PypeLocalFile = pypeflow.data.PypeLocalFile fn = pypeflow.data.fn class TestFn: def test_fn(self): file = PypeLo...
import ipopt import numpy as np import scipy.sparse as sps import sympy as sp import sys sys.path.append("../..") from envs.aslaug_v1_cont import AslaugEnv env = AslaugEnv(gui=True) print(env.obs_slicing) N = 2 rotmat = lambda a: sp.Matrix([[sp.cos(a), -sp.sin(a)], [sp.sin(a), sp.cos(a)]]) vars = sp.symbols('x_0:97'...
import json # format: # serosurvey_data = { # "belgium": # [ # { # "time_range": [], # "measures": [ # {"age_range": [0, 5], "central": 0., "ci": []} # ] # } # ], # } import os import pandas as pd from aut...
import shelve import numpy as np import re import pandas as pd import json import pickle import pdb from copy import copy with open('metadata/bacnet_devices.json', 'r') as fp: sensor_dict = json.load(fp) nae_dict = dict() nae_dict['bonner'] = ["607", "608", "609", "557", "610"] nae_dict['ap_m'] = ['514', '513','6...
# standard imports from typing import Dict # scientific imports import numpy as np from scipy.signal import butter, filtfilt from astropy.convolution import convolve, Box1DKernel from astropy.stats import LombScargle from scipy.integrate import simps # project imports mag_list = np.array([ 7, 7.4, 8.1, ...
# (C) Copyright 2016-2021 Xilinx, Inc. # All Rights Reserved. # # 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 ...
# Gurobi xref planner # Written by: <NAME> from __future__ import division from gurobipy import * from math import * import numpy as np import matplotlib.pyplot as plt def add_initial_constraints(model, x, Theta): # Make sure to start in Theta A, b = Theta dims = len(A[0]) # Find center of initial se...
import json import uuid import requests from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from celery.task import Task from celery.utils.log import get_task_logger from celery.exceptions import SoftTimeLimitExceeded from django.utils import timezone from seed_services_client.metri...
import asyncio, discord from discord.ext import commands from Cogs import Utils, DisplayName, Message def setup(bot): bot.add_cog(Lockdown(bot, bot.get_cog("Settings"))) class Lockdown(commands.Cog): # Init with the bot reference, and a reference to the settings var def __init__(self, bot, sett...
from math import ceil from queue import Queue from threading import Thread from readerwriterlock import rwlock from teos.cleaner import Cleaner from teos.chain_monitor import ChainMonitor from teos.constants import OUTDATED_USERS_CACHE_SIZE_BLOCKS from common.tools import is_compressed_pk, is_u4int from common.crypto...
import torch import numpy as np import cv2 def get_center_point_contour(output, thresh, scale, ori_size): ori_w, ori_h = ori_size height, width, num_classes = output.shape c_mask = (output > thresh).astype(np.uint8) results = [] for cls in range(num_classes): mask = c_mask[:, :...
from server import client_teacher from numpy import spacing from kivymd.app import MDApp from kivymd.uix.boxlayout import MDBoxLayout from kivymd.uix.button import MDRaisedButton from kivymd.uix.label import MDLabel from kivy.uix.image import Image from kivymd.uix.textfield import MDTextField from kivymd.uix.datatabl...
import secrets from enum import Enum from fractions import Fraction from operator import itemgetter, attrgetter from typing import Dict, List, Tuple, Set """ STV calculator Based on procedure as defined in https://prfound.org/resources/reference/reference-meek-rule/ Uses exact ratio arithmetic to prevent need to use ...
import six from nose.tools import assert_raises from syn.base_utils import GroupDict, AttrDict, assert_type_equivalent, \ ReflexiveDict, SeqDict, getfunc, Precedes from syn.type.a import AnyType, TypeType from syn.base.b.meta import Attr, Attrs, Meta, Data from syn.base.a.meta import mro from syn.base.b.meta import...
#!/usr/bin/env python # Copyright (c) 2019, IRIS-HEP # 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 ...
from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils import flt, cstr,nowdate,cint,get_datetime, now_datetime,add_months,getdate,date_diff,add_days @frappe.whitelist() def get_fmcr_data(vlcc=None,cycle=None,farmer=None): cyclewise_computation = frappe.db.g...
import controlTypes import braille import brailleInput import queueHandler from logHandler import log from ctypes import * import time import threading import wx import config import speech import NVDAObjects import api import textInfos import inputCore import socket import ui import unicodedata class BrailleDisplayD...
""" Created on 18.12.2018 :author <NAME> User specific functions """ import json from django.db import connection from urllib.parse import unquote, urlparse from core.oauth.models import BPUser, BPUserSettings def get_relevant_links(userid, fields): links = {'task': [], 'job': [], 'other': []} sqlquerystr ...
import math, random import gym import numpy as np np.random.seed(123) import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from IPython.display import clear_output import matplotlib.pyplot as plt import torch.autograd as autograd import gym_malware from gym_malware.envs.uti...
import cv2 from math import exp import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np # np.set_printoptions(threshold=np.nan) import matplotlib.pyplot as plt def sobel(window_size): assert(window_size % 2 != 0) ind = window_size // 2 matx...
import os import torch import random import numpy as np import copy from torch.utils.data.dataloader import default_collate from src.utils.basic_utils import flat_list_of_lists from src.utils.load_save import LOGGER from src.datasets.dataset_base import AlproBaseDataset from src.datasets.randaugment import TemporalCons...
# Copyright 2016 VMware, 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 a...
""" Code to run and pre-train LSTM models on SMILES strings <NAME>, Eindhoven University of Technology, March 2022 Inspired by: <NAME>., <NAME>., <NAME>. & <NAME>. Perplexity-based molecule ranking and bias estimation of chemical language models. ChemRxiv (2021) doi:10.26434/chemrxiv-2021-zv6f1-v2. """ import tensor...
import cufflinks as cf from plotly.offline import init_notebook_mode import plotly.graph_objects as go import plotly.express as px import os import pandas as pd import numpy as np from dropbox_api import update_on_dropbox from index import generate_index from gauss import Gauss cf.go_offline() init_notebook_mode(conne...
import torch if torch.cuda.is_available(): import torch.cuda as device else: import torch as device from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from torch.distributions.categorical import Categorical from util.functions import time_distributed, create_onehot_va...
# # tsne_torch.py # # Implementation of t-SNE in pytorch. The implementation was tested on pytorch # > 1.0, and it requires Numpy to read files. In order to plot the results, # a working installation of matplotlib is required. # # # The example can be run by executing: `python tsne_torch.py` # # # Created by <NAME> o...
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2016, <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...
# Some draft layers, I'd like to eventually add these to the nfp repo import numpy as np import tensorflow as tf from tensorflow.keras import layers from tensorflow.python.keras.layers.pooling import GlobalPooling1D from tensorflow.python.keras import backend from tensorflow.python.ops import math_ops from tensorflow...
from keras.engine import Layer from keras import backend as K from keras.metrics import binary_accuracy from keras.utils.vis_utils import model_to_dot from keras.models import Model import functools from keras.utils.generic_utils import to_list from keras.utils.generic_utils import unpack_singleton from keras.utils.gen...
import curses import textwrap import logging import re import os from collections import namedtuple BULLET = '•' MIN_HEIGHT = 5 CTRL = 0b1100000 DOWN_KEYS = (curses.KEY_DOWN, ord('j')) UP_KEYS = (curses.KEY_UP, ord('k')) START_KEYS = (curses.KEY_HOME, ord('g')) PAGE_UP_KEYS = (curses.KEY_PPAGE, CTRL ^ ord('u')) PA...
from configparser import ConfigParser, ExtendedInterpolation import os import subprocess import sys BB_DIR = os.path.dirname(os.path.realpath(__file__)) + '/' CFG = BB_DIR MAIN = 'base' KINETICS = 'https://storage.googleapis.com/deepmind-media/Datasets/' HACS = 'http://hacs.csail.mit.edu/dataset/' ACTNET = 'http://ec...
import logging import random import numpy as np import torch from .model.pytorch_pretrained import BertAdam, warmup_linear def set_random_seed(seed=42, use_cuda=True): """Seed all random number generators to enable repeatable runs""" random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) ...
# Future from __future__ import annotations # Standard Library import colorsys import datetime as dt import io import math import random from typing import Any, Literal # Packages import aiohttp import discord import humanize import mystbin import pendulum # My stuff from core import colours, config, emojis, values ...
import json from os import listdir import os.path as osp import cv2 as cv import random import numpy as np def load_zone_anno(json_filename): """ Load the json with ROI and MOI annotation. """ with open(json_filename) as jsonfile: dd = json.load(jsonfile) polygon = [(int(x), int(y)) for ...
import os import os.path import re import logging import jinja2 from io import StringIO from .utils import ( get_meta_name_and_modifiers, html_escape, split_page_url, get_url_tail) RE_FILE_FORMAT = re.compile(r'\r\n?', re.MULTILINE) RE_META_SINGLE_LINE = re.compile( r'^\{\{(?P<name>(__|\+)?[a-zA-Z][a-zA-Z0-9...
# Copyright 2019-2021 Toyota Research Institute. All rights reserved. """Dataset for handling frame-level (unordered) for unsupervised, self-supervised and supervised tasks. This dataset is compliant with the TRI-ML Dataset Governance Policy (DGP). Please refer to `dgp/proto/dataset.proto` for the exact specification...
import time from aco import aco import tkinter as tk import numpy as np class paramWindow: def __init__(self): self.param_window = tk.Tk() self.inputs = {} self.parameters = {} self.valid_params = False self.param_window.title('ACO Simulator') def add_parameter(self, p...
import argparse import colorsys import logging import random from pathlib import Path import cv2 import numpy as np REWIND_MSG = False def random_rgb(): h, s, l = random.random(), 0.5 + random.random() / 2.0, 0.4 + random.random() / 5.0 r, g, b = [int(256 * i) for i in colorsys.hls_to_rgb(h, l, s)] retu...
import torch.nn as nn from torch.nn import functional as F import math import torch.utils.model_zoo as model_zoo import torch import os import sys import pdb import numpy as np from torch.autograd import Variable import functools affine_par = True BASE_DIR = os.path.dirname(os.path.abspath(__file__)) s...
#!/usr/bin/env python # =============================================================================== # Copyright (c) 2014 Geoscience Australia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: ...
#! /usr/bin/python # -*- coding: UTF-8 -*- # Copyright 2012 <NAME>, TestLink-API-Python-client developers # # 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/...
#!/usr/bin/python3.6 import pyorient def create_user_class(client): print('Creating the class User') client.command('CREATE CLASS User EXTENDS V') print('Add the followings properties to the User:') print('- firstName') client.command('CREATE PROPERTY User.FirstName STRING') client.command('AL...
import io import json import os import random import sqlite3 from time import sleep import discord try: from PIL import Image except ImportError: import Image import pytesseract import requests from discord.ext import commands import src.util as util from src import const, config, db_access config = config.Co...
import random from typing import Union, List import cv2 import numpy as np import matplotlib.pyplot as plt from affine import Affine from geopandas import GeoDataFrame from shapely.geometry import Polygon, mapping from kaizen_mapping.map.trace import TracePoint from kaizen_mapping.utils.gis import ( geom_check, ...
import pandas as pd import gym import numpy as np import matplotlib.pyplot as plt GAMMA = 0.9 ALL_POSSIBLE_ACTIONS = [0,1] def random_action(a, epsilon): p = np.random.rand() if p < epsilon: action = np.random.choice(ALL_POSSIBLE_ACTIONS) else: action = a return action def max_dict(dictionary, s): # dict...
""" post process compute mapping compute embeddings union graph """ import os import re import json import itertools import logging import pandas as pd import numpy as np import torch import torch.nn.functional as F from .conceptnet import chunks log = logging.getLogger(__name__) def post_process_graph(graph_path):...
from typing import Dict, Tuple, List import sys import re import time from multiprocessing import Pool from . import NED as N from WikiParser import Parser as P import importlib importlib.reload( N ) importlib.reload( P ) class DatasetDocument: """ Auxiliary class to process dataset documents in parallel. """ de...
#!/usr/bin/env python3 import argparse import numpy as np from pathlib import Path from time import monotonic, strftime from datetime import datetime from multiprocessing import Process, Queue import cv2 import depthai as dai def check_range(min_val, max_val): def check_fn(value): ivalue = int(value) ...
'''***************************************************************************** Purpose: To extract insider trading data from sec website This program extracts insider trading data from the sec website and stores it in excel file. Usage: Enter a ticker (ex: 'AAPL, MSFT') or type 'all' to search thru all the tickers in...
from math import fabs import _geometry import bisect import itertools import random from sims4.math import vector_cross_2d from sims4.repr_utils import standard_repr from sims4.utils import ImmutableType import enum import sims4.math import sims4.random ANIMATION_SLOT_EPSILON = 0.01 __all__ = ['Polygon'] get_intersecti...
# # Copyright (c) 2015-2016 <NAME> <<EMAIL>> # - Universitat de Barcelona, 2015-2016 # - University of Calgary, 2016 # # 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...
"""Handle constraints by reparametrizations. The functions in this module allow to convert between internal and external parameter vectors. An external parameter vector is the parameter vector as it was specified by the user. This external parameter vector might be subject to constraints, such as the condition that ...
# -*- coding: utf-8 -*- """ Compute kcore and avg cascade length Extract the train set for INFECTOR """ import igraph as ig import time import pandas as pd import json import numpy as np from datetime import datetime def sort_papers(papers): """ # Sort MAG diffusion cascade, which is a list of papers and ...
"""Decorates command lines with docker arguments.""" import os from fnmatch import fnmatch from dodo_commands import CommandError, Dodo from dodo_commands.dependencies.get import plumbum from dodo_commands.framework.args_tree import ArgsTreeNode from dodo_commands.framework.config import merge_into_config from dodo_co...
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
#!/usr/bin/env python # cardinal_pythonlib/tools/convert_mdb_to_mysql.py # noinspection HttpUrlsUsage """ =============================================================================== Original code copyright (C) 2009-2021 <NAME> (<EMAIL>). This file is part of cardinal_pythonlib. Licensed under the Ap...
#!/usr/bin/env python3 """ """ DESCRIPTION = ''' Read in allc tables (with tabix open) and generate summarized mc levels for given regions. Inputs: allctables, a bedfile (a list of regions), a list of contexts. Outputs: one file for each allc table for a list of context. ''' from __init__scr import * import argparse ...
"""This script converts a GangSTR output VCF to the .json format ExpansionHunter uses to output results. This makes it easier to pass GangSTR results to downstream scripts. """ from pprint import pprint """ GangSTR output vcf format: chr14 39042968 . tttatttatttatttattta . . . ...
#!/usr/bin/env python # (c) 2020 <NAME> <<EMAIL>> import string import numpy as np # score non-blank paths from IPython import embed class Tokenizer(): def __init__(self, symbols): # symbol_set = list(string.ascii_lowercase) + ['<bos>','<eos>', '<blank>'] self._int2char = symbols self._ch...
# Copyright (c) 2010-2011 OpenStack, 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 ...
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches from scipy.ndimage.filters import gaussian_filter1d import math from .config import ( GAUSSIAN_RELATIVE_SIGMA, OUTER_CORNER_THRESH_FACTOR, MODULE_DETECTION_PEAK_THRESH, ) from scipy import optimize, signal from pvinspect...
from __future__ import print_function from ..Model import Struct import numpy as np import inspect class WriteProp(object): def __init__(self, prop): self._write(prop) def _write(self, prop): pass #print (prop) class RandomGrid(object): """ Base class for Random grids """ ...