text
stringlengths
6.04k
39.5k
# -*- coding: utf-8 -*- # Copyright (c) 2017, <EMAIL> and contributors # For license information, please see license.txt from __future__ import unicode_literals from six.moves import range from six import string_types import frappe import json from frappe import _ from frappe.model.document import Document from frapp...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ basic_types.py /basic_types/ module in the /egp/ package. Created by <NAME>. Copyright (c) 2012. All rights reserved. Contains the basic data types used in other modules. """ import numpy as np import egp.toolbox import egp.fft import egp.cosmology import egp.utils ...
from itertools import chain from typing import List, Union import torch from torch import nn from torch.utils.checkpoint import CheckpointFunction from equideepdmri.layers.Recomputeable import recompute from equideepdmri.layers.layer_builders import build_pq_layer, build_p_layer, build_q_reduction_layer from equideep...
""" Tests for Asset AssetStore and SessionAssets. Note that our docs is very much a test for our export mechanism. """ import os import sys import tempfile import shutil from flexx.util.testing import run_tests_if_main, raises, skip from flexx.app._asset import solve_dependencies, get_mod_name, module_is_package fr...
# import psutil import time import threading from typing import List, Dict, Tuple, Any, Optional, Union from functools import wraps # from inspect import getfullargspec # from datetime import datetime import logging from sqlalchemy.orm import load_only from tackle.db_models import APIKeyData from tackle.db_models imp...
import csv import re import mock import pytest import yaml from mock import MagicMock from tests.util import compare_iter from user_sync.connector.connector_umapi import Commands from user_sync.engine.common import AdobeGroup from user_sync.engine.umapi import UmapiTargetInfo, UmapiConnectors, RuleProcessor @pytest...
""" General project models used. These may get moved to a blueprint/package at any time """ from datetime import date from school.config import Config from school.extensions import db from sqlalchemy import Column, Integer, String, ForeignKey, \ Date, SmallInteger, Boolean, PrimaryKeyConstraint, and_ # keep tra...
import torch from torch import nn import numpy as np from common.nn import SharedMLP from mvpnet.ops.group_points import group_points import mvpnet.models.unet_resnet34 as net2d from functools import partial class FeatureAggregation(nn.Module): """Feature Aggregation inspired by ContFuse""" def __init__(se...
from pytorch_lightning import LightningModule from omegaconf import DictConfig import os import logging import torch import torch.nn.functional as F from transformers import AdamW, get_linear_schedule_with_warmup from pytorch_lightning.core.step_result import TrainResult, EvalResult from src import MODEL_CLASSES from ...
# Copyright (c) 2012-2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
# Copyright 2020, the e-prop team # Full paper: A solution to the learning dilemma for recurrent networks of spiking neurons # Authors: <NAME>*, <NAME>*, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> import tensorflow as tf import numpy as np from collections import namedtuple Cell = tf.contrib.rnn.BasicRNNCell LightLIFStat...
# -*- coding: utf-8 -*- """ This file contains MLTools class and all developed methods. """ # Python2 support from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function import numpy as np import pickle class MLTools(obje...
# options.py from collections import defaultdict from dataclasses import fields, field, Field, dataclass from django.apps import apps from django.db import models from django.db.models import Q from django.db.models.options import make_immutable_fields_list from django.utils.functional import cached_property from impo...
from __future__ import unicode_literals import re import time import socket import logging import telnetlib from netmiko.cisco_base_connection import CiscoBaseConnection show_trace = 0 if show_trace > 1: logger = logging.getLogger('netmiko_connection') logger.setLevel(logging.DEBUG) def trace(fmt, *args): ...
#!/usr/bin/env python import sys import rospy from hybrid_control_api.srv import * import numpy as np import math from scipy import linalg from keras.models import load_model from keras.models import Model from utils import * # cartesian position of the end effector endEffectorPosition = ( ['end_arm_position_x', 0...
from cached_property import cached_property from sqlalchemy import text import requests import json import urllib.parse import datetime from app import db from app import USER_AGENT from app import MAX_MAG_ID from app import get_apiurl_from_openalex_url from util import jsonify_fast_no_sort_raw # truncate mid.concep...
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from astropy.time import Time import astropy.units as u from astropy.coordinates import SkyCoord, EarthLocation from ..utils i...
import datetime import gensim.downloader as api import io import json import math import nltk import numpy as np import os import pandas as pd import pdfminer import pickle import PyPDF2 import re import sys import pdfrw import textract import tldextract import traceback from collections import Counter from nltk impor...
import numpy as np import time import os import tensorflow as tf from tf_rl.common.utils import sync_main_target, soft_target_model_update, huber_loss, logger, ClipIfNotNone class DQN: """ Boilerplate for DQN Agent """ def __init__(self, params, num_action, state_shape): """ define th...
#!/usr/bin/env python3 """ Script to generate buildkite pipeline and run commands in CI """ import argparse import copy import json import os import tempfile import subprocess from shutil import copyfile import sys import time from urllib.request import url2pathname from urllib.parse import urlparse import yaml # pat...
# -*- coding: utf-8 -*- ''' config ====== logging ------- logging verwenden:: import logging logger = logging.getLogger( "MQTT" ) debug Meldungen ausgeben:: logger.setLevel( logging.DEBUG ) logging level: * CRITICAL - 50 * ERROR - 40 * WARNING - 30 * INFO - 20 * DEBUG - 10 * NOTSET - 0 CHANGELOG...
# coding: utf-8 lib_common = { 'uri': 'common', 'type': 'config', 'cxxflags': [ '-std=c++11', ], 'source_base_dir': 'd:/lib/ogre', 'install_dirs_map': { }, } def dyn_common(lib, context): c = context versions = c.parseFile( 'OgreMain/include/OgrePrerequ...
import abc import itertools import inspect import pandas as pd import numpy as np from skimage.measure import regionprops_table, perimeter from scipy.ndimage.measurements import labeled_comprehension from scipy.ndimage.morphology import distance_transform_edt from scipy.ndimage import find_objects # TODO test for 3D ...
from __future__ import absolute_import, print_function, division import ast import logging import numpy as np from itertools import repeat from sklearn.cross_decomposition import PLSRegression from sklearn.metrics import r2_score, mean_squared_error from sklearn.model_selection import GridSearchCV, KFold, GroupKFold fr...
"""Computes the gyral coordinate system For each point in space defines the radial, sulcal, and gyral orientations """ from numpy import linalg import numpy as np import nibabel from nibabel import gifti from . import grid, utils from .cortical_mesh import CorticalMesh from fsl.wrappers import gps, LOAD class Weight...
import torch import torch.nn as nn import torchvision.models as models import torchvision.transforms as transforms from torch.autograd import Variable from PIL import Image import config import cv2 import matplotlib.pyplot as plt import numpy as np import os from copy import deepcopy from collections import deque from ...
import errno import logging import os import subprocess import sys from unittest.mock import patch import pytest import runez from runez.conftest import exception_raiser from runez.program import RunAudit, RunResult CHATTER = runez.DEV.tests_path("chatter") def simulate_os_error(code): e = OSError(code) e...
#!python # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
"""Some functions to generate simulated data""" try: from os import link except ImportError: # Hack for windows from shutil import copy2 def link(src, dst): copy2(src, dst) from numpy.random import randn, rand, permutation, randint, seed from numpy import where, nonzero, sqrt, real from numpy ...
import numpy as np import scipy import os from scipy.stats import t from yass.template import align_get_shifts_with_ref, shift_chans def connected_components(img, x, y, cc): pixel = [x, y] if (pixel in cc) or (x < 0) or (x >= img.shape[0]) or (y < 0) or (y >= img.shape[1]) or (img[x,y] == 0): return c...
"""Provides a concrete class for controlling Spectrum digitiser StarHubs.""" # <NAME>, King's College London # Copyright (c) 2021 School of Biomedical Engineering & Imaging Sciences, King's College London # Licensed under the MIT. You may obtain a copy at https://opensource.org/licenses/MIT. import datetime from funct...
from collections import OrderedDict import dolfin as df from pathlib import Path import numpy as np from fenics_helpers import boundary from fenics_helpers.timestepping import TimeStepper import constitutive as c TEST = True class MechanicsSpaces: def __init__(self, mesh, constraint, mesh_function=None): ...
# coding=utf-8 import random import dynet as dy import numpy as np import pickle from datetime import datetime from candidate_generators import TurkishStemSuffixCandidateGenerator from data_utils import data_generator, load_data import logging.config from utils import to_lower, WordStruct, capitalize ...
""" Visualize data """ import os import configparser import numpy as np import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt import seaborn as sns import contextily as ctx CONFIG = configparser.ConfigParser() CONFIG.read(os.path.join(os.path.dirname(__file__), '..', 'scripts', 'script_config.in...
#!/usr/bin/python from __future__ import print_function import solidscraper as ss import traceback import argparse import codecs # utf-8 text files import json import os from collections import defaultdict from datetime import datetime from datetime import timedelta from dateutil import tz import time def toFixed(s...
# Copyright (c) 2021, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and t...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys root_path = "/".join(os.path.realpath(__file__).split("/")[:-2]) if root_path not in sys.path: sys.path.insert(0, root_path) import torch import torch.nn as nn from torch.optim import Adam import time from sklearn.metrics import precision_score,...
import cv2 import numpy as np import matplotlib.pyplot as plt from datetime import datetime from mpl_toolkits.mplot3d import Axes3D #import time # Initialize webcam input cap = cv2.VideoCapture(0) # Initialize video input #cap = cv2.VideoCapture("C:/Users/liangx/Documents/Dunhill Project Data/Single Sign/Stomach/FARM...
# -*- coding: utf-8 -*- """ Created on 2013-2014 Author : <NAME> Affiliation : Université catholique de Louvain - ICTEAM - UCL Crypto Group Address : Place du Levant 3, 1348 Louvain-la-Neuve, BELGIUM email : <EMAIL> """ ################## AHO Commitment ############################ ###################################...
from io import FileIO import numpy as np from scipy import ndimage from matplotlib import pyplot as plt import yaml import csv from PIL import Image import ReferenceModification.LibFunctions as lib class TrackMap: def __init__(self, map_name) -> None: self.map_name = map_name # map info ...
# 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 "License"); you may not ...
# -*- coding: utf-8 -*- import pytest import numpy as np from skcurve import Point, Segment, Curve, GeometryAlgorithmsWarning, IntersectionType @pytest.mark.parametrize('p1, p2, ndim', [ (Point([1, 1]), Point([2, 2]), 2), (Point([1, 1, 1]), Point([2, 2, 2]), 3), ]) def test_create_segment(p1, p2, ndim): ...
import datetime import discord import linecache import modules.bottiHelper import modules.data.ids as ids import os import xlrd import xlwt from time import sleep async def ban(botti, message, botData): """ Reserviert für Moderator oder höher Dieser Befehl bannt einen Nutzer. !ban {@USER} {@USER} ...
import base64 import json import math from collections import OrderedDict from io import TextIOBase, TextIOWrapper from math import isnan from cassis.cas import NAME_DEFAULT_SOFA, Cas, IdGenerator, Sofa, View from cassis.typesystem import * RESERVED_FIELD_PREFIX = "%" REF_FEATURE_PREFIX = "@" NUMBER_FEATURE_PREFIX = ...
''' Optimizing and testing the Kalman Filter from data of trajectories with both observations and system states. Contents: - TRAIN a KF from data: both noise-estimation and gradient-based optimization are supported. - TEST a trained model. - ANALYSIS of the test results. Written by <NAME>, 2021 ''' import numpy as n...
import os, json from collections import defaultdict from itertools import permutations from math import inf, sqrt, factorial, exp import numpy as np from random import seed, random import facenet seed() DETECTION_CONSTANT = 0.8 FALSE_ALARM_CONSTANT = 0.8 MISSING_CONSTANT = 0.8 POS_CONSTANT = 0.8 TOTAL_ITERATIONS = ...
#encoding: utf-8 import argparse import time import os try: import visualizacao_resta_um no_pygame = False except ModuleNotFoundError: no_pygame = True """ N ^ | O <--x--> L | v S DIRECOES = ['O', 'L', 'N', 'S'] """ DIRECOES = ['O', 'L', 'N', 'S'] # Distâncias a qu...
from django.shortcuts import render, redirect, get_object_or_404 from django.views.generic import View, DeleteView from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.decorators import login_required f...
from operator import itemgetter from functools import reduce from launcher import parse_file from frequency import get_freq_bounds_ryzen def calc_share_ratios(list_prio, cores): """ Basic Shares calculator""" # Shares calculation logic max_shares_per_app = 100 # collect all high priority apps shar...
#!/usr/bin/python3 import pytest import mock import hashlib from utils.features import * from bson.objectid import ObjectId from datetime import datetime from utils.models import JavascriptArtefact, JavascriptVectorSummary #def test_safe_for_mongo(): # assert safe_for_mongo({ 'a': 0, '$': 1 }) == { 'a': 0, 'F$': 1 }...
import datetime from operator import or_ from django.conf import settings from django.contrib.auth.models import User, Group from django.contrib.sites.models import Site from django.core.exceptions import ValidationError from django.db import models from django.db.models import get_model from django.utils.functional im...
#!/usr/bin/env python # -*- coding: utf-8 -*- import functools from itertools import imap, ifilter, islice, izip, repeat def identity(x): "Returns x unchanged." return x def const(x, *args, **kw): "Returns x unchanged, ignoring all other arguments." return x def constantly(result): """ Retur...
import sys sys.path.append('../') sys.path.append('.') #sys.path.append('') import warnings warnings.filterwarnings("ignore") import torch.nn as nn from globalUtils import * from models import * from dataset.datasets import loadDataset #from torch.utils.data import DataLoader, Subset from torch.utils.data import DataLo...
########################################################## # to turn off warnings # import warnings # warnings.filterwarnings('ignore') # # import os ...
#!/usr/bin/env python from OpenGL.GL import * from OpenGL.GLU import * import pygame from pygame.locals import * import serial import re import math import time ser = serial.Serial('/dev/ttyACM0', 115200, timeout=1) ax, ay, az, mx, my, mz, gx, gy, gz = ( 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1) Mmag = 0.0 t...
import numpy as np import xarray as xr import pickle import os import glob from _collections import defaultdict import re import copy from py_wake.site.distance import TerrainFollowingDistance from py_wake.site.xrsite import XRSite class WaspGridSite(XRSite): """Site with non-uniform (different wind at different ...
"""Script for multi-gpu training for incremental learing.""" from copy import deepcopy import numpy as np import pandas as pd import torch import torch.nn as nn import torchvision import torch.utils.data from tensorboardX import SummaryWriter from tqdm import tqdm from alphapose.models import builder from alphapose....
# ' % kmergrammar # ' % <NAME> mm2842 # ' % 15th May 2017 # ' # Introduction # ' Some of the code below is still under active development # ' ## Required libraries # + name = 'import_libraries', echo=False import os import sys import numpy as np import pandas as pd import sqlalchemy import logging import time from m...
""" Doc """ import os import time import yaml import PIL.Image import io import base64 import PySimpleGUI as sg from pathlib import Path from loguru import logger # load global options dictionary opt_fn = "app_options.yaml" # default options opt = { 'station_config_file': None, # station file is used to ide...
import argparse import os import pickle # noinspection PyPackageRequirements import tensorflow as tf import Networks as Nets import Params import DataHandeling import sys import losses from utils import log_print import requests __author__ = '<EMAIL>' try: # noinspection PyPackageRequirements import tensorflo...
import os from collections import namedtuple import tarfile import random import abc import pickle as pk import numpy as np import pandas as pd from tqdm import tqdm from sklearn.decomposition import PCA class BatchGenerator: """ Batch generator base class. Implement the _create_batch abstract method to g...
# -*- coding: utf-8 -*- # farmeconomy.py module # authors: <NAME> & <NAME> # An OOP implementation import numpy as np from matplotlib import pyplot as plt from scipy.optimize import minimize from collections import namedtuple class Economy(object): """ Economy with an Equilibrium Farm Size Distribution At p...
# additional tests of the extended XYZ file I/O # (which is also included in oi.py test case) # maintained by <NAME> <<EMAIL>> import os from pathlib import Path import numpy as np import pytest from extxyz.extxyz import read, write # from ase.io.extxyz import key_val_str_to_dict, key_val_dict_to_str # import ase....
import json import os import copy import re import time import argparse from StanfordCoreNLP import * import transformers delimiters = ['\n', '。', '!', '?', ';', ':"', '……', ';', '。"'] # ' ' should appear in extra-long sentence detection rather than regular splitting global_filtered_sentence_count = 0 global_filtere...
# -*- coding: utf-8 -*- ########################################################################## # NSAp - Copyright (C) CEA, 2021 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html #...
from pathlib import Path from karp.domain.models.resource import Resource from typing import Optional, Dict, List, Tuple, Any import json import collections import logging from datetime import datetime, timezone import fastjsonschema # pyre-ignore from sb_json_tools import jsondiff import json_streams # from karp.re...
#!coding=utf-8 import requests import re import random import time import json from requests.packages.urllib3.exceptions import InsecureRequestWarning import pandas as pd requests.packages.urllib3.disable_warnings(InsecureRequestWarning) ###禁止提醒SSL警告 ###格式化时间戳 def timestamp_to_date(time_stamp, format_s...
# Note that scrapers can become obsolete and some changes may be needed to this over time. #contents # - get_pubmeddata - gets pubmed data, run with no parameters for interactive, or add parameters # - txt2dataframe - takes beautifulsoup object and makes dataframe # This code is a little non-pythonic and, if I was to...
import numpy as np from pandas import DataFrame import os, os.path import csv from itertools import groupby from time import time import sys os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as tf v0 = tf.__version__[0] if v0 == '2': # For tensorflow 2, keras is included in tf import tensorflow.keras....
import numpy as np import pandas as pd import lib.utils as utils import lib.aux_utils as aux from collections import defaultdict def transform_vacineja(df): ''' Description. Args: return_: Bool. colnames: List of strings o...
#!/usr/bin/env python from matplotlib import pyplot as plt from matplotlib import gridspec import sys from time import time import numpy as np from biseqt.sequence import Alphabet from biseqt.stochastics import rand_seq, MutationProcess from biseqt.seeds import SeedIndex from biseqt.blot import band_radius, band_radii,...
from django.shortcuts import render, redirect from django.http import HttpResponse, JsonResponse import subprocess, os, requests, re, yaml from . import models, forms dnsmasq_prefix = "/etc/dnsmasq_blocklist." iptables_bin = "/usr/sbin/iptables" leasefile="/var/lib/dnsmasq/dnsmasq.leases" def index(request): retu...
#!/data/ia/anaconda3/bin/python ''' Given an input skymap and a list of coordinates, find into which probability contour they are enclosed ''' import numpy as np import json import pdb from astropy.time import Time from astropy.io import ascii from astropy.io import fits from astropy.table import Table import reque...
""" A set of generic utilities used in bilby_pipe """ import ast import json import logging import math import os import pickle import re import subprocess import sys import urllib import urllib.request from importlib import import_module from pathlib import Path import bilby CHECKPOINT_EXIT_CODE = 77 class tcolors...
#!/usr/bin/env python import sys import os import math import pysam import argparse import multiprocessing as mp from statistics import mean def printBinInfo(info): if (info[3] + info[4] != 0): print(info[0] + '\t' + info[1] + '\t' + info[2] + '\t' + str(info[3]) + '\t' + str(info[4])) def outputUnmappedLowQual...
# -*- coding: utf-8 -*- """ Module to simulate a spectra observed by a telescope given the instruments specifications. """ import numpy as np from scipy.interpolate import interp1d #from astropy.convolution import convolve, Gaussian1DKernel from scipy.ndimage import gaussian_filter1d from scipy.optimize import brentq ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ CLINGON Command Line INterpreter Generator for pythON Compatible python 2 and 3 (c) <NAME>, https://github.com/francois-vincent """ from __future__ import print_function, absolute_import from future.utils import listitems, iteritems from past.builtins import basestri...
"""Basic modules data state and store.""" from __future__ import annotations from dataclasses import dataclass from typing import ( Dict, List, NamedTuple, Optional, Sequence, overload, Union, Type, TypeVar, ) from numpy import array, dot from opentrons.hardware_control.modules.ma...
'''Utility functions for activation_maximization. This codes in this repository are based on CNN preferred image (cnnpref) https://github.com/KamitaniLab/cnnpref, which is written for 'Caffe'. These scripts are released under the MIT license. Copyright (c) 2020 Kamitani Lab (<http://kamitani-lab.ist.i.kyoto-u.ac.jp/>)...
import copy import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment import logging class DER: """ Class to compute a s4d error rate. Error is computed at a rate of 10ms. :attr uem_set: a set of index to evaluate :attr collar: is the no-score zone around reference speaker seg...
import datetime from django.db import models from django.db.models import Avg, Max, Min, Sum from django.conf import settings from django.utils.translation import ugettext, ugettext_lazy as _ from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.mod...
import asyncio import binascii import hashlib import os import logging import zipfile import synapse.common as s_common import synapse.cortex as s_cortex import synapse.tests.utils as s_test import synapse.tools.genpkg as s_genpkg logger = logging.getLogger(__name__) dirname = os.path.dirname(__file__) pkgproto = s_...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'final1.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QSt...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function import os import keras import tensorflow as tf from keras.models import Model from keras.utils import plot_model from keras import backend as K from keras.callbacks import LambdaCallback, TensorBoard from keras.layers import Input, me...
import os import bpy import json import pathlib from . import retargeting from .auto_detect_lists.bones import bone_list, ignore_rokoko_retargeting_bones from .auto_detect_lists.shapes import shape_list bone_detection_list = {} bone_detection_list_unmodified = {} bone_detection_list_custom = {} shape_detection_list =...
# ****************************************************************************** # Copyright 2017-2018 Intel Corporation # # 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.apa...
#!/usr/bin/env python """ Tools to work with data from different spectrographs: CARMENES, HARPS, HARPN. Uses functions from `harpsutils` and `carmenesutils`. """ from __future__ import division from __future__ import print_function import os import sys import numpy as np import pandas as pd from . import carmenesuti...
"""Module with utilities that ease the transformation of word sets to embeddings.""" import logging from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union import numpy as np from sklearn.feature_extraction.text import strip_accents_ascii, strip_accents_unicode from wefe.query import Query from wefe...
import math import numpy as np import torch from torch import nn, optim from torch.nn import functional as F import pytorch_lightning as pl from pytorch_lightning.core.lightning import LightningModule import argparse import wandb from relso.nn.bneck import BaseBottleneck from relso.nn.pooling import AttnPooling ...
#!/usr/bin/env python # coding: utf-8 """ let's see whether we get the internals hidden away from the johanna module interface. Created: 29.08.20 """ import os import sys from pathlib import Path import configparser import logging from logging.handlers import RotatingFileHandler from time import perf_counter, proces...
################################ # WAVE FUNCTION COLLAPSE IN 2D # ################################ # Original WFC implementation by <NAME> @mxgmn on github # Python implementation by <NAME> @Coac on github # Blender implementation by <NAME> @benkl on github import time import os import numpy as np import random impor...
import re import os from PyPSASP.utils import utils_gadgets from PyPSASP.constants import const from PyPSASP.utils.utils_PSASP import reshape_pos_keys # import numpy as np class PSASP_Converter(object): def __init__(self): pass def convert_get2list(self, dict_get): list_get = [] for ...
import numpy as np import cv2 import os import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from sklearn import linear_model from scipy import stats from collections import deque from camera_cal_test import camera_cal import gradients_colors_thresholding_test as grad_color_thres from perspective_...
import os import io import numpy as np import torch from scipy.ndimage.filters import gaussian_filter from scipy.interpolate import RectBivariateSpline from scipy.spatial.distance import cdist from skimage.transform import resize as resize_image from skimage import measure from skimage.color import rgb2gray from tqdm i...
from Segmentation.utilities import * import json import numpy as np import matplotlib.pyplot as plt from glob import glob from scipy.misc import imread from scipy import ndimage, signal from skimage import morphology, feature, exposure import neurofinder import cv2 as cv import ast from PIL import Image ...
#!/usr/bin/python3 import argparse import datetime import googleapiclient.discovery import json import oauth2client.file, oauth2client.client, oauth2client.tools import os import re from enum import Enum from httplib2 import Http from pathlib import Path # ANSI color codes C_RED = '\033[91m' C_GREEN = '\033[92m' C_YE...
#author: akshitac8 from typing import no_type_check_decorator import torch import torch.nn as nn from torch.autograd import Variable import torch.optim as optim import numpy as np import util from sklearn.preprocessing import MinMaxScaler import sys import copy import pdb class CLASSIFIER: # train_Y is interger ...
import json import os import pickle as pkl from collections import Counter, defaultdict, OrderedDict from copy import deepcopy from itertools import product from typing import ( Any, Dict, Iterable, List, Optional, OrderedDict as OrderedDictType, Union, ) import numpy as np import quaternio...
import os import numpy as np import pretty_midi import torch import dataprocess import matplotlib.pyplot as plt import dataprocess # Directory to load processed midi files processed_dir = 'processed_midi_files\\' # Directory to load processed event files processed_events_dir = 'processed_event_indices_files/' # Number...