text
stringlengths
6.04k
39.5k
# Copyright (c) 2016 Universidade Federal Fluminense (UFF) # Copyright (c) 2016 Polytechnic Institute of New York University. # This file is part of noWorkflow. # Please, consult the license terms in the LICENSE file. """Lightweight objects for storage during collection""" from __future__ import (absolute_import, print...
"""Utility functions for evaluating model fits.""" import numpy as np from behavenet.fitting.utils import get_best_model_and_data def export_latents(data_generator, model, filename=None): """Export predicted latents using an already initialized data_generator and model. Latents are saved based on the model'...
# Additional functions that will eventually end up in mPyPl import json import mPyPl as mp from pipe import Pipe import os,sys from moviepy.editor import VideoFileClip import numpy as np import random import cv2 def to_mdict(x): m = mp.mdict() for z in x.keys(): m[z] = x[z] return m def from_jso...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import math import libs.utils.gpy_finite_diff as gpy_finite_diff import libs.utils.gpy_estimation_lib as gpy_estimation_lib from GPy.util.linalg import pdinv, dpotrs from GPy.util import diag import sklearn.linear_model def plot_paramz_likelihood...
import struct import cpuid_native def cpuid(leaf): _, a, b, c, d = cpuid_native.get_cpuid(leaf) return (a, b, c, d) def cpuid_count(leaf, subleaf): _, a, b, c, d = cpuid_native.get_cpuid_count(leaf, subleaf) return (a, b, c, d) def cpu_vendor(): _, b, c, d = cpuid(0) return struc...
# -*- coding: utf-8 -*- import json import os import re import shlex from collections import namedtuple from subprocess import CalledProcessError from typing import Iterable from chmod_monkey import tmp_chmod from dockerfile_parse import DockerfileParser from dotty_dict import Dotty from ..copy.actions import copy_fr...
## ## 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,...
from __future__ import print_function from sympy import * from eqn_manip import * # Solve for cubic spline coefficients using a straightforward (but inefficient) derivation # from the defining equations. # Generates unit tests for the spline coefficient solver (CubicSplineSolve in SplineSolvers.h) # and the evaluat...
import torch from torch import nn import torch.nn.functional as F import torchvision.models.resnet as resnet from mtl.datasets.definitions import RESNET34PATH from mtl.utils.pytorch_code import load_state_dict_from_url class BasicBlockWithDilation(torch.nn.Module): """Workaround for prohibited dilation in BasicBl...
import json import os import pickle from collections import Counter, deque from multiprocessing import Pool import networkx as nx import textdistance import tqdm from quantlaw.utils.beautiful_soup import create_soup from quantlaw.utils.files import ensure_exists, list_dir from quantlaw.utils.networkx import get_leaves...
# encoding: utf-8 # @author: zxding # email: <EMAIL> import codecs import random import numpy as np import pickle as pk from sklearn.metrics import precision_score, recall_score, f1_score import pdb, time def print_time(): print('\n----------{}----------'.format(time.strftime("%Y-%m-%d %X", time.local...
"""Sphinx configuration defaults for LSST Stack packages. Notes ----- Some configurations based on astropy-helpers https://github.com/astropy/astropy-helpers/blob/master/astropy_helpers/sphinx/conf.py see licenses/astropy-helpers.txt """ __all__ = ("build_package_configs", "build_pipelines_lsst_io_configs") import d...
import numpy as np import h5py from sklearn.decomposition import PCA from Starfish.grid_tools import HDF5Interface, determine_chunk_log from Starfish.covariance import sigma, V12, V22 from Starfish import constants as C class PCAGrid: def __init__(self, wl, min_v, flux_mean, flux_std, pcomps, w, gparams): ...
#!/usr/bin/env python import vtk def main(): colors = vtk.vtkNamedColors() # Set the background color. colors.SetColor("BkgColor", [51, 77, 102, 255]) titles = list() textMappers = list() textActors = list() uGrids = list() mappers = list() actors = list() renderers = list(...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division import atexit import argparse import os import time import json import warnings import inspect import codecs import imageio from atx import consts from atx import errors from atx import imutils from ...
# -*- coding:utf-8 -*- import logging logger = logging.getLogger(__name__) import ast import re import os.path import tempfile import shutil import hashlib import stat from prestring.python import PythonModule from functools import partial from collections import namedtuple from io import StringIO from kamo.expr import...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
# Copyright (C) 2018 by <NAME> <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You may # obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import logging from pathlib import Path from typing import List, Optional, Tuple, Union import numpy as np import pandas as pd from datasets import Dataset, DatasetDict from pyannote.audio import Pipeline from pydub import AudioSegment from sklearn.model_selec...
'''Train CIFAR10 with PyTorch.''' # Cifar-10 dataset을 closed-set으로 학습을 시키고 SVHN test dataset을 openset으로 Test하는 코드입니다. # SVHN 데이터셋은 검색해보시면 어떠한 데이터셋인지 나올 겁니다. import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision impor...
import os, re import matplotlib.cm as cm import matplotlib.pyplot as plt import math import numpy as np from threading import Thread import time import json FILE_NAME = os.path.basename(__file__) CURR_DIR = os.path.dirname(__file__) BASE_DIR = os.path.dirname(CURR_DIR) import sys sys.path.insert(-1, CURR_DIR) sys.path...
import copy import math import random import os import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit import time import datetime import os import torch import torch.nn as nn import torch.nn.functional as F from torchvision import datasets, transforms from torch.utils.data import Dat...
#Importations And Value Table Creation# from random import randint bot_field = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0,...
#!/usr/bin/env python # coding: utf-8 # In[1]: import streamlit as st import re from IPython.display import display import numpy as np import shutil import posixpath import plotly.graph_objects as go # EDA Pkgs import pandas as pd import numpy as np import matplotlib.pyplot as plt import joblib import pickle import...
""" Copyright 2021 Max-Planck-Gesellschaft Code author: <NAME>, <EMAIL> Embodied Vision Group, Max Planck Institute for Intelligent Systems, Tübingen This source code is licensed under the MIT license found in the LICENSE.md file in the root directory of this source tree or at https://opensource.org/licenses/MIT. """ ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import pickle import shutil import sys import random import json import time import datetime import argparse from itertools i...
# General Headers#################### import numpy as np import copy ##################################### # sklearn headers################################## import xgboost as xgb from sklearn.metrics import roc_auc_score, accuracy_score from sklearn.model_selection import KFold from sklearn.neighbors import NearestN...
# -*- coding: utf-8 -*- """ @file @brief Defines a :epkg:`sphinx` extension to describe a function, inspired from `autofunction <https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/autodoc/__init__.py#L1082>`_ and `AutoDirective <https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/autodoc/__init__.py#L1...
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
#!/usr/bin/python # -*- coding: utf-8 -*- # ====================================================================== # Copyright 2020 <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 # #...
""" https://stackoverflow.com/questions/29362142/django-rest-framework-hyperlinkedidentityfield-with-multiple-lookup-args http://www.tomchristie.com/rest-framework-2-docs/api-guide/relations https://github.com/miki725/formslayer/blob/master/formslayer/pdf/relations.py#L7-L46 https://stackoverflow.com/questions/32038643...
#! /usr/bin/env python # # [VPYTHON:BEGIN] # wheel: < # name: "infra/python/wheels/psutil/${vpython_platform}" # version: "version:5.2.2" # > # wheel: < # name: "infra/python/wheels/six-py2_py3" # version: "version:1.10.0" # > # [VPYTHON:END] # # Copyright 2020 The ANGLE Project Authors. All rights reserved. # Use ...
# -*- coding: utf-8 -*- # Copyright 2018, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """Backend for the JKU C++ simulator.""" import itertools import json import logging import operator import os import platfo...
import logging from tqdm import tqdm import time import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader from torchvision.models.densenet import densenet121 import matplotlib.pyplot as plt import torchvisi...
#!/usr/bin/env python # # Copyright 2014 cloudysunny14. # # 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...
import csv import yaml import random from collections import defaultdict from gurobipy import * import template.adapter as adapter from fixed.source import Source from fixed.fixed_instance import FixedInstance from network.links import Links from network.nodes import Nodes from template.arc import Arc from t...
import logging from timeit import default_timer as timer import os import cv2 import math import math_utils import numpy as np from opensfm import dataset from opensfm import features from opensfm import io from opensfm import log from opensfm import types from opensfm.commands import undistort from opensfm.context im...
import re from decimal import Decimal from datetime import datetime import attr import pytz from pathlib import Path from zope.interface import implementer from .. import handhistory as hh from ..card import Card from ..hand import Combo from ..constants import Limit, Game, GameType, Currency, Action, MoneyType __all_...
# -*- coding: utf-8 -*- """ Created on Wed Jan 20 18:17:02 2016 @author: <NAME> <EMAIL> """ # -*- coding: utf-8 -*- """ Parameter Optimizer. Test before rolling into Image Analys """ #%% Vers="0.1" #%% Imports # import tkinter as tk from tkinter import filedialog, ttk import lmfit from PIL import Image import os ...
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. from collections import OrderedDict import numpy as np from pyiron_atomistics.atomistics.structure.atoms import Atoms im...
"""A module containing tests for the library representation of default values.""" import pytest import iati.codelists import iati.constants import iati.default import iati.schemas import iati.tests.utilities class TestDefault: """A container for tests relating to Default data.""" @pytest.fixture(params=[ ...
import sqlite3 import time from datetime import datetime, timedelta from typing import Union import psutil from pathlib2 import Path # Is a stripped down program object to differentiate between running programs and given programs to track from manager_core import Settings # TODO add type hints for all classes class...
# coding=utf-8 # # Copyright (c) 2017 Illumina, Inc. # All rights reserved. # # This file is distributed under the simplified BSD license. # The full text can be found here (and in the LICENSE file in the root folder of # this distribution): # # https://github.com/Illumina/licenses/blob/master/Simplified-BSD-License.tx...
# -*- coding: utf-8 -*- """ Created on Fri Dec 4 16:53:14 2020 @author: Specim """ import os import spectral.io.envi as envi import numpy as np import matplotlib.pyplot as plt from pathlib import Path from scipy import signal import pandas as pd import re from argparse import ArgumentParser def dec...
""" Validation of PacBio dataset XML (and referenced files) """ import xml.etree.ElementTree as ET from cStringIO import StringIO from urlparse import urlparse import xml.parsers.expat import traceback import itertools import argparse import logging import os.path import sys try: from pyxb import exceptions_ as ...
#!/usr/bin/env python3 # This file is covered by the LICENSE file in the root of this project. #https://github.com/PRBonn/semantic-kitti-api import numpy as np import math import time class PanopticEval: """ Panoptic evaluation using numpy authors: <NAME> and <NAME> """ def __init__(self, n_classes, de...
from __future__ import annotations # Needed for returning the same class type where using factory static builders import base64 import hashlib import json import logging import os import platform import random import string import time import uuid from datetime import datetime from typing import Optional, List from ...
# Author: <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 required by applicable law or agreed to in wr...
from typing import Text, Dict, Any from sagas.nlu.patterns import print_result from sagas.nlu.rules_header import * import sagas.tracker_fn as tc import logging logger = logging.getLogger(__name__) #⊕ [nmod](https://universaldependencies.org/u/dep/nmod.html) def verb_patterns(meta, domains): behaviours_obl = la...
import flask import sqlalchemy from flask import Response from flask_restplus import Namespace, Resource, fields, inputs from model.models import db from utils import sql_query_generator, log_query api = Namespace('query', description='Operations to perform queries using metadata') query = api.model('Query', { #...
# <NAME> from tkinter import * from tkinter.ttk import * from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk) from matplotlib.backend_bases import key_press_handler from matplotlib.figure import Figure # allows buttons to take multiple inputs from functools import partial import ...
import asyncio import json import logging import os import re import shutil import string from collections import Counter from dataclasses import dataclass, asdict, field from random import random from typing import List, Optional, Dict, Generator import aiofiles import github import time import github_util git_hub ...
""" source: https://stackoverflow.com/questions/65498782/how-to-dump-confusion-matrix-using-tensorboard-logger-in-pytorch-lightning https://pytorch-lightning.readthedocs.io/en/latest/starter/introduction_guide.html https://medium.com/pytorch/introduction-to-captum-a-model-interpretability-library-for-pytorch-d23659...
import csv import glob import math import os import torch from astropy.io import fits from six.moves import urllib import torch is_torchvision_installed = True try: import torchvision except: is_torchvision_installed = False import torch.utils.data import random import itertools import numpy as np def load_...
"""其他自定义因子、分类器、过滤器 由于存在大量依赖,整合在一个模块中 说明: 1. 雅虎数据基础单位:千 """ import numpy as np import pandas as pd from . import factors, filters, classifiers from ..utils.math_utils import nanmean, nansum, nanmax from ..utils.numpy_utils import changed_locations, int64_dtype from .classifiers import CustomClassifier from .data....
import datetime from typing import Union import pandas as pd from tepuy.processes import SimEvent, SimProcess, EmptyProcess from logging import Logger import numpy as np class IntelligentObject: def __init__(self, name: str): self.__name = name self.__logger = Logger(name=name) self.__avai...
# from pprint import pprint # import json import asyncio import operator import random import discord from dateparser import parse from discord.ext import commands from discord.ext.commands import MessageConverter, EmojiConverter from django.db.models import F import config from francis.utils.role import is_image_url...
# # The SELDnet architecture # from keras.layers import Bidirectional, Conv2D, MaxPooling2D, Input, Concatenate from keras.layers.core import Dense, Activation, Dropout, Reshape, Permute from keras.layers import add, multiply, GlobalAveragePooling2D, ELU import keras.backend as K from keras.layers.recurrent import GRU...
""" Copyright 2019 Cartesi Pte. Ltd. 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 d...
#Importing Libraries from tkinter import * from tkinter import messagebox as ms import tkinter as tk import tkinter.font as tkFont import album as a from PIL import ImageTk, Image import pygame import os import socket import _thread #Initiallizing host credentials host_name = socket.gethostname() host_ip...
import json from datetime import datetime import os.path, sys import time import locale try: import requests except ModuleNotFoundError: import pip pip.main(['install', "requests"]) import requests # Указываем токен вашего телеграм бота, если хотите его использовать. # Add your telegram bot token if y...
#!/usr/bin/env python """Provides encoding into graphs for proteins.""" from Bio.PDB import Selection, NeighborSearch from collections import defaultdict from collections import deque import networkx as nx from networkx import union from toolz import curry, compose # ac properties aa_properties_dict = { "fullname...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """GPU Usage. Outputs GPU usage in a Line chart along with memory usage in a bar chart. Author: <NAME> <<EMAIL>> Created on: December 13, 2019 """ from curses import newwin, KEY_RESIZE, doupdate import curses from math import ceil, floor import argparse from thread...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Implementation of the HRG structure.... Stick to returning None vs. raising Exceptions for the HRG... """ from __future__ import unicode_literals, division, print_function #Py2 __author__ = "<NAME>" __email__ = "<EMAIL>" class DuplicateItemInRelation(Exception): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ wrappers.py Abstract classes for objects that can wrap any objects and make their attributes/methods accessible from the wrapper. StaticWrapper calls wrapped attributes/methods by creating property descriptor objects for each of the wrapped objects' attributes/methods....
import curses import romkan #kana/romaji conversion import re #trim leftover characters from incomplete input conversion def loopOn(input): if isinstance(input,list): for i in input: yield i; else: yield input; class UIComponentBase: def __init__(self, win): self.win = win; def clear(self): sel...
import operator import django.urls import ipware.ip import ipware.ip from django.contrib.auth.decorators import login_required from django.db import transaction from django.db.models import Prefetch, Min from django.http.response import (HttpResponseNotFound, JsonResponse, ...
import re import os import math import torch import numpy as np import torch.nn.functional as F from sklearn.metrics import roc_auc_score EPOCHS = 5 BATCH_SIZE = 2048 # def train_model_v2(model, device, train_label_path, train_idx_path, train_value_path, optimizer, epoch, # use_reg_l1=False, use_r...
from __future__ import division, print_function import numpy as np import cPickle as pickle import os, glob import argparse from utils import models from utils.sample_helpers import JumpProposal, get_parameter_groups from enterprise.pulsar import Pulsar from enterprise import constants as const from PTMCMCSampler.PT...
import numpy as np import matplotlib.pyplot as plt from random import random eps = 8.8541878e-12 mu = 4.0e-7 * np.pi R = 6371000.0 def plot_map( s_lat, s_lon, s_int, m_lat, m_lon, show=True, save=False, filename="schupy_map.png" ): import cartopy.crs as ccrs assert len(s_lat) == len(s_lon), 's_lat s...
import tempfile import numpy as np import h5py from pyscf import lib #einsum = np.einsum einsum = lib.einsum # This is restricted (R)CCSD # Ref: Hirata et al., J. Chem. Phys. 120, 2581 (2004) ### Eqs. (37)-(39) "kappa" def cc_Foo(t1,t2,eris): nocc, nvir = t1.shape foo = eris.fock[:nocc,:nocc] Fki = foo....
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import math from datetime import date, timedelta from django.core.urlresolvers import reverse_lazy from django.db import m...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # --------------------------------------------------------------------------- # ___ __ __ __ ___ # / | \ | \ | \ / Automatic # \__ |__/ |__/ |___| \__ Annotation # \ | | |...
import logging from typing import Union from copy import deepcopy from glob import glob from numpy import array, ndarray, round from pandas.errors import ParserError from tqdm import tqdm from os.path import join import matplotlib import matplotlib.pyplot as plt matplotlib.use('TkAgg') from . import utilities as util...
import os, sys, pymzml, pickle, shutil, argparse import numpy as np import pandas as pd import scipy.signal import scipy.optimize as opt import pyteomics.mass as pymass import matplotlib.pyplot as plt DEFAULT_MIN_CLUSTER_WIDTH = 5 DEFAULT_EXTRACTION_WIDTH = 0.01 DEFAULT_EXTRACTION_LENGTH = 0.5 DEFAULT_ISOTOPE_WEIGHT =...
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # Copyright (c) 2020 ContinualAI # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE...
# Produce the Overscreening Figure import json import numpy as np import matplotlib.pyplot as plt import os # Stylistic preferences from matplotlib import rc, rcParams from collections import OrderedDict # --------------------------------------------------- # Color sets # --------------------------------------------...
import numpy as np def get_Pnm_n(nmax, m, theta): """ Calculation of associated Legendre functions P(n,m) (Schmidt normalized) and its derivative dP(n,m) vrt. theta. Input: theta[:] co-latitude (in rad) nmax maximum spherical harmonic degree Output: Pnm ndarray PD with Leg...
""" Created on Feb 25, 2018 @author: <NAME> Description of the file. """ import os import argparse import time import datetime import pickle import numpy as np import torch import torch.autograd import sklearn.metrics import vsrl_eval import datasets import units import models import config import logutil import...
import os import argparse import numpy as np import tensorflow as tf from keras.layers import Input from dataset import QuasarTDataset, get_trimmed_embeddings, pad_sequences from constants import DATA, TRAINED_MODELS, PARAMS from utils import Timer class PairwiseModel: def __init__(self, model_name, embeddings, ...
""" LICENSE: 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, softwar...
from collections import defaultdict, Counter from datatable_util import AttributeDict, CSV_GivenHeaders, FIXEDWIDTH, JoinType, sortKey from hierarchies import Hierarchy import os from datatable import DataTable, DataColumn from itertools import chain from functools import reduce def createColumnFilter(criteria): if c...
#Import dependencies. import numpy as np import ModularRoboticsToolkit as mrt import sys ################ ######MELT###### ################ #Find the most populated line in the structure, so modules can be appended to it. def findMeltCoordinates(structure): #Count how many modules are behind a face of voxels. ...
import os import pickle import argparse import math import numpy as np import pandas as pd import torch from torch import nn from pyro.infer.util import torch_item from pyro.contrib.util import lexpand, rexpand from torch.distributions.utils import broadcast_all from pyro.poutine.util import prune_subsample_sites imp...
import threading import datetime import PySimpleGUIQt as sg from PySimpleGUIQt.PySimpleGUIQt import ( BUTTON_TYPE_BROWSE_FILE, BUTTON_TYPE_BROWSE_FILES, BUTTON_TYPE_SAVEAS_FILE, BUTTON_TYPE_BROWSE_FOLDER, POPUP_BUTTONS_NO_BUTTONS, WIN_CLOSED, ) from toolbox_creator.globe_icon import globe_icon f...
# %% from functools import partial import logging import numpy as np import torch import colorsys from torchvtk.utils import make_5d, tex_from_pts # Persistent Homology peak extraction class Peak: def __init__(self, startidx): self.born = self.left = self.right = startidx self.died = None d...
# Copyright 2017 Mycroft AI 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 writin...
import sys from math import hypot import json from vectorMap import VectorMap from const import CONST from pprint import PrettyPrinter pp = PrettyPrinter(indent=2).pprint ARROW_NAME_SEPARATER = "/" class MapAuthoring(object): def __init__(self, vectorMap): self.__vectorMap = vectorMap self.__view...
import logging from warnings import warn from typing import Dict, Union, Tuple, NamedTuple, Optional, TypeVar from typing_extensions import final, Final from numbers import Number import typing from lomentum.types import ( ContextDict, Symbol, RoutesDictType) from functools import partial from contextlib import ...
import sys import re import math BEGIN = 'BEGIN' END = 'END' class Pawky: """The base `awk` class. It contains almost all the `awk` builtin variables and functions. These builtin variables from `awk` are currently available. :ivar str CONVFMT: Format for internal conversion of numbers to string, initi...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ================================================================ # @Time : 2019/10/30 10:11 # @Author : YangTao # @Site : # @File : train_lanenet_like_yolo.py # @IDE: PyCharm Community Edition # ================================================================ "...
""" <Program Name> runlib.py <Author> <NAME> <<EMAIL>> <Started> June 27, 2016 <Copyright> See LICENSE for licensing information. <Purpose> Provides a wrapper for any command of the software supply chain. The wrapper performs the following tasks which are implemented in this library. - Record st...
import os import random import time from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains import linecache import...
from nanome.util import Logs, Color import time import traceback import os import random import shutil class TestOptions(): def __init__(self, ignore_vars = [], accurate_floats = False, print_float_warnings = False): self.ignore_vars = ignore_vars self.accurate_floats = accurate_floats self...
#!python3 """ Module for creating the PDF reports from reports tables """ import warnings import os import zipfile import pandas as pd from fpdf import FPDF from datetime import date from modules import filework TOP_MARGIN = 0.75 BOTTOM_MARGIN = 0.75 LEFT_MARGIN = 0.5 RIGHT_MARGIN = 0.5 LINE_WIDTH ...
""" Helper methods for loading and parsing KITTI data. Author: <NAME> Date: September 2017 """ from __future__ import print_function import tensorflow as tf import numpy as np import cv2 import os class Object3d(object): """ 3d object label """ def __init__(self, label_file_line=None): # each object...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # <NAME> (March 2018) # """ Wrapper for Verena Zuber's colocalisation method Assumptions: - GWAS and cov matrix are referring to the same strand """ import sys import argparse import pandas as pd import numpy as np import Finemap import pickle def main(): # Ge...
''' Data structure of the input .npz: the data is save in python dictionary format with keys: 'acs', 'ep_rets', 'rews', 'obs' the values of each item is a list storing the expert trajectory sequentially a transition can be: (data['obs'][t], data['acs'][t], data['obs'][t+1]) and get reward data['rews'][t] ''' import os...
# Copyright 2019 Systems & Technology Research, LLC # Use of this software is governed by the license.txt file. import pandas as pd import imageio import numpy as np import six import os from pathlib import Path import torch from torch.autograd import Variable import random import shutil import skimage.transform impor...
# a waf tool to add autoconf-like macros to the configure section import Build, os, sys, Options, preproc, Logs import string from Configure import conf from samba_utils import * import samba_cross missing_headers = set() #################################################### # some autoconf like helpers, to make the ...