text
stringlengths
3.07k
22.1k
import numpy as np import matplotlib.pyplot as plt from config import * import os,sys import pandas as pd from pandas import DataFrame as df import networkx as nx import nilearn from nilearn.connectome import ConnectivityMeasure from sklearn import covariance, preprocessing def reorder_corrs(corrmtx,labelda...
import traceback import gevent from gevent.event import Event from gevent import GreenletExit from rooms.script import Script from rooms.position import Position from rooms.vector import create_vector, Vector, create_vector_list from rooms.vector import time_to_position from rooms.timer import Timer from rooms.utils...
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.sites.models import Site from django.urls import NoReverseMatch from django.utils.translation import ugettext_lazy as _, override from menus.menu_pool import menu_pool from cms.utils.i18n import get_current_language, get_default_language from ...
import sys import traceback def safeFilter_intern(msg): #get rid of terminal codes s = "" i = 0 def consume(c, i): if i < len(msg) and msg[i] == c: return i+1 return i def consume_num(i): i2 = i while 1: i2 = consume("0", i2) i2 ...
"""Usage: python3 swarm_setup.py $GRAPL_DEPLOY_NAME""" from __future__ import annotations import json import logging import sys import time from typing import TYPE_CHECKING, Any, Iterator, List, NamedTuple, Optional, Sequence import boto3 if TYPE_CHECKING: from mypy_boto3_cloudwatch.client import CloudWatchClien...
from django.conf import settings import sys, os sys.path.append(os.getcwd()) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "swiss.settings") import django django.setup() from swissdutch.constants import FideTitle, Colour, FloatStatus from swiss_gui.models import InitialPlayerList,ParticipatedPlayerList,CurrentRoundP...
import os.path import torch import numpy as np import pickle as pkl def get_train_test_ind(paths): """ Select from the list of all files the train and test files :param paths: all files :return: list of train and list of test data """ list_train = [] list_test = [] for i, str_path in e...
from flask import Flask import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import pandas as pd import random server = Flask('UK schools cluster analysis') app = dash.Dash('UK schools cluster analysis', server=server, url_base_pathname='/', csrf_protect=Fa...
import argparse from glob import glob from time import time from datetime import timezone, datetime, timedelta import os import tensorflow as tf from model import get_model from losses import anchor_loss from dataset_utils import get_dataset, train_val_split def get_timestamp(): timestamp = str(datetime.now(time...
#!/usr/bin/env python3 from asciimatics.effects import Print from asciimatics.event import KeyboardEvent from asciimatics.widgets import Frame, ListBox, MultiColumnListBox, Layout, Divider, Text, \ Button, TextBox, Widget, PopUpDialog, Divider, THEMES from asciimatics.scene import Scene from asciimatics.screen imp...
import logging import requests from time import sleep from datetime import datetime import socket import urllib.parse import geoip2.database import pandas as pd from typing import Tuple from datetime import timedelta import tldextract import idna import psycopg2 from multiprocessing import Pool from os import path fro...
import numpy as np import moderngl from .matutil import * import numpy as np from math import sin, cos, tan, pi class Surface: def __init__(self, vts, ids, ns, cs=(0,0,1)): self.vts, self.ids, self.ns, self.cs = vts, ids, ns, cs self.box = np.vstack((vts.min(axis=0), vts.max(axis=0))) self.mode, self.blend, sel...
import xml.etree.ElementTree as ET from xml.sax.saxutils import quoteattr, unescape import datetime import re from typing import Union, Any, Optional, List, Dict, Tuple # from ..tableau_base import * from tableau_tools.tableau_exceptions import * from tableau_tools.logging_methods import LoggingMethods from tableau_t...
# -*- coding: utf-8 -*- import sys import os import platform import warnings from setuptools import setup, Extension, find_packages from pyquicksetup import read_version, read_readme, default_cmdclass ######### # settings ######### project_var_name = "cpyquickhelper" versionPython = "%s.%s" % (sys.version_info.major,...
import torch import logging import tempfile import numpy as np from sacred import Experiment from pathlib import Path from tabulate import tabulate from dfp.doom_sim_env import DoomSimulatorEnv from dfp.env_wrapper import TargetMeasEnvWrapper from dfp.network import model, make_model from dfp.agent import Agent from d...
import socket import sqlite3 import datetime import os import random import array_shuffler STATIC_KEY = '<KEY>' KEY_SIZE = 20 HEADER_SIZE = 256 # choose minimum value of rand key is 100'000 because # the number of shuffled bytes depends on the value of the key # so small values can't guarantee safe shu...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import os import numpy as np import matplotlib.pyplot as plt from matplotlib import rc import GPy import visibility as vis import conversion as conv import sampler as sa _save_ext = ".pdf" rc('font', **{'family': 'serif', 'serif': ['Cardo'], 'size': 25}) rc('text', us...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as tf import argparse import cv2 import numpy as np from glob import glob num_classes = 2 img_height, img_width = 64, 64 def conv2d(x, k=3, in_num=1, out_num=32, strides=1, activ=None, bias=True, name='conv'): w = tf.Variable(tf.random_normal([...
import tkinter as tk import tensorflow as tf import matplotlib.pyplot as plt import numpy as np import math import os from PIL import Image, ImageTk import time np.random.seed(int(time.time())) # random seed """ function for setting up the screen. It draws the drawing area with the grid. """ def clearScreen(): ...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import json import logging import os import sys import threading import time import uuid from collections import OrderedDict from pathlib import Path from typing import Dict, List, Optiona...
""" Main entrypoint for builder. """ import sys from collections.abc import Iterable, Sequence from boto3 import __version__ as boto3_version from boto3.session import Session from botocore import __version__ as botocore_version from newversion.version import Version from mypy_boto3_builder.cli_parser import Namespac...
# -*- coding: utf-8 -*- """ calculate bands distance """ import numpy as np from aiida import orm from aiida.engine import calcfunction @calcfunction def calculate_bands_distance(bands_structure_a: orm.BandsData, bands_parameters_a: orm.Dict, bands_structure_...
"""Model utils""" import torch import torch.nn as nn from torch.nn import init from torch.nn.utils.rnn import pad_sequence import torch.nn.functional as F import logging # Adds padding to a batch of tensors with pad up to pad_len from bootleg.utils.utils import flatten def pad_tensor(batch, pad, pad_len=None): a...
import GUI.gui_utilities as gui_ut import ogc_utility as ogc_util class PatchView: def __init__(self, main_view): self.view_elements = [] self.selected_type = None self.selected_boolean_expression = None self.selected_identifiers = None self.result = None self.main_...
#region IMPORTS import numpy as np import math as m import random import re import os import subprocess import ast from datetime import datetime #endregion #region CONSTANTS #enter path to local blender installation BLENDER_PATH = '' INSPECTION_PATH_FILE = 'Inspektionspfad_links_blenderready.txt' DEFECT_MODELS_AMOUN...
import os import datetime import gossip from flask import request, abort, render_template_string from flaskext.markdown import Markdown from bson.json_util import dumps from eva.config import save_config import eva.util from eva.plugin import plugin_enabled, \ get_plugin_directory, \ ...
from flask import Flask, jsonify, request from flask_cors import CORS import pymodm from pymodm import connect import mainfunction import numpy as np import models import datetime import time import Image_processing import io import base64 import PIL from PIL import Image connect("mongodb://vcm-3608.vm.duke.edu:27017/...
# Copyright The PyTorch Lightning team. # # 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 i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 22 10:53:43 2020 @author: sagarsetru """ # gensim import json import pandas as pd import numpy as np import os import time # NLP Packages from gensim.corpora import Dictionary from gensim.models import LdaModel from gensim.utils import simple_pr...
# ##### BEGIN MIT LICENSE BLOCK ##### # # MIT License # # Copyright (c) 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rig...
import psycopg2 import re import subprocess import sys import time from os import path, linesep, environ, mkdir, makedirs from MapColoniesJSONLogger.logger import generate_logger from osmeterium.run_command import run_command_async, run_command SEQUENCE_PATH_DENOMINATORS = [1000000, 1000, 1] CARTO_FILE = '/src/openst...
import stat import sys import os.path import MenuMaker import Prophet from Keywords import Keyword as Kw, Set as KwS import optparse from optparse import OptionParser as _OP from MenuMaker import msg, warn, fatal, fronts, terms # Output the generated menu to stdout instead of the menu file writeToStdout = False for...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from rasa_sdk import Action from rasa_sdk.events import SlotSet import zomatopy import json from email.message import EmailMessage import smtplib d_email_rest = [] class ActionSearchRestaurants(Action): d...
import numpy import time # import bigfloat import matplotlib.pyplot as plt # wspolczynnik uczenia eta = 0.1 # momentum alfa = 0.1 class NeuralNetwork: def __repr__(self): return "Instance of NeuralNetwork" def __str__(self): if self.is_bias: return "hidden_layer (wiersze - neuro...
# -*- coding: utf-8 -*- ''' Data Transforms Module This module contains functions for transforming PV power data, including time-axis standardization and 2D-array generation ''' from datetime import timedelta import numpy as np import pandas as pd from scipy.signal import argrelextrema from scipy.stats import mode f...
import random import shutil from abc import abstractmethod from pathlib import Path import tensorflow as tf from pysat.solvers import Glucose4 from data.dataset import Dataset from utils.iterable import elements_to_str, elements_to_int, flatten def compute_adj_indices(clauses): adj_indices_pos = [[v - 1, idx] f...
#!/usr/bin/env python import os,sys, subprocess, math, datetime from os.path import basename import numpy as np import numpy.ma as ma import gdal from gdalconst import * from osgeo import ogr, osr from pyhdf.HDF import * from pyhdf.V import * from pyhdf.VS import * from pyhdf.SD import * def getCoordsULLR(fileAb...
"""Extract features and save as .mat files for ED-TCN. Only used for spatial-temporal or appearance stream (in the case of 2 stream). Do NOT use for motion stream. """ from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys sys.path.insert( ...
import csv import numpy as np import pandas as pd import tensorflow as tf from tensorflow import keras from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Activation, Dense, Flatten, BatchNormalization, Conv2D, MaxPool2D, Input from tensorflow.keras.optimizers import Adam from tensorflow....
""" Common HTTP code. """ import asyncio import logging import os import pickle import urllib.parse import aiohttp import appdirs from sacad import rate_watcher from sacad import redo def aiohttp_socket_timeout(socket_timeout_s): """ Return a aiohttp.ClientTimeout object with only socket timeouts set. """ retu...
""" Yacc-style lexer and parser for NENA Markup texts with Sly Sly is a Python implementation of Yacc ("yet another compiler compiler"). Yacc is a unix-based shift-reduce parser. Sly follows the same basic parsing approach. The Yacc documentation is helpful for understanding the basic concepts: https://www.ibm.com/do...
# Copyright (c) 2020, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause import os import torch import numpy as np # from tqdm import tqdm from torch.utils.data.dataloader imp...
# coding:utf-8 import numpy as np import torch import math import cv2 from pycocotools import mask as cocomask class IOUMetric(object): """ Class to calculate mean-iou using fast_hist method """ def __init__(self, num_classes): self.num_classes = num_classes self.hist = np.zeros((num...
from __future__ import division import numpy as np from scipy.stats import norm from scipy import stats from sklearn.metrics.pairwise import euclidean_distances from scipy.spatial.distance import cdist from acquisition_maximization import acq_max counter = 0 ##########################################################...
"""Objects representing spectra.""" import logging as lgg from typing import Dict, Optional, Sequence, Union import numpy as np import tesliper # absolute import to solve problem of circular imports from .. import datawork as dw from .array_base import ArrayProperty # LOGGER logger = lgg.getLogger(__name__) cla...
import win32com.client as com import os import sys global Vissim import time import math def generate_phase_times(ct, sf, flows, lt, n_phase, scheme='relative'): phase_times = [0] * 4 if scheme == 'relative': for i in range(0,4): phase_times[i] = flows[i] * (ct - lt) elif scheme == 'ra...
import os import time from datetime import datetime import json import logging import http.client import base64 import nomad # pylint: disable=E0401 import consul # pylint: disable=E0401 logger = logging.getLogger() logger.setLevel(logging.INFO) logging.basicConfig(level=logging.INFO) def clear_input_list(in_list)...
import argparse import timeit import time as systemtime import os import numpy as np import torch import torch.backends.cudnn as cudnn from torch import nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data.distributed from torchvision import models import bluefog.torch as bf from blue...
import pandas as pd import os from helpers import * import math import numpy as np import matplotlib # import matplotlib.pyplot as plt # import seaborn as sns def deletefile(filename): """ delete the file and recreate it :param filename: the name of file :return: True = succeeded, False = failed """ ...
import random import torch from torch import nn from functools import partial from recbole.model.abstract_recommender import SequentialRecommender from recbole.model.layers import TransformerEncoder from einops import rearrange, reduce, repeat from einops.layers.torch import Rearrange, Reduce class PreNormResidual(nn...
import torch import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader from models import SimpleCNN, SimpleCNNDeconv from dataload import mnist_load, cifar10_load from saliency.attribution_methods import * from saliency.ensembles import * from utils import seed_ev...
"""Accumuldated days""" import datetime from collections import OrderedDict from pandas.io.sql import read_sql from pyiem.network import Table as NetworkTable from pyiem.plot.use_agg import plt from pyiem.util import get_autoplot_context, get_dbconn PDICT = OrderedDict([('high_above', 'High Temperature At or Above'),...
#! /usr/bin/env python 3 """ This is a game that counts players points. This is a game where you click a button to "spin the wheel" and it gives out points from 1000 to 20000. If you spin a zero it is essentially a bankrupt so your score goes down to zero. play this with some of your friends to see who has the best lu...
# pylint: skip-file # type: ignore # -*- coding: utf-8 -*- # # tests.models.opload.opload_integration_test.py is part of The RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com """Class for testing operating load integrations.""" # Thir...
import time import tensorflow as tf import numpy as np from abc import ABC from abc import abstractmethod from termcolor import colored from common.utils import Timer from common.utils import get_logger from common.utils import format_log from common.utils import format_text from metrics.summaries import BaseSummarie...
import itertools import nibabel as nib import numpy as np import torch import torch.utils.data as Data def generate_grid(imgshape): x = np.arange(imgshape[0]) y = np.arange(imgshape[1]) z = np.arange(imgshape[2]) grid = np.rollaxis(np.array(np.meshgrid(z, y, x)), 0, 4) grid = np.swapaxes(grid,0,2...
from __future__ import division, absolute_import from __future__ import print_function, unicode_literals import itertools import numpy as np import sklearn.datasets import sklearn.cross_validation import sklearn.metrics import theano import theano.tensor as T import treeano import treeano.nodes as tn import canopy imp...
#!/usr/bin/env python3 import json from path import Path import os from mathbind.types import BasicType, VoidType from mathbind.compilers.compiler import Compiler class FunctionObject: """ Represents a function object. """ def __init__(self, func_name, return_type, argnames, args): self.func...
####### 1. Import modules ####### from requests import get from json import dumps from datetime import datetime import os, time, subprocess apt_updates = "sudo apt-get update; sudo apt update; sudo apt-get upgrade; sudo apt upgrade" initialise = "cd ~; cd browsertrix; sudo git pull; sudo ./install-browsers.sh; sudo d...
import numpy as np import pandas as pd from scipy.io.arff import loadarff from sklearn.ensemble import RandomForestClassifier,GradientBoostingClassifier from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix,accuracy_score,p...
#Author: <NAME> and <NAME> import glob import datetime import zipfile import tarfile import logging from .scalebar_identification import * from .particle_identification import * from .rdf_functions import * from .image_identification import TEMImageExtractor from .figure_splitting import split_by_photo, split_by_gri...
# NOTICE # # This software was produced for the U.S. Government under # contract SB-1341-14-CQ-0010, and is subject to the Rights # in Data-General Clause 52.227-14, Alt. IV (DEC 2007) # # (c) 2018 The MITRE Corporation. All Rights Reserved. #==================================================== # CASE NLG VERIFIER v...
"""======================================================== RNA-Seq pseudocounting pipeline for differential expression =========================================================== The RNA-Seq differential expression pipeline performs differential expression analysis using pseudocounting methods. It requires three inpu...
#!/usr/bin/env python # -*- python -*- # # Copyright (C) 2017 Love Park Robotics, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
import typing as tp import matplotlib.pyplot as plt import numpy as np import scipy.odr from scipy.optimize import curve_fit from devices.mca import MeasMCA import plot import stats import type_hints # Adjusting these may result in failed fits THRESHOLD_LEVEL = 0.5 CUT_WIDTH_MULT = 1.7 # Functions to be fit def p...
import os import sys import re import ast import sublime import sublime_plugin sys.path.insert(0, os.path.dirname(__file__)) import refmate_utils class CiteFromBiblioFilesCommand(sublime_plugin.TextCommand): # """ # Parses a list of files to regex search for sphinx project bibliographies # Th...
# =============================================================================== # Copyright 2011 <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/LI...
import configparser from datetime import datetime import os import shutil import sys import argparse from pyspark.sql import SparkSession from pyspark.sql import functions as F from pyspark.sql import types as T from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format def create_spark_...
# -*- coding: utf-8 -*- import sys import os import time import re import operator from numpy import * from scipy import * from scipy.spatial import * from ivutils import * from viewer import * from mplan_env import * class State: def __init__(self, parent=None, avec=zeros(6)): self.parent = parent ...
import dataclasses from datetime import datetime import logging import os import pickle import tempfile from typing import Dict, List, Optional, Set, Tuple import sys import click import dotenv from dataclasses_json import dataclass_json import requests import shutil import tweepy STATE_FILE = "pautabot.state" BIGNUM...
from gettext import gettext as _ from django.conf import settings from django.contrib import admin from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.db.models import Q from django.http import Http404, HttpResponse, HttpRequest from django.shortcuts import...
import json import sys from enum import Enum from pprint import pprint import pygame from pygame.locals import * from pygame.math import Vector2 from twisted.internet.task import LoopingCall from twisted.internet import reactor, protocol from twisted.protocols.basic import LineReceiver pygame.init() # square window...
#!/usr/bin/python3 ## ## Licensed Material - Property of IBM ## (c) Copyright IBM Corp. 2017. All Rights Reserved. ## import bluepy import threading import time import re import argparse import sys gworg = '' gwdevtype = '' gwdevid = '' gwtoken = '' # this name is the BTLE characteristic which gives the device typ...
''' Accelerate demo with fp16 and multi-gpu support. Single CPU: python accelerate_demo.py --cpu 16-bit Floating Point: python accelerate_demo.py --fp16 Model from timm: python accelerate_demo.py --timm Singe-GPU: python accelerate_demo.py Multi-GPU or Multi-CPU: accelerate config accelerat...
import math class Math: def __init__(self, eq): self.equation = eq self.equation_list = None def print_equation(self): print(self.equation) def remove_spaces(self): self.equation = self.equation.replace(" ", "") def split_equation(self): self.equation_list = self.equation.split(" ") def is_ope...
#! /usr/bin/python # -*- coding: utf-8 -*- import sys, os import re import ConfigParser import xml.dom.minidom from ModuleObj import ModuleObj from data.PmicData import PmicData from utility.util import log from utility.util import LogLevel from utility.util import compare from utility.util import sorted_key class...
import json from enum import Enum import requests import sys import threading from time import sleep import websocket from logging import getLogger _logger = getLogger() class JSONObjectEncoder(json.JSONEncoder): def default(self, obj): if type(obj) in PUBLIC_ENUMS.values(): retu...
import numpy as np import h5py from scipy.interpolate import interp1d from pyspi.utils.livedets import get_live_dets_pointing from pyspi.io.package_data import get_path_of_internal_data_dir #from scipy.special import erfc from math import erfc from scipy.integrate import quad from numba import njit, float64 import os ...
# DRG Pom visualisation module, adapted from work by <NAME>, eLife, 2019. from pylab import * from matplotlib import pyplot as plt import numpy as np def plot_currentscape(trace, figsize=(6,8), start_time=None, end_time=None, legend=True, title=None): voltage, currents = format_trace_for_currentscape(trace) ...
import numpy as np import skfuzzy as fuzz from skfuzzy import control as ctrl from typing import Final import math # <NAME> def countWithTwoInputedVariables(throwRange, angle): score = math.sqrt((int(throwRange) * 10) / pow(math.sin(int(angle)), 2)) print("Velacity : ") print(score) def fun1(): throw...
# -*- coding: utf-8 -*- """ @author: <NAME> @license: Apache License, Version 2.0 Online handwriting features. """ import math import numpy as np from tools import mathutils def calculate_feature_vector_sequence(traj, args, delayed_strokes=None): """ Calculates all features named in args for each point in t...
import turtle import time import random wn = turtle.Screen() wn.title("TETRIS by @qiaw99") wn.bgcolor("black") wn.setup(width = 600, height = 800) wn.tracer(0) delay = 0.05 class Shape(): def __init__(self): self.x = 5 self.y = 0 self.color = random.randint(1, 7) # Block ...
import logging import os import sys from urllib.parse import urlparse import crayons import flywheel from .. import sdk_impl, console, util log = logging.getLogger(__name__) perror = util.perror def add_commands(subparsers, parsers): # Login login_parser = subparsers.add_parser('login', help='Login to a F...
# coding: utf-8 import sys import rarfile import argparse from os import path from collections import OrderedDict from traceback import format_exc from requests import exceptions from getsub.__version__ import __version__ from getsub.constants import PREFIX from getsub.downloader import DownloaderManager from getsub...
import numpy as np import json import time from sdirl.elfi_utils import * from sdirl.model import ObservationDataset from matplotlib import pyplot as pl from matplotlib.backends.backend_pdf import PdfPages import logging logger = logging.getLogger(__name__) class ExperimentResults(): def to_dict(self): ...
#!/usr/bin/env python3.4 # Author: <NAME> <<EMAIL>> # Description: The printing module import datetime import os import re import subprocess import sys import time import io try: from termcolor import colored except ImportError: print("Termcolor import failed") pass import lib.flags header_order = ['s...
import sys import os #import setuptools linkArgs = [] if sys.platform == 'win32': linkArgs = ['-static-libgcc'] #if sys.version_info[0] == 3: # linkArgs.append('-l python3.lib') #windows VC++ has really shocking c standard support so we need to include #custom stdint.h and intypes.h files from ht...
from .utils import Dataset from .utils import Selection from .utils import Ntuple from .utils import Cut from .utils import Weight from .utils import Action from .utils import Count from .utils import Histogram from .utils import Variation from ROOT import gROOT gROOT.SetBatch(True) from ROOT import TFile import os i...
#!/bin/python3 import scipy.stats import numpy as np from scipy.ndimage import gaussian_filter1d import pandas as pd from scipy import spatial, optimize, interpolate import matplotlib.pyplot as plt ## Description of the collection of functions def isUniformSpacing(vector): """Checks if the spacing is uniform...
from sqlalchemy import ForeignKey, Column, Integer, String, Enum, Boolean, Table, or_, and_, desc from sqlalchemy.orm import relationship, backref from sqlalchemy_utils import PasswordType from app import db # USER OBJECT === class User(db.Model): # Model metadata __tablename__ = 'users' # Model informa...
#!/usr/bin/env python from __future__ import print_function import os import sys import re import gzip import bz2 import argparse import logging import pickle from pickle import UnpicklingError desc = 'Transferring UniRef annotations by cluster cutoff' epi = """DESCRIPTION: Using an index of how UniRef50 clusters map ...
#Key bindings for rigcontroy.py #to use this file simply import keyDicts #or manually import only what you want even though #makeModeDict is smart enough to discard anything that isn't installed def rigDict(): rigDict= { 'mode':'rig', 'allFuncs':{ #'keyFuncs':{ 'esc':'es...
import discord import arrow from typing import List, Optional from discord.ext import commands as cmd from discord.ext import tasks as tsk from .utils import checks from .utils.converters import Truthy from .utils.discord_search import choose_item from string import ascii_letters, digits AVAILABLE_SETTINGS = [ "ce...
from concurrent import futures from functools import partial from pprint import pprint from pathlib import Path import subprocess as sp import itertools as it import datetime as dt import atexit import os import re from importlib_resources import read_text from invoke import task from jinja2 import Template shell ...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. """Provides a set of basic ...
#!/usr/bin/python3 # First choice pack and unpack into sqlite # <NAME> 2021 try: import sqlite3 except: print("Please install the sqlite3 module") print("\tit should be part of the standard python3 distribution") raise import common def FC2SQLquery( fld, fol_string ): # converts an first cho...
import torch.nn as nn from torch.nn import Parameter, ModuleList import torch.nn.functional as F import torch import multiprocessing import numpy as np import os from gym import spaces from torchvision.models import resnet18 from evkit.rl.utils import init, init_normc_ from evkit.preprocess import transforms import tor...
import torch import torch.nn as nn from tqdm import tqdm import json import os import gc from torch.utils.data import DataLoader import argparse from src.utils import setup_seed, multi_acc from src.pixel_classifier import load_ensemble, compute_iou, predict_labels, save_predictions, save_predictions, pixel_classifie...
### charts.py - NOAA Nautical CHARTS fetch ## ## Copyright (c) 2010 - 2022 Regents of the University of Colorado ## ## charts.py is part of CUDEM ## ## 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 th...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import glob import filecmp import shutil from multiprocessing import cpu_count import pytest from HinetPy import win32 username = "test_username" password = "<PASSWORD>" pwd = os.path.dirname(__file__) path = os.path.join(pwd, "data") data = os.path.join(path,...