text
stringlengths
3.07k
22.1k
import os from telegram.ext import CommandHandler, MessageHandler, Filters from settings import WELCOME_MESSAGE, DAFTAR_HARGA, TELEGRAM_SUPPORT_CHAT_ID, REPLY_TO_THIS_MESSAGE, WRONG_REPLY from telegram import ParseMode, InlineKeyboardMarkup, InlineKeyboardButton buttons = [ [ InlineKeyboardButton( ...
import pandas as pd import torchvision from torch.utils.data import DataLoader from tqdm import tqdm from pre_process import * from utils import * warnings.filterwarnings("ignore") parser = argparse.ArgumentParser(description='MuSE Training') parser.add_argument('--lr', default=1e-3, type=float, help='learning rate'...
import numpy as np import cv2 import random import tqdm import utils import os DAVIS17_TRAINING_VIDEOS = [ 'bear', 'bmx-bumps', 'boat', 'boxing-fisheye', 'breakdance-flare', 'bus', 'car-turn', 'cat-girl', 'classic-car', 'color-run', 'crossing', 'dance-jump', 'dancing', 'disc-jockey', 'dog-agility', 'dog-go...
from __future__ import print_function import gdal import os import numpy as np from time import time import osr import argparse import shutil from scipy import ndimage as ndi from skimage.filters import gabor_kernel import multiprocessing as mp from sklearn.cluster import AffinityPropagation from sklearn im...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2019 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
import pandas as pd import numpy as np import mapping as mp from . import strategy def get_relative_to_expiry_instrument_weights(dates, root_generics, expiries, offsets, all_monthly=False, holidays=None): """ Generate ...
from PIL import Image import os import time from typing import List, Tuple, Optional, Dict, Set # class Vis: # pass class VisGrid: def __init__(self, grid, window_dim, border_width=25, line_width=1, tick_time=0.1, agent_color="blue", path_width=3, text_size=20): self.grid = grid ...
"""GUI for the othello application.""" import logging import tkinter as tk import tkinter.messagebox from random import choice as choose_from from typing import Optional from .player import GUIPlayer from .. import bitboard as bb from ..ai import ai_default, ai_options, AIOption from ..board import Board from ..color...
import os import sqlite3 import re import datetime def get_tags_by_book(db_con, _id): c = db_con.execute("""SELECT group_concat(Tags.name) FROM Tags, BookTags bt, Books WHERE bt.book_id = Books.id AND Books.id = ? ...
#!/usr/bin/python """Generate Terraform configuration files from a set of predefined templates. Copyright 2021 Google LLC. This software is provided as-is, without warranty or representation for any use or purpose. Your use of it is subject to your agreement with Google. """ import os import sys import shutil impo...
# Front matter ############## import os from os import fdopen, remove from tempfile import mkstemp from shutil import move import glob import re import time import pandas as pd import numpy as np from scipy import constants from scipy.optimize import curve_fit, fsolve from scipy.interpolate import interp1d import matpl...
import os import cv2 import copy import numpy as np import imgaug as ia from imgaug import augmenters as iaa from keras.utils import Sequence import xml.etree.ElementTree as ET from yok.utils import BoundBox, normalize, bbox_iou def parse_annotation(ann_dir, img_dir, labels=[]): count = 0 all_img...
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import re try: import urlparse except: import urllib.parse as urlparse import urllib import functools import locale import calendar import time import requests import warnings from amazon.api import AmazonAPI import dateutil.parser fr...
from collections import defaultdict from datetime import datetime, timedelta, time from django.template.loader import render_to_string from django.utils.translation import ugettext as _ from jsonobject.properties import DateTimeProperty from corehq.apps.app_manager.models import ApplicationBase from corehq.apps.users....
""" Get Cannabis Data for Connecticut Copyright (c) 2021 Cannlytics Author: <NAME> Contact: <<EMAIL>> Created: 9/16/2021 Updated: 9/18/2021 License: MIT License <https://github.com/cannlytics/cannlytics-ai/blob/main/LICENSE> Data Sources: Connecticut Medical Marijuana Brand Registry: https://data.ct.gov/Health-an...
""" Module for holding common checking utility functions. """ # Copyright (c) 2012-2013 <NAME> # # This file is part of the KMCLib project distributed under the terms of the # GNU General Public License version 3, see <http://www.gnu.org/licenses/>. # import numpy from KMCLib.Exceptions.Error import Error def c...
# MIT License # # Copyright (c) 2022 GozZzer # # 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...
from numba import jit import numpy as np import matplotlib.pyplot as plt visualization = True def show_spheres(scale, points, rgb, label=None): """ :param scale: int :param points: tuple (x, y, z) :param rgb: :return: """ if label is not None: print('') print(label) p...
"""Django models representing IIIF canvases and IIIF image server info.""" from genericpath import exists import os from boto3 import resource from bs4 import BeautifulSoup from urllib.parse import quote import config.settings.local as settings from django.db import models from django.contrib.auth import get_user_model...
# Copyright 2020 <NAME> # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software...
import os, sys import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from anndata import read_mtx import pegasus as pg from termcolor import cprint from sklearn.metrics import silhouette_score method_list = ["baseline", "pegasus", "seurat", "mnn", "combat", "bbknn"] figure_index...
''' json anlysis ''' from collections import defaultdict from .utils import readjson, find_json_file, get_analyzeResult, \ get_pageResults, get_readResults, get_lines, get_tables, get_cells, get_text, \ get_boundingBox, compare_xposition, compare_yposition, outjson def part1_1(tables, preserveintable, tmptextintable...
import argparse import configparser import os import sys sys.path.append('..') sys.path.append('../..') # if running in this folder from vimms.Common import IN_SILICO_OPTIMISE_TOPN, load_obj, add_log_file, IN_SILICO_OPTIMISE_SMART_ROI, \ IN_SILICO_OPTIMISE_WEIGHTED_DEW from vimms.InSilicoSimulation import extrac...
import math import numpy as np from scipy.spatial.transform import Rotation """ The rotations can of two types: 1. In a global frame of reference (also known as rotation w.r.t. fixed or extrinsic frame) 2. In a body-centred frame of reference (also known as rotation with respect to current frame of reference. It is ...
""" Provide some basic statistics on the get_valid_cpgs_dataset file before converting it to a data for the nn """ import argparse import os import sys import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns plt.style.use('seaborn') sns.set_style('whitegrid') # Change this when ...
from flask import redirect, url_for, render_template, request, session, Markup, Blueprint, send_from_directory import uuid, string, random, json, re from subprocess import call import database as db main = Blueprint("main", __name__) # All colors that a user can choose from in a chat room colors = [ "#e0383e", "i...
# -*- coding: utf-8 -*- import json import itertools from hashlib import md5 from math import isnan from datetime import datetime from flask import current_app from importlib import import_module from fastnumbers import isfloat from flask_mongoengine import DynamicDocument from mongoengine import CASCADE, signals from...
import subprocess import time import threading import shelve import queue import re from collections import defaultdict import urllib.request as request import urllib import socket import datetime socket.setdefaulttimeout(5) class DBHandler(object): """数据文件操作""" def __init__(self, file_name, file_...
""" This file outlines the interaction between snek and Discord's Gateway API. """ import asyncio import concurrent.futures import logging import random import sys import threading import time import zlib from typing import Any, Callable, Coroutine, List, Optional from aiohttp import WSMsgType from dis_snek.const imp...
import torch import torch.nn as nn def initialize_layer(m): if isinstance(m, nn.Conv2d): nn.init.normal_(m.weight, 0.0, 0.02) nn.init.zeros_(m.bias) if isinstance(m, nn.Linear): nn.init.normal_(m.weight, 0.0, 0.02) nn.init.zeros_(m.bias) class RelationNonLocal(nn.Module): ...
from tkinter import * import tkinter as tk from tkinter import ttk from pylsl import StreamInlet, resolve_stream, StreamInfo, StreamOutlet #import xlwt from datetime import datetime running = True def stop1(): global running if running == False: running = True print("now true") else: ...
import random import os def jogar(): tema = define_tema() arquivo = arquivo_do_tema(tema) palavra_secreta = sorteia_palavra(arquivo) loop_jogo_forca(palavra_secreta) def loop_jogo_forca(palavra_secreta): lista_historico = [] print(f"\nA palavra secreta tem {len(palavra_secreta)} letras\n")...
from collections import defaultdict import networkx as nx import graphviz as gv from graphviz import Source import nltk def load_graph(frame_label2frame_obj, synset_id2synset_obj, rbn_objs, options, verbose=0): """ """ g = nx.Graph() for frame_label, frame_obj in frame_label2frame_obj.items(): ...
from abc import ( ABC, abstractmethod, ) from datetime import datetime import json import os from pathlib import Path import re import shutil import time from typing import ( List, Dict, Union, Optional, TypeVar, Type, ) import unicodedata import urllib.parse import dateutil.tz.tz as tz...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
""" Description: Author: <NAME> (<EMAIL>) Date: 2021-06-06 01:55:29 LastEditors: <NAME> (<EMAIL>) LastEditTime: 2021-06-06 01:55:30 """ import os import argparse import json import logging import logging.handlers import time from collections import OrderedDict from datetime import datetime from pathlib import Path fro...
import pygame import random import neat import os import numpy as np from collections import deque pygame.font.init() WIN_WIDTH = 600 WIN_HEIGHT = 600 GRID_WIDTH = 250 # 20 x 20 squares GRID_HEIGHT = 250 TOP_LEFT_X = (WIN_WIDTH-GRID_WIDTH) // 2 TOP_LEFT_Y = (WIN_HEIGHT-GRID_HEIGHT) // 2 CELLWIDTH = 25 LOWER = 4 UPP...
""" Copyright 2016-2022 by Sophgo Technologies 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 applicab...
""" split scRNA-Seq fastq file(01.barcode/{sample}_2.fq) """ import glob import os from collections import defaultdict import pysam import pandas as pd import celescope.tools.utils as utils from celescope.tools.step import Step, s_common from celescope.__init__ import HELP_DICT from celescope.tools.cellranger3.wrappe...
from model import * from config import * import torch.optim as optim from collections import OrderedDict def load(path): state_dict = torch.load(path) state_dict_rename = OrderedDict() for k, v in state_dict.items(): name = k[7:] # remove `module.` state_dict_rename[name] = v #print(s...
import json import re import datetime import time import sys import Doberman import os import socket from pymongo import MongoClient dtnow = datetime.datetime.utcnow __all__ = 'PrintHelp ProcessCommand'.split() def print_help(db, name): print('Accepted commands:') print('help [<plugin_name>]: help [for spec...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os import random import sys import time import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow ...
""" AppOpener Project to open apps Version 0.2.0 By <NAME> """ # Imports import tkinter as tk from tkinter import filedialog, messagebox import os import csv # Initialising Variables apps = [] profiles = [] profileName = [] defaultProfile = None # Functions/Classes class Profile: def __init__(self, name, num, ...
# Copyright (c) 2013, earthians and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe def execute(filters=None): columns = get_columns() data = get_data(filters) return columns, data def get_columns(): columns = [ { "fieldname": "lot_no", ...
""" Support for Mitsubishi heatpumps using https://github.com/SwiCago/HeatPump over MQTT. For more details about this platform, please refer to the documentation at https://github.com/lekobob/mitsu_mqtt """ import logging import voluptuous as vol from homeassistant.components.mqtt import ( CONF_STAT...
# ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008-2012 <NAME>, <NAME>, <NAME>, # <NAME> # Copyright (c) 2009-2019 <NAME>, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provid...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. r""" Basic training script for PyTorch """ # Set up custom environment before nearly anything else is imported # NOTE: this should be the first import (no not reorder) from maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:s...
""" Pontos para serem melhorados: * Descobrir como salvar o QRcode em um tipo de buffer que o OpenCV leia * Descobrir como salvar a imagem gerada pelo OpenCV em buffer para que o PIL leia/ou descobrir como salvar em pdf pelo próprio OpenCV * Verificar as questões de resolução de cartões para as pá...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import os.path as op import sys import pandas as pd import logging #import simplejson as json import yaml from jcvi.apps.base import sh, mkdir def get_gsize(fs): cl = pd.read_csv(fs, sep="\t", header=None, names=['chrom','size']) return sum(cl['size']) ...
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This module is not automatically loaded by the `cros` helper. The filename # would need a "cros_" prefix to make that happen. It lives here so tha...
import tarfile import numpy as np import os import sys import h5py from scipy import ndimage import random import pickle from matplotlib import pyplot as plt def maybe_extract(filename, force=False): root = os.path.splitext(os.path.splitext(filename)[0])[0] # remove .tar.gz if os.path.isdir(root) and not for...
import numpy as np import os from .utils.utils import get_yolo_boxes, makedirs def evaluate_full(model, generator, obj_thresh = 0.5, nms_thresh = 0.5, net_h = 416, net_w = 416, save_path = ""): # Predict box...
# -*- coding: utf-8 -*- """ Created on Mon Jun 11 21:43:14 2018 @author: robot """ import plotly.plotly as py import plotly.graph_objs as go import plotly import random import numpy as np import copy as cp import copy import readCfg.read_cfg as rd from IPython.display import HTML,display import colorlover as cl impo...
# Copyright (C) 2021-2022 Modin authors # # SPDX-License-Identifier: Apache-2.0 """Common classes and utilities.""" import logging from unidist.core.backends.common.data_id import DataID, is_data_id class Operation: """ Class that describes supported operations. Attributes ---------- EXECUTE :...
""" OpenAPISpecParser, OpenAPISpecException """ from os import path from pathlib import Path from sys import modules from flask import request from werkzeug.exceptions import BadRequest from yaml import load from requests import get from typing import Callable, Any from re import match from .response import APIExcept...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import TransformerEncoder, TransformerEncoderLayer import math, os from dataset.dolphin import DOLPHINVIDEOVRD, get_transform from model.helper.utility import cpu_or_gpu, git_root from model.helper.parser import DolphinParser from rnn i...
# Copyright 2021 Spectra Logic Corporation. 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. A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" file ...
# -*- coding: utf-8 -*- # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd from scipy.stats import mode from sklearn.preprocessing import LabelEncoder from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split from sklearn.linear...
from typing import Dict from datetime import datetime from ged4py import GedcomReader from ged4py.model import Record, NameRec from ged4py.date import DateValueVisitor from models.Human import Human, LifeEvent from models.Pos import Pos from gedcomoptions import gvOptions homelocationtags = ('OCCU', 'CENS', 'EDUC') ...
import inspect import io import json import logging import os import sys import six def ensure_path_exists(path): path = os.path.expanduser(path) if not os.path.exists(path): os.makedirs(path) return path logger = logging.getLogger(__name__) class ConfigurationRegistry(object): def __ini...
# coding=utf-8 # Basically a listener for events sent by github (and maybe youtube, later on). import re import os import sys import json import hmac import yaml import random import datetime import logging from hashlib import sha1 from flask import Flask, send_from_directory, request, abort, url_for from jinja2 impo...
"""passbook core authentication views""" from typing import Dict, Optional from django.contrib import messages from django.contrib.auth import login, logout from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.forms.utils import ErrorList from django.http import HttpRequest, HttpR...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import math import operator, collections import numpy as np import scipy.ndimage import matplotlib.pyplot as plt from features import extract_features from save_features import feature_vector, dump, load, label_vec data_dir = '../data/CXR_png_complete/' # 0 -...
import numpy as np from . import torch_warp as t_warp import torch from torch.autograd import Variable import scipy # this file is to find the TVL1 energy of the optical flow vector def compute_flow_gradient(flowvector,pixelposx,pixelposy,imgwidth,imgheight): ux_grad = 0 uy_grad = 0 if pixelposx > 0 and ...
#!pip install --upgrade pip #!pip install pandas bs4 requests lxml html5lib pandas lxml html5lib BeautifulSoup4 import pandas as pd import requests import bs4 import json import re import time import bs4 import xml.etree.ElementTree as ET import re def bash_regex_to_python_regex(r): "*.mp3 -> ^.*\.mp3$" ...
import tarfile from datetime import timedelta from pathlib import Path from time import perf_counter import PIL.Image import h5py import numpy as np from tqdm import tqdm from torchdata.logger import log from torchdata.utils import download_file, remote_file, md5sum MPII_Joint_Names = ['right_ankle', 'right_knee', ...
# Copyright (c) 2019 Mycroft AI, Inc. and <NAME> # # This file is part of Mycroft Light # (see https://github.com/MatthewScholefield/mycroft-light). # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional i...
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to ...
from pyexpat import features import numpy as np from src.io import npy_events_tools from src.io import psee_loader import tqdm import os from numpy.lib import recfunctions as rfn import torch import time import math import argparse def generate_agile_event_volume_cuda(events, shape, events_window = 50000, volume_bins...
from __future__ import annotations import asyncio import functools import inspect import logging import uuid from dataclasses import asdict, dataclass from enum import Enum from typing import Any, Awaitable, Callable, Optional from ocpp.charge_point import camel_to_snake_case, remove_nones, snake_to_camel_case from o...
import cfile as C import os import io import autosar innerIndentDefault=3 #default indendation (number of spaces) def _genCommentHeader(comment): code = C.sequence() code.append(C.line('/********************************************************************************************************************...
# Copyright 2015 The Bazel 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 applicable la...
import logging import random from django.utils.translation import ugettext as _ from django.conf import settings from django.db import models from django.contrib.contenttypes.models import ContentType from django.utils import translation from django.utils import timezone from django_extensions.db.fields import Modific...
#coding=utf-8 #__author__ = 'zgs' import os import socket import time import cv2 import base64 from tqdm import tqdm import argparse import threading import struct import sys from common.base import * from dataset_config import * def init_path(): cur_path = os.path.abspath('.') comm_path = cur_path + "/common...
import numpy as np ''' DATA NAME WEIGHT GROWTH GENDER Alice 133 65 F Bob 160 72 M Charlie 152 70 M Diana 120 60 F NAME WEIGHT(Minus 135) GROWTH(Minus 66) GENDER(1 - F, 0 - M) Alice ...
import unittest def parse_grades(grades_string): GRADES = ['PK', 'K', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 'Ungraded'] # Remove & for grades list grades_string = grades_string.replace(' &', ',') # Grades list - will add to separated grade string to grades grades = [] ...
from logging import getLogger from pathlib import Path import random import numpy as np import h5py as h5 from scipy.optimize import minimize import yaml import isle # This script is a fork of Jan-<NAME> make-train-data.py in foldilearn. # foldilearn introduced Machine Learning parametrization of Lefschetz thimbles # ...
# SPDX-License-Identifier: BSD-3-Clause from time import localtime, mktime, struct_time, time from typing import Callable, Iterator, Sequence, Tuple, cast import re _numOfDays = (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) _timePattern = re.compile( r'\s*((?:20)?\d\d)([-./])(0?[1-9]|1[0-2])\2(0?[1-9]|[12]...
try: import matplotlib matplotlib.use('WXAgg') import numpy from matplotlib.pyplot import cm import types numpy.seterr(invalid='ignore') except ImportError: pass """@package pipeline_display This package allows easy plotting of pipeline data (images, spectra, tables) with a few class method...
# uncompyle6 version 3.2.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] # Embedded file name: posixpath import os, sys, stat, genericpath, warnings from genericpath import * try: _unicode = unicode except NameError: class...
import codecs import json import logging import os import textwrap import traceback from dataclasses import asdict from datetime import datetime from io import BytesIO from typing import Optional import pytz import telegram from dotenv import load_dotenv from telegram import InlineKeyboardButton, InlineKeyboardMarkup ...
import datetime import hashlib import io import os import pickle import random from typing import Any, List, Type import pytest from beancount import loader from beancount.core import data, distribution from beancount.scripts import example # type: ignore from pydantic import BaseModel from bdantic import models, ty...
import torch import torch.nn as nn import torch.nn.functional as F import os import numpy as np import time import cv2 from tqdm import tqdm from model_wrappers.ldf_wrapper import LDF_Wrapper import logging def get_mae(img1, img2): # get mae from two gray scale images ims = [] for pred in [img1, img2]: ...
import bpy from PIL import ImageDraw import os import torch import cv2 import math import numpy as np from math import radians from PIL import Image, ImageFilter from dataset.data_utils import process_viewpoint_label, TransLightning, resize_pad, random_crop import torchvision.transforms as transforms from model.resnet ...
from abc import abstractmethod import debug from premise import Premise from tokens import Token from copy import deepcopy from rules_core.negation import negate from output import Step, StepType import re class MasterPool: pools: list['Pool'] = [] def add(): pool = Pool() MasterPool.pools.app...
# -*- coding: utf-8 -*- """ gc3-query.sec_list [9/9/2018 11:47 AM] ~~~~~~~~~~~~~~~~ <DESCR SHORT> <DESCR> """ # ################################################################################ # ## Standard Library Imports # import sys, os # from typing import List, Optional, Any, Callable, Dict, Tuple, Union, S...
#!/usr/bin/env python3 """ Program to load and parse csv files.""" #from collections import Counter import sys, random, csv, os from shutil import copy2 DATE = "26 May 2022" VERSION = "ii" AUTHOR = "<NAME>" AUTHORMAIL = "<EMAIL>" THISPROG = sys.argv[0].replace("./","") WHATISTHIS_p1 = f""" \t {THISPROG} \t A grade...
import numpy as np import pandas as pd from typing import List, Union, Tuple import random from macrosynergy.management.simulate_quantamental_data import make_qdf def reduce_df(df: pd.DataFrame, xcats: List[str] = None, cids: List[str] = None, start: str = None, end: str = None, blacklist: dict = None...
import argparse import sys print() print(" ".join(sys.argv)) print() parser = argparse.ArgumentParser('Options for model configuration and training') parser.add_argument('--num_epochs', type=int, default=100, help="Number of iterations to run training for") parser.add_argument('--starting_epoch', type=int, default=0,...
"""Extract the user warnings templates and the options specified in user talk pages""" import json import more_itertools import mwxml import datetime from typing import Iterable, Iterator, Mapping from backports.datetime_fromisoformat import MonkeyPatch from .. import extractors, utils # Polyfiller for retrocompatib...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# %% # %matplotlib widget import base64 import io import pathlib import ipyvuetify as v import ipywidgets as widgets import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from controls import SpectralBandsControlPanel parameters = { 'model': 6, 'range': 1, 'haze': 1, 'spectral_...
# coding=utf8 import tensorflow as tf from options import Options as opt from tqdm import tqdm import time if opt.energy == 'KL': print("Using KL Energy") from utils.distance import diagKL as dist elif opt.energy == 'CE': print("Using CE Energy") from utils.distance import diagCE as dist elif opt.ener...
import os import cv2 import matplotlib.pyplot as plt import numpy as np from PIL import Image, ImageChops from config_parser.config import CONFIG, IMAGE_PARAMS try: import deformation HAS_DEFORMATION_LIB = True except ModuleNotFoundError: HAS_DEFORMATION_LIB = False W = IMAGE_PARAMS["W"] H = IMAGE_PARA...
import models.model_factory as factory import models.gm_utils as gm_utils from options import TrainOptions, Options from constants import OUT_DIR from show.view_utils import view from custom_types import * from process_data.mesh_loader import get_loader, AnotherLoaderWrap from process_data.files_utils import collect, i...
''' Script to check the pymosa modules for the online monitor Simulation producer, interpreter converter and receiver. ''' import os import sys import unittest import yaml import time import psutil from PyQt5.QtWidgets import QApplication from online_monitor import OnlineMonitor import pymosa from pymosa.online...
import sys import numpy as np from gym import utils from gym.envs.toy_text import discrete from six import StringIO LEFT = 0 DOWN = 1 RIGHT = 2 UP = 3 MAPS = { "4x4": [ # Simple balanced paths "S ", " WW ", " W ", " G" ], "5x5": [ # Unbalanced wi...
from .output import pretty_draw from .misc import constant, dataframe_value_mapping import networkx as nx import pandas as pd import numpy as np from copy import copy, deepcopy from .formats import bif_parser import os.path from itertools import repeat, combinations from .factor import TableFactor, DictValueMapping d...
import logging from abc import ABCMeta, abstractmethod import hgvsp import numpy as np import pandas as pd from numpy.testing import assert_array_equal from tqdm import tqdm from joblib import Parallel, delayed from . import constants, utilities, exceptions, LOGGER logger = logging.getLogger(LOGGER) class Vali...