text
stringlengths
3.07k
12.6k
#!/usr/bin/env python3 import cppheaderparser import sys import os import re from typing import List def debug(data): print(data, file=sys.stderr) class DynEnum: """Custom Dynamic Enum""" def __init__(self, name: str): self.name = name def __str__(self) -> str: return " FOUND %s" %...
"""Python build rule templates.""" ___all__ = [ 'define_package', 'define_pip_package', 'define_source_package', ] from collections import namedtuple import logging import tempfile from garage import scripts from foreman import get_relpath, rule from .common import define_copy_src from .utils import pa...
# -*- coding: utf-8 -*- import sys import threading import pytest import pytz import pytz_deprecation_shim as pds from pytz_deprecation_shim import helpers as pds_helpers from ._common import UTC get_timezone = pds._compat.get_timezone get_fixed_timezone = pds._compat.get_fixed_offset_zone SYS_MODULES_LOCK = threa...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import json import os from glob import glob import h5py import numpy as np import pandas as pd from batchlib.util import read_table, image_name_to_well_name from tqdm import tqdm manuscript_plates = [ "20200417_132123_311", "20200417_152052_943", "20200420_164920_764", "20200420_152417_316", "pla...
""" Demonstrate how to synchronize the status between two games over an HTTP server. Based on https://arcade.academy/examples/sprite_move_keyboard_better.html#sprite-move-keyboard-better """ from http_synced_dictionary import HttpSyncedDictionary import arcade import os from uuid import uuid4 as get_random_id from ...
import math import os import torch from torch import nn import torch.nn.functional as F from torch.autograd import Variable import time from numpy import float32 from Data import getNormalDataIterator, getNormalData class PositionalEncoder(nn.Module): def __init__(self, d_model, seq_len = 10): super().__in...
import random import pytest from assemblyline.common import forge from assemblyline.common.dict_utils import unflatten from assemblyline.common.tagging import tag_list_to_dict from assemblyline.odm.models.file import File from assemblyline.odm.models.result import Result from assemblyline.odm.randomizer import random...
import logging import re import arrow from fastapi import HTTPException from jose import JWTError from starlette import status from app.helpers.cache_utils import cache from app.helpers.jwt import decode_jwt_token, generate_jwt_token from app.helpers.w3 import checksum_address, get_wallet_address_from_signed_message ...
#!/usr/bin/env python3 """ The main entry point for the package. Module Attributes: _NAME_MOD_OVERRIDE (str): Name to use as override for `__name__` in select cases since, in this module, `__name__` is often expected to be `__main__`. logger (Logger): Logger for this module. (C) Copyright 2021 <NAME>. All Ri...
import json import os import sys from functools import partial from pathlib import Path from shutil import move from subprocess import run # nosec from tempfile import TemporaryDirectory from typing import Optional from cookiecutter.config import get_user_config from cookiecutter.generate import generate_context, gen...
# Coyright 2018 The TensorFlow Author YuanLi. All Rights Reserved. # ============================================================================== """Contains utilities for encode images to tfrecord file. """ from __future__ import absolute_import from __future__ import division from __future__ import print_functio...
import numpy as np import cv2 from rfvision.components.utils import (xyz2uv, affine_transform, get_K, generate_heatmap_2d) from rfvision.datasets import PIPELINES @PIPELINES.register_module() class GetJointsUV: # Compute joints uv toward joints xyz and K. def get_joints_bbox(self, joints_uv): # get bb...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2020 Dremio # # 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 ...
from InstagramAPI import InstagramAPI import sys import requests import os import time from safe import sendMessage, accts #get a userID associated with a username. API requires userIDs but only provides usernames from friends def getUserID(username): route = 'https://www.instagram.com/web/search/topsearch/?co...
import numpy as np import itertools import sys from datetime import datetime PRINT_BENCHMARKS = True PRINT_OUTPUT = True FILE_OUTPUT = False """ Version 2.1 Instead of writing the Hamming distance in the table, just a boolean which says it's >= d or not. Benchmark: n=6, d=4: 0:00:00.004000 - correct answer: 4 n=7, ...
# -*- coding: utf-8 -*- # from __future__ import division import numpy import sympy from ..helpers import untangle class Felippa(object): """ <NAME>, A compendium of FEM integration formulas for symbolic work, Engineering Computation, Volume 21, Number 8, 2004, pages 867-890. <https://peopl...
""" A dataset that applies a transformation on the fly as examples are requested. """ __authors__ = "<NAME>" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["<NAME>"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "<EMAIL>" from theano.compat.six import Iterator from...
#!/usr/bin/python3 from collections import Counter import tokenize_weak from settings import hparams import sys, os from operator import itemgetter from gensim.scripts.glove2word2vec import glove2word2vec from gensim.models.keyedvectors import KeyedVectors import numpy as np import argparse embed_size = hparams['embe...
''' These test cases are based on the parts of the ietf TFTP specification our server implements. https://www.ietf.org/rfc/rfc1350.txt run with trial: $ trial tests.py ''' # stdlib imports from StringIO import StringIO # 3rd party imports from twisted.trial import unittest # our imports import tftp class DummyF...
#!/usr/bin/env python3 import gym import copy import numpy as np import random import torch from torch import optim from torch import nn from torch.distributions import Normal, Distribution import cherry as ch from cherry import envs ACTION_DISCRETISATION = 5 ACTION_NOISE = 0.1 BACKTRACK_COEFF = 0.8 BACKTRACK_ITERS ...
import asyncio import datetime import logging import traceback from typing import List import aiohttp import discord from discord.ext import commands import botto logger = logging.getLogger("botto.events") class Events(commands.Cog): def __init__(self, bot: botto.Botto) -> None: self.bot: botto.Botto ...
import os import cv2 import numpy as np from PIL import Image from random import shuffle import torch import torch.utils.data import torchvision from torchvision.models.detection.faster_rcnn import FastRCNNPredictor from torchvision.models.detection.mask_rcnn import MaskRCNNPredictor import utils import transforms as...
import string from pathlib import Path import pandas as pd from pyaaas.models.attribute_type import AttributeType from pyaaas.models.dataset import Dataset import random import pandas module_dir = __file__ def dummy_dataset(): df = pandas.read_csv("scripts/data/dummy-dataset-260219.csv", sep=";") dataset = ...
import hashlib import logging import random import time import uuid from website.db.subclassing import SubfieldBase from website.views.fields import MultiSelectFormField from django.core import exceptions from django.db import models from django.db.models import SlugField, ManyToManyField from django.utils.text import...
"""Tools to compute and manipulate correlation maps. """ import math import torch from ..tools.decorators import to_minibatch from ..tools.tensor_ops import extract_local_features, offset_and_sparsify from ..tools.math import log @to_minibatch(expected_outputs=1) def compute_correlation_maps( source_descriptors...
import os import glob import re from datetime import datetime import pandas as pd from tqdm import tqdm_notebook as tqdm import nyse HOME = ".." DATA_DIR = os.path.join(HOME, "data") PREPROCESSED_DIR = os.path.join(DATA_DIR, "preprocessed", "occurrences") REUTERS = os.path.join(DATA_DIR, "bloomberg_reuters", "raw", ...
""" Define a mixture ARMA model. """ import numpy as np from bioslds import sources from bioslds.utils import rle_encode from bioslds.markov import SemiMarkov from typing import Sequence, Tuple, Union, Callable, Optional def sample_switching_models( models: Sequence, usage_seq: Sequence, X: Union[None,...
import re import nltk import string import os import random def sanitize_list_of_tokens(tokenized_sentences): sanitized_sentences = [] is_word = re.compile('\w') for sent in tokenized_sentences: eachSentence = ' '.join(e for e in sent) eachSentence = eachSentence.lower() eachSentenc...
import rhinoscriptsyntax as rs from compas.datastructures import Mesh from compas.geometry import is_point_in_polygon_xy from compas.topology import delaunay_from_points from compas.topology import trimesh_remesh from compas.utilities import geometric_key from compas_rhino import get_line_coordinates ...
u""" Fixer for standard library imports renamed in Python 3 """ from lib2to3 import fixer_base from lib2to3.fixer_util import Name, is_probably_builtin, Newline, does_tree_import from lib2to3.pygram import python_symbols as syms from lib2to3.pgen2 import token from lib2to3.pytree import Node, Leaf from libf...
# coding: utf-8 import argparse import gc import os import pickle import random import sys from pathlib import Path from timeit import default_timer import matplotlib.pyplot as plt import numpy from common import (DATA_DIR, DEFAULT_METHOD, FIGURES_DIR, METHODS, RESULTS_DIR) from make_figures import ( plot_results...
""" The procedure of this file: 1. Read the data from dataset.csv 2. Check whether all images are there for each item (i.e. mission) 3. Check whether there are left images 4. Fulfill the dataset.csv if some item is unfilled, e.g. the image file path 5. Create single page for each mission 6. Gather the information to t...
# Software License Agreement (BSD License) # # Copyright (c) 2012, <NAME>, Inc. # 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 copyri...
# This file is part of chocolatine # # Copyright (C) 2021 The Regents of the University of California # All Rights Reserved # # Permission to copy, modify, and distribute this software and its # documentation for academic research and education purposes, without fee, and # without a written agreement is hereby granted,...
import re,os,requests from tkinter import * import platform from datetime import datetime from time import sleep try : from PIL import ImageTk, Image except ImportError: os.system('pip3 install pillow') lookup = platform.system() if lookup == 'Linux': os.system('sudo apt-get install python3-pil python3-pil.imaget...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, <NAME> and <NAME>. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistribut...
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. """ Tests constant folding with globals. """ import dace import numpy as np from dace.frontend.python import astutils from dace.frontend.python.newast import (GlobalResolver, ConditionalCodeResolver, ...
"""Example with fitting a 32 triangles soup to an image.""" import copy import os import cv2 import deodr from deodr import differentiable_renderer_cython from deodr.differentiable_renderer import Scene2D from imageio import imread import matplotlib.pyplot as plt import numpy as np def create_example_scene(n_t...
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 # importing the Kratos Library import KratosMultiphysics import KratosMultiphysics.DelaunayMeshingApplication as KratosDelaunay import KratosMultiphysics.ContactMechanicsApplication as ...
# Copyright 2021 AIPlan4EU project # # 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...
"""Train GAIL or AIRL and plot its output. Can be used as a CLI script, or the `train_and_plot` function can be called directly. """ import os import os.path as osp import pickle from typing import Optional from sacred.observers import FileStorageObserver import tensorflow as tf from imitation.algorithms.adversaria...
from model import create_model from load_data import load_data from parameters import * from matplotlib.colors import ListedColormap from sklearn.metrics import accuracy_score, mean_absolute_error, mean_squared_error import numpy as np import matplotlib.pyplot as plt import sys def inverse_transform_sequence_scaling(...
from .helper import download_file, parse_rule_list, inherit_json, empty, get_user_agent from .natives import extract_natives_file, get_natives from typing import Any, Callable, Dict, Union from .exceptions import VersionNotFound from .runtime import install_jvm_runtime import requests import shutil import json import o...
import yaml import operator import functools from flask import Blueprint, render_template, request, g, jsonify, current_app from rowboat.util.decos import authed from rowboat.models.guild import Guild, GuildConfigChange from rowboat.models.user import User, Infraction guilds = Blueprint('guilds', __name__) def ser...
''' author:nick date:2019/2/21 MIT license ''' #import what we need import requests from bs4 import BeautifulSoup import time import re import class_connect import threading import queue as Queue from redis import Redis import os #get the link link_list=[] for i in range(1,208): url='http://ca...
import itertools from typing import Any, List, Sequence, Tuple import numpy as np import pytest from pydantic import BaseModel from useq import ( Channel, MDAEvent, MDASequence, NoT, NoZ, Position, TDurationLoops, TIntervalDuration, TIntervalLoops, ZAboveBelow, ZAbsolutePos...
#!/usr/bin/env python3 import argparse import enum import logging import os import subprocess log = logging.getLogger(__name__) class Run(enum.Enum): Benders = 1 Test = 2 Train = 3 class Config: def __init__(self, cplex_lib_path, instance, jar_path, model, num_delays, path, run_ty...
import os import tensorflow as tf import numpy as np import cv2 import gym from scipy.signal import lfilter from tensorflow.contrib import summary def boltzmann(probs, epsilon=0.): random = tf.random_uniform(shape=(), minval=0, maxval=1) action = tf.cond(random > epsilon, lambda: tf.multi...
import json from random import random import datetime import re from urllib.parse import unquote import asyncio from .collection import Collection import os from requests.cookies import cookiejar_from_dict from requests import Session from bs4 import BeautifulSoup class Bandcamp: FORMATS = { 'wav': 'wav'...
# Copyright 2019-2021 Cambridge Quantum Computing # # 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 a...
import logging from collections import namedtuple import numpy as np from tqdm import tqdm from es.draw_utils import find_best_shape, get_reward_config from es.environment import Environment from es.optimizer import GradientDescent, Adam, Momentum, Nesterov, Adadelta, Adagrad, RMSProp from es.strategy import RandomSt...
# Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import pandas as pd import datetime as dt def processF (File, Tarifa, fest): miTarifa =[] FIFO =[] pivFile =File[' KW_DEL'] archivoRetorno =[] for element in pivFile: FIFO.append(element) if len(FIFO)<15: archivoRetorno.append(0.0) else: ...
import re import networkx as nx from thread_helpers import StoppableThread import matplotlib.pyplot as plt import copy SEQUENCE = "Sequence" SELECTOR = "Selector" PARALLEL = "Parallel" ACTION = "Action" INVERTER = "Inverter" CONDITION = "Condition" PARSEL = "Parallel Selector" REPEAT = "Repeater" LATSEQ = "LAT Sequenc...
# -*- coding: utf-8 -*- import yaml import os import importlib from bag.core import BagProject from bag.layout import RoutingGrid from bag.data import * from bag.layout.template import TemplateDB def make_tdb(prj, target_lib, specs): grid_specs = specs['routing_grid'] layers = grid_specs['layers'] spaces...
import asyncio import datetime import enum import logging import unittest import os from unittest import mock import pyemit.emit as e from pyemit.remote import Remote from tests.helper import async_test logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) _received_test_decorator_msgs = 0 ...
from datetime import date from pprint import pprint # noqa from opensanctions.models import Entity, Alias, Identifier ID_TYPES = { 'diplomatic-passport': Identifier.TYPE_PASSPORT, 'driving-license': Identifier.TYPE_OTHER, 'driving-permit': Identifier.TYPE_OTHER, 'id-card': Identifier.TYPE_NATIONALID...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable INITRANGE = 0.04 SOS_ID = 0 EOS_ID = 0 class Attention(nn.Module): ...
import torch.utils.data as data import torch from .human_parse_labels import get_label_map from PIL import Image import numpy as np import cv2 import torchvision.transforms as transforms import torch import copy, os, collections import json import random def listdir(root): all_fns = [] for fn in os.listdir(roo...
import torch import torch.nn as nn import torch.nn.functional as F from .architecture import VGG19, VGGFace19 # Defines the GAN loss which uses either LSGAN or the regular GAN. # When LSGAN is used, it is basically same as MSELoss, # but it abstracts away the need to create the target label tensor # that has the same...
import json import math import os from time import sleep import requests from requests import get from getters_maker import get_cookies, get_insta_query, get_request_hash def save_media(link, path): reintentos = 3 sleep_time = 10 # 1 seg reintentos_actuales = 0 obtenido = False ...
""" Operations on trees (dependency parse tree) """ import numpy as np from collections import defaultdict import torch from torch.autograd import Variable class Tree(object): """ Modified from tree.py from 'Graph Convolution over Pruned Dependency Trees for Relation Extraction' """ def __init__(self): ...
from django.shortcuts import render,redirect,get_object_or_404 from .models import Profile,Project,UsabilityRating,DesignRating,ContentRating from django.contrib.auth.models import User from .forms import RegistrationForm,ProjectForm,EditProfileForm,DesignForm,UsabilityForm,ContentForm from django.contrib.auth.decorato...
#-*- coding: utf-8 -* # noqa: E265 """Traps capture varying events within the system""" __author__ = "<NAME>" __docformat__ = "reStructuredText" import logging import collections import json import psutil import curio import arrow from .machines import StateMachineMixin logger = logging.getLogger(__name__) class...
import argparse import os import library.migrationlogger as m_logger import library.utils as utils import library.localstore as store import library.clients.entityclient as ec import library.status.appstatus as appkeys logger = m_logger.get_logger(os.path.basename(__file__)) MIGRATE_SETTINGS = 'settings' DEFAULT_MIGRA...
# -*- coding: utf-8 -*- """ @author : <NAME> """ import numpy as np def conv_forward(x, w, b, conv_param): """ a naive implementation of the forward pass for a convolutional layer """ stride = conv_param['stride'] pad = conv_param['pad'] N, C, H, W = x.shape F, C, HH, WW = w.shape H_ou...
import pickle from pathlib import Path from flask import Flask, render_template from flask_bootstrap import Bootstrap from flask_wtf import FlaskForm from wtforms import SelectField, SubmitField, SelectMultipleField from wtforms.widgets import CheckboxInput, ListWidget from wtforms.validators import DataRequired import...
import os import cv2 import platform import numpy as np import random as r import matplotlib.pyplot as plt import utils as u ##################################################################################################### # Function to get ORB Features from an image. def get_orb_features(orb, image): """ ...
#!/usr/bin/env python3 import matplotlib.pyplot as plt from hdrh.histogram import HdrHistogram import seaborn as sns import pandas from matplotlib import pyplot as plt import os.path from enum import Enum import matplotlib as mpl from typing import * import argparse parser = argparse.ArgumentParser(description='Genera...
# Copyright 2020 NVIDIA. 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 law or agree...
def rotated_array_search(input_arr, number): """ Find the index by searching in a rotated sorted array Time complexity: O(log2(n)) (as long as array is rotated only once) Space Complexity: O(1) Where n is the array size Args: input_array(array), number(int): Input array to search an...
import inspect import logging from functools import partial, update_wrapper from django.conf import settings from django.contrib import messages from django.contrib.admin.templatetags.admin_urls import admin_urlname from django.http import HttpResponseRedirect from django.template.response import TemplateResponse from...
import pdfkit from pathlib import Path import csv from lib.constants import INFO_KEY, GRADES_KEY, GRADE_NOT_PRESENT_ANNOTS __all__ = ['printReport', 'makeCsvSummary'] #TODO: dropLowest def makeCsvSummary(attrs, students, allAssignments, outputConfigObj): fields = attrs + list(allAssignments.keys()) reportsDi...
""" Preprocess the bAbI symbolic data into a nicer form. <NAME>, 10/2015 """ import os import sys import argparse def parse_dataset(file_name, edge_type_dict={}, node_id_dict={}, question_type_dict={}, label_dict={}): """ Parse the dataset file. Return dataset, edge_type_dict, node_id_dict, question_typ...
import discord from discord.ext import commands import time import config import db from discord_ui import SlashOption from discord_ui.cogs import slash_cog replay = { "صقر": "يا عمر صقر", "حازم": "اسطوره البايثون عطه لكزز", "بترولي": "يعني يوسف يعني طيران يعني حبيبي والله", "يوسف": "يعني...
import os import sys import glob import pickle import pandas as pd import numpy as np from tqdm import tqdm from matplotlib import pyplot as plt from .parse_result import decode_img, load_data_from_pkl from .calculate import get_common_attacks def plot_row_images(images, labels, title='', figsize=(12, 6), save_path=...
import argparse import SimpleITK as sitk import skimage import nibabel as ni import numpy as np import matplotlib.pyplot as plt import skimage.measure from pathlib import Path def isocont(img_arr, mask_arr, b_out_labeled_mask=False, b_class_components=True, b_use_percen...
from __future__ import print_function __author__ = '<NAME>, <EMAIL>' from numpy import random from random import sample from scipy import isscalar from pybrain.datasets.dataset import DataSet from pybrain.utilities import fListToString class SupervisedDataSet(DataSet): """SupervisedDataSets have two fields, on...
""" Copyright (c) 2021, Electric Power Research Institute 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 li...
# Copyright 2018 Alibaba Group. 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 law o...
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
import time import random import os import sys def design(): os.system("figlet -f small WORDLAP") print("") def analyse(stringto): t1 = stringto.split("-") t2 = "".join([str(item) for item in t1]) t = t2.split(" ") return t def help(): os.system("clear") os.system("figlet -f small WORDLAP-HELP") clear =...
""" Make latex table of fit summary using arviz and pandas to_latex method. """ import pandas as pd import numpy as np import arviz as az import click import kinesis as kn kn.set_mpl_style() df = kn.data.load_hyades_dataset() b0 = np.array([17.15474298, 41.28962638, 13.69105771]) # map arviz summary index -> latex ...
import tkinter as tk from tkinter import ttk class Funcs(): def limpar_tela(self) -> None: self.et_codigo.delete(0, tk.END) self.et_nome.delete(0, tk.END) self.et_telefone.delete(0, tk.END) self.et_cidade.delete(0, tk.END) class Application(Funcs): def __init__(self): ...
# -*- coding:utf-8 -*- """ @Author : g1879 @Contact : <EMAIL> @File : session_element.py """ import re from html import unescape from typing import Union, List from requests_html import Element, BaseParser from .common import DrissionElement, get_loc_from_str, translate_loc_to_xpath class SessionElement(D...
# encoding: utf-8 # Author: <NAME> # Created: 2021/9/28 import logging from typing import Dict, Union import numpy as np from src.utils.libcoord.coord_transform import normalize_pc, invert_normalize_pc class PointCloudSubsampler(object): """ Point cloud subsampling transformation class. A transformer to ...
""" Correlation Map =============================================================================== >>> from techminer2 import * >>> directory = "data/" >>> file_name = "sphinx/images/auto_corr_map.png" >>> matrix = auto_corr_matrix('authors', min_occ=2, directory=directory) >>> correlation_map(matrix).savefig(file_na...
from collections import OrderedDict from pypospack.qoi import Qoi class RelaxedStructureCalculations(Qoi): qois_calculated = [ 'Ecoh_min_all', 'a1_min_all','a2_min_all','a3_min_all', 'a11_min_all','a12_min_all','a13_min_all', 'a21_min_all','a22_min_all','a23_min_all'...
"""Utilities for creating point cloud input representation.""" from dataclasses import dataclass from typing import List, Tuple import numpy as np from constants import DO_CLASSES, DYNAMIC_OBJECTS, SO_CLASSES, STATIC_OBJECTS from plot_objects_annot_on_image import ObjectAnnotationHandler, get_annotations_files, read_a...
"""Some prebuilt visualization""" import logging import matplotlib.pyplot as plt import pandas as pd def peak_plot(peak, sample_table=None, max_dist=None, norm_on_center=True, log_y=True, marker_list=None, color_list=None, guidelines=None, guideline_colors=None, legend_off=False, legend_c...
import sys try: import Tkinter as tk except ImportError: import tkinter as tk try: import ttk py3 = False except ImportError: import tkinter.ttk as ttk py3 = True import project_gui_shi_main_right_support import os.path from tkinter import filedialog from PIL import ImageTk,Image from pre...
from core.constants import Visibility from django.contrib.syndication.views import Feed from django.shortcuts import get_object_or_404 from django.urls import reverse from django.utils.feedgenerator import Rss201rev2Feed, rfc2822_date from entry.models import TLocation from indieweb.constants import MPostKinds, MPostSt...
from keras.layers import Dense, Input from keras.models import Model from pathlib import Path import spacy from itertools import product, chain from keras.utils import Sequence from collections import Counter import numpy as np from time import time from keras import backend as K class SkipGramDataGenerator(Sequence)...
from __future__ import annotations import inspect from collections import defaultdict from operator import itemgetter from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Literal, Optional, Union, cast import discord from discord.ext import commands from . import errors if TYPE_CHECKING: fr...
import argparse import logging import re from easyprocess import EasyProcess import os import json import time import multiprocessing as mp import traceback from z3 import Solver as z3Solver from z3 import parse_smt2_string from pysmt.smtlib.parser import SmtLibParser from pysmt.shortcuts import Solver from six.move...
import re, time, string from datetime import datetime, date, timedelta __all__ = ['Cookie'] class Cookie(dict): def __init__(self, input=None): if input: self.load(input) def load(self, data): ckey = None for key, val in _rx_cookie.findall(data): if key.lower()...
import copy from os import path from typing import Dict import torch from torch import nn from torch.utils.data import TensorDataset from torchvision.datasets import CIFAR10, MNIST from torchvision.transforms import Compose, Normalize, ToTensor from tqdm import tqdm def transform_mnist(): return Compose([ToTenso...
import asyncio import os from typing import Tuple, Union import virtool.analyses.utils import virtool.bio import virtool.db.utils import virtool.history.db import virtool.indexes.db import virtool.jobs.db import virtool.otus.utils import virtool.samples.db import virtool.utils PROJECTION = [ "_id", "workflow"...
import datetime import os from functools import wraps from django.conf import settings from django.contrib.auth import BACKEND_SESSION_KEY, SESSION_KEY from django.contrib.sessions.backends.db import SessionStore from django.core.urlresolvers import reverse from django.test import LiveServerTestCase, TestCase from sel...