text
stringlengths
6.04k
39.5k
""" Kernel functions designed to be compatible with real-time digital filters (IIR and FIR) This implements three basic filters and a rounding function - multipath_bias_tee - multipath_filter - multipath_filter2 """ import logging import textwrap import numpy as np from scipy import signal # Uses an "old-style" kern...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ASPYRE GT manage tkbtoes package author: <NAME> date: 19/03/2021 """ import os from bs4 import BeautifulSoup from tqdm import tqdm from ..utils import utils # ALTO_V_4_0 = 'http://www.loc.gov/standards/alto/v4/alto-4-0.xsd' # ALTO_V_4_1 = 'http://www.loc.gov/stand...
""" To Do: -Add an optional input for the networks so they can be defined in a main run script. -Test -Combine Training Operation """ from .method import Method from .buffer import Trajectory,BatchDivider,MultiBatchDivider from .AdvantageEstimator import gae import tensorflow as tf import numpy as np from utils.utils ...
""" Created on Sun Feb 2 13:28:48 2020 @author: matias """ import numpy as np from scipy.interpolate import interp1d from scipy.integrate import cumtrapz as cumtrapz from scipy.constants import c as c_luz #metros/segundos c_luz_km = c_luz/1000 import sys import os from os.path import join as osjoin from pc_path impo...
# Copyright 2022 The EvoJAX 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...
# ############################################################################## # Helpers ################################################################################ # Purpose: Determine if word should be plural or singular # Parameters: Word (string), value (integer) # Returns: Parsed word (string) def Analyze...
import logging import hashlib import hmac import requests from time import sleep, time from datetime import datetime from enum import Enum logger = logging.getLogger('cryptocom_api') RATE_LIMIT_PER_SECOND = 10 # LIMIT_ORDER = 1 # MARKET_ORDER = 2 # STOP_LOSS = 3 # STOP_LIMIT = 4 # TAKE_PROFIT = 5 # TAKE_PROFIT_LIMIT ...
# Copyright 2019 <NAME>. 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 agreed...
#Copyright (c) 2013, Regents of the University of California #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. Redistributions of source code must retain the above copyright notice, #this list of...
from builtins import str from past.builtins import basestring from builtins import object from django.conf import settings from django.core.exceptions import FieldError, ValidationError as DjangoValidationError from django.template.loader import render_to_string from django.db.models import Q import re from rest_fram...
from typing import List, Optional, TYPE_CHECKING, Union from mstrio.api import browsing from mstrio.connection import Connection from mstrio.object_management.search_enums import (CertifiedStatus, SearchDomain, SearchPattern, SearchResultsFormat) from mstrio.server.pr...
""" bmorph: modify a time series by removing elements of persistent differences (aka bias correction) Persistent differences are inferred by comparing a 'ref' sample with a 'training' sample. These differences are then used to correct a 'raw' sample that is presumed to have the same persistent differences as t...
from ogb.graphproppred.dataset_pyg import PygGraphPropPredDataset from pytorch_lightning import LightningModule, LightningDataModule from torch_geometric.nn import MessagePassing, global_mean_pool, global_add_pool import torch from torch import Tensor, cat from torch.optim import Adam import torch.nn.functional as F fr...
from collections import OrderedDict from typing import List, Tuple, Dict import numpy as np import torch from .base_metric import BaseMetric from .metric_keys import DetailMetricKey, MainMetricKey def calc_overlap_union_iou(pred: np.ndarray or None, teacher: np.ndarray) -> Tuple[float, float, float]: """ :p...
# -*- coding: utf-8 -*- import functools import inspect import json import os import types from io import open import requests import six import wrapt try: from lark import ParseError except ImportError: from lark.common import ParseError from brewtils.choices import parse from brewtils.errors import Plugin...
# Copyright 2014-2016 <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, ...
import os import logging import traceback from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler, SMTPHandler import time import smtplib import warnings warnings.simplefilter('always', DeprecationWarning) class SizedTimedRotatingFileHandler(TimedRotatingFileHandler): """ Handler for loggin...
# Copyright (C) 2019 SAMSUNG SDS <<EMAIL>> # # This code is distribued under the terms and conditions from the MIT License (MIT). # # Authors : <NAME>, <NAME>, <NAME>, <NAME> from core.common.callback import * import datetime from core.common.util import * class TestLogger(Callback): """ Logger Class for Test """...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import collections import inspect import logging import os import threading from time import time import six from .compat import force_text, force_binary, getargspec from .utils import get_function_path, cached_property try: # noinspection PyUnres...
""" Written by <NAME> copyright big willy incorporated """ import jax.numpy as np from jax import random from jax.experimental import stax from jax.experimental.stax import Dense, Relu, Conv from jax.nn import log_sigmoid from utils import squeeze2d, unsqueeze2d """ Probability utils """ def sample_n01(rng, shape): ...
# -*- coding: utf-8 -*- import tensorflow as tf import utils.tensorflow_utils as tf_utils import numpy as np from threading import Thread, RLock, Timer import os import traceback import logging import time import sys from pickle import Pickler, Unpickler import gc from multiprocessing import Queue, Process from collect...
"""Dynamic decoding utilities.""" import abc import collections import tensorflow as tf import tensorflow_addons as tfa from opennmt import constants from opennmt.utils import misc class Sampler(abc.ABC): """Base class for samplers.""" @abc.abstractmethod def __call__(self, scores, num_samples=1): """Sam...
import logging import pandas as pd from django.conf import settings from time import perf_counter from typing import Optional, Dict, Union, Any from elasticsearch import Elasticsearch from elasticsearch_dsl import Search from elasticsearch_dsl.mapping import Mapping from usaspending_api.common.helpers.s3_helpers im...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script automatically builds dataset archives (one for the frames, one for the models) from the original dataset structure of the authors. It can also produce small sample archives for testing purpose. The authors' dataset structure is as follows: /data/competi...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Pocket PiAP # ...................................................................... # Copyright (c) 2017-2020, <NAME> # ...................................................................... # Licensed under MIT (the "License"); # you may not use this file except in co...
# this code is implemented as a discriminator to classify the sentence import tensorflow as tf from tensorflow.python.ops import math_ops from tensorflow.python.ops import variable_scope as vs from data_iterator import disTextIterator from share_function import dis_length_prepare from share_function import average_cl...
from logging import warn from discord.ext.commands import bot from bot import Bot import discord import asyncio import math import enum from .mongo import ModLogs from helpers.paginator import Paginator from discord.ext import commands from discord.ext.commands import Cog from discord.ext.commands.errors import Missing...
# -*- coding: utf-8 -*- """Module for the classes extending the default `Enum` class. It contains four classes: `ExtendedEnum`, `ExtendedEnum`, `LabeledEnum`, `PairEnum` and one function `namedenum`. """ import sys as _sys from enum import Enum from typing import ( Any, Optional, Sequence, Tuple, Union ) from .meta...
""" Data resource for completeness data """ import json import pandas as pd import meerkat_abacus.util as abacus_util from datetime import datetime, timedelta from dateutil.parser import parse from flask import jsonify, request, g from flask_restful import Resource, abort from pandas.tseries.offsets import CustomBusin...
import os import fnmatch import logging import hashlib import json from collections import defaultdict, namedtuple from flask import url_for as flask_url_for from flask import current_app from boto.s3.connection import S3Connection from boto.s3 import connect_to_region from boto.exception import S3CreateError, S3Respo...
#!/usr/bin/env python3 import os import subprocess import argparse from shutil import copy2 import filecmp import coloredlogs, logging, verboselogs import exiftool from fractions import Fraction EXIF_CAMERA_MODEL = 'EXIF:Model' #EXIF_VIDEO_WIDTH = "EXIF:RelatedImageWidth" #EXIF_VIDEO_HEIGHT = "EXIF:RelatedImageHeight...
from os import path from functools import wraps from cv2 import imread, imwrite from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog, QMessageBox from PyQt5.QtCore import Qt from PyQt5.QtGui import QFont from main_ui import MainWindowUI from image import Image, ImageWindow, ImageBmp from style_sheet imp...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: utf-8 -*- import sys import pickle, time from copy import deepcopy from shutil import copy import numpy as np import matplotlib import matplotlib.pyplot as plt import scipy as sp from scipy.linalg import svd from scipy import optimize from sklearn.neighbors import KernelDensity ### Generalized Entro...
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests from bot import Curses_ui_bot import ui import sys import select import time import os import ConfigParser import ast TIMEOUT = 15 class Config: def __init__(self, game_mode="training", server_url="http://vindinium.org", numbe...
# http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current import ptypes from ptypes import * import sys, operator, six BLOCKSIZE = pow(2, 9) largeinteger = long if sys.version_info.major < 3 else int class stringinteger(pstr.string): def int(self): try: res = self.str() ex...
# -*- coding: utf-8 -*- import math import matplotlib.pyplot as plt # Precyzja Pythona dla liczba zmiennoprzecinkowych typu float to 53 bit # w naszym przypadku niedokładności z tym związane są # pomijalne. Nawet dla większych spadków i większych rozpiętości otrzymane # wartości byłyby akceptowalne. Otrzymanie dokładn...
# -*- coding: utf-8 -*- # #Created on Fri Apr 21 11:13:09 2017 # #author: <NAME> # from joblib import Parallel,delayed from abc import abstractmethod import numpy as np import scipy.linalg from scipy.special import gammaln,iv import math import warnings import h5py import time def _full_covariance_matrix(points,mean,w...
import warnings warnings.filterwarnings('ignore') # data processing import pandas as pd import numpy as np # image processing from PIL import Image # tf and keras import tensorflow as tf import keras from keras.models import Sequential, Model, load_model from keras.layers import Input, concatenate, Conv2D, MaxPoolin...
# (C) Copyright 2014 <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, soft...
import cjb.uif import cjb.util from cjb.uif.layout import Size, Grid, Rect from cjb.uif.views import Label from spats_shape_seq.util import reverse_complement from viz.scenes.base import BaseScene from viz.layout import buttonSize class Nuc(object): def __init__(self, char, context): self.char = char ...
import pygame from pygame.locals import * from pygame import mixer import os import time import random import sys def resource_path(relative_path): try: # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except Exception: base_path = os.path.abspat...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Sep 27 16:42:52 2019 @author: <NAME> """ import cv2 import numpy as np import dlib import time import math import sys from os import path file_dir = path.dirname(path.realpath(__file__)) import socket detector = dlib.get_frontal_face_detector() pred...
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
import os import sys import asyncio import aiohttp import async_timeout import requests import logging from datetime import datetime from peewee import ( Model, IntegerField, CharField, TextField, DateTimeField, SqliteDatabase, fn, ) from beyond.io.tle import Tle from .wspace import ws lo...
import numpy as np import os import sys import theano import theano.tensor as T import anglepy.ndict as ndict import preprocessing as pp from adam import AdaM def main(n_passes, n_labeled, n_z, n_hidden, dataset, seed, alpha, n_minibatches, comment): ''' Learn a variational auto-encoder with generative mode...
# 股票策略模版 # 初始化函数,全局只运行一次 def init(context): # 设置基准收益:沪深300指数 set_benchmark('000300.SH') # 打印日志 log.info('策略开始运行,初始化函数全局只运行一次') # 设置股票每笔交易的手续费为万分之二(手续费在买卖成交后扣除,不包括税费,税费在卖出成交后扣除) set_commission(PerShare(type='stock',cost=0.0002)) # 设置股票交易滑点0.5%,表示买入价为实际价格乘1.005,卖出价为实际价格乘0.995 set_slippage...
import re from typing import Any, List, Optional, Union import dask import dask.array as da import dask.dataframe as dd import ee import eemont import numpy as np import pandas as pd import xarray as xr from .utils import _check_params, _get_indices def computeIndex( index: Union[str, List[str]], params: Op...
#!/usr/bin/env python3 import sys import os import io import urllib3 from openpyxl import Workbook from openpyxl.styles import Font, PatternFill, Alignment from openpyxl.styles.borders import Border, Side, BORDER_THIN from openpyxl.drawing.image import Image from openpyxl.chart import PieChart, Reference from openpyxl...
from tkinter import * from tkinter import ttk #COLORS dark_gray = '#a9a9a9' gainsboro = '#dcdcdc' lawn_green = '#7cfc00' light_blue = '#add8e6' light_gray = '#d3d3d3' light_green = '#90ee90' light_slate_gray = '#778899' light_steel_blue = '#b0c4de' #TUNEABLE PARAMETERS AXIS_COLO...
######################FILE NAME: IO.py########################### # ============================================================================================= # author: <NAME> & <NAME> | # : Master Student, ...
# (C) StackState 2021 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import pprint import requests from orionsdk import SwisClient from schematics import Model from schematics.types import StringType, ListType from stackstate_checks.base import AgentCheck, Health, HealthStream, Health...
""" Script that trains a tseep species classifier. To use tensorboard during or after model training, open a terminal and say: conda activate vesper-dev-tf2 tensorboard --logdir "/Users/Harold/Desktop/NFC/Data/Vesper ML/ MPG Ranch Species Classifier 2.0/Logs/Tseep" and then visit: 127.0....
# Standard Library import codecs import functools import logging import operator import os from itertools import chain # Third-Party Imports import xlsxwriter from django.conf import settings from django.core.files.storage import FileSystemStorage from django.core.validators import ValidationError from django.db.model...
# # Copyright 2013, <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, so...
""" Created on Wed Jan 15 11:17:10 2020 @author: mesch """ from colorama import init, Fore, Back init(autoreset=True) #to convert termcolor to wins color import copy from pyqum.instrument.benchtop import RSA5 from pyqum.instrument.benchtop import PSGA from pyqum.instrument.modular import AWG from pyqum.instrument.log...
# MIT License # Copyright (c) 2020 <NAME> & <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 restriction, including without limitation the rights # to use, copy, modify...
#! /usr/bin/env python """ Script to download sitemaps and check if they have obvious text in them. Reports success and failures and number of docs that have text """ import asyncio import json import os import re from asyncio import Semaphore from collections import defaultdict, Counter from datetime import datetime ...
# -*- coding: utf-8 -*- """ Created on Sat Nov 13 18:54:00 2021 @author: rictom https://github.com/rictom/cnpj-mysql """ #%% import pandas as pd, sqlalchemy, glob, time, dask.dataframe as dd import os, sys #%% DEFINA os parâmetros do servidor. dbname = 'cnpj' username = 'root' password = '' host = '1...
################################################################################################## # # TracSynth.py - GW quality trace element analysis & Monte Carlo modeling setup # # (1) clean up (account for non-detects, etc.) # (2) limit to useful analytes (e.g., sufficient detections) # (3) compute and list ...
"""Defines the Request class. Copyright 2013 by Rackspace Hosting, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable...
""" Python Character Mapping Codec for T61 See https://en.wikipedia.org/wiki/ITU_T.61 """ # pylint: disable=invalid-name, no-member, redefined-builtin import codecs from typing import Tuple try: import importlib.metadata as imlib except ImportError: import importlib_metadata as imlib # type: ignore __ver...
import matplotlib matplotlib.use('TkAgg') import os import sys import time import tkinter import requests import traceback from lxml import etree import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg # Custom Imports import functions import agentframework # Get the current w...
# ghost.py import random from enum import Enum import game import sample_projects.pacman.scripts.scene_tree as scene_tree from sample_projects.pacman.scripts.script_class import ScriptClass from sample_projects.pacman.scripts.vector2 import Vector2, Direction from sample_projects.pacman.scripts.level_grid import Lev...
import argparse import os import time from distutils.util import strtobool from statistics import mean import math import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.optim as optim import torchvision from torch.autograd import Variable from torch.optim import lr_schedule...
''' --- I M P O R T S T A T E M E N T S --- ''' import json import time from datetime import datetime import os import csv import cv2 import random import numpy as np import sqlite3 import torch import torch.utils.data as data import coloredlogs, logging coloredlogs.install() import linecache import sys from torch.n...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import PackedSequence, pack_padded_sequence, pad_packed_sequence import modules.utils as utils from modules.caption_mo...
import sys import numpy as np import logging import pickle import itertools from scripts.utils import get_logger logger = get_logger(level=logging.INFO) def recluster(input_jet, alpha=None, save=True): """ Uses helper functions to get the leaves of an input jet, recluster them following some algorithm determi...
from flask import Module from flask import redirect,render_template,request,session,url_for, Response from functools import wraps from util import * from datetime import datetime from random import random,randint from uuid import uuid4 from trueskill import trueskill from bson.json_util import dumps study = Module(__...
# bchhun, {2020-02-21} import os os.environ['KERAS_BACKEND'] = 'tensorflow' import pickle import torch import re import numpy as np import matplotlib.pyplot as plt import importlib import inspect from torch.utils.data import TensorDataset from SingleCellPatch.extract_patches import process_site_extract_patches, im_ad...
from __future__ import print_function from __future__ import absolute_import import os,sys import random import tensorflow as tf from ultra.ranking_model import BaseRankingModel ## Before changes we can get around 0.748 ndcg@10 ## encodr part the transformer is borrowed from https://www.tensorflow.org/tutorials/text/tr...
""" The code implementation of the paper: <NAME>, <NAME>, <NAME>, and <NAME>, "PIE: A Large-Scale Dataset and Models for Pedestrian Intention Estimation and Trajectory Prediction", ICCV 2019. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Licens...
""" IMPORTING LIBS """ import dgl import numpy as np import os import socket import time import random import glob import argparse, json import pickle import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader from tensorboardX import S...
#! /usr/bin/env python import os from copy import copy import time from quex.frs_py.string_handling import blue_print from quex.frs_py.file_in import open_file_or_die, \ get_include_guard_extension import quex.lexer_mode as lexer_mode import quex.output.cpp.mode_classes ...
__all__ = ['ButtonBehavior', 'ToggleButtonBehavior', 'FloatBehavior'] from kivy.clock import Clock from kivy.config import Config from weakref import ref from time import time from kivy.app import App from kivy.uix.image import Image from utils import image, icon from kivy.metrics import dp from kivy.properties impo...
from functools import partial from inspect import signature import numpy as np import torch import torch.nn as nn import torch.utils.model_zoo as model_zoo from .common import TemporalPooling from .temporal_modeling import temporal_modeling_module from model_zoo.inflate_from_2d_model import convert_rgb_model_to_grou...
# Python backend for looking up words in an online thesaurus. # # Author: <NAME> [[<EMAIL>][E-mail]] try: import vim independent_session = False except ImportError: independent_session = True try: import neovim neovimUsed = True except ImportError: neovimUsed = False import re from . im...
import re import os import sys import random import string import logging import argparse import json import torch import msgpack import pickle import numpy as np from shutil import copyfile, move from datetime import datetime from collections import Counter, defaultdict from src.model import DocReaderModel from src.ba...
"""utils.py contains utility functions used for simulating and evaluating couplings of Gibbs samplers on partitions.""" import numpy as np import matplotlib.pyplot as plt from scipy import stats import itertools import ot def pad_with_zeros(arr, axis): """pad_with_zeros returns a copy of arr with one row or column...
import os import sys import json import requests import logging as log import traceback import time import string import argparse as arg from typing import List, Tuple, Dict from lxml import etree from fake_useragent import UserAgent from bs4 import BeautifulSoup IMG_BASE = 'https://www.ncbi.nlm.nih.gov' USE_PROXY = F...
# coding: utf-8 import json import logging import re import warnings from celery import shared_task from collections import namedtuple from django.contrib.auth import get_user_model from django.core.exceptions import PermissionDenied from django.db import transaction from django.utils.translation import ugettext as _...
#!/usr/bin/env python3 # copyright 2020 <NAME> # Tag Tamer Admin UI # Import Collections module to manipulate dictionaries import collections from collections import defaultdict # Import getter/setter module for AWS Config import config from config import config # Import getter/setter module for AWS resour...
## # @file # This file is part of SeisSol. # # @author <NAME> (c.uphoff AT tum.de, http://www5.in.tum.de/wiki/index.php/Carsten_Uphoff,_M.Sc.) # # @section LICENSE # Copyright (c) 2015, SeisSol Group # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permit...
import socket import time import sys import httpx import requests import mechanize import string import json as _json from httpx import AsyncClient from datetime import datetime from bs4 import BeautifulSoup from collections.abc import Iterable from webeye.encryptions.rot import encoding from typing import Union from c...
from django.shortcuts import get_object_or_404, render from django.template import Template, Context from django.http import HttpResponse from .forms import * from datetime import datetime from .models import Memory from .models import UserProfile from django.contrib.auth.models import User from friendship.models impor...
import future, sys, os, datetime, argparse # print(os.path.dirname(sys.executable)) import torch import numpy as np import matplotlib from tqdm import tqdm import matplotlib.pyplot as plt from matplotlib.lines import Line2D # matplotlib.rcParams["figure.figsize"] = [10, 10] import torch from torch.nn import Module, P...
import numpy as np import math import torch import torch.nn as nn import torch.nn.functional as F import dgl import dgl.function as fn class HeteroGNNLayer(nn.Module): def __init__(self, in_size, out_size, etypes, aggregator_type='mean', # mean pool sum attention? ...
# -*- coding: utf-8 -*- """ Main engine module, brings everything together. """ import os import sys import time import random import textwrap from engine.instances import * from engine.initiate import * from engine.typewriter import * from engine.ending_sequence import * import engine.map_layout as ml...
#!/usr/bin/env python3 from Crypto import Random pc1 = [6, 4, 15, 7, 13, 9, 11, 2, 5, 14, 8, 10, 0, 12, 1, 3] fp = [12, 14, 7, 15, 1, 8, 0, 3, 10, 5, 11, 6, 13, 4, 9, 2] s_box = ( 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59...
import warnings warnings.filterwarnings("ignore") import pandas as pd import numpy as np from IPython import display from datetime import datetime, timedelta import datetime as dt import pickle from finrl_meta import config from finrl_meta.data_processor import DataProcessor from main import check_and_make_directori...
#!/usr/bin/env python # Copyright 2012 Red Hat # 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 # # Un...
# Copyright 2022 <NAME>. # # Licensed under the BSD 3-Clause License. from abc import ABC from abc import abstractmethod from typing import Optional import gym from typing import Union from gym import utils, spaces from gym import error import numpy as np import torch from matplotlib import collections as mc class G...
# !usr/bin/env python # coding:utf-8 """ 分类 - load_digits 手写字体的识别 author: prucehuang @email: <EMAIL> @modify: @time: 2018/12/18 """ import pandas as pd import numpy as np from sklearn.base import BaseEstimator from sklearn.datasets import load_digits import matplotlib import matplotlib.pyplot as plt from sklearn.ensem...
#!/usr/bin/env python3 # pyfu/image.py """ Method for turning extracted spectra into IFU images. """ import numpy as np import logging from astropy.io import fits from astropy.table import Table, Column from astropy.wcs import WCS from matplotlib import pyplot as plt, cm as colourmaps from mpl_t...
#!/usr/bin/env python # coding=utf-8 from __future__ import division, print_function, unicode_literals import h5py import numpy as np import six from brainstorm import layers, Network, initializers from brainstorm.scorers import (aggregate_losses_and_scores, gather_losses_and_scores) f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #File pyrscwlib.py #Author <NAME>/M0ZJO #Date 13/01/2019 #Desc. This is the main software library for the CW decoding software "Pyrscw". # The original inspiration for this software was rscw.c (http://wwwhome.cs.utwente.nl/~ptdeboer/ham/...
import argparse import functools import json import os import random import math import multiprocessing as mp import datasets import numpy as np import textattack import torch import tqdm import transformers from lime.lime_text import LimeTextExplainer, IndexedString from configs import DATASET_CONFIGS NUM_SAMPLES_...
r"""*CLI tests for* ``sphobjinv``. ``sphobjinv`` is a toolkit for manipulation and inspection of Sphinx |objects.inv| files. **Author** <NAME> (<EMAIL>) **File Created** 20 Mar 2019 **Copyright** \(c) <NAME> 2016-2020 **Source Repository** http://www.github.com/bskinn/sphobjinv **Documentation** ...
"""Script for managing changelogs.""" # A couple of things to note here: # # This is meant to be a single file script. # This makes it easier to package for those that don't want # to go through pip. This also means: # # * No runtime dependencies # * It only needs to run on py3 (Specifically py37 is all we test) # * I...
import copy from django import forms from django.contrib.admin.widgets import AdminSplitDateTime from django.db.models import Q from django.forms import ModelForm, ModelChoiceField, MultiValueField, NullBooleanField, BooleanField, DateField, \ DateTimeInput, DateTimeField from django.forms import CharField from dja...