text
stringlengths
3.07k
22.1k
import asyncio import re import urllib.parse from typing import TYPE_CHECKING, Optional import aiohttp import disnake from disnake.ext import commands from monty.bot import Monty from monty.constants import Paste, URLs from monty.log import get_logger from monty.utils.messages import DeleteButton from monty.utils.ser...
""" Base class that holds the various properties of the Yara signature and is responsible for assembling the pieces into a (hopefully) valid Yara signature """ import re class InvalidTypeError(Exception): """ Simple error if we don't get the data type we expect """ def __init__(self, value): self.value...
# -*- coding: utf-8 -*- """ Created on Wed Mar 20 20:02:49 2019 @author: yanxi """ import os import numpy as np import matplotlib.pyplot as plt from draw import * plt.rcParams["figure.figsize"] = [4,3] plt.rcParams["font.size"]=12 plt.rcParams["font.size"]=14 plt.rcParams["figure.figsize"] = [6,4.5] plt.rcParams["f...
# -*- coding: utf-8 -*- "gsxws/repairs.py" import sys import logging from core import GsxObject, GsxError, validate from lookups import Lookup REPAIR_TYPES = ( ('CA', 'Carry-In/Non-Replinished'), ('NE', 'Return Before Replace'), ('NT', 'No Trouble Found'), ('ON', 'Onsite (Indirect/Direct)'), ('RR...
import re from os import path import pandas as pd from neo4j import GraphDatabase from config import proteoforms, LEVELS, proteins, genes from queries import QUERIES_PARTICIPANTS, QUERIES_COMPONENTS, get_query_participants_by_pathway, \ QUERY_GET_COMPLEXES_BY_PATHWAY_OR_REACTION def get_query_result(query): ...
from itertools import product import numpy as np import pandas as pd from Bio.Alphabet import generic_dna, generic_rna, RNAAlphabet, DNAAlphabet, IUPAC from Bio.Seq import Seq from Bio.Data import IUPACData import re from sklearn.base import BaseEstimator from crseek import exceptions from crseek import utils class ...
import numpy as np import foolbox from attacks.methods.refinement_tricks import refine_with_boundary_attack from models.utils.ensemble_tf_model import EnsembleTFModel from models.utils.batch_tensorflow_model import BatchTensorflowModel from utils.util import softmax print_details = False class SuperFGM: """ ...
from sklearn.datasets import load_svmlight_file import numpy as np import scipy.sparse as sp from scipy.special import expit from scipy import linalg class Oracle: def __init__(self, data_path): x, y = load_svmlight_file(data_path, zero_based=False) y[y == -1] = 0 y[y == 2] = 0 # для br...
# Imports import torch import torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, BatchNorm, Loss functions import torch.optim as optim # For all Optimization algorithms, SGD, Adam, etc. import torch.nn.functional as F # All functions that don't have any parameters from torch.utils.data import ( I...
"""spdaot.variable Overview: Defines the Variable class, which stands for a known variable. To declare a variable called 'x' with degree d (d may be of any type), call the constructor Variable('x', d). Classes: Variable: stands for a known variable VariableWord: stands for a word in known variabl...
from abc import ABC, abstractmethod import numpy as np from pymanopt import Problem from pymanopt.manifolds import Product, Stiefel import tensorflow as tf from pymanopt.solvers import ConjugateGradient class ManifoldDiscrimantAnalysis(ABC): """ This is an abstract class serving to implement joint methods bet...
tabela = { "1": ["Hidrogênio", "H"], "2": ["Hélio", "He"], "3": ["Lítio", "Li"], "4": ["Beŕilio", "Be"], "5": ["Boro", "B"], "6": ["Carbono", "C"], "7": ["Nitrogênio", "N"], "8": ["Oxigênio", "O"], "9": ["Flúor", "F"], "10": ["Neônio", "Ne"], "11": ["Sódio", "Na"], "12": ...
#!/usr/bin/python3 import urllib.parse import http.client from pathlib import posixpath as path import sys import re import os import gzip import datetime import hashlib BASEURL = "http://mirror.centos.org/centos-8/8/AppStream/x86_64/os/" LOCALPATH = "" MESSAGEPREFIX = "AppStream" VERBOSE = False def print_err(*args,...
import collections import logging import re import asn1crypto.pem import asn1crypto.x509 from oscrypto import asymmetric from pyasn1.codec.der import encoder as der_encoder from pyasn1.codec.der import decoder as der_decoder from pyasn1.codec.ber import decoder as ber_decoder from pyasn1_modules import rfc5652, rfc528...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, posixpath from time import time from fabric.api import * from fabric.contrib.console import confirm from fabric.contrib.files import exists, append ## GLOBALS env.project_name = 'opengov' # e.g. 'opengov' env.project_url = 'opengov.hk' # e.g. '...
#!/usr/bin/env python3 """ September 2020 <EMAIL> flagellin.py formerly: pipeline_flagellin_TLR5.py The D1 subunit of bacterial flagellin has the potential to act an an immune adjuvant via direct iteraction with Toll LIke Receptor 5. Structural studies suggest an Arginine at reference position R[89] in bascillus ...
"""Mess where crew eat. Fun stuff.""" from random import randint from pyntnclick.i18n import _ from pyntnclick.state import Scene, Item, CloneableItem, Thing, Result from pyntnclick.cursor import CursorSprite from pyntnclick.scenewidgets import ( InteractNoImage, InteractImage, InteractImageRect, InteractAnimated...
"""Script interface to reproduce figures from https://arxiv.org/abs/1707.02038. """ import argparse import importlib import collections import os import sys import numpy as np import pandas as pd import plotnine as gg import base.plot as bp from base import config_lib sys.path.append(os.getcwd()) gg.theme_set(gg.th...
import logging import argparse import math import os import sys from time import strftime, localtime import random import numpy as np from pytorch_transformers import BertModel, BertConfig from data_utils import Tokenizer4Bert, ABSADataset from asa_tgcn_model import AsaTgcn from sklearn import metrics import torch im...
import logging import swisseph as swe import flask_restx from flask import Blueprint from flask_restx import Resource from flask_restx import reqparse import jyotisha.panchangam.spatio_temporal.annual import jyotisha.panchangam.spatio_temporal.daily from jyotisha.panchangam import scripts from jyotisha.panchangam.spa...
import flaskr from flask import Blueprint from flask import flash from flask import g from flask import redirect from flask import render_template from flask import request from flask import url_for from flask import session from werkzeug.exceptions import abort from flask_cors import CORS, cross_origin from...
import torch from math import sqrt def get_central_crop_args(batch_width, batch_height, crop_area_ratio_range): random_ratio = torch.empty(1).uniform_(*crop_area_ratio_range).item() if 0 < random_ratio <= 1 : h = int(sqrt(random_ratio) * batch_height) w = int(sqrt(random_ratio) * batch_width) ...
import torch from torch import nn from modules.build_contextpath import build_contextpath import warnings warnings.filterwarnings(action='ignore') class ConvBlock(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=2,padding=1): super().__init__() self.conv1 = nn.C...
import argparse import os import json import shutil import random from itertools import islice import torch import torch.nn.functional as F import torch.optim as optim import torch.utils.data as data from torch.utils.data import DataLoader from ignite.contrib.handlers import ProgressBar from ignite.engine import Engin...
"""Script to calibrate a robot.""" import sys import Tkinter as tk import ttk import numpy as np from components.messaging import Signal from components.robots import VirtualRobot from components.sensors import FilteringMonitor, VirtualMonitor from components.world import Border, Wall, Package from components.control...
import pandas as pd from tests import data_generator from diviner import GroupedProphet from diviner.exceptions import DivinerException from prophet import Prophet from datetime import timedelta, datetime import os import shutil import pytest def _get_individual_model(model, index): _model_key = list(model.mode...
# -*- coding: utf-8 -*- """ Created on Sat Mar 28 15:36:42 2020 @author: nikbakht """ #--------------------------------- import tensorflow as tf #import socket GPU_mode = 0 if GPU_mode: num_GPU =0# GPU to use, can be 0, 2 mem_growth = True print('Tensorflow version: ', tf.__version__) gpus = tf.config...
#!/usr/bin/python3 import gc import hashlib import json import os from collections import defaultdict, namedtuple from typing import DefaultDict, Dict, List, Optional from karton.core import Config, Karton, Resource, Task from karton.core.resource import ResourceBase from malduck.extractor import ExtractManager, Extra...
ALL_NUMBERS = set(range(1,10)) BLANK = 0 BLANK_CHAR = '_' class SudokuBoard: def __init__(self,make_blank=True): self.cellValues = [] self.rowSets = [] self.colSets = [] self.blockSets = [] if make_blank: for i in range(9): self.cellValues.append...
import json import os import ComputedMetricsSummary import logging def add_options(parser): parser.add_option('-m', '--metricfile', help='input metrics file') (opts, args) = parser.parse_args() return opts def convert_pp_metric(metric, value, inUnit, outUnit): """Convert temperature to ...
# Copyright (c) 2013 Rackspace, Inc. # # 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 wr...
import requests from PyQt5.QtWidgets import * from PyQt5 import uic from PyQt5.QtCore import Qt from PyQt5.QtGui import QPixmap import sys class Parser: def __init__(self): self.org_apikey = '85bdbf69-a248-4ef5-8968-ed2566c2ce41' self.geo_apikey = '40d1649f-0493-4b70-98ba-98533de7710b' ...
#%% # Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
import base64 import os import shutil import socket import tempfile from shlex import split from subprocess import check_call from charms.reactive import hook from charms.reactive import remove_state from charms.reactive import set_state from charms.reactive import when from charms.reactive import when_not from char...
import unittest import numpy as np import pumapy as puma class TestImportExportVTKI(unittest.TestCase): def test_io_vti_ws(self): ws = puma.Workspace.from_shape_value((10, 11, 12), 34) ws.matrix[0, -1, 0] = 1 ws.matrix[0, 0, -1] = 2 ws.matrix[-1, -1, -1] = 3 ws.matrix[-1, ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 UnitedStack 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.or...
# -*- coding: utf-8 -*- # Copyright (c) 2019 BuildGroup Data Services Inc. import logging import json import xmljson from xml.etree.ElementTree import fromstring from caravaggio_rest_api.utils import quarter from davinci_crawling.example.bovespa import BOVESPA_CRAWLER from davinci_crawling.example.bovespa.models im...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: UTF-8 -*- import argparse import json import pathlib import sqlite3 import time import firefox_helper __title__ = 'NicoFox to Firefox Bookmarks' __version__ = '0.1.0' def _create_bookmark_data(): return { 'title': '', 'url': '', 'description': '', 't...
#!/usr/bin/env python """ Calculate combinations * Configuration parameters: - The ones required by intogen.data.entity.EntityManagerFactory - repositories.data: The path to the repository where data files are written. - overwrite: (optional) Overwrite already existing files ?. Default = no - bin_paths.gitools: Path...
# -*- coding: utf-8 -*- ''' mania.node ~~~~~~~~~~ :copyright: (c) 2014 by <NAME>. :license: MIT, see LICENSE for more details. ''' from __future__ import absolute_import, division import sys import logging import io import time import os.path import multiprocessing import threading import importlib impor...
#!/usr/bin/python # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
# Copyright (c) 2020, 2022, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, # as published by the Free Software Foundation. # # This program is also distributed with certain software (including # ...
import os import pytest from vcr import VCR, use_cassette from vcr.compat import mock from vcr.request import Request from vcr.stubs import VCRHTTPSConnection def test_vcr_use_cassette(): record_mode = mock.Mock() test_vcr = VCR(record_mode=record_mode) with mock.patch( 'vcr.cassette.Cassette.lo...
# -*- coding: utf-8 -*- from cwr.record import TransactionRecord """ Acknowledgement entity model classes. """ __author__ = '<NAME>' __license__ = 'MIT' __status__ = 'Development' class AcknowledgementRecord(TransactionRecord): """ Represents a CWR Acknowledgement of Transaction (ACK). """ def __i...
from cffi import FFI from .blosc_constants import BLOSC_MAX_OVERHEAD ffi = FFI() ffi.cdef( """ void blosc_init(void); void blosc_destroy(void); int blosc_compress(int clevel, int doshuffle, size_t typesize, size_t nbytes, const void* src, void* dest, size_t destsize); ...
import os import sys import time import regex import signal import threading import traceback import url as ruu # ------------------------------------------------------------------------------ # def split_dburl(dburl, default_dburl=None) : """ we split the url into the base mongodb URL, and the path element, w...
import numpy as np import pandas as pd from fireant.dataset.references import calculate_delta_percent from fireant.dataset.totals import get_totals_marker_for_dtype from fireant.utils import ( alias_selector, reduce_data_frame_levels, ) from .fields import ( DataType, Field, ) from ..reference_helpers ...
""" Distributed under the terms of the BSD 3-Clause License. The full license is in the file LICENSE, distributed with this software. Author: <NAME> <<EMAIL>> Copyright (C) European X-Ray Free-Electron Laser Facility GmbH. All rights reserved. """ import numpy as np from PyQt5.QtCore import Qt from PyQt5.QtWidgets i...
import inspect import platform from functools import (partial, singledispatch, wraps) from itertools import (chain, starmap, zip_longest) from operator import itemgetter from types import (BuiltinFunctionType, ...
import configparser import os import numpy import pytorch3d import torch import torchvision.transforms from PIL import Image from torchvision.utils import save_image # Data structures and functions for rendering from matplotlib import pyplot as plt from pytorch3d.io import load_ply from pytorch3d.structures import Poi...
''' Much like websites, this library collects anonymous usage statistics. It ONLY collects import and function call events. It does NOT collect any of your data. Example: {'profile': 'prod', 'package': 'd6tmodule', 'module': 'd6tmodule.utils', 'classModule': 'd6tmodule.utils.MyClass', 'class': 'MyClass', 'function...
# -*- coding: utf-8 -*- from PyQt5.QtWidgets import * # PyQt5 from PyQt5.QtCore import QThread, pyqtSignal, Qt # 多线程,以及多线程之间传递信号 from PyQt5.QtChart import QChartView, QChart, QBarSet, QHorizontalBarSeries, QBarCategoryAxis from network_monitor_no_gui import * from ui_Main_Window import * # ui 文件导出的窗体界面 SNIFF_INTER...
import pandas as pd import os import re import numpy as np import pprint import logging ''' @Author: <NAME> This script extracts voting members using the minutes of FOMC meetings, and then appends a manual verification for certain values. ''' def main(): voter_df = get_voters() get_errors(voter_df) merge...
from typing import List, Dict, Any import pandas as pd import pypsa from epippy.geographics import match_points_to_regions from epippy.generation.vres.legacy import get_legacy_capacity_in_regions, get_legacy_capacity_in_countries # from epippy.potentials import get_capacity_potential_at_points from epippy.generation...
from math import e, log from random import random import json def sigmoid(x): return 1.0 / (1.0 + pow(e, -x)) def sigmoidGradient(x): return sigmoid(x) * (1 - sigmoid(x)) def matrixSigmoid(M): return [[sigmoid(x) for x in row] for row in M] def matrixSigmoidGradient(M): return [[sigmoidGradient(...
"""Utilities for manipulating variant files in standard VCF format. """ import contextlib import copy import itertools import os import shutil import pysam from bcbio import broad, utils from bcbio.distributed.split import parallel_split_combine from bcbio.distributed.transaction import file_transaction from bcbio.pi...
import calendar import discord from discord.ext import commands from discord import app_commands import datetime from pymongo import MongoClient class Moderation(commands.Cog): """All Moderation Commands""" def __init__(self, bot: commands.Bot): self.bot = bot @commands.c...
""" Plots precision vs. recall curves for the Vesper reimplementations of the Old Bird Tseep and Thrush detectors run on the BirdVox-full-night recordings. This script plots curves for the detectors run both with and without the post-processing steps performed by the Old Bird detectors, including the merging of overla...
''' adapted from Section 3.1 in Lee and Kitanidis WRR 2014 Note: this is not a reproduction of the paper!!! ''' import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np from pyPCGA import PCGA import mf import math import datetime as dt import os import sys # model doma...
# Copyright 2019 T-Mobile US, Inc. # # 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 wri...
#!/usr/bin/env python3 import os import os.path as osp import numpy as np from scipy.spatial import transform as sptf import rclpy from rclpy.node import Node from rclpy.time import Time from rclpy.time_source import CLOCK_TOPIC import sensor_msgs.msg as sensor_msgs import std_msgs.msg as std_msgs import geometry_ms...
import argparse from multiprocessing import Process, Queue import time import os import logging log = logging.getLogger(__name__) import cooler from hicmatrix import HiCMatrix as hm from hicmatrix.lib import MatrixFileHandler from datetime import datetime import numpy as np from scipy.sparse import csr_matrix import ...
''' ======================== test_main.py ======================== Created on Dec.17, 2021 @author: <NAME> @Email: <EMAIL> @TaskDescription: This is used to unit function test and demo. @Reference: ''' import sys import time import random import logging import argparse from utils.utilities import FileUtil, TypesUtil...
# This code implements a clone of the asyncio mainloop which hooks into # Trio. import types import warnings import asyncio import trio_asyncio from contextvars import ContextVar from .util import run_aio_generator, run_aio_future, run_trio_generator current_loop = ContextVar('trio_aio_loop', default=None) current_...
# -*- coding: utf-8 -*- """ conftest ---------------------------------- Configurations for tests. Include shared fixtures here. """ # pylint: disable=locally-disabled,redefined-outer-name import asyncio import codecs from distutils.util import strtobool import os import sys import warnings import pytest from mindme...
import numpy as np import math import os import pandas as pd import powerlaw as plaw import random import scipy.io as sio import sys import time import torch lib_path = os.getcwd() sys.path.append(f'{lib_path}') from scipy.stats import levy_stable from scipy.stats import anderson_ksamp, ks_2samp, shapiro, distributio...
import time import pandas as pd import numpy as np from clear_console import clear CITY_DATA = { 'chicago': 'chicago.csv', 'new york city': 'new_york_city.csv', 'washington': 'washington.csv' } def welcome_message(): """Prints a welcome message""" clear() print('Hello! Let\'s e...
#! /usr/bin/env python3 import sys import subprocess import click import time import requests import yaml import logging import boto3 import backoff import random from itertools import zip_longest import asym_crypto_yaml from enum import Enum class Protocol(Enum): https = 1 s3 = 2 valid_protocols = [] for pr...
# %% [markdown] # This notebook is a -modified- VSCode notebook version of: # https://www.kaggle.com/sheriytm/brewed-tpot-for-nyc-with-love-lb0-37 # # You could find the train data from: # https://www.kaggle.com/c/nyc-taxi-trip-duration/data # You could find the fastest routes data from: # https://www.kaggle.com/oscar...
"""CGR routing algorithm implementation with route anchoring mechanism. This module contains an implementation of the CGR routing algorithm as outlined in the paper *Assessing Contact Graph Routing Performance and Reliability in Distributed Satellite Constellations* by Fraire et al. This routing implementation curren...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2015 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
from ...utils import gradient_diffusion import numpy as np import skimage.morphology as mp from skimage import measure as ms def gvf_tracking(I, Mask, K=1000, Diffusions=10, Mu=5, Lambda=5, Iterations=10, dT=0.05): """ Performs gradient-field tracking to segment smoothed images of cell nuclei...
""" Machine operations """ import os import uuid import logging from typing import List, Mapping from dataclasses import dataclass, replace, asdict, field from nspawn.base.image import ( ImageStore, image_store_from_url, perform_image_get_steps, ) from nspawn.base.overlay import ( ResourceOverlay, ...
''' * Page 01 of Plymouth_Daily_Rounds.xlsx * DCF Office & BMS Monitoring Computer * Electrical Room Closets * Command Center ''' print('\nStart next file, \'page_01_bms_commandctr.py\'') # imports # import openpyxl from openpyxl import load_workbook # from openpyxl.styles import PatternFill, Border, Side, Alignment, P...
#!/usb/bin/env python3 import re import itertools def solve(puzzle): ''' From http://www.diveintopython3.net/advanced-iterators.html ''' words = re.findall('[A-Z]+', puzzle.upper()) unique_characters = set(''.join(words)) assert len(unique_characters) <= 10, 'Too many letters' first_letter...
import glob import os import re import sys import urllib from tkinter import (BOTH, CENTER, RIGHT, YES, HORIZONTAL, Button, Entry, Label, Listbox, Menu, Scrollbar, StringVar, Tk, Toplevel, Y, font) from tkinter import messagebox as m_box from tkinter.ttk import Progressbar from numpy import insert ...
r""" This is the QCoDeS driver for Vaunix LDA digital attenuators. It requires the DLL that comes with the instrument, ``VNX_atten64.dll`` and/or ``VNX_atten.dll``, for 64-bit Windows and 32-bit Windows, respectively. If the instrument has more than one physical channel, ``InstrumentChannel`` s are created for each one...
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from pathlib import Path from nipype.pipeline import engine as pe from nipype.interfaces import utility as niu from nipype.interfaces import fsl from fmriprep import config from ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Dec 30 18:43:02 2018 @author: benmo """ from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium....
# -*- coding: utf-8 -*- # # Author: <NAME>, Finland 2013-2020 # # This file is part of Kunquat. # # CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ # # To the extent possible under law, Kunquat Affirmers have waived all # copyright and related or neighboring rights to Kunquat. # import math from...
#!/usr/bin/python3 import os import sys import boto3 import botocore from smart_open import open import re import hashlib import codecs import argparse import json import glob class S3RSyncDB: CHUNK_SIZE = 1073741824 #1G ROTATION_LVL = 7 # Keep this many def __init__(self, dest_keys, dest_endpoint, chunk_size...
import socket import select import datetime import tty import sys import time import fileinput ''' IRC-like chat client using PICROM Protocol by Picachoc & ROMAINPC For more information about client commands: see README file at: https://github.com/picachoc/IRC_python ''' HOST = '127.0.0.1' #the parameter of th...
import torch import torch.nn as nn import torch.nn.functional as F from ..common.blocks import Conv2dReLU, OctaveConv2ReLU, FirstOctaveConv2ReLU, LastOctaveConv2ReLU from ..base.model import Model class DecoderBlock(nn.Module): def __init__(self, in_channels, out_channels, use_batchnorm=True): super().__...
#!/usr/bin/env python3 import getpass import glob import os import pathlib import shutil import subprocess import sys import unittest if os.path.abspath(sys.argv[0]) == os.path.abspath(__file__): # When running this module directly via `./commands.py` or # `python commands.py`: # # - Ensure virtual en...
#! /usr/bin/env python # -*- coding: utf-8 -*- # <NAME> # Created : 2019-04-30 # Last Modified: 2019-04-30 # Vanderbilt University from __future__ import absolute_import, division, print_function __author__ = ['<NAME>'] __copyright__ = ["Copyright 2018 <NAME>, "] __email__ = ['<EMAIL>'] __maintainer__ ...
import numpy as np from nltk.tokenize import word_tokenize import string from nltk.corpus import stopwords from nltk.stem import PorterStemmer import pandas as pd import os def get_raw_weapon_matrix(in_weapon_dic): ''' Transform weapon code from decimal to binary, and save in a array. Input ...
import os import shutil import json import random import numpy as np from PIL import Image import plotly.graph_objects as go def mkdir(folder): if os.path.exists(folder): shutil.rmtree(folder) os.makedirs(folder) def create_random_data_splits(seed, data_filepath, object_name, ratio=0.8): random....
### MODULE_VISUALIZATION_WORLDMAP.PY ### This is the visualization on worldmap module. In here you can find several functions: ### - Functions for creating variables necessary for visualization ### - Functions necessary for other visualization options ### - Functions to create the visualization on the worldmap ### -...
# MIT License # Copyright (c) 2019 Akshay-Kawlay # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, ...
# pylint: disable-msg=E1101,E1103 from datetime import datetime import operator import numpy as np from pandas.core.index import Index import pandas.core.datetools as datetools #------------------------------------------------------------------------------- # XDateRange class class XDateRange(object): """ ...
######################################################################################################################## # Apresentação # ####################################################################################...
import tensorflow as tf from keras.models import Sequential from keras.layers.convolutional import Conv2D from keras.layers.convolutional import MaxPooling2D from keras.layers.core import Dense from keras.layers import BatchNormalization from keras.applications.vgg16 import VGG16 from keras.preprocessing import ...
import pickle import shlex from collections import namedtuple from configparser import ConfigParser, NoOptionError, NoSectionError from pathlib import Path from shutil import copy2 from subprocess import PIPE, run from .constants import (MOCK_OUTPUT_DIR, REPO_CONFIGS_DIR, ...
''' Simple sanity check for all four Hidden Markov Models' implementations. ''' import jax.numpy as jnp from jax.random import PRNGKey import matplotlib.pyplot as plt import numpy as np import distrax from distrax import HMM from jsl.hmm.hmm_numpy_lib import HMMNumpy, hmm_forwards_backwards_numpy, hmm_viterbi_numpy ...
""" Coupled Matrix Tensor Factorization """ import numpy as np from tensorly import partial_svd import tensorly as tl from tensorly.tenalg import khatri_rao from copy import deepcopy from tensorly.decomposition._cp import initialize_cp from tqdm import tqdm from .SVD_impute import IterativeSVD tl.set_backend('numpy'...
import os import numpy as np from pygeo import DVGeometry, DVGeometryAxi from pyspline import Curve ################## # DVGeometry Tests ################## def setupDVGeo(base_path, rotType=None): # create the Parent FFD FFDFile = os.path.join(base_path, "../inputFiles/outerBoxFFD.xyz") DVGeo = DVGeome...
import argparse import os import pickle from pathlib import Path import numpy as np import torch import torch.backends.cudnn as cudnn from torch.utils import data from diagan.datasets.predefined import get_predefined_dataset from diagan.models.predefined_models import get_gan_model from diagan.trainer.trainer import ...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # Modifications copyright (c) 2020 Computing Systems Group. # # 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.ap...
# Copyright 2018 <NAME> and <NAME>. # Adapted from The TensorFlow Authors, under the ASL 2.0. # # 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....