text
stringlengths
8.04k
46.5k
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import sys import os from torchtext import data import pandas as pd import re from torchtext import vocab import time import random import os #from utils import log fr...
# Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright...
import os import pathlib from datetime import datetime from functools import wraps from pathos.multiprocessing import Pool import numpy as np from scipy import linalg as splin from scipy import sparse as spsparse from scipy.optimize import minimize import h5py import cupy as cp from geoist import gridder from geoist...
from includes import * from common import * import csv from RLTest import Env def testWITHSUFFIXTRIEParamText(env): conn = getConnectionByEnv(env) env.expect('ft.create', 'idx', 'schema', 't', 'TEXT', 'SORTABLE', 'WITHSUFFIXTRIE').error() env.expect('ft.create', 'idx', 'schema', 't', 'TEXT', 'SORTABLE', 'N...
# -*- coding: utf-8 -*- """ Created on Thu Mar 8 19:45:39 2018 @author: alnoah """ import os import requests import numpy as np import time from bs4 import BeautifulSoup from io import BytesIO from tqdm import trange, tqdm from astropy.table import Table, join, unique, vstack, hstack from astropy.coordinates impor...
from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf tf.random.set_seed(1234) import tensorflow_datasets as tfds import os import re import sys import numpy as np """##Prepare Dataset We will use the conversations in movies and TV shows provided by [Cornell Mov...
"""A module to handle HaTSPiL filename barcoding. HaTSPiL highly relies on a filename barcoding in order to perform the correct type of analysis. The barcode is heavily inspired from the one used by TCGA, and it has been developed with the idea of being scalable to a high variety of cases. Here a brief example of a b...
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-386, distribute-compatible and semantic versioning. """ import re from .compat import string_types __all__ = ['Nor...
#!/usr/bin/env python3 # sleeperPy # REQUIREMENTS: # pip3 install bs4 # if apache is root, sudo pip3 install bs4 # ISSUES/TODO # TODO: not taking account into flex, e.g noah fant tier 5 better than desean tier 7 # TODO: waiver wire suggestions would be great, especially for DST/K. If player on WW is higher tier, ment...
#!/usr/bin/python3 import os import sys import shutil import fnmatch import subprocess import textwrap import json import argparse from datetime import date from collections import defaultdict from configparser import SafeConfigParser, Error from fanfic_scraper import current_fanfic from pony.orm import db_session, se...
from itertools import combinations, chain, permutations import networkx as nx import matplotlib.pyplot as plt import random random.seed(0) class Atom: def __init__(self,info): self.atom = info[0] self.electrons = info[1] self.atomic_numb = info[2] self.valence = info[3] self.orbit...
#!/usr/bin/env python3 # Python standard library imports import argparse import configparser import os from pathlib import Path import resource import shutil import timeit import xml.etree.ElementTree as ET # Third party packages import h5py as h5 import numpy as np import vtk from vtk.util import numpy_support as np...
from teafacto.core.base import Block, param from teafacto.core.base import tensorops as T from teafacto.util import getnumargs from teafacto.util import issequence from teafacto.blocks.basic import Dropout from IPython import embed default_init_carry_gate_bias = 1 class RecurrentBlock(Block): # ancestor class for...
import json import os import re from .Base_Helper import BaseHelper from .Biochem_Helper import BiochemHelper class CompoundNotFoundError(Exception): pass class ObsoleteCompoundError(Exception): pass class CompoundKeyError(Exception): pass class DuplicateBiomassError(Exception): pass class Duplica...
# Copyright (c) 2014 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import contextlib import fnmatch import os import re import subprocess import sys import tempfile import time import urlparse from naclports import...
import logging import time import random from typing import Union from typing import Any from typing import Dict from typing import Optional from typing import List from typing import Tuple from typing import Set from typing import Callable from pyspark.sql.types import StructType from pyspark.sql.types import StructFi...
#!/usr/bin/env python """ Take simulated (and reconstructed) HDF5 file(s) (as converted from I3 by icecube.hdfwriter.I3HDFTableService) as input and writes out a simplified HDF5 file for use with PISA. """ from __future__ import absolute_import, division from argparse import ArgumentParser, ArgumentDefaultsHelpForm...
import types from collections import deque, namedtuple from pycsp3.classes.entities import Node, TypeNode, ECtr, EMetaCtr from pycsp3.classes.main.constraints import ( ScalarProduct, PartialConstraint, ConstraintSum, ConstraintElement, ConstraintElementMatrix, ConstraintInstantiation, auxiliary, global_ind...
""" preprocess COCO annotations into LMDB """ import argparse from collections import defaultdict import json import os from os.path import basename, exists import pickle import re from cytoolz import curry from tqdm import tqdm from pytorch_pretrained_bert import BertTokenizer from utils.vqa import compute_target fr...
import numpy as np import numba import scipy.sparse from pykeops.torch import LazyTensor import torch import umap from sklearn.metrics import pairwise_distances from scipy.stats import pearsonr, spearmanr # Contains utility function, including for computing similarities and losses def corr_pdist_subsample(x, y, sam...
# Originally made by <NAME> (https://github.com/crowsonkb, https://twitter.com/RiversHaveWings) # The original BigGAN+CLIP method was by https://twitter.com/advadnoun # Adapted from https://github.com/nerdyrodent/VQGAN-CLIP/blob/main/generate.py import argparse import os import random from urllib.request import urlope...
import cmath import numpy.ma import sys import matplotlib.pyplot as plt from objs import * import math import copy """ This is the utility file for the calculator, nearly all features are kept and maintained here. it includes: tokenizer(expression) findNeg(token list) fixmult(token list) check(token list) ...
""" This module is a wrapper around parsets used in YandaSoft. The code takes template parset(s) and creates custom parsets for pipelines such as the gridded DINGO pipeline. Currently not everything is supported and the wrapper is not complete, i.e. the user can break the wrapper if not careful! """ __all__ = ['check_...
# ==================================================== # Library # # ==================================================== import os import gc import sys import math import time import random import shutil from requests import get from pathlib import Path from contextlib import contextmanager from collections import def...
#!/usr/bin/python #-*- coding:utf-8 -*- import os import socket from ctypes import * import struct import time import configparser import threading import datetime import ipConversion import logging from logging.handlers import TimedRotatingFileHandler from kelidata import db, Device, Alarmrecord, Alarm ...
################################################################################ # DCT-II / DCT-III generator # # Based on: # - "A low multiplicative complexity fast recureise DCT-2 algorithm" # by <NAME> and <NAME> / arXiv / 20 Jul 2012 # - TODO ####################################################################...
from Tokens import * from Errors import RTError from Lexer import * from Nodes import * from Parser import * import os from math import isnan, sqrt from copy import deepcopy #RTResult class RTResult: def __init__(self): self.reset() def reset(self): self.value = None se...
import sys import pygame import random WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) DARKGRAY = (169, 169, 169) YELLOW = (222, 178, 0) PINK = (225, 96, 253) BLUE = (0, 0, 255) BROWN = (139, 69, 19) ORANGE = (255, 99, 71) GRAY = (119, 136, 153) LIGHTORANGE = (255, 176, 56) INTERMEDIARY...
# std libs import io import ast import sys import math import warnings as wrn import itertools as itt from pathlib import Path from functools import partial from collections import defaultdict # third-party libs import anytree from stdlib_list import stdlib_list # relative libs from ..iter import accumulate from ..i...
''' Transforms to gates. ''' ''' Aim is to find a solution to the issue of the default gate rings causing large ships to suicide on the projecting pylons. Files of interest: /objects /others argon_gate.bod argon_gate_destroyed.bod argon_gate_effect.bod argon_gate_scene.bod ...
import torch import torch.nn as nn from torch.nn import init import functools from torch.optim import lr_scheduler ############################################################################### # Helper Functions ############################################################################### class LayerNorm(nn.Modu...
""" Calculate Nafion transport properties as a function of morphology/state: The Nafion electrolyte used in the particle_shell_pemfc_* files has a complex microstructure and morphology that affects the value of important parameters that are used in the model, i.e. ionic conductivity and effe...
""" Тренировка модели для превращения символьной цепочки слова в вектор действительных чисел фиксированной длины. Реализации RNN и CNN вариантов энкодера, включая комбинации. Реализовано на Keras. Подробности: https://github.com/Koziev/chatbot/blob/master/ruchatbot/trainers/README.wordchar2vector.md """ import numpy ...
import matplotlib matplotlib.use("Agg") from imageio import imread import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np import scipy.signal as sg import scipy as sp def get_im2col_indices(x_shape, field_height, field_width, padding=1, stride=1): # from cs231n assignments #...
# -*- coding: utf-8 -*- """ Created in 2016-2017 Author : <NAME> Affiliation : Université catholique de Louvain - ICTEAM - UCL Crypto Group Address : Place du Levant 3, 1348 Louvain-la-Neuve, BELGIUM email : <EMAIL> """ from tkinter import * from tkinter import filedialog, messagebox from binascii import hexlify impor...
import copy import logging import os import re from fuzzywuzzy import fuzz from args import Pos2idx, Rel2idx, mismatch import torch from torch.utils.data import TensorDataset import numpy as np from tqdm import tqdm logger = logging.getLogger(__name__) from transformers.data.processors.squad import _improve_answer_span...
# -*- coding: utf-8 -*- """ Raw Line Edit. Licensed under MIT Copyright (c) 2013 - 2016 <NAME> <<EMAIL>> """ from __future__ import unicode_literals import sublime import sublime_plugin import codecs import re from os.path import exists try: from SubNotify.sub_notify import SubNotifyIsReadyCommand as Notify except...
"""Points-to / dataflow / cfg graph engine. It can be used to run reaching-definition queries on a nested CFG graph and to model path-specific visibility of nested data structures. """ import collections from pytype.pytd import utils _solved_find_queries = {} _supernode_reachable = {} class Program(object): ...
""" Train a BERT-based PICO Extraction model on the EBM-NLP corpus and create PIO predictions for SciFact claims. The following repositories are required and should be downloaded to `../data`: - [SciFact](https://github.com/allenai/scifact/) - Contains the claims to make predictions for. - [EBM-NLP 2.0](https://gi...
import random import time from lib.game_object import Weapon, Armor from lib.static import screen_width, clear class NPC: def __init__(self, health, strength): self.health = health * random.randrange(10, 21) self.strength = strength * random.randrange(5, 11) self.active_effect = [] de...
import logging import time from decimal import Decimal from enum import Enum from typing import Any, Dict, Tuple from typing import List from sqlalchemy import select, and_, join, func from sqlalchemy.orm import DeclarativeMeta from sqlalchemy.sql import expression from plugins.costume_loader_pkg.backend.attribute im...
import copy import logging import numpy as np import trimesh import open3d as o3d from tqdm import tqdm from scipy.spatial.transform import Rotation as R from . import core from . import grasp from . import util from . import visualization from . import mesh_processing def rays_within_cone(axis, angle, n=10, unifor...
# see how involved a NEFIS reader in native python/numpy would be from __future__ import print_function import os import sys import numpy as np import matplotlib.pyplot as plt # import memoize ## # os.chdir('/Users/rusty/research/sfei/models/delft/delft3d_repository/examples/01_standard') d3d_libdir=os.path.join(os....
#!/usr/bin/env python """ line.py General script for testing consistency of all of Rail's outputs given any input manifest file and index. Here, consistency is verified using third-party tools: 1) bedtools genomecov and bigWigToBedGraph to check that coverage vectors from BAM and bigWig are consistent. 2) samto...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :Mod: propagate_names :Synopsis: Collect names, normalize, and apply various methods to match name variants :Author: ide :Created: 6/1/21 """ import os import daiquiri from flask import ( Flask, Blueprint, jsonify, request, current_app ) from unidecode ...
# encoding: utf-8 import warnings from ..lib.cocoa import * from math import pi, sin, cos, sqrt from plotdevice import DeviceError from . import _cg_context from .atoms import PenMixin, TransformMixin, ColorMixin, EffectsMixin, Grob from .colors import Color, Gradient, Pattern from .geometry import CENTER, DEGREES, Tr...
__all__ = [ 'Session', 'SessionError', 'Stream', 'StreamClosed', # HTTP/2 entities 'Request', 'Response', # HTTP/2 entity properties 'Method', 'Scheme', 'Status', # Helpers 'get_library_version', 'make_ssl_context', ] from http import HTTPStatus as Status # Rena...
""" Module : Main Description : The main entry point for the program. Copyright : (c) CHER_WEI_YUAN, 29DEC2021 License : - Maintainer : <EMAIL> Portability : POSIX This program reads the output of GeneScan in csv format, remove peaks with small or relatively small areas, and calculates, for each...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os import sys import json import errno import platform import fileinput import subprocess from datetime import datetime, timezone try: import requests except ImportError: raise ImportError( 'Failed to import \'requests\', run \'pip instal...
import warnings import re import os import glob import numpy as np from hipose.rotations import convert_quat_to_euler_continuous, \ convert_euler_to_quat, quat_mult from hipose.imu import compute_imu_orientation, rotate_vectors, \ remove_gravity_acceleration, imus_static_calibration, apply_imu_calibration f...
# -*- coding: utf-8 -*- # chat.py # A python p2p chat. # Copyright 2015 <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 # # ...
#!/usr/bin/env python3 from args import FLAGS import os.path import tensorflow as tf import math import scipy.misc import time import imageio import numpy as np from tqdm import tqdm from tqdm import trange from distutils.version import LooseVersion import helper import project_tests as tests import augmentation MOD...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals """ oauthlib.oauth1.rfc5849.signature ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module represents a direct implementation of `section 3.4`_ of the spec. Terminology: * Client: software interfacing with an OAuth API * Server: the API provi...
#!/usr/bin/env python # pylint: disable=W0201 import sys import argparse import yaml import numpy as np import os # torch import torch import torch.nn as nn import torch.optim as optim import shutil # torchlight import torchlight from torchlight import str2bool from torchlight import DictAction from torchlight import ...
""" Admin for Dominion """ from django.contrib import admin from .models import (PlayerOrNpc, Organization, Domain, Agent, AgentOb, Minister, MapLocation, AssetOwner, Region, Land, Castle, WorkSetting, PraiseOrCondemn, Ruler, Army, Orders, MilitaryUnit, Member, Task, OrgUnitMod...
from sympy.concrete.products import Product from sympy.concrete.summations import Sum from sympy.core.numbers import (Rational, oo, pi) from sympy.core.relational import Eq from sympy.core.singleton import S from sympy.core.symbol import symbols from sympy.functions.combinatorial.factorials import (RisingFactoria...
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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...
################################################################################ # test_osmnx.py # License: MIT, see full license in LICENSE.txt # Web: https://github.com/gboeing/osmnx ################################################################################ import matplotlib as mpl import pandas as pd import w...
import tkinter as tk import investpy import yfinance as yf import sys from tkinter import ttk from tkinter import * import datetime from time import strftime import locale import PIL.Image as Image import PIL.ImageTk as ImageTk window = tk.Tk() window.title('Nepriam Capital') window.iconbitmap('C:/Us...
from __future__ import division import numpy as np import utils.InitHelper as initializer from configparser import ConfigParser import random import tqdm import pickle parser = ConfigParser() parser.read('configuration.ini') class Sorn(object): # SORN network Initialization def __init__(self): p...
#------------------------------------------------------------------------------- # Read output of gen_json.py and generate Zig language bindings. # # Zig coding style: # - types are PascalCase # - functions are camelCase # - otherwise snake_case #---------------------------------------------------------------...
############################################################################## # # Copyright (c) 2019 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
''' steps: conver the new dicom to nii align the nii to cfg.templateFunctionalVolume_converted apply mask load clf get morphing parameter ''' """----------------------------------------------------------------------------- sample.py (Last Updated: 05/26/2020) The purpose of this script is to act...
import sys import datetime import time import threading import serial import yaml import logging from logging.handlers import RotatingFileHandler import paho.mqtt.client as mqtt import ssl import argparse import copy import json """ Description ----------- This small Python application reads the pulse counters of a S...
"""Fairly basic set of tools for real-time data augmentation on image data. Can easily be extended to include new transformations, new preprocessing methods, etc... """ from __future__ import absolute_import, division, print_function import multiprocessing.pool import os import re import threading import warnings fro...
import matplotlib import matplotlib.pyplot as plt import numpy as np import torch import torch.nn as nn import torch.optim as optim from .networks import FCNN from copy import deepcopy def _network_output(net, ts, ith_unit): nn_output = net(ts) if ith_unit is not None: return nn_output[:, ith_unit]....
# Authors: <NAME> <<EMAIL>> # # License: BSD (3-clause) from datetime import datetime, timedelta import time import os.path as op import re from copy import deepcopy from itertools import takewhile from collections import OrderedDict import collections import numpy as np from .utils import _pl, check_fname, _validat...
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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...
from taxii2client.common import TokenAuth from taxii2client.v20 import Server, as_pages from CommonServerPython import * # disable insecure warnings requests.packages.urllib3.disable_warnings() UNIT42_TYPES_TO_DEMISTO_TYPES = { 'ipv4-addr': FeedIndicatorType.IP, 'ipv6-addr': FeedIndicatorType.IPv6, 'dom...
from dummy import Hyper, Param, Var, Runtime, Input, Output, Inline #### Parameters to the model (changes in this block should not require #### any changes in the actual model) maxInt = Hyper() inputNum = Hyper() inputStackSize = Hyper() prefixLength = Hyper() lambdaLength = Hyper() suffixLength = Hyper() #### Inputs...
"""Implements serializers for Wyscout data.""" import glob import os import re import warnings from pathlib import Path from typing import Any, Dict, List, Optional from urllib.parse import urlparse from urllib.request import urlopen, urlretrieve from zipfile import ZipFile, is_zipfile import pandas as pd # type: ign...
# Copyright (c) 2017 The sqlalchemy-bigquery Authors # # 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, mer...
"""Tests for command serialization.""" # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import numpy as np from PIL import Image import pytest import scenepic as sp def test_color(): expected = sp.Color(0.5, 0, 0.2) actual = sp.ColorFromBytes(255, 0, 102) * 0.5 np.testing.assert_...
import asyncio import base64 from datetime import datetime from enum import IntEnum import json from hashlib import sha256 import logging import os from pathlib import Path from time import time from typing import Sequence import tempfile import aiohttp import aiosqlite import base58 import libnacl from indy import d...
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lic...
# Copyright 2004-2008 <NAME>. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """ defines classes, that describe C++ types """ import compilers import algorithms_cache class type_t(object): """base class for ...
import testClasses import json from collections import defaultdict from pprint import PrettyPrinter pp = PrettyPrinter() from game import Agent from pacman import GameState from ghostAgents import RandomGhost, DirectionalGhost import random, math, traceback, sys, os import layout, pacman import autograder # import gr...
import torchvision import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torch.autograd import Variable from datetime import datetime import json import argparse from datetime import datetime import pathlib from calculateStatistics import calculateMean, calculateSTD, saveStatistics from mod...
"""OptionsClass Classes: Option - Holds information about an option OptionsClass - A collection of options Abstract: This module is used to manage "options" managed in user editable files. This is the implementation of the Options.options globally shared options object for the SpamBayes project, but is also ...
# Copyright (C) 2014-2017 New York University # This file is part of ReproZip which is released under the Revised BSD License # See file LICENSE for full license details. """Graph plugin for reprounzip. This is not actually an unpacker, it just creates a graph from the metadata collected by the reprozip tracer (eithe...
import requests from bs4 import BeautifulSoup from multiprocessing.dummy import Pool import time import shutil import re import os import json import string import glob BASE_URL = 'https://www.pro-football-reference.com{0}' PLAYER_LIST_URL = 'https://www.pro-football-reference.com/players/{0}' PLAYER_PROFILE_URL = 'ht...
from absl import flags # import Control operators. from pylot.control.pylot_agent_operator import PylotAgentOperator from pylot.control.ground_agent_operator import GroundAgentOperator # Import debug operators. from pylot.debug.depth_camera_visualizer import DepthCameraVisualizer from pylot.debug.lidar_visualizer_ope...
import math from collections import OrderedDict import torch import torch.nn as nn import numpy as np import torch.utils.model_zoo as model_zoo model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth', 'r...
import sys from threading import Thread, Event, Condition from struct import pack, unpack from codecs import encode import logging import re import pygdbmi.gdbcontroller import parse if sys.version_info < (3, 0): import Queue as queue # __class__ = instance.__class__ else: import queue from avatar2.archs...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Coverage data for coverage.py.""" import glob import itertools import json import optparse import os import os.path import random import re import socket from ...
#!/usr/bin/env python """ ============================================= dMRI: Connectivity - Camino, CMTK, FreeSurfer ============================================= Introduction ============ This script, connectivity_tutorial.py, demonstrates the ability to perform connectivity mapping using Nipype for pipelining, Fre...
# pylint: disable=arguments-differ import logging import fnmatch from pyparsing import alphanums, OneOrMore, Optional, Regex, Suppress, Word import configshell_fb as configshell from configshell_fb.shell import locatedExpr from .core import CephNodeManager, SshKeyManager from .exceptions import CephBootstrapExcepti...
#!/usr/bin/env python from time import sleep import datetime import json import operator import os from pathlib import Path import re import sys from colorama import init, Fore from emoji import emojize init(autoreset=True) # colorama: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET. dir_path = os.pat...
# -*- coding: utf-8 -*- # Copyright 2013-2019 <NAME>, MIT license """ Classes and functions for receiver function calculation. """ import json from operator import itemgetter from pkg_resources import resource_filename import warnings import numpy as np from obspy import read, Stream, Trace from obspy.core import Attr...
""" Pitch class (e.g., C), Pitch (e.g., C4) """ # https://github.com/campagnola/pyabc/blob/4c22a70a0f40ff82f608ffc19a1ca51a153f8c24/pyabc.py#L94 import functools import re import warnings from fractions import Fraction from typing import TYPE_CHECKING, Dict, Optional if TYPE_CHECKING: from .key import Key def _g...
import os import torch import numpy as np from torch.utils.data import Dataset, DataLoader import torch.nn as nn import pickle from tqdm import tqdm import argparse from torch.nn import functional as F from dataloader import DatasetMetaQA, DataLoaderMetaQA from model import RelationExtractor from torch.optim.lr_schedul...
import os, sys, shutil, json from datetime import timedelta import time sys.path.append('../') ## For Luca: please put every thing you want to add after this line from GenericTools.KerasTools.esoteric_optimizers.AdaBelief import AdaBelief import pandas as pd from GenericTools.StayOrganizedTools.VeryCustomSacred imp...
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # Copyright © 2013 eNovance # # Author: <NAME> <<EMAIL>> # <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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- import logging from logging.handlers import RotatingFileHandler import datetime import os import numpy as np import pandas as pd from docx import Document as Document_compose from docxcompose.composer import Composer from docxtpl import DocxTemplate, RichText from PyQt5.QtWidg...
import io import logging import os import re import uuid from typing import Any, Dict, List import disnake import financedatabase as fd import natsort import pandas as pd import plotly.graph_objects as go import yfinance as yf from kaleido.scopes.plotly import PlotlyScope from numpy.core.fromnumeric import transpose f...
from __future__ import print_function try: import argparse import os import numpy as np import math import time import datetime import matplotlib import matplotlib.pyplot as plt import pandas as pd import pickle as pkl from torch.autograd import Variable from torc...
import numpy as np import tensorflow as tf from shape_checker import ShapeChecker import typing from typing import Any, Tuple import utils class Encoder(tf.keras.layers.Layer): def __init__(self, enc_units: int, data_type: str, rnn_type: str = 'gru', bidir_merge_mode: str = 'sum'): ''' Initializ...
# -*- coding: utf-8 -*- """ FIXME: This class is very old, convoluted, and coupled. It really needs to be rewritten efficiently. the __setattr__ __getattr__ stuff needs to be redone, and DynStruct probably needs to go away. """ from __future__ import absolute_import, division, print_function, unicode_li...
"""solver.py""" import warnings warnings.filterwarnings("ignore") import os from abc import ABC, abstractmethod from tqdm import tqdm import visdom import random from PIL import Image, ImageDraw import math import numpy as np import torch import torch.optim as optim from torchvision.utils import make_grid, save_imag...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import random import datetime import socket import numpy as np from multiprocessing import Process, Pipe from PyQt5 import QtWidgets, uic from PyQt5.QtWidgets import QWidget from PyQt5.QtGui import QIcon class MainWindow(QtWidgets.QMai...