text
stringlengths
3.07k
22.1k
# -*- coding: utf-8 -*- import copy import json import numpy as np import mxnet as mx # The interface of a data iter that works for bucketing # # DataIter # - default_bucket_key: the bucket key for the default symbol. # # DataBatch # - provide_data: same as DataIter, but specific to this batch # - provide_labe...
#!/usr/bin/env python __author__ = '<NAME> and <NAME>' __date__ = '2020-06-29' __version__ = '0.0.1' import argparse import warnings import numpy as np # from scipy import stats import pandas as pd import plotnine as plt9 import scanpy as sc # NOTE: copied this code from scipy. It was introduced with 1.5.0, but du...
import copy import functools import logging import time from datetime import datetime, date logger = logging.getLogger(__name__) PROPERTY_GROUPS = [ { 'name': 'your_org', 'displayName': 'My Sample Organization Property Group' } ] sentinel = object() def rgetattr(obj, attr, default=sentine...
import torch import torch.nn as nn import kornia from utils.utils import derivative_scale, gram_matrix, total_variation_loss, VGG16Partial, device def compute_loss_ord(disparity, target, mask, mode='L1'): if mode == 'L1': L1loss = nn.L1Loss(reduction='sum') # loss = nn.L1Loss(reduction='none') ...
# https://cocodataset.org/#format-data from collections import defaultdict from concurrent.futures import ProcessPoolExecutor, as_completed from distutils.util import strtobool from typing import Any, Dict, List, Tuple from pathlib import Path import numpy as np from tqdm import tqdm from pydantic import BaseModel f...
#!/usr/bin/env python3 # Written by <NAME> and released under the MIT license. # See git repository (https://github.com/nf-core/eager) for full license text. import argparse import multiprocessing import pysam from xopen import xopen from functools import partial import sys from Bio.SeqIO.QualityIO import FastqGener...
import argparse import csv import os import sys import numpy as np import pandas as pd from flee import coupling # coupling interface for multiscale models from flee.datamanager import handle_refugee_data, read_period from flee.postprocessing import analysis as a work_dir = os.path.dirname(os.path.abspath(__file__))...
import os import time import datetime import numpy as np import pandas as pd # from xlrd.biffh import XLRDError import warnings warnings.filterwarnings("ignore") # 设置根目录路径 root_path = os.path.abspath('.') # print('The Root Path:', root_path) # 数据路径 raw_data_dir_path = os.path.join(root_path, "data/rawdata") # 允许的扩...
#!/usr/bin/env python3 """ Copyright 2018 <NAME> (<EMAIL>) https://github.com/rrwick/Bacsort This script is the fourth step of Bacsort. It takes no arguments. When run, it loads the tree and searches for clades which best describe each species. It outputs to stdout the best clade for each species, in order of best to ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import scipy.io as sio import numpy as np from datasets import tracket_num FLAGS = tf.app.flags.FLAGS # define one line functions for # computing distances, losses and normalisation...
#!/usr/bin/python3 import sqlite3 import json import jinja2 import os import requests import shutil import re import pkgutil from datetime import datetime from mimetypes import MimeTypes try: import zlib from Crypto.Cipher import AES except ModuleNotFoundError: support_backup = False else: support_back...
""" Functions for finding anchors given Q matrix. - FindAnchorsForSizeKBasis - findAnchorsForExpandedBasis """ import numpy as np def FindAnchorsForSizeKBasis(Q, K, lowerDim=None, seed=0, candidateRows=None): """ Find K rows of Q that best span the entire rowspace of Q Args -------- Q : ...
import logging import os import requests import json from exception.crawler_exception import CrawlerException, ContentException logging.basicConfig() logging.root.setLevel(logging.INFO) log = logging.getLogger(__name__) GET_USER_DETAILS = "{curation_api}/user/admin/?user_orcid={user_orcid}&admin_orcid={admin_orcid}&...
""" Convert excel to list or tuple """ import os import shapefile import openpyxl def bar_point_id_xy_dict(wbname, ws='Barriers'): wb = openpyxl.load_workbook(wbname) barriers_ws = wb[ws] bars = [] for row in barriers_ws.rows: vals = [cell.value for cell in row] bars.append(vals) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # CODE DESCRIPTION HERE Created on 2019-11-02 12:51 @author: ncook Version 0.0.1 """ import os import sys # try to deal with python 2/3 compatibility if sys.version_info.major > 2: import tkinter as tk from tkinter import ttk from tkinter import filedial...
from PIL import Image, ImageFilter import cv2 import matplotlib.patches as mpatches import numpy as np from matplotlib import pyplot as plt import matplotlib.gridspec as gridspec from skimage import filters from skimage import measure from skimage.color import rgb2gray from skimage.morphology import closing, square fr...
import os import time import numpy as np import torch import torch.nn as nn import torch.optim as optim from argparse import Namespace from .metrics import accuracy from sopa.src.solvers.utils import noise_params from MegaAdversarial.src.attacks import ( Clean, PGD, FGSM ) CONFIG_PGD_TRAIN = {"eps": 0.3, "...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals try: import numpy as np except ImportError as ex: pass from six.moves import zip, map import six from utool import util_type from utool import util_inject from utool import util_dev print, rrr, profile = u...
#// #//------------------------------------------------------------------------------ #// Copyright 2007-2011 Mentor Graphics Corporation #// Copyright 2007-2010 Cadence Design Systems, Inc. #// Copyright 2010 Synopsys, Inc. #// Copyright 2019 <NAME> (tpoikela) #// All Rights Reserved Worldwide #// #// Lice...
import os from datetime import datetime import time import logging import pathlib from datetime import datetime as dt import multiprocessing as mp import json import plotly from flask import ( render_template, flash, redirect, url_for, request, g, session, jsonify, Response, ) from...
from mapsmx import MapsMX import pandas as pd import matplotlib.pyplot as plt class DGEBase: """ Base class for dge information """ def __init__(self, dge_data, catalogue, description): self.dge_data = self.prepare_data(dge_data) self.dge_data['cve_ent'] = self.dge_data['cve_ent'].asty...
""" Based on PyTorch DQN tutorial by <NAME> <https://github.com/apaszke> BSD 3-Clause License Copyright (c) 2017, Pytorch contributors All rights reserved. """ import matplotlib.pyplot as plt import numpy as np from PIL import Image import time import torch import torch.nn as nn import torch.optim as optim import to...
import botocore.client import boto3 import elasticsearch import sqlalchemy import neo4j from sqlalchemy.orm import Session import redis import requests import typing as t from configuration.providers import DefaultConfigProvider from urllib.parse import urljoin from enum import Enum from contextlib import contextmanage...
"""Module containing low-level functions to classify gridded radar / lidar measurements. """ from typing import List import numpy as np import skimage from numpy import ma from cloudnetpy import utils from cloudnetpy.categorize import droplet, falling, freezing, insects, melting from cloudnetpy.categorize.containers ...
import pygame import math from pygame import gfxdraw import random import numpy as np import time pygame.init() width = 1280 height = 720 win = pygame.display.set_mode((width, height)) pygame.display.set_caption("Gravity Ball") g = 1000 click = False clicked = False balls = [] init = time.time() class ball: def...
from django.db import models """ These models are made by the `python manage.py inspectdb` command. It shows all the information about the entities in the database """ class Groups(models.Model): groupid = models.AutoField(db_column='GroupID', primary_key=True) # Field name made lowercase. adminid = models....
import os import sys class RedirectStdStreams(object): def __init__(self, stdout=None, stderr=None): self._stdout = stdout or sys.stdout self._stderr = stderr or sys.stderr def __enter__(self): self.old_stdout, self.old_stderr = sys.stdout, sys.stderr self.old_stdout.flush(); ...
#!/usr/bin/env python3 # # Copyright (c) 2004-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# <NAME> # Networking Project # The Game of Hangman # Last Edited 12/11/18 import socket import os import sys import time # Define clear function which will clear the terminal clear = lambda: os.system('cls' if os.name == 'nt' else 'clear') # Define pause function which will pause the program until the us...
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # MIT License # # Copyright (c) 2021 <NAME> # # 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 res...
import asyncio from datetime import datetime as dt from functools import wraps from marshmallow.exceptions import ValidationError import ujson from auth import is_expired_token, is_valid_auth from models import Actor, ActorStatus, LiftStatus from schema import with_schema import schema as sc class AuthRequired(Exce...
# Copyright 2013-2014 <NAME> <EMAIL> """ module to implement shared functions for the sync tool """ import sys import os import re import traceback import queue import threading import platform import time import io from bkp_core.fs_mod import fs_get,fs_put,fs_ls,fs_stat,fs_test,fs_utime from bkp_core.util import put_c...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import tensorflow.contrib.slim as slim from backbones import utils resnet_arg_scope = utils.resnet_arg_scope @slim.add_arg_scope def bottleneck(inputs, depth, depth_bottleneck, strid...
import subprocess, datetime, gzip, os, pickle, glob, openpyxl, shutil, psutil import pandas as pd import numpy as np from joblib import Parallel, delayed from pathlib import Path from Bio.SeqIO.FastaIO import SimpleFastaParser from io import StringIO from tqdm import tqdm from openpyxl.utils.dataframe import dataframe_...
""" Plot numeric data from stdio as text to stdout. """ import os import sys if __name__ == "__main__": from csv_translate import CsvTranslateProcessor else: from .csv_translate import CsvTranslateProcessor HELP_TEXT = """{program_name} tool version 20201201 print a graph of numeric data from a CSV stream on...
from __future__ import annotations from dataclasses import dataclass from datetime import date, datetime from enum import Enum, auto from typing import Any, List, Mapping, Optional def parse_date(date_str: str) -> date: return datetime.strptime(date_str, "%Y-%m-%d").date() def parse_datetime(date_str: str) -> ...
from __future__ import print_function import argparse import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optimizer from get_dataset import * import models import utils from sklearn.metrics import confusion_matrix, roc_curve,auc from sklearn.metri...
"""This module provides a `log_stream` class for generating logging information. It is intended for the generation of course-grained reporting of program execution for the user and should not be used in performance-critical situations, in tight loops, etc. Formatting is organized by indenting levels which can be incr...
import os # noqa from argparse import ArgumentParser, Namespace from math import ceil from pathlib import Path import matplotlib.pyplot as plt import numpy as np import torch import torch.nn as nn import torch.optim as optim from ignite.contrib.handlers import WandBLogger from ignite.engine import Engine, EventEnum...
from typing import List, NamedTuple class Argument(NamedTuple): name: str typ: str has_underscore_label: bool class StaticMethodKind: def __init__(self, name: str, signature: str): self.name = name self.signature = signature split = signature.split('->') assert len(...
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2018 <NAME> <<EMAIL>> # Released under the terms of the MIT License. See LICENSE for details. from __future__ import print_function from glob import glob import os import pipes import re import shlex from colorama import Fore, Style from git import RemoteReference as R...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from room_simulator import ElementType, Direction async def place_sworded_element(interface, element, sword, x, y): """Place sworded elements to include all directions. Parameters ---------- interface The editor interface. element The element to place. sword The sword ...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------- import logging from typing import Union from fusion_attention import At...
#! python # coding:utf-8 """ ツールの概要 """ from email import header import pymel.core as pm import nnutil.core as nu import nnutil.decorator as deco import nnutil.ui as ui import nnutil.display as nd from PySide2 import QtGui window_name = "NN_Launcher" window = None def get_window(): return w...
import csv from io import StringIO from django import forms from django.conf.urls import url from django.contrib import admin, messages from django.core.exceptions import PermissionDenied from django.db import transaction from django.forms.models import BaseInlineFormSet from django.http import HttpResponseRedirect fr...
import argparse import json,os, sys import time import torch import torch.optim as optim import traci import random import numpy as np import traci.constants as tc from sumolib import checkBinary from utils import interest_list from configs import EXP_CONFIGS def parse_args(args): parser = argparse.ArgumentParser...
""" Utilities Function """ import glob import math import os import re import string import numpy as np from keras.utils.np_utils import to_categorical import constant class Text(object): def __init__(self, path, filename, content): self.path = path self.filename = filename self.content...
import os, torch import numpy as np from numba import njit, jit from UTILS.colorful import * from UTILS.tensor_ops import copy_clone, my_view, add_onehot_id_at_last_dim, add_obs_container_subject import pickle from config import GlobalConfig DEBUG = True # @njit def distance_matrix(A): assert A.shape[-1] == 2 # as...
import os import uuid from django.db import models from rest_framework import reverse class Project(models.Model): Name_category = ( ('<NAME>', '<NAME>'), ('<NAME>', 'Chenghai WANG'), ('<NAME>', '<NAME>'), ('<NAME>', '<NAME>'), ('HuLin-<NAME>', 'HuLin-<NAME>'), ('K...
import tkinter as tk from math import cos, sin, radians, pi, degrees from fuzzy.storage.fcl.Reader import Reader from random import randint from collections import defaultdict from sys import platform, exit if platform == 'darwin': import matplotlib matplotlib.use("TkAgg") import matplotlib.pyplot as plt M = ...
#!/usr/bin/env python import os import argparse import csv import operator as op import collections as col def parse_command_line(): parser = argparse.ArgumentParser() parser.add_argument( '--contig-alignments', '-ca', type=str, dest='alignments', help='Contig to refe...
''' Some util functions Part of the code is referenced from Kaggle ''' import os import cv2 import torch import random import numpy as np import pandas as pd from . import fmix from tqdm import tqdm from torch.utils.data import Dataset from torch.cuda.amp import autocast import copy def seed_everything(seed): ''...
"""Module for writing bug-data metrics tables.""" import typing as tp import networkx as nx import pandas as pd from benchbuild.utils.cmd import git from varats.data.reports.blame_interaction_graph import ( create_blame_interaction_graph, AIGNodeAttrs, create_file_based_interaction_graph, ) from varats.da...
import itertools as it import os import random from scipy.ndimage import distance_transform_edt import cv2 import numpy as np from skimage import color, morphology from datasets.Util.flo_Reader import read_flo_file from datasets.Util.python_pfm import readPFM D = 40 D_MARGIN = 5 # Number of positive clicks to sample...
import threading, time, sys, getopt, json, queue, nslookup from collections import deque from config import * from priority_dict import * from debug_utils import * from commer import CommerOnMaster, LISTEN_IP, send_msg from msg import Msg, InfoType, UpdateType, Update from plot import plot_master def get_wip_s(domain...
import operator import math import random import numpy from deap import algorithms from deap import base from deap import creator from deap import tools from deap import gp import matplotlib.pyplot as plt import networkx as nx import graphviz # import pygraphviz as pgv from networkx.drawing.nx_agraph import graphvi...
#!/usr/bin/env python import os, sys import traceback as tb from snap import common from sqlalchemy import orm from smslang import SMSDialogContext, CommandLexicon from smslang import SystemCommand, GeneratorCommand, FunctionCommand SMS_CLIENT_TYPE = 'pulse_sms' class UserNotFound(Exception): def __init__(self,...
from collections import defaultdict from collections.abc import MutableMapping from enum import Enum import itertools as it from multiset import Multiset import numpy as np import re from typing import Callable, Generic, Iterable, Sequence, TypeVar _T = TypeVar("_T") _K = TypeVar("_K") _V = TypeVar("_V") def guess_i...
# -*- coding: utf-8 -*- """ Implement subclass for real-space interatomic force constants file from QE-Q2R """ import numpy from aiida.orm.data.singlefile import SinglefileData from aiida_quantumespresso.parsers.constants import bohr_to_ang class ForceconstantsData(SinglefileData): """ Class to handle interato...
#!/usr/bin/env python import logging import time import re from random import choice import json from flask import Flask, request, jsonify from os import getenv import sentry_sdk from common.constants import CAN_NOT_CONTINUE, CAN_CONTINUE_SCENARIO, CAN_CONTINUE_PROMPT, MUST_CONTINUE from common.utils import get_skil...
from __future__ import print_function import json import os from argparse import ArgumentParser from time import strftime, localtime, time import numpy as np import torch from matplotlib import pyplot as plt from torch.utils.data.dataset import random_split, Subset from gpn.struct2seq.data import StructureDataset, S...
# -*- coding: utf-8 -*- #training the model. #process--->1.load data(X:list of lint,y:int). 2.create session. 3.feed data. 4.training (5.validation) ,(6.prediction) import sys reload(sys) sys.setdefaultencoding('utf8') import tensorflow as tf import numpy as np import os from joint_intent_slots_knowledge_domain_model i...
from src.config import CENSUS_KEY import json import requests import numpy as np import pandas as pd from numpyencoder import NumpyEncoder # from numpy.lib.function_base import quantile def get_census_response(table_url, get_ls, geo): ''' Concatenates url string and returns response from census api query ...
import tkinter as tk from tkinter.ttk import Combobox from tkinter import messagebox import lib.DataTool as DT type_vehicule = "" gamme_vehicule = "" carburant_vehicule = "" def valide(type_vehicule, marque_vehicule, modele_vehicule, gamme_vehicule, carburant_vehicule, km_vehicule, app): """ [summa...
# Python Standard Library Imports import re # Django Imports from django.db import models # HTK Imports from htk.apps.bible.utils import ( get_bible_book_choices, get_bible_book_model, get_bible_chapter_model, get_translation_model, ) from htk.utils import htk_setting # isort: off class AbstractBi...
# Author: <NAME> # Email: <EMAIL>andro.bernardis at gmail.com # Created: 2019/10/18 # ~ import sys import json import logging from copy import deepcopy from pathlib import Path from docopt import docopt, DocoptExit from inspect import getdoc, isclass from configparser import ConfigParser, ExtendedInterpolation ENV_FI...
from django.http import Http404 from rest_framework.exceptions import ValidationError from rest_framework import viewsets, mixins, status from rest_framework.generics import get_object_or_404 from rest_framework.response import Response from rest_framework import status from rest_framework.permissions import IsAuthenti...
import numpy as np import logging from plunc.common import round_to_digits from plunc.exceptions import SearchFailedException, InsufficientPrecisionError, OutsideDomainError from plunc.WaryInterpolator import WaryInterpolator class IntervalChoice(object): """Base interval choice method class """ method = ...
import callhorizons import datetime import os import subprocess import time from astropy import units as u from astropy.coordinates import Angle import logging from logging.handlers import RotatingFileHandler import unicodedata import string import re from astropy.coordinates import SkyCoord, EarthLocation, AltAz, Angl...
# from https://github.com/adambielski/siamese-triplet from __future__ import print_function import os, math, logging import numpy as np from itertools import combinations import torch import torch.nn as nn import torch.nn.functional as F import pytorch_lightning from .losses.contrastive import OnlineTripletLoss fr...
import wx import telnetlib from time import sleep import _thread as thread from chatbot import baidu_api2, chatbot, tuling, play_mp3, remove_voice, getText from config import BOT, default_server, VOICE_SWITCH from recorder import * import threading bot_use = BOT class LoginFrame(wx.Frame): """ 登录窗口 """ ...
import gc import os.path from SegmentEditorEffects import * import monai from monai.inferers.utils import sliding_window_inference from monai.networks.layers import Norm from monai.networks.nets.unet import UNet from monai.transforms import (AddChanneld, Compose, Orientationd, ScaleIntensityRanged, Spacingd, ToTensord...
import pathlib import numpy as np import torch from matplotlib import pyplot as plt import mmcv from mmdet.datasets import PIPELINES from mmdet3d.core.points import BasePoints, get_points_type import sparse_to_dense.models import sparse_to_dense.dataloaders.transforms as transforms @PIPELINES.register_module() cla...
"""Contains the symbolic regression neural network architecture.""" import numpy as np import torch import torch.nn as nn from utils import functions as functions class SymbolicLayer(nn.Module): """Neural network layer for symbolic regression where activation functions correspond to primitive functions. Can t...
#!/usr/bin/env python3 import argparse import arrow import libvirt import logging import sys import threading from collections import defaultdict from virt_backup.exceptions import ( BackupNotFoundError, BackupsFailureInGroupError, DomainNotFoundError, ) from virt_backup.groups import groups_from_dict, Ba...
from meshparty import trimesh_io, skeletonize, mesh_filters, skeleton import numpy as np import pytest import cloudvolume import json import os import struct import contextlib import json @contextlib.contextmanager def build_basic_mesh(): verts = np.array([[0, 0, 0], [1, 0, 0], ...
import torch import torch.nn as nn import torch.nn.functional as f from interval.layers import LinearInterval, Conv2dInterval, MaxPool2dInterval, AvgPool2dInterval, IntervalDropout class CNN(nn.Module): def __init__(self, in_channel=3, out_dim=10, pooling=nn.MaxPool2d): super().__init__() self.i...
#!/usr/bin/env python3.7 import argparse import logging import os import re import signal import socket import stat import subprocess import sys import time def kill(sig, frame): try: wacker.kill() except: pass sys.exit(0) signal.signal(signal.SIGINT, kill) class Wacker(object): RET...
""" Created on Mar 24, 2015 @author: rgeorgi """ import sys import logging from io import StringIO from intent.igt.consts import INTENT_POS_CLASS, INTENT_POS_PROJ, ODIN_GLOSS_TAG, ODIN_LANG_TAG, ODIN_TRANS_TAG from intent.igt.rgxigt import RGCorpus, GlossLangAlignException,\ PhraseStructureProjectionException, P...
__all__ = [ "add_net_meta", "convert_column", "and_filter", "get_outlier_bounds", "avg_over_net", "normalize", "add_topo", "add_median_lh", "add_split_label", "remove_outliers", "calc_paired_diff", "calc_percentage_change", "calc_icc", "normalize_series", "concat_dfs", "long_column_to_wide", ] import itert...
#!/usr/bin/env python ''' Native Python wrappers for PyMaterialX, providing a more Pythonic interface for Elements and Values. ''' import warnings from .PyMaterialXCore import * from .PyMaterialXFormat import * from .datatype import * # # Element # def _isA(self, elementClass, category = ''): """Return True if...
#5a0a bot - Music cog import discord from discord.ext import commands from youtube_dl import YoutubeDL import requests import asyncio import os PATH = os.path.dirname(__file__) + '/data' YDL_OPTIONS = {'format': 'bestaudio', 'playlistend': 50} FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_stre...
import numpy as np import os import time from datetime import datetime from environment.custom.knapsack_v2.env import KnapsackEnvironmentV2 from environment.custom.knapsack_v2.attention_plotter import attention_plotter from agents.agent import Agent from environment.custom.knapsack_v2.heuristic.factory import heurist...
from xml.etree import ElementTree import numpy as np class GeoExtentError(Exception): def __init__(self, message): self.message = message def get_noise(path): # Extract noise floor information tree = ElementTree.parse(path) root = tree.getroot() nsmap = {'schemas': 'http://www.rsi.ca/rs2...
# -*- coding: utf-8 -*- from __future__ import division, print_function import subprocess import os import numpy as np import pandas as pd from .io.process import cmd_exists, run, to_dataframe, tsv from .io.resources import fetch_ucsc_mrna def split_chromosomes(chromsizes, split_pos, suffixes=('L', 'R')): """ ...
"""App for calculating the cumulative probability of *r* successes in *n* trials. Determine the number of trials needed to reach a certain probability threshold or find the probability at a specified number of trials. [Streamlit](https://share.streamlit.io/hqn006/streamlit-probability/main/cumulative.py) [GitHub](ht...
import datetime import statistics import webbrowser from pathlib import Path import plotly.graph_objs as go from jinja2 import PackageLoader, Environment from plotly.offline import plot, iplot template_env = Environment( loader=PackageLoader('JSSP', 'templates'), autoescape=True ) benchmark_template = "bench...
# Copyright (C) 2019 <NAME> # # Ported and add more features from my script inside build-kernel.py """ Google Drive manager for Userbot """ import pickle import codecs import asyncio import math from os.path import isfile, isdir from mimetypes import guess_type from telethon import events from google_auth_oauthl...
# Copyright 2021 The Deluca Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
import io from typing import Any, Dict, List, Tuple import PIL import numpy from PIL.Image import Image from flatbuffers import Table from neodroid.messaging.fbs import FActor, FArray, FBSModels as F, FByteArray, FObservation, FQTObs, FRange, FValues from neodroid.utilities import unity_specifications as US from neo...
from django.http import HttpResponse, HttpResponseRedirect, QueryDict, JsonResponse from django.shortcuts import render, redirect from django.urls import reverse from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from .models import Profile, Gift, Family import rand...
# -*- coding: utf-8 -*- ############################################################# # Copyright (c) 2020-2021 <NAME> # # # # This software is open-source and is distributed under the # # BSD 3-Clause "New" or "Revised" License #...
# Strong Password detection wth Regexes # By <NAME> import re import Plot import matplotlib.pyplot as plt import numpy as np from scipy import stats from docx import Document from docx.shared import Inches, Pt from docx.enum.table import WD_TABLE_ALIGNMENT with open('Pass10k.txt', encoding="utf-8") as file: data =...
from .._core.base_components import ( TendencyComponent, DiagnosticComponent, ImplicitTendencyComponent, Stepper ) class ScalingWrapper(object): """ Wraps any component and scales either inputs, outputs or tendencies by a floating point value. Example ------- This is how the ScalingWrappe...
#-*- coding:utf-8 -*- ##### # Created on 19-9-20 上午10:05 # # @Author: <NAME>(laygin) ##### import torch import torch.nn as nn from torch.autograd import Variable import numpy as np def normalize_adj(A, type="AD"): if type == "DAD": # d is Degree of nodes A=A+I # L = D^-1/2 A D^-1/2 A = A ...
# coding=utf-8 # Copyright 2020 The HuggingFace Team 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 require...
import sys import os import mxnet as mx import symbol_utils sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from config import config def channel_shuffle(data, groups): data = mx.sym.reshape(data, shape=(0, -4, groups, -1, -2)) data = mx.sym.swapaxes(data, 1, 2) data = mx.sym.reshape(data, ...
"""This module contains functions for the automated runs""" from __future__ import absolute_import, print_function, division, unicode_literals from rq import get_current_job from xcessiv import functions from xcessiv import models from xcessiv import constants import numpy as np import os import sys import traceback fr...