text
stringlengths
6.04k
39.5k
from __future__ import division import sys import os import random import argparse from pathlib import Path import torch from torch.utils import data import numpy as np from tqdm import tqdm from models import get_model from datasets import get_dataset from loss import * from utils import * from buffer import createB...
""" CEUS -- Data processing support for Commercial End-Use Survey data This program takes CEUS data and NOAA weather and generate loadshapes and temperature sensitivities for the various forecasting climate zones, building types, and end-uses in the CEUS data set. xls -----------------+ +---> en...
from enum import Enum, IntEnum from .._version import get_versions_with_clean class ReferenceTypesSpecification(Enum): FORMAT_VERSION = get_versions_with_clean()['clean_version'] class RecorderNumber(IntEnum): AVL = 1 IKA = 2 DLR = 3 class RoadLocation(IntEnum): TODO = 0 URBAN = 1 ...
import mmcv import numpy as np import os.path as osp import cv2 import matplotlib.pyplot as plt import random import argparse import cv2 import torch from torch.utils.data import Dataset import numpy as np # from tensorboardX import SummaryWritter from pysot.core.config import cfg from pysot.models.model_builder impor...
import os from random import randint from collections import OrderedDict from multiprocessing import Pool, TimeoutError, Lock import numpy as np import mmgroup from mmgroup import structures, MM0, MMV from mmgroup.mat24 import vect_to_cocode from mmgroup.mm_space import MMSpace from mmgroup.generators import gen_leec...
# General Packages from math import atan2, degrees from datetime import datetime from pathlib import Path import time import pprint import numpy as np import pandas as pd import pickle # Plotting import matplotlib.pyplot as plt import matplotlib.ticker as mtick from matplotlib.dates import date2num import seaborn as s...
''' Proximal policy optimization with a few tricks. Adapted from the implementation in baselines. ''' import pickle import pathlib import os.path as osp import time import joblib import numpy as np from baselines import logger from collections import deque import tensorflow as tf import horovod.tensorflow as hvd import...
# -*- coding: utf-8 -*- ########################################################################## # NSAp - Copyright (C) CEA, 2019 # 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 #...
""" garmin.com access for exporting data files """ import http.cookiejar import json import logging import re import urllib.error import urllib.parse import urllib.request import gceutils log = logging.getLogger(__name__) LIMIT_MAXIMUM = 1000 def query_garmin_stats(): log.debug("Getting display name and us...
import re import bempp.api import os import numpy as np import time import pbj.electrostatics.mesh_tools.mesh_tools as mesh_tools import pbj.electrostatics.utils as utils import pbj.electrostatics.pb_formulation as pb_formulation class solute(): """The basic Solute object This object holds all the solute info...
#!/usr/bin/env python # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # ''' Hartree-Fock for periodic systems at a single k-point See Also: pyscf.pbc.scf.khf.py : Hartree-Fock for periodic systems with k-point sampling ''' import sys import time import numpy as np import h5p...
import re import numpy as np import pandas as pd from nltk import WordNetLemmatizer import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from src.embeddings import load_vocab, load_embeddings def find_all_num(data): all_ch_c = len(data) i = 0 all_nums = set() while i <...
from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F from torchvision import models from torch.autograd import Variable from orn.backbone.resnet_based import resnet_two_heads import numpy as np import random from orn.orn_two_heads.encoder import EncoderMLP from orn.or...
from tkinter import * import tkinter.font as tkFont from tkinter import messagebox import mysql.connector import sys, os, dlib, glob, numpy import cv2 from skimage import io import time from PIL import ImageFont, ImageDraw, Image from functools import partial # cv2顯示中文字 # 使用 PIL # paint_chinese_opencv(影像, 文字, 座標, 字...
import pydgm import numpy as np import sys import matplotlib.pyplot as plt import time class XS(): # Hold the cross section values with routines for outputting to txt file def __init__(self, nFG, nCellPerPin, sig_t, sig_f, chi, sig_s, mu=None): order, _, G, nMat = sig_t.shape self.sig_t = s...
# MIT license # <EMAIL> import OpenGL from OpenGL.GL import * from OpenGL.GLU import * from .math import * from .tool import * from .qt import * from . import gl import time import sys class Camera(object): def __init__(self, owner): self.owner = owner # frame/pivot self.frame = Ri...
import pygame from random import randint import math SCREEN_WIDTH = 900 SCREEN_HEIGHT = 900 FPS = 30 GAME_FINISHED = False BALLS = [] GAME_SCORE = 0 GHOST_TIME = 0 GAME_TIME = 1000 REMAINING_TIME = GAME_TIME WHITE = (255, 255, 255) WHITE_ALPHA = (255, 255, 255, 0) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255,...
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
#!/usr/bin/python2 import sys import time #INIT import os os.environ['QT_API'] = 'pyqt5' #/INIT from PyQt5 import QtGui from PyQt5.QtCore import pyqtSlot, QTimer, Qt from PyQt5.QtGui import QColor, QTextCursor from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QTreeWidgetItem, QHeaderView from PyQt5...
# -*- coding: utf-8 -*- """ @author: <NAME> """ # TODO: add execption handling from __future__ import print_function from termcolor import colored import os import numpy as np import matplotlib.pyplot as plt from PIL import Image as imgop import imageio from glob import glob import json import random from tqdm import ...
# -*- coding: utf-8 -*- from __future__ import division import os import pandas import numpy as np from particletools.tables import PYTHIAParticleData from . import constants as cst from . import qcd _srcdir = os.path.dirname(__file__) # Meson properties # ---------------- # Special cases for K_S0 and K_L0 _k0_co...
import numpy as np import read_data as rd import visualizations as viz import matplotlib.pyplot as plt import argparse import pandas as pd # sklearn imports, may need to add more to use different models import sklearn import sklearn.ensemble import sklearn.linear_model def model(timestamps, predictors, classes, ...
from __future__ import print_function import os, pdb from . import Utils def Main( ATMO ): # First make the ATMO input file: out_str = '&PARAM\n' out_str += 'Debug = {0}\n'.format( int( ATMO.Debug ) ) out_str += 'fout = "{0}"\n'.format( str( ATMO.fout ) ) out_str += 'fin = "{0}"\n'.format( str( AT...
import warnings warnings.filterwarnings("ignore") import click import pandas as pd import numpy as np from snakemake import shell from random import randint from mgefinder import fastatools, embosstools, pysamtools, sctools from os.path import basename, join, dirname from Bio import SeqIO import pysam from collections ...
import numpy as np import cv2 from PIL import Image import random from yolo.preprocessing import lut_int8 import os from functools import partial def autodetect_size(num_pixels): supported_resolutions = [(1920,1080), (1280,720), (1024,768), (800,600), (640,480), (320,240), (1152,1152)...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import atexit import hashlib import logging import os import os.path import random import re import subprocess import sys import tempfile import threading im...
#!/usr/bin/python # coding=utf-8 from __future__ import print_function import numpy as np import time from scipy import ndimage import math from sklearn.cross_validation import train_test_split from sklearn.cross_validation import KFold import os import glob # from scipy.misc import imread, imresize import cPickle as ...
""" Basic calculations of sequence statistics. """ # XXX keeping this free of PB dependencies from collections import namedtuple, defaultdict import functools import logging import time import copy import math import sys import numpy as np from pbcore.util.statistics import accuracy_as_phred_qv log = logging.getLo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #**************************************************************************************************************************************************** # Copyright 2017 NXP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifi...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Coordinator for PID protocol. Handles prepare, match, and combine. Usage: pid_coordinator shard <input_path> <...
# encoding:utf-8 # from dataset.data import read_image # 图片读取方法,可以自己写,我是用的baseline里自带的 from data.datasets.dataset_loader import read_image import os import torch import numpy as np import json # from evaluate import eval_func, euclidean_dist, re_rank # 计算距离以及rerank,均是来自baseline import torchvision.transforms as T from...
""" sui ~~ The user interface for Conway's Game of Life. """ from abc import ABC, abstractmethod from os import listdir from copy import deepcopy from time import sleep from typing import Any, List, Optional, Sequence from blessed import Terminal from life.grid import Grid # Complex type aliases for type hints. Se...
import numpy as np import rllab.misc.logger as logger from rllab.sampler import parallel_sampler from rllab.sampler.base import Sampler from rllab.misc import ext from rllab.misc import special from rllab.misc import tensor_utils from rllab.algos import util def local_truncate_paths(paths, max_samples): """ ...
# ------------------------------IMPORTS------------------------------ from . import nyaa from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QMessageBox, QDialog, QInputDialog, QLineEdit from PyQt5.QtCore import Qt, QThread, pyqtSignal from winotify import Notification, audio from shutil import mo...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021/9/29 15:28 # @Author : Jun """ CUDA_VISIBLE_DEVICES=7 python boosting.py --eval_model_path checkpoint/fsd_all_npy/seg_350/2021-10-02_02-29-17 -k 10 --config configs/ctrgcn-fsd-train.yaml --seg 350 -b 1 """ import os import paddle import pandas a...
from random import randrange import random import string import re import inflect from Templates import temps from ReportTemplate import report, dictionary, hyperlink, collapse import operator TAG_RE = re.compile(r'<br>|</b>') p = inflect.engine() def count_placeholders(fmt): count = 0 L = string.Formatter(...
""" Contains methods for sequentially computing features of trips between various regions within a city over time. The implementation in this class is a simple grid of regions, but this behavior can easily be overridden in child classes (such as regions.py) Created on Sat May 3 12:33:42 2014 @author: <NAME> (<EMAIL>...
#!/usr/bin/python # encoding: utf-8 """ @author: Ian @contact:<EMAIL> @file: model3.py @time: 2019/2/27 14:48 """ import pandas as pd from mayiutils.file_io.os_wrapper import OsWrapper as osw from mayiutils.file_io.pickle_wrapper import PickleWrapper as pkw import numpy as np import cv2 from keras.utils import np_util...
#!/usr/bin/env python import argparse from mountaintools import client as mt import os import json import numpy as np import spikeextractors as se from spikeforest import mdaio from spikeforest_analysis import bandpass_filter import mlprocessors as mlpr from spikeforest import SFMdaRecordingExtractor, SFMdaSortingEx...
import os import pickle import random import time import numpy as np from torch.utils import data from tqdm import tqdm from .loaders import list_pkl_filenames, list_pkl_filenames_from_prepared def add_freq_channel(confmap, radar_data): # confmap [n_class, W, h, w] # radar_data [2, W, h, w] energy = np...
import json import logging import re import SoftLayer from jumpgate.common import config from jumpgate.common import error_handling from jumpgate.common import utils LOG = logging.getLogger(__name__) # This comes from Horizon. I wonder if there's a better place to get it. OPENSTACK_POWER_MAP = { "NO STATE": ...
import numpy as np import pandas as pd import seaborn as sns import os from pathlib import Path import seaborn as sns import matplotlib.pyplot as plt from multiprocessing import Pool import torch from src.data.data_utils import load_train_test_ims, load_train_test_femto from src.models.utils import ( test_metrics_...
# importing the necessary libraries import matplotlib.pyplot as plt import pandas as pd import re import random import math import numpy as np random.seed(10) """ Read text data from file and pre-process text by doing the following 1. convert to lowercase 2. convert tabs to spaces 3. remove "non-word" characters Store...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sat Dec 1 19:41:48 2018 @author: masonng To make a movie (using FFMpeg) by stitching together images of: 1) Count rate from each of the FPMs - need to use a colorbar to show counts! See if I can add in the image from the NICER Mission Guide https:/...
""" Import as: import oms.broker as ombroker """ import abc import collections import logging from typing import Any, Dict, List, Optional, Tuple, cast import pandas as pd import helpers.hasyncio as hasynci import helpers.hdbg as hdbg import helpers.hsql as hsql import market_data as mdata import oms.oms_db as ooms...
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import optim from HParams import HParams from models_AAE import DecoderAAE, EncoderAAE, InnerDecoder, InnerEncoder TINY = 1e-15 class SketchAAE(): def __init__(self, hp: HParams): se...
import face_recognition from PIL import Image, ImageDraw import numpy as np from sklearn.svm import LinearSVC import glob import os import matplotlib.pyplot as plt ''' Draw box on all face_locations of an image ''' def draw_face_box(image, face_locations): # Convert the image to a PIL-format image pil_ima...
"""Interval and NumericSet classes with methods to work with numeric intervals. Interval methods ---------------- get_formatted - return formatted interval as a string is_overlapping - determine whether intervals overlap is_almost_overlapping - determine whether intervals almost overlap...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 Intel Corporation, 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.or...
# -*- coding: utf-8 -*- """ Created on Fri Oct 27 20:31:43 2017 @author: nbody Modified by <NAME> @ 2020 """ import csv import pickle from pathlib import Path from time import perf_counter from typing import Dict import numpy as np import pandas as pd from tqdm import tqdm from recodiv.triversity.utils import norma...
import logging import sys import time import zipfile from collections import OrderedDict import dill as pickle from mcpack import ( Advancement, DataPack, FunctionTag, LootTable, Recipe, Structure, ) from .functions import * from .items import * from .namespaced import Namespaced from .order_f...
"""Estimators for compressed sensing""" # pylint: disable = C0301, C0103, C0111, R0914 import os import sys import copy import tensorflow as tf import numpy as np import utils import scipy.fftpack as fftpack sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from celebA_dcgan import model_def as celebA_...
import sys, os, re, time, math, copy import alignlib import ProfileLibrary from AddaModule import AddaModuleRecord import SegmentedFile import AddaProfiles import AddaIO import cadda class AddaAlign( AddaModuleRecord ): """align domains and check if similarity is sufficient to infer homology. Homology bet...
"""Assortment of layers for use in models.py. Author: <NAME> (<EMAIL>) """ import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from util import masked_softmax class Embedding(nn.Module): """Embedding layer used by BiDAF...
import json import logging import numpy as np import pandas as pd from pathlib import Path import matplotlib import matplotlib.pyplot as plt import seaborn as sns from biclust_comp.analysis import accuracy_utils as acc_utils from biclust_comp.analysis import plots from biclust_comp import logging_utils from biclust_co...
# coding: utf-8 # Copyright (C) 2016 UKP lab # # Author: <NAME> (ukp.tu-darmstadt.de/ukp-home/) # import os import ast, json import numpy as np np.random.seed(1) from keras import layers, models, optimizers from keras import backend as K from keras import regularizers import tqdm from core import embeddings from grap...
from components.security.encryption import encryption_tools from components.security.encryption.encryption_tools import HashedMessage from components.security.certification.certificates import EcuCertificate from tinytree import Tree from enums.sec_cfg_enum import CAEnum, AsymAuthMechEnum, AuKeyLengthEnum, \ HashMe...
import base64 import os import struct import asyncio import logging import zlib from datetime import date from concurrent.futures.thread import ThreadPoolExecutor from io import BytesIO from typing import Optional, Iterator, Tuple, Callable from binascii import hexlify, unhexlify from lbry.crypto.hash import sha512, ...
"""This module defines LoopPulseTemplate, a higher-order hierarchical pulse template that loops another PulseTemplate based on a condition.""" from typing import Dict, Set, Optional, Any, Union, Tuple, Generator, Sequence, cast import warnings import sympy from cached_property import cached_property from qupulse.se...
#!/usr/bin/env python3 import re import begin import sys import math import time import mido import pyaudio import json from collections import namedtuple from enum import Enum RawNotePlay = namedtuple('RawNotePlay', 'midi_num, sec') RbNotePlay = namedtuple('RbNotePlay', 'midi_num sec_64') RbTune = namedtuple('RbTune...
# -*- coding: utf-8 -*- """ Created on Thu Oct 4 13:30:06 2018 @author: gregz """ import time import numpy as np import os.path as op import glob import warnings from astropy.io import fits from utils import biweight_location from scipy.signal import savgol_filter, medfilt2d from scipy.interpolate import interp1d, i...
from manimlib.imports import * from typing import Tuple from copy import deepcopy from lib.proof import Spacing, ProofData, ProofScene from lib.constants import * proof_one = ProofData( nodes = [ #1 f"[b<B {TIMES} A>]^z", f"[b<B {TIMES} A>]^z", #2 "b<A>", "...
import os, re, sys, shutil import subprocess as sp import random, string import numpy as np from .utils import * #DEBUG=False # load package locations from yaml file, watch! global dict package_locs = load_package_locations() def pfunc(seq, package='vienna_2', T=37, constraint=None, motif=None, linear=False, ...
import itertools from soap import logger from soap.analysis.core import ( Analysis, AnalysisResult, thick_frontier, sample_unique ) from soap.context import context from soap.expression import ( expression_factory, FixExpr, UnaryExpression, TernaryExpression, is_variable, GenericExecuter ) from soap.semant...
import torch as tr import sys, time import pickle as pk sys.path.append('../../envs') from blocks_world import BlocksWorldEnv, random_thing_below import block_stacking_problem as bp import neural_virtual_machine as nv from abstract_machine import make_abstract_machine, memorize_problem from nvm import virtualize from r...
from datetime import datetime import tensorflow as tf import os import numpy as np from typing import List class TransferVGG(object): @classmethod def get_model(cls, img_w=256, img_h=256, decoding_start_f=512, keep_last_max_pooling=True, fine_tuning=True): vgg: tf.keras.Model = tf.keras.applications...
# Copyright (C) 2017 TU Dresden # Licensed under the ISC license (see LICENSE.txt) # # Author: <NAME> from __future__ import print_function import numpy as np import numba as nb import cvxpy as cvx import math import random from os.path import exists import json # import fjlt.fjlt as fjlt #TODO: use fjlt to (automati...
import argparse import json import logging from dataclasses import dataclass from pathlib import Path from typing import List, Dict, Any, Tuple, Optional import numpy as np import pandas as pd from timeeval import Algorithm, Status, Datasets, Metric from timeeval.adapters.docker import SCORES_FILE_NAME as DOCKER_SCOR...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Cross-validation helper script for the PerceptualMetric. """ from perceptree.perceptree_main import * import datetime from dateutil.relativedelta import relativedelta import itertools import logging import os import pathlib import re from typing import Dict, Optiona...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Functions to read and compute lookup tables The available lookup tables are **qpebias_station** : dict with the bias correction of RZC at every station **cosmo1_to_rad** : dict which maps COSMO grid to polar radar grid it has keys [sweep][coord_type], coord_type is...
#!/usr/bin/python # ======================================================== # Python script for PiBot-A: maze solver # Version 1.0 - by <NAME> - www.retas.de # ======================================================== # ----------------- TERMINOLOGY OF NODES ----------------- # # --|-- crossing, + # # --| T-...
import mmd_scripting.core.nuthouse01_core as core import mmd_scripting.core.nuthouse01_packer as pack import mmd_scripting.core.nuthouse01_pmx_parser as pmxlib import mmd_scripting.core.nuthouse01_pmx_struct as pmxstruct from mmd_scripting.overall_cleanup import alphamorph_correct from mmd_scripting.overall_cleanup imp...
from typing import List from catalogsources.admin.forms import ( GamesImportForm, PlatformsImportForm, SingleFetchedGameImportForm, SingleFetchedPlatformImportForm, SingleGameImportForm, SinglePlatformImportForm, ) from catalogsources.apps import CatalogSourcesConfig from catalogsources.manager...
#!/usr/bin/env python # Copyright (c) 2012 Mandiant # Copyright (c) 2019-2020 Siemens AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
# Copyright 2021 DeepMind Technologies 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 agre...
#! -*- coding: utf-8 -*- # 自定义层 import numpy as np import tensorflow as tf import keras.backend as K from keras.layers import * from keras.models import Model from functools import partial import json from kaitian.transformer.position import TransformerCoordinateEmbedding from kaitian.transformer.transformer import ...
#!/usr/bin/env python # Filename: xml_rw.py """ introduction: authors: <NAME> email:<EMAIL> add time: 11 May, 2016 """ import sys,os,time import io_function,basic import xml.etree.ElementTree as ET # from lxml import etree as ET from xml.etree.ElementTree import ParseError import xml.dom.minidom as minidom class Xm...
# Copyright 2018 Google 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, ...
import os import sys import bioframe import click import cooler import cooltools import cooltools.expected import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib.lines import Line2D import numpy as np import pandas as pd import pairlib import pairlib.scalings import pairtools from diskc...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Main Dash app entry point - interactive situational awareness visualisation and analysis framework This module is a web-based application powered by Dash and Plotly.py, both of which are essential data analysis, visualisation, and hosting libraries. Dash is the library...
#!/usr/bin/env python3 # # Copyright 2014 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for sys_utils module.""" import os import subprocess import tempfile import unittest from unittest import mock fr...
"""Methods for plotting precipitation fields.""" import matplotlib.pylab as plt from matplotlib import cm, colors import numpy as np from pysteps.exceptions import MissingOptionalDependency try: from mpl_toolkits.basemap import Basemap basemap_imported = True except ImportError: basemap_imported = False ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2021 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """Module updating the Conda Lock.""" import...
import numpy as np import torch import sys from utils import * import rbo FLOAT_MIN = -sys.float_info.max class PointWiseFeedForward(torch.nn.Module): def __init__(self, hidden_units, dropout_rate): # wried, why fusion X 2? super(PointWiseFeedForward, self).__init__() self.conv1 = torch.nn.Conv1...
""" * This file is part of RNIN-VIO * * Copyright (c) ZJU-SenseTime Joint Lab of 3D Vision. 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/...
import pickle, gzip, glob, sys, keras, os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # gets rid of AVX message import random as rn import numpy as np import tensorflow as tf os.environ['PYTHONHASHSEED'] = '0' np.random.seed(37) rn.seed(1254) tf.set_random_seed(89) from keras import optimizers from keras import backend a...
import torch.nn as nn from utils.statistics import RewardStatistics, LagrangianStatistics from utils.time_log import time_since import time from sequence_generator import SequenceGenerator from utils.report import export_train_and_valid_reward, export_lagrangian_stats import sys import logging from validation import ev...
#!/usr/bin/env python ''' This script will run the tests from the requirements repository (from t/) and output the result of the run in the same format (into out/). Usage: ./runtest.py [-x] [<test> ...] If no tests are specified, all tests found in t/ will be run. -x will cause the testing to stop at the first failu...
# Copyright 2020 Regents of the University of Minnesota. # # 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 applic...
# encoding: utf-8 """ .. codeauthor:: <NAME> <<EMAIL>> """ from __future__ import absolute_import, unicode_literals import copy import enum import multiprocessing from collections import Counter from six import text_type from six.moves import zip from typepy import ( Bool, DateTime, Dictionary, Infi...
# Copyright 2018 AT&T Intellectual Property. All other 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...
from __future__ import absolute_import, division, print_function import itertools as it import os import gzip import bz2 from functools import partial from contextlib import contextmanager from ..dispatch import dispatch from cytoolz import partition_all, merge, keyfilter, pluck from toolz import concat, get, pipe, i...
#! /usr/bin/env python3 # Copyright (C) 2018 <NAME> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # * Redistributions of source code must retain the above copyright # notice, this list o...
# # Author : <NAME> # from pyqtside.QtGui import QWidget, QLabel, QGroupBox, QComboBox, QSizePolicy, QButtonGroup from pyqtside.QtCore import QObject, Qt, SIGNAL, Signal, Slot import views class JigWidget(QObject): def __init__(self, key ,title, desc): QObject.__init__(self) self._key = key self._title ...
#!/usr/bin/python # Copyright: (c) 2018, <NAME> (@wimnat) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = r''' --- module: aws_glue_job version_added: 1.0.0 short_descr...
import copy import grp import matplotlib import matplotlib.cm import numpy as np import os import re import sys import threading # OpenCV import for python3.5 if os.environ['ROS_PYTHON_VERSION'] == '3': import cv2 else: sys.path.remove('/opt/ros/{}/lib/python2.7/dist-packages'.format(os.getenv('ROS_DISTRO'))) ...
#!/usr/bin/env python # Copyright 2016 NeuroData (http://neurodata.io) # # 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 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Dec 7 04:37:00 2017 @author: scott """ import os import numpy as np import matplotlib as mpl from matplotlib import pyplot as plt calibration_0 = { "direct_beam_x": 255, # November and May "direct_beam_y": 98, # November and May #'Sampl...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Stolen and slightly modified from https://github.com/Dinnerbone/mcstatus "TCP and UDP Connections, both asynchronous and not." # This version of mcstatus's connection module # has support for varlongs and has general text reformatting # and spaceing changes. Slight cha...
from datetime import datetime import json from json import JSONEncoder import logging import os from pathlib import Path import random import shutil import yaml from Cryptodome.PublicKey import RSA from jinja2 import Environment, PackageLoader, select_autoescape from . import tools METADATA_FILENAME = ".metadata" ...