text
stringlengths
3.07k
12.6k
import textwrap import re from path import Path import schema import tomlkit import pytest from tbump.hooks import HOOKS_CLASSES, BeforeCommitHook import tbump.config from tbump.config import Config def test_happy_parse(test_data_path: Path) -> None: config = tbump.config.parse(test_data_path / "pyproject.toml"...
import numpy as np import pandas as pd import torch import itertools import json import re from collections import Counter from nltk.corpus import stopwords from nltk.stem import PorterStemmer from skmultilearn.model_selection import IterativeStratification def cleanText(text, lower=True, stem=False, remove_stop...
import sys import numpy as np import cv2 import onnxruntime import time import queue import threading import json import copy def py_cpu_nms(dets, thresh): """ Pure Python NMS baseline. Copyright (c) 2015 Microsoft Licensed under The MIT License Written by <NAME> """ x1 = dets[:, 0...
''' Jupyter psychoacoustics ''' # pylint: disable=C0103, R0912, R0914 import warnings from io import BytesIO import wave import numpy as np from IPython.display import Audio, display from IPython.core.display import HTML, display as coredisplay import ipywidgets as widgets from statsmodels.tools.sm_exceptions import ...
import time, os from PyQt5 import QtGui, QtCore from PyQt5.QtCore import Qt, QSize from PyQt5.QtGui import QPalette, QPixmap, QPaintEvent, QPainter, QFont from PyQt5.QtWidgets import QWidget, QHBoxLayout, QGridLayout, QScrollArea, QVBoxLayout class Thumbnail(QWidget): _base_dimensions = 96 _padding_left = 0 ...
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, <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 right...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # source.py # # Copyright 2019 <NAME> [<EMAIL>] import importlib import inspect import json import random import sys import uuid def components_source(): """ Used by playexo to retrieve the place this file on the sandbox before a build """ ...
""" Made by <NAME> <EMAIL> https://github.com/BenAsaf https://www.linkedin.com/in/ben-asaf/ Oct 10 2020 """ import tensorflow as tf import numpy as np from typing import List from PIL import Image import argparse import os from tqdm.auto import tqdm import dd_utils tf.get_logger().setLevel("ERROR") ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from glob import glob from logging import getLogger from os.path import isfile, join, lexists from ..base.constants import CONDA_TARBALL_EXTENSION, PREFIX_MAGIC_FILE from ..base.context import context from ..com...
from a10sdk.common.A10BaseClass import A10BaseClass class MessageDigestCfg(A10BaseClass): """This class does not support CRUD Operations please use parent. :param md5_value: {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"} :param me...
import enum from collections import namedtuple from dataclasses import dataclass from typing import Optional from aio_arango.client import ArangoClient QueryResult = namedtuple('QueryResult', 'data meta') class QueryOption(enum.Enum): COUNT = 1 FULL_COUNT = 2 class QueryBuilder: def __init__(self): ...
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: <EMAIL> ## ## This file is part of VisTrails. ## ## "Redistributio...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
# The MIT License (MIT) # Copyright (c) 2022 Microsoft Corporation # 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...
import csv import datetime import os import shutil import sys import argparse from mikrotik import Mikrotik def compare_files(f1, f2): """ Compare two text files. Ignore lines with '#'. :param f1: current_file :param f2: previous_file :return: True - if files identical, otherwise - False. If prev...
''' Useful functions related to TensorFlow. Copyright(C) 2017 Engineering Department, University of Cambridge, UK. License 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.a...
# -*- coding: utf-8 -*- import itertools import pandas as pd from multiprocessing.pool import ThreadPool from ..common import _TIMEFRAME_CHART, _getJson, _raiseIfNotStr, PyEXception, _strOrDate, _toDatetime, _BATCH_TYPES from .fundamentals import _dividendsToDF, _earningsToDF, _financialsToDF, _splitsToDF from .news im...
import datetime # Numpy import numpy as np # Matplotlib import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from Plotter import Plotter from dsp import crosszero from learningUtils import validated, to2d, zscore, loadModel from utils import readConfig, getLogger, reportTrend, loadnpy, StopWatch ...
import logging import queue from wsgiref import simple_server import prometheus_client from ctf_gameserver.lib.metrics import SilentHandler def inc(metrics_queue, name, value=1, labels=None): metrics_queue.put(MetricsMessage(name, 'inc', value, labels)) def dec(metrics_queue, name, value=1, labels=None): ...
# -*- coding: utf-8 -*- import os import sys from subprocess import Popen, PIPE os.chdir(os.path.dirname(os.path.realpath(__file__))) this_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) interpreter_path = os.path.abspath(sys.executable) python_path = os.path.abspath(os.path.join(this_dir, '..')) ...
import argparse import tensorflow as tf import os from model import DNOC from data import VisualTextData tf.app.flags.DEFINE_string('stage', '', """train/val/test""") # Files settings tf.app.flags.DEFINE_string('dataset_path', './prepare_data/mscoco/noc_coco_cap.json', ...
# -*- coding: utf-8 -*- ''' Copyright (c) 2015 by <NAME> This file is part of Statistical Parameter Estimation Tool (SPOTPY). :author: <NAME> and <NAME> This class holds the Simulated Annealing (SA) algorithm based on Kirkpatrick et al. (1983): <NAME>., <NAME>., <NAME>. and others: Optimization by simmulated anneal...
# -*- coding: utf-8 -*- """ peregrine.resources.submission.graphql.util ---------------------------------------- Defines utility functions for GraphQL implementation. """ from flask import current_app as capp from flask import g as fg from peregrine.errors import AuthError, UserError import node from datamodelutils ...
# -*- coding: utf-8 -*- """ Author: shifulin Email: <EMAIL> """ import os from ctypes import CDLL, POINTER, create_string_buffer, cast, byref from ctypes import Structure, c_char_p, c_void_p, c_char, c_int, c_double, c_bool, c_ulong class DepthMarketData(Structure): _fields_ = [ ('TradingDay',...
"""Actions to support jsonnet.""" import json from typing import Optional, Union, Dict, Tuple, Any from argparse import Action from .actions import _is_action_value_list from .jsonschema import ActionJsonSchema from .loaders_dumpers import get_loader_exceptions, load_value, load_value_context from .optionals import (...
# Import both skimage and cv from skimage import transform as tf from skimage import io import cv2 import numpy as np from scipy import optimize import matplotlib.pyplot as plt # Could use either skimage or cv to read the image # img = cv2.imread('label.png') img = cv2.imread('./picture/mask.jpg') img = cv2.resize(im...
import logging from io import BytesIO from typing import Union import discord from discord import Object, User from redbot.core import checks, commands from redbot.core.utils.chat_formatting import box, inline, pagify from tsutils.cog_settings import CogSettings from tsutils.user_interaction import get_user_confirmati...
import json import math import re import requests from bs4 import BeautifulSoup from .exceptions import NoDataError _intraday_pattern = re.compile("var (?P<name>.*)=(?P<content>\[[^;]*\]);") def _load_script_vars_from_web(symbol_id, year, month, day): d = f'{year:04}{month:02}{day:02}' script_variables = {...
import numpy as np from matplotlib import pyplot as plt from matplotlib.ticker import MaxNLocator from .basewidget import BaseWidget import scipy.spatial class TimeseriesWidget(BaseWidget): """ Plots recording timeseries. Parameters ---------- recording: RecordingExtractor The recordng e...
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Python Crawler and Site Map Generator v1.2.1 # # # # Copyright 2016, PedroHenriques # # http://www.pedrojhenriques.com # # https://github.com/PedroHenriques # # # # Free to use u...
"""A sqlite2 store""" import sqlite3 from typing import Any, List, Mapping, MutableMapping, Tuple import aiosqlite from ..types import Session, Store CREATE_SEQNUM_TABLE_SQL = """ CREATE TABLE IF NOT EXISTS initiator_seqnums ( sender_comp_id VARCHAR(64) NOT NULL, target_comp_id VARCHAR(64) NOT NULL, out...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
#!/usr/bin/python3 import os import subprocess import filecmp import time import argparse import hashlib import lxml.html import lxml.etree import re parser = argparse.ArgumentParser() parser.add_argument('--lsd-dir', dest='lsd_dir') parser.add_argument('--lsa-dir', dest='lsa_dir') parser.add_argument('--duden-dir', ...
# Copyright (c) 2015 OpenStack Foundation # # 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 ...
# Copyright (c) 2010 <NAME> # Copyright (c) 2011 <NAME> # Copyright (c) 2011 oitel # Copyright (c) 2011 Kenji_Takahashi # Copyright (c) 2011 <NAME> # Copyright (c) 2012, 2014 roger # Copyright (c) 2012 nullzion # Copyright (c) 2013 <NAME> # Copyright (c) 2014-2015 <NAME> # Copyright (c) 2014 <NAME> # Copyright (c) 2014...
#Standard Libraries from picamera.array import PiRGBArray from picamera import PiCamera from enum import Enum import io import time #Third Parties Libraries from PIL import Image import numpy as np #Local Libraries import io_utils import opencv_utils class PiCamera_Version(Enum): V1 = 1.3 V2 = 2.1...
''' More complex interface than Google's to download images from Planet. Unlike Google, Planet allows us to query images at a certain time. However, Planet's API is not great and there are a variety of issues ranging from a little annoying to fairly serious. This interface simplifies the use from a user's perspective. ...
"""Complex building blocks that work with PyTorch native (!) complex tensors, i.e. dtypes complex64/complex128, or tensors for which `.is_complex()` returns True. Note that Asteroid code has two other representations of complex numbers: - Torchaudio representation [..., 2] where [..., 0] and [..., 1] are real and i...
from inspect import isclass import pytest from async_v20.definitions import primitives from async_v20.definitions.primitives import ClientComment, ClientID, ClientTag, OrderID, TradeID from async_v20.definitions.primitives import OrderSpecifier, TradeSpecifier, DateTime from async_v20.definitions.primitives import Tr...
from unittest import TestCase import numpy as np from numpy.testing import assert_allclose from skfem import BilinearForm, asm, solve, condense, project from skfem.mesh import MeshTri, MeshTet, MeshHex, MeshQuad, MeshLine from skfem.assembly import InteriorBasis, FacetBasis, Dofs from skfem.element import (ElementVec...
from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from socket import gaierror import smtplib import linkedin_scraper import indeed_scraper import monster_scraper import going_global_scraper import simplyhired_scraper import helper import time def run(): connection = helper.db_con...
""" Energyplus file reader """ import pandas as pd import math import cea.inputlocator import numpy as np from cea.constants import BOLTZMANN, KELVIN_OFFSET, HOURS_IN_YEAR from calendar import isleap __author__ = "<NAME>" __copyright__ = "Copyright 2014, Architecture and Building Systems - ETH Zurich" __credits__ =...
import logging import re from typing import Any from gidgethub import sansio from .. import utils from ..constants import MAINTENANCE_BRANCHES, UPSTREAM_REPO from . import gh_router log = logging.getLogger(__name__) TITLE_RE = re.compile(r"\s*\[(?P<branch>\d+\.\d+)\].+\(#(?P<pr_number>\d+)\)") MAINTENANCE_BRANCH_TI...
#!/usr/bin/env python # Copyright 2012-2018 CERN for the benefit of the ATLAS collaboration. # # 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 ...
# Copyright 2018 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
import torch.nn as nn from src.models.module.layers import Conv_bn, Conv_bn_relu class Residual(nn.Module): expansion = 1 def __init__(self, in_planes, planes, stride=1): super(Residual, self).__init__() self.layer1 = Conv_bn_relu(in_planes, planes, kernel_s...
""" Valve v2 lighthouse power management over BT LE """ # external libs from bluepy import btle # standard imports import signal import sys import time from functools import partial # globals #------------------------------------------------------------------------------- # return error code EXIT_O...
"""Peak detection algorithms.""" import warnings import numpy as np from scipy import optimize from scipy.integrate import simps eps = np.finfo(float).eps def indexes(y, thres=0.3, min_dist=1, thres_abs=False): """Peak detection routine. Finds the numeric index of the peaks in *y* by taking its first order...
import configargparse import os import sys import json from common.es_proxy import add_basic_es_arguments, get_es_connection from common.log import setup_logging from elasticsearch import TransportError from elasticsearch.helpers import bulk # --------------------------------------------------------------------------...
""" # Contains a custom Engine for querying the PATSTAT installation on the Server I am using # You may want to define a different engine according to your installation """ # Required libraries import pandas as pd import sqlalchemy from sqlalchemy import create_engine import tempfile import pandas.core.common as com f...
import os baseLoc = os.path.dirname(os.path.realpath(__file__)) + '/' from gimpfu import * import sys sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages', baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'face-parsing-PyTorch']) f...
# coding: utf-8 # # Copyright 2018 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
#!/usr/bin/env python3.4 #################################################################### # KPS_Kepler2State.py # KPS # # Author: <NAME> # <EMAIL> # https://github.com/komrad36 # # Last updated Feb 27, 2016 # This application is entirely my own work. #########################################################...
# Copyright 2015 Carnegie Mellon University # # Author: <NAME> <<EMAIL>> # # 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 numpy as np import tensorflow as tf from keras.layers import Input, Conv2D, Flatten, Dense, Conv2DTranspose, Reshape, Activation, BatchNormalization, LeakyReLU, Dropout, Layer from keras.models import Model from keras import backend as K import matplotlib.pyplot as plt # A layer that creates an activity regul...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: <NAME> (<EMAIL>) # @Date: 2020-01-09 # @Filename: mixins.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) from __future__ import annotations import abc import asyncio from typing import Callable, Union from basecam.camera import...
# coding=utf-8 """This file, interactive_script.py, provides base abstraction for creating specific types of scripts to run.""" ''' Created : 2019.04.17 Environments: {DEV} ''' from libraries.universal_code import output_coloring as oc from libraries.universal_code.time_abstraction.simple_timer import SimpleTime...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import argparse import cv2 import numpy as np from glob import glob import matplotlib.pyplot as plt from copy import copy # config max_dim = 128 channel = 3 style_weight=5e-1 content_weight=1e4 total_variation_weight=30 epochs = 10 steps_per_epoch = 100 def load...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018-2020 Accenture Technology # # 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 #...
import logging from dataclasses import dataclass from typing import List, Union from flaat.requirements import REQUIREMENT, HasSubIss, Satisfied, Unsatisfiable logger = logging.getLogger(__name__) LOG_LEVEL_OVERRIDES = { "requests_cache": logging.WARN, "urllib3": logging.WARN, "asyncio": logging.WARN, } ...
# coding: utf-8 import numpy as np from bilstm_crf_add_word import BiLSTM_CRF from collections import defaultdict import preprocess as p from keras.optimizers import Adam, Nadam def get_X_orig(X_data, index2char): X_orig = [] for n in range(X_data.shape[0]): orig = [index2char[i] if i > 0 else 'None' f...
#!/usr/bin/env python3 # # From <NAME> on the solution megathread # https://www.reddit.com/r/adventofcode/comments/a5qd71/2018_day_13_solutions/ # import sys import os import logging import argparse from typing import List, Tuple, Dict, Callable from collections import defaultdict _log = logging.getLogger(__name__) ...
""" Written by <NAME> and <NAME> This script converts from Amber restart format to AIMS Geometry.dat files. It assumes your restart file has velocities. To run, just give it the paths to your prmtop, restart data and desired output data as below. main('test_data/parm.prmtop','test_data/','test_data/outs/') """ imp...
from __future__ import annotations import abc from typing import Any from typing import Callable from typing import ClassVar from typing import Generic from typing import Iterable from typing import Iterator from typing import Protocol from typing import Sequence from typing import TypeVar from typing import cast from...
import argparse import logging import pathlib import sqlalchemy as sa import subprocess from opencell.database import models from opencell.cli import utils as cli_utils logger = logging.getLogger(__name__) def _execute_sql(statement, interface, quiet=False): if not quiet: logger.info("Executing SQL stat...
from pathlib import Path from typing import List, Optional import joblib import torch from random import random from guacamol.goal_directed_generator import GoalDirectedGenerator # from guacamol.scoring_function import ScoringFunction from guacamol.utils.chemistry import canonicalize_list, canonicalize from joblib imp...
from copy import copy, deepcopy from pprint import pformat, pprint from textwrap import dedent, indent from collections import Iterable import makefun import inspect import textwrap import attr import attr.validators as valid import exam_gen.util.logging as logging log = logging.new(__name__, level="WARNING") setu...
# -*- coding: utf-8 -*- import os import glob import h5py import numpy as np def load_from_txt(path_to_store:str, run_id:str)->np.ndarray: txt_prefix = 'bubble_sim_' run_ids = [ os.path.split(f)[-1][len(txt_prefix):-4] for f in glob.glob(os.path.join(path_to_store, '*.txt')) ...
import argparse import numpy as np import matplotlib import matplotlib.pyplot as plt from mplapp.window import Window from mplapp.horizontal_box import HorizontalBox as HBox from mplapp.vertical_box import VerticalBox as VBox from mplapp.label import Label from mplapp.spacer import Spacer from mplapp.button import ...
import sys import signal import logging import webbrowser from Queue import Queue from datetime import datetime import gi gi.require_version('Gtk', '3.0') gi.require_version('AppIndicator3', '0.1') import notify2 from gi.repository import Gtk, AppIndicator3, GObject from apscheduler.schedulers.background import Bloc...
""" Pixel Contrastive """ import torch from models.byol import BYOL from models.network_emb_study import UNet_Pretrained import argparse from datasets.ceph_ssl import Cephalometric from torch import optim from tutils import trans_init, trans_args, tfilename, dump_yaml, timer, save_script import numpy as...
# Copyright 2019-2021 The ASReview Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# Copyright 2020 Lorna Authors. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# encoding: utf-8 """ Metadata about, or related to, software """ # Copyright 2018-2020 CNRS and Universität Trier # 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...
import pydicom as dicom import numpy as np from numpy import interp import os import cv2 from skimage import morphology,restoration,transform from torch.utils.data import DataLoader,Dataset from torchvision import * from sklearn.model_selection import train_test_split as tts from progress.bar import IncrementalBar from...
""" This is a template for creating custom ColumnMapExpectations. For detailed instructions on how to use it, please see: https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations """ from shapely.geometry import Point, Polygon from great...
w = 0.63 ww = 0.63 s = 1.6 #Matrix für Angreifer gemäß Tabelle effektMat = [[1,1,1,1,1,1,1,1,1,1,1,1,w,ww,1,1,w,1], #Normal [1,w,w,s,1,s,1,1,1,1,1,s,w,1,w,1,s,1], #Feuer [1,s,w,w,1,1,1,1,s,1,1,1,s,1,w,1,1,1], #Wasser [1,2,s,w,1,1,1,w,s,w,1,w,s,1,w,1,w,1], #Pflanze ...
#!/usr/bin/env python3 """ Generate a list of active versions for students. Useful for when the database gets bad values for the active version and then you can just run this function to get the proper values to update the database with. Basic usage of this script is ./get_version_details.py <semester> <course> which...
# Copyright 2022 <NAME>, <NAME> and <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 appl...
# -*- coding: utf-8 -*- # Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """controller_util unittests.""" from __future__ import print_function from chromite.api.controller import controller_util from ...
from itertools import combinations from typing import List, Set, Tuple import pandas as pd import textdistance as td import utils class Regexes: """ Class that contains all regular expressions used in the data pre processing. """ CITY_REPLACE_DICT = { r"w. hollywood": "west hollywood", ...
import numpy as np import torch import pandas as pd ''' rle2mask 已经改成功 ''' def mask2enc(mask, shape=(1600, 256), n=4): pixels = mask.T.flatten() encs = [] for i in range(1, n + 1): p = (pixels == i).astype(np.int8) if p.sum() == 0: encs.append('') else:...
from rest_framework import generics from rest_framework import permissions as drf_permissions from rest_framework.exceptions import NotFound, PermissionDenied from framework.auth.oauth_scopes import CoreScopes from osf.models import ( Guid, BaseFileNode, FileVersion, QuickFilesNode, ) from api.base.e...
from datetime import datetime from typing import Optional import discord from discord.ext import commands from discord.utils import get from utils.message import filterReactionCount, getVoteDetails from utils.time import formatToHumanTime from utils.constants import REACTIONS from lib.bot import VoteBot class Vote(...
""" Created on Sep 26, 2013 @author: <NAME> """ from qal.sql.sql import VerbCreateTable, VerbSelect, VerbInsert, VerbDelete, VerbUpdate, VerbDropTable, SqlList, \ ParameterColumndefinition, ParameterIdentifier, ParameterSource from qal.sql.utils import datatype_to_parameter def make_column_definitions(_field_n...
# <NAME>, 2016 # <NAME>, 2018 import math # Standard library imports from argparse import ArgumentParser from random import choice, random from time import sleep import numpy as np # External library imports from matplotlib import pyplot as plt # Local imports from mini_pacman import Game def epsilon_greedy(Q, s...
import json import time from typing import Optional from utils import load_file, get_file_logger, epoch_seconds_to_local_timestamp, save_file, create_sub_dir, \ files_in_path, timestamp_to_epoch_seconds, path_parts_to_abs_path, directory_exists, file_exists from utils.coingecko import get_historical_price, get_pric...
r""" Examples of a Lie algebra with basis """ #***************************************************************************** # Copyright (C) 2014 <NAME> <tscrim at ucdavis.edu> # # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #********************...
""" Everything related to page styling. """ from stadiumpy.font_properties import * import platform button_options_red = {'bg':'#E69A8D', "fg":'#FFFFFF', "borderless":1, 'activebackground':('#AE0E36', '#D32E5E') } button_options_green = { "b...
from typing import Optional, List from functools import reduce import math from tqdm import tqdm import torch from torch.utils.tensorboard import SummaryWriter from regym.environments import Task from regym.rl_algorithms.agents import Agent # TODO: consider moving some of these functions to regym.utils def learn_a...
import asyncio import discord import re import os import random import string from discord.ext import commands from Cogs import Settings from Cogs import DisplayName from Cogs import Nullify def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") bot.add_cog(MadLibs(bot, sett...
# -*- coding: utf-8 -*- # # MCR-Analyser # # Copyright (C) 2021 <NAME>, Technical University of Munich # # This program is free software, see the LICENSE file in the root of this # repository for details import hashlib import numpy as np import sqlalchemy from qtpy import QtCore, QtGui, QtWidgets from mcr_analyser.d...
import scipy import cv2 import numpy as np import json import scipy.io as sio import os from glob import glob height, width = 41*2, 51*2 num_feat_pts = 7 angle_dim = 2 def expansion_to_layer(feat_pts): feat_pts_layers = np.zeros(shape=(height, width, num_feat_pts, 2), dtype=np.int) for n in range(num_fe...
import os import torch import math from torch import nn class PosEncoding(nn.Module): ''' Transformer-style positional encoding with wavelets ''' def __init__(self, d_model, max_len=1250): super().__init__() self.d_model = d_model pe = torch.zeros(max_len, d_model) posi...
import numpy as np from . import ffi, lib from .dtypes import _INDEX, lookup_dtype def libget(name): """Helper to get items from GraphBLAS which might be GrB or GxB""" try: return getattr(lib, name) except AttributeError: ext_name = f"GxB_{name[4:]}" try: return getatt...
# @package parallel_workers # Module caffe2.python.parallel_workers from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals ''' This module provides a python-land multithreaded mechanism for executing work. Basic usage is as...
import math import tensorflow as tf import tensorflow_probability as tfp _std_normal = tfp.distributions.Normal(loc=0, scale=1.) la = tf.linalg def diff_transforms_modulo_orthonormal(A, B): """The difference between two transforms, A and B, modulo an arbitrary orthogonal transformation.""" A, B = align_transf...
# INSTAGRAM PROFILE DOWNLOADER # imported necessary library from tkinter import * import tkinter as tk import tkinter.messagebox as mbox from pil import ImageTk, Image import cv2 import glob import webbrowser import instaloader # Main Window & Configuration window = tk.Tk() # created a tkinter gui window frame wind...
from abc import ABC, abstractmethod from typing import Tuple, Dict, Any import gym import numpy as np import torch from ..datasets.preprocess import subsample, gray_scale, binary_image, crop from ..encoding import Encoder, NullEncoder class Environment(ABC): # language=rst """ Abstract environment class...