text
stringlengths
6.04k
39.5k
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy import argparse import cv2 as cv import numpy as np import mediapipe as mp from utils import CvFpsCalc import sys from plyer import notification import tkinter as tk from tkinter import messagebox import tkinter.simpledialog as simpledialog import statistics ...
""" MIT License Copyright (c) 2017 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
import csv import math from sklearn.metrics import precision_score, recall_score, f1_score, jaccard_score import time import numpy as np import matplotlib.pyplot as plt import pandas as pd import torch from sklearn.utils import class_weight from torch import nn from torch.utils.data import DataLoader from model.DeepCo...
import base64 import inspect import json import logging import warnings from collections import defaultdict, namedtuple from enum import Enum, EnumMeta from types import FunctionType from typing import Union, get_type_hints from decouple import config from lpipe import kinesis, sentry, sqs from lpipe.exceptions impor...
from __future__ import print_function, division import numpy as np np.random.seed(1234) import time import matplotlib.pyplot as plt import os import tensorflow as tf tf.logging.set_verbosity(tf.logging.ERROR) tf.set_random_seed(1234) from tensorflow.keras.layers import Input, Dense, Reshape, Flatten, Dropout, ...
import os import numpy as np import scipy.misc import cv2 import scipy.ndimage from sys import platform SLASH = '/' if platform == "win32": SLASH = '\\' class Dataset(object): """The base class for dataset classes. To use it, create a new class that adds functions specific to the dataset you want t...
# -------------------------------------------------------- lattice ------------------------------------- import torch from torch import nn import numpy as np from collections import namedtuple from typing import List, Union, Set import tarfile from task.util import utils from tqdm import tqdm from torchtext import data...
#!/usr/bin/env python # -*- coding: utf-8 -*- """These functions provide some mechanisms for dealing with ISIS cube files. These functions are not comprehensive, and only seek to provide functionality that does not exist elsewhere. For example, there is already a GDAL driver for ISIS cubes, and access to the primary ...
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from ..loss import acc from ..post_processing import BeamSearch class PAN_PP_RecHead(nn.Module): def __init__(self, input_dim, hidden_dim, voc, ch...
# -*- coding: utf-8 -*- """Special collections types.""" from __future__ import annotations import functools import itertools from typing import List, Tuple, Any, overload, Sequence, MutableSequence, \ Generic, TypeVar, Type, Union, Optional, Iterable, Iterator, Mapping, \ Callable, ClassVar T = TypeVar("T"...
import functools import heapq import dynet as dy import numpy as np import trees from collections import defaultdict, OrderedDict from state import State START = "<START>" STOP = "<STOP>" UNK = "<UNK>" def augment(scores, oracle_index, aug=(0,1)): assert isinstance(scores, dy.Expression) correct_aug, incor...
from app import send_message from flask import Blueprint, render_template, redirect, abort, request, url_for, flash from flask import make_response, jsonify from flask_login import login_user, logout_user, login_required, current_user from flask_mail import Message from data import User, Tournament, League, Team, Game,...
from collections import OrderedDict from datetime import datetime import json import posixpath import random import threading import traceback import sys from mysos.common.cluster import get_cluster_path from mysos.common.decorators import logged from .launcher import ( EXECUTOR_CPUS_EPSILON, EXECUTOR_DISK_EPSILO...
"""GUI wrapper application around exiftool to rename photos based on their meta information. """ # Coding standards: http://www.python.org/dev/peps/pep-0008/ # Public import configparser import os import os.path import sys import time import tkinter import tkinter.font import tkinter.filedialog # Internal import e...
import os import json import platform import subprocess from pathlib import Path import consts.resource_paths import urllib.request from depthai_helpers import utils from model_compiler.model_compiler import download_and_compile_NN_model from consts.resource_paths import nn_resource_path as model_zoo_folder from depth...
# -*- coding: utf-8 -*- """Evaluation loops for KGE models.""" import dataclasses import logging from abc import abstractmethod from collections import defaultdict from typing import Any, Collection, DefaultDict, Generic, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union, cast import numpy import pandas import...
from copy import copy import logging _POINT_VALUES = {4, 5, 6, 8, 9, 10} log = logging.getLogger(__name__) class IllegalBetChange(TypeError): pass class IllegalBet(TypeError): pass class Strategy: def __init__(self, name, bankroll=0): self._name = name self._bankroll = bankroll ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # name: colors.py # author: <NAME> # email: <EMAIL> # created on: 02/23/2016 # # pylint: disable=unused-argument """ ext_pylib.terminal.colors ~~~~~~~~~~~~~~~~~~~~~~~~~ Functions for text effects and colors using ANSI esc...
import copy import os import pickle import random from typing import Dict, List from multiprocessing import Pool from functools import partial import torch from torch.distributions.geometric import Geometric from tqdm import tqdm from transformers import PreTrainedTokenizer from dataset.wiki_entity_path_v5 import Wik...
from ..base import * from . import catmull_clark import random import array class Model(TopLevelObject): def __getstate__(self): state = TopLevelObject.__getstate__(self) state["geom_obj"] = None state["_color"] = None state["_material"] = None return state def __s...
#!/usr/bin/env python3 ''' © 2014 <NAME> <<EMAIL>> ''' import sys, math, os, random, ctypes import sdl2, sdl2.sdlmixer, sdl2.sdlimage #from item import Item from being import Being import _map class s: ''' global state ''' #skip_intro = False skip_intro = True win_s = 'Turtle Crackers' win_w, win...
import numpy as np import matplotlib.pyplot as plt import torch import torch.nn.functional as F from torchvision import transforms,datasets from numba import jit import math import time import scipy.misc import os import sys from PIL import Image from setup_mnist_model import MNIST from setup_cifar10_model import CIFAR...
from .base import * class PickingCamera: def __init__(self): self._tex = None self._tex_peeker = None self._buffer = None self._np = None self._mask = next(camera_mask) self._pixel_color = VBase4() self._transformer = None UVMgr.expose("picking_ma...
import os import tensorflow as tf import argparse import numpy as np import cv2 import tensorflow.contrib.layers as layers from tensorflow.contrib.framework import arg_scope import models.resnet.resnet_utils as resnet_utils import train_helper import eval_helper import losses import datasets.reader as reader #import...
import sublime import sublime_plugin import datetime import re from pathlib import Path import os import fnmatch import OrgExtended.orgparse.node as node from OrgExtended.orgparse.sublimenode import * import OrgExtended.orgutil.util as util import OrgExtended.orgutil.navigation as nav import OrgExtended.orgutil.temp...
from typing import Callable, List, Union import Gnuplot from spectrum import Iterable, Spectrum def __fix_outpath( path: str, filename: str = None ) -> str: """ Simple wrapper to ensure that the output path sent to Gnuplot is properly formatted. The path returned works in both Linux and Windows systems....
""" Unit and regression test for the neutromeratio package. """ # Import package, test suite, and other packages as needed import neutromeratio import pytest import sys import os import pickle import torch from simtk import unit import numpy as np import mdtraj as md from neutromeratio.constants import device from ope...
# compile.py - Syntax driven compilation support for DHParser # # Copyright 2016 by <NAME> (<EMAIL>) # Bavarian Academy of Sciences an Humanities (badw.de) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
# Copyright 2014 Isotoma Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
import math from pathlib import Path from functools import partial import torch from torch import nn, einsum import torch.nn.functional as F from torch.autograd import grad as torch_grad from torch.utils.data import Dataset, DataLoader from torch.optim import Adam from torch.optim.lr_scheduler import LambdaLR from t...
from django.shortcuts import render from django.http import HttpResponse, JsonResponse from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator import os, requests, uuid, json import pandas as pd import numpy as np from io import BytesIO,StringIO import xlsxwriter i...
#!/usr/bin/env python3 import json import os import re import subprocess import sys import time from optparse import OptionParser from env import env try: # noinspection PyShadowingBuiltins, PyUnresolvedReferences input = raw_input except NameError: pass def _confirm_phase(): phase = env['common']['...
#!/usr/bin/env python3 ''' Docker runtime script: load /meta/taupage.yaml and run the Docker container ''' import argparse import base64 import boto.kms import boto.utils import functools import logging import pierone.api import pwd import requests import sys import subprocess import time import yaml import os import ...
#!/usr/bin/env python """ Script name: Create3DDAT.py Author: JO'N, CEMAC (University of Leeds) Date: March 2018 Purpose: Generate input file to CALMET from NAM met data Usage: ./Create3DDAT.py <date> <date> - Start date of NAM data in format YYYYMMDD, e.g. 20171204 Output: File written to <root>/NAM_data/proce...
import itertools as it import json from typing import Any, Dict, List, Tuple import numpy as np import pandas as pd from pytorch_lightning.metrics.metric import Metric from sklearn.metrics import accuracy_score, precision_recall_fscore_support from src import utils as sutils from src.postprocessing.document_merger imp...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright 2017 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
import os import time import numpy as np import pandas as pd from shutil import copyfile import h5py from nibabel import load as load_nii import nibabel as nib from keras.models import load_model from keras.callbacks import EarlyStopping, CSVLogger, ModelCheckpoint, LambdaCallback from keras.utils.np_utils import to_ca...
# -*- coding: utf-8 -*- """Tests for the model module""" import copy import itertools import math import os import random import statistics from collections import namedtuple from itertools import zip_longest import pytest from bach_generator.src import model # pylint: disable=protected-access INPUTS_OUTPUTS_TEST_...
#Import dependencies import os, json, sys, random, re, time #Check for dependencies try: from tqdm import tqdm except Exception: os.system("python3 -m pip install tqdm") from tqdm import tqdm try: import requests except Exception: os.system("python3 -m pip install requests") import requests try...
# -*- coding: utf-8 -*- """ The features module. Extract useful features for training the model. Created by <NAME> on 2020-09-25 22:26:54 """ import bisect import functools as ft import logging import random import typing as t import pandas as pd import sklearn.model_selection from . import perf logger = logging....
""" Title: 3D Image Classification from CT Scans Author: [<NAME>](https://twitter.com/hasibzunair) Date created: 2020/09/23 Last modified: 2020/09/23 Description: Train a 3D convolutional neural network to predict presence of pneumonia. """ """ ## Introduction This example will show the steps needed to build a 3D convo...
from lectura import * from globales import * from copy import * # Funcion principal para obtener una # direccion de memoria en el mapa_memoria def extraerMemoria(direccion): contexto = len(dir_memoria) - 1 # Itera sobre todos los contextos while contexto >= 0: tipoVariable = len(dir_memoria[contexto]) - 1 ...
"""Graphical User Interface Module This module is responsible for creating and interacting between different menus. It contains methods responsible for making button or displaying label, animating them. Here is defined size (width, height) of application. It chains elements showed to user with proper functions from ot...
""" TCKDB backend app schemas non-physical species (np_species) module """ from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union from pydantic import BaseModel, Field, validator, constr, conint try: from rmgpy.molecule.adjlist import from_adjacency_list except ImportError: ...
############################################################ # Copyright (c) 2015-now, TigerGraph Inc. # All rights reserved # It is provided as it is for benchmark reproducible purpose. # anyone can use it for benchmark purpose with the # acknowledgement to TigerGraph. ###############################################...
""" This module implements a Flask-based JSON API to talk with the annotation store via the Annotation model. It defines these routes: * Root * Index * Create * Read * Update * Delete * Search * Raw ElasticSearch search See their descriptions in `root`'s definition for more detail. """ from __future__ i...
# coding: utf-8 from __future__ import absolute_import from __future__ import division import dbmail import json import logging import django.core.exceptions from django import http from django.contrib import messages from django.core.urlresolvers import reverse from django.conf import settings from django.dispatch i...
# coding: utf-8 import torch from torch.nn import functional as F import torch.utils.data import torch.utils.data.distributed from torch import autograd import numpy as np from torch.autograd import Variable from torch import nn import torchvision from torchvision import transforms import sys class Trainer(object): ...
# Copyright 2019 United Kingdom Research and Innovation # Author: <NAME> (<EMAIL>) # -*- coding: utf-8 -*- """LowerRankApproximation of a matrix. """ import math import numpy import numpy.linalg as nla import scipy.linalg as sla from ..core.solver import Options from ..algebra.dense_matrix import AMatrix from .part...
# Dynamic Troop Trees by Dunde, modified by Caba'drin. from header_common import * from header_presentations import * from header_mission_templates import * from ID_meshes import * from header_operations import * from header_triggers import * from module_constants import * # from header_items import * # Added for Sh...
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. import numpy as np import popart import os from collections import deque import time import glob from ipu_sampler import IpuBucketingSampler from common.data.dali.data_loader import DaliDataLoader from common.data.text import Tokenizer from rnnt_refer...
import socket import selectors import logging import sharpy.io.message_interface as message_interface import sharpy.io.inout_variables as inout_variables import sharpy.utils.settings as settings import sharpy.io.logger_utils as logger_utils sel = selectors.DefaultSelector() logger = logging.getLogger(__name__) clien...
""" Copyright 2013 Parse.ly, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
# import gc from typing import Tuple import bottleneck import numpy as np import scipy.sparse as spr import scipy.stats as sts from scipy.signal import fftconvolve from triku.logg import TRIKU_LEVEL from triku.logg import triku_logger # import logging # from tqdm import tqdm # from triku.genutils import TqdmToLogger...
# CMPUT 291 - Mini Project 2 # Group 13 - <NAME>, <NAME>, <NAME> # Phase 3 # Last Change By: Ken # Time Changed: Apirl 2 - 2:03AM # ---- from bsddb3 import db #Get an instance of BerkeleyDB import xml.etree.ElementTree as ET def XMLformatter(byteTweetXML): root = ET.fromstring(byteTweetXML) dateString = "Created o...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) import numpy as np import scipy.stats as scistats import acor import matplotlib.pyplot as plt try: import cPickle as pickle except ImportError: import pickle # Log-spaced frequncies def linBinnin...
# from statsmodels.tsa.stattools import arma_order_select_ic # from statsmodels.tsa.stattools import adfuller as ADF # from statsmodels.tsa.statespace.sarimax import SARIMAX # from statsmodels.tsa.seasonal import seasonal_decompose # from statsmodels.tsa.arima.model import ARIMA # from statsmodels.graphics.tsaplots imp...
# !/usr/bin/env python import arcpy import os from arcpy import env from Includes import load_depth_string from Includes import NetCDFFile from Includes import raster_to_xyz import pandas as pd import gc import numpy as np import time import multiprocessing from functools import partial import shutil impo...
## -------------------------------------- ## ## Client Connections ## connects clients ## -------------------------------------- ## from Constants import * import json import socket from PokemanClass import Pokeman from StatClass import Stats from MoveClass import Move from random import randint from BattleClass impor...
#!/usr/bin/env python3 # # Analyses the result of the bipartite matching between adjacent time # steps. There are numerous interesting cases here: # # 1) One-to-one matches: There is exactly one match between two # coordinates in the data. This is the most regular match we # may hope for. It indicates that ...
from __future__ import print_function from utils.config import * import sys sys.path.insert(0, caffe_dir + 'python/') import caffe from caffe import layers as L, params as P, to_proto from caffe.proto import caffe_pb2 import pdb import os import stat base_prototxt_file = 'prototxt/' class caffe_net(object): def __...
# vim:set ff=unix expandtab ts=4 sw=4 from typing import List, Tuple, Dict, Callable, Tuple, Any from sympy import sin, exp, symbols, Matrix, Symbol, Function, solve, Eq, log, Expr, lambdify from .TimeStep import TimeStep import numpy as np from scipy.integrate import quad from scipy.interpolate import interp1d from ...
import re import time import locale import calendar import math import operator from itertools import tee, islice from collections import defaultdict from polyglot.text import Text import dateparser import logging import string import datetime as dt from measurement.base import MeasureBase from measurement.measures imp...
import json from enum import IntEnum from threading import Lock import numpy as np from club_controller import app_config from club_controller.audio_udp_server.dsp import interpolate from club_controller.audio_udp_server.filters import ExpFilter from club_controller.misc.config_manager import config_manager from club_...
# -*- coding: utf-8 -*- """ Created on Wed Aug 8 16:37:29 2018 ------------------------------------------------------------------------------- =============================== VarNet Library ================================ ------------------------------------------------------------------------------- Author...
import copy import logging import six import pandas as pd import numpy as np from ..objects import ColumnDataSource, Range1d, FactorRange, GridPlot, Widget, DataSource from ..widgetobjects import Select, MultiSelect, InputWidget #crossfilter plotting utilities from .plotting import (make_histogram_source, make_factor...
#!/usr/bin/env python3 # coding:utf-8 """ this module to write channel info to apk which signing with scheme v2 """ __author__ = '<NAME>' import os, unittest, logging, getopt, sys logging.basicConfig(level=logging.INFO, format='%(levelname)s\t\t%(asctime)s' + '\t\tApkV2ChannelsTools\t%(message)...
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse import getpass import inspect import os import random import re import time from collections import OrderedDict...
from antlr4 import * from autogen.CymbolParser import CymbolParser from autogen.CymbolVisitor import CymbolVisitor import struct def printError(ctx): print("erro: operador '", ctx.op.text, "' na linha", (ctx.op.line), ",coluna", (ctx.op.column), "indefinidos para os tipos") def round_hex(c): return s...
"""Beam pipeline helper for converting satellite data.""" from __future__ import absolute_import import datetime import json import logging import pathlib import re from typing import Tuple, Dict, Any, Iterator, Iterable import apache_beam as beam from pipeline.metadata.beam_metadata import DateIpKey, IP_METADATA_P...
import numpy as np import torch import pickle from libs.utils.utils import * import libs.utils.utils_MIL as utils_MIL import os from libs.datagen.dataset_generic import save_splits from sklearn.metrics import roc_auc_score from libs.model.model_mil import MIL_fc, MIL_fc_mc from libs.model.model_clam import CLAM class...
# -*- coding: utf-8 -*- """ResNet-101 model for Keras. # Reference: - [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385) Slightly modified Felix Yu's (https://github.com/flyyufelix) implementation of ResNet-101 to have consistent API as those pre-trained models within `keras.application...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2018-02-23 07:01:55 # @Author : <NAME> & <NAME> (<EMAIL>) # @Link : http://iridescent.ink # @Version : $1.0$ import os import sys import h5py import numpy as np import torch as th import pickle as pkl import scipy.io as scio from torchsar import SarData, S...
from typing import List import pandas as pd import plotly.graph_objs as go from dash import Dash import dash_core_components as dcc import dash_html_components as html import dash_table from dash.dependencies import Input, Output GOOGLE_SHEETS_URL = "https://docs.google.com/spreadsheets/d/e/{}&single=true...
import os, shutil from copy import deepcopy from collections import OrderedDict import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.manifold import TSNE from sklearn.cluster import DBSCAN from sklearn.mixture import GaussianMixture from pypospack.pyposmat.data import PyposmatDataFile...
import sqlite3 import functools from flask import ( Flask, Blueprint, flash, redirect, render_template, request, session, url_for ) from werkzeug.security import check_password_hash, generate_password_hash from werkzeug.exceptions import abort from datetime import datetime from foodhubsg.classes import Food, Vendo...
from __future__ import print_function, division from skimage import io, color from skimage.transform import rescale, resize, downscale_local_mean from keras.datasets import mnist from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization from keras.layers import Input, Dense, Reshape, F...
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import itertools import statistics from typing import List, Tuple import cv2 import numpy as np from line_mapper import LineMapper from refine_point import refine_point from sudoku.solver import load_image, cut_out_field, find_corners, perspective_transform_co...
import numpy as np import time import warnings warnings.filterwarnings("ignore") def get_internal_processing_config(): return { "image_buffer": { "name": "Image history", "value": 100, "limits": [10, 10000], "type": int, "text": None, },...
import numpy as np from numpy.core.einsumfunc import _parse_einsum_input import mygrad as mg from mygrad import Tensor from .ops import * __all__ = ["multi_matmul", "matmul", "einsum"] def matmul(a, b, constant=False): r""" Matrix product of two tensors: ``matmul(x, y)`` is equivalent to ``x @ y``. ...
import torch from torch import nn as nn from torch.nn import functional as F from basicsr.models.archs.model import Backbone,MobileFaceNet from basicsr.models.archs.arch_util import (DCNv2Pack, ResidualBlockNoBN, make_layer) class PCDAlignment(nn.Module): """Alignment m...
""" Check whether automated model documentation template generation works """ import atomica as at import numpy as np def test_program_scenarios(): P = at.demo("tb", do_run=False) # Get the default values for coverage etc. instructions = at.ProgramInstructions(2018) res_baseline = P.run_sim(result_...
from functools import partial from typing import List, Callable, Optional import torch import torch.nn.functional as F from equideepdmri.utils.spherical_tensor import SphericalTensor, SphericalTensorType from equideepdmri.utils.q_space import Q_SamplingSchema from equideepdmri.layers.filter.utils import normalized_sh...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 <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/LICE...
import csv import jinja2 import json import os import requests from collections import defaultdict from copy import deepcopy from io import StringIO from jinja2 import PackageLoader from sqlalchemy.engine import Connection from sqlalchemy.sql.expression import bindparam from sqlalchemy.sql.expression import text as sq...
import os import random import sys import glob import librosa import keras import tensorflow as tf import librosa.display import matplotlib.pyplot as plt import numpy as np import pandas as pd import json from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import StratifiedShuffleS...
import abc import contextlib import functools import logging import shutil import socket import tempfile from typing import Any, Callable, Dict, List, Optional import determined as det from determined import constants, horovod, ipc class TrialContext(metaclass=abc.ABCMeta): """ TrialContext is the system-pro...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020-2021 by <NAME>. All rights reserved. This file is part # of the Robot Operating System project, released under the MIT License. Please # see the LICENSE file included as part of this package. # # author: <NAME> # created: 2020-08-05 # modified: 2020-0...
""" hymie.hymie ~~~~~~~~~~~ Internal operation. :copyright: 2020 by hymie Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import functools import pathlib from datetime import datetime from typing import Dict from flask import Flask, url_for from flask_emai...
"""KWCNN descriptor generator definition.""" import os import io import itertools import logging import multiprocessing import multiprocessing.pool import numpy import PIL.Image import PIL.ImageFile # noinspection PyUnresolvedReferences from six.moves import zip from smqtk.algorithms.descriptor_generator import Descr...
# -*- coding: utf-8 -*- import sys,os import imageio as io import numpy as np import matplotlib.pyplot as plt from PyQt5.QtWidgets import QApplication, QDialog, QLabel, QPushButton,QWidget,\ QLineEdit,QFileDialog, QStatusBar,QCheckBox,QMessageBox from PyQt5.QtCore import QTimer from PyQt5 import ui...
#!/usr/bin/env python """ Usage: dgui.py [OPTIONS] INPUT_FILE Text based user interface to dgasm and dgsim. This script accepts one parameter (INPUT_FILE) that is the .dsf file to go through the compilation procedure. Options: -o, --output_file PATH Optionally sets the output file --help ...
import os import argparse from pdtb2 import CorpusReader from utils import * SELECTED_SENSES_PDTB2 = set([ 'Temporal.Asynchronous', 'Temporal.Synchrony', 'Contingency.Cause', 'Contingency.Pragmatic cause', 'Comparison.Contrast', 'Comparison.Concession', 'Expansion.Conjunction', 'Expansion.Instantiation', '...
import unittest import numpy as np import dtmm.wave as wave import dtmm.conf rtol, atol = (1e-05,1e-08) if dtmm.conf.PRECISION == "double" else (1e-3,1e-4) def allclose(a,b): return np.allclose(a,b, rtol = rtol, atol = atol) class TestWave(unittest.TestCase): def allclose(self,a,b): self.assertTr...
from os import getenv import pymssql import pyjson2 import plotfi #server = getenv("SRVTSTVITARD\SQLEXPRESS") #server = "SRVTSTVITARD" #user = "Lab" #password = "<PASSWORD>" #password = getenv("<PASSWORD>") #conn = pymssql.connect(server, user, password, "<PASSWORD>") #cursor = conn.cursor() ''' cursor.execute(""" IF ...
#------------------------------------------------------------------------------- # isobar: a python library for expressing and manipulating musical patterns. #------------------------------------------------------------------------------- import sys import copy import random import inspect import itertools import iso...
# """ Python tools for creating the MIRI MRS 1d extraction reference files (extract1d and apcor). This is the ASDF variant Author: <NAME> (<EMAIL>) REVISION HISTORY: 12-Feb-2020 First written (D. Law) 27-Sep-2020 Add in extract1d file as well (D. Law) 29-Oct-2020 Convert to asdf output (D. Law) 04-Dec-2020 Change...
from numba import njit, prange import numpy as np from openamundsen.modules.radiation import shadows def slope_aspect(dem, res): """ Calculate terrain slope and aspect using Horn's formula. Parameters ---------- dem : ndarray Terrain elevation (m). res : float DEM resolution ...
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
''' yukun 20210801 ''' import torch.nn.functional as F import argparse import logging import os import torch import numpy as np import pandas as pd from tqdm import tqdm from model import Discriminator, Segmenter from dataset import SEDataset_out from torch.utils.data import DataLoader from torchvision.utils import sa...