text
stringlengths
3.07k
22.1k
"""Test for deprecated VehicleState.""" import datetime import pytest import time_machine from bimmer_connected.api.regions import get_region_from_name from bimmer_connected.vehicle.doors_windows import LidState, LockState from bimmer_connected.vehicle.fuel_and_battery import ChargingState from bimmer_connected.vehi...
import tkinter as tk import tkinter.ttk as ttk from tkinter import filedialog from tkinter import messagebox as msgbox import os import sys import subprocess import requests import threading import locale import gettext from ruamel.yaml import YAML from packaging import version VERSION = '1.1' LOCALE = locale.getdefau...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
from __future__ import print_function import io import gzip from datetime import datetime, timedelta from reloadium.vendored.sentry_sdk.utils import Dsn, logger, capture_internal_exceptions, json_dumps from reloadium.vendored.sentry_sdk.worker import BackgroundWorker from reloadium.vendored.sentry_sdk.envelope impor...
# Copyright 2020 Inspur # # 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, soft...
from unittest import TestCase from csbiginteger.BigInteger import BigInteger as BigIntegerOrig # The test-cases are copied from neo-python where we use some NEO specific methods # Extending BigInteger here to add those specific methods class BigInteger(BigIntegerOrig): def __init__(self, *args, **kwargs): ...
import torch import numpy as np import json from models.resnet import * from models.downstream_net import * from dataset import transform_train, transform_test, CustomDataset, OOD_dataset from sklearn import metrics import torch.utils.data as data from tqdm import tqdm import pandas as pd import os from loss.focal_loss...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
# Relational # Copyright (C) 2008 Salvo "LtWorf" Tomaselli # # Relational is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pro...
# # BSD 3-Clause License # # This file is part of the RootBA project. # https://github.com/NikolausDemmel/rootba # # Copyright (c) 2021, <NAME>. # All rights reserved. # import copy import numpy as np class ExperimentSpec: def __init__(self, string): if "@it" in string: self.name, it = strin...
# This code accepts two hosts and their respective interface names for input # and finds common unused vlans from the two hosts' interfaces (as sub-intefaces) # The affected hosts are accessed via ssh using paramiko lib import os import re import sys import time import socket import getpass import paramiko import date...
import graphene from django.core.exceptions import PermissionDenied from graphene import InputField, ClientIDMutation from graphene.types.utils import yank_fields_from_attrs from graphene_django.forms.mutation import DjangoModelFormMutation from graphene_django.rest_framework.mutation import SerializerMutationOptions f...
""" This file is part of SleekBot. http://github.com/hgrecco/SleekBot See the README file for more information. """ __author__ = '<NAME> <<EMAIL>>' __license__ = 'MIT License/X11 license' from functools import wraps import collections import logging import inspect import threading import re from heapq impor...
import torch.nn as nn import torch from torch.distributions import MultivariateNormal from math import log class BaseNet(nn.Module): def __init__(self, input_dim, output_dim, network_config, activation_func=nn.Tanh): super(BaseNet, self)....
# -*- coding: utf-8 -*- """ Usage: python MusicNoteExtraction.py path path: Image path. Steps: 1. Use `cv2.morphologyEx` to remove horizontal and vertical lines, and only notes are left. 2. Use `cv2.findContours` to find the contours of the notes. 3. Show the ...
# -*- coding: utf-8 -*- from . import topology, RC_STRING from ... import toolz from ...data_helpers import production_volume from ...errors import OverlappingMarkets, MissingSupplier from ..utils import get_single_reference_product from .markets import allocate_suppliers, annotate_exchange import logging logger = lo...
from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import object from io import StringIO, IOBase import requests import csv import json import logging import re import os from .constants import DEFAULT_API_PREFIX, OLD_API_PREFIX class Socrata...
''' Created on May 1, 2013 @author: gabrielp Helps get region information from oolite ''' from collections import defaultdict import os import pybedtools from gscripts.general.pybedtools_helpers import get_single_gene_name, rename_to_gene_from_dict, get_five_prime_end, get_three_prime_end def trim_names(interva...
import argparse import pandas as pd import numpy as np import re import nltk from sklearn.preprocessing import LabelEncoder from sklearn import utils from ..utils import serialize, deserialize from .tokenization import tokenize_articles, nan_to_str, convert_tokens_to_int, get_words_freq from gensim.models.doc2vec im...
# coding: utf8 from __future__ import unicode_literals, print_function import tensorflow as tf import numpy as np import copy import io from PIL import Image from time import time from prodigy.components.loaders import get_stream from prodigy.components.preprocess import fetch_images from prodigy.core import recipe, ...
# -*- coding: utf-8 -*- """ Main class for accessing data in Amazon DynamoDB tables Developed by Coin-AI, 2017-2018 Contact: banca """ import boto3, json, os from boto3.dynamodb.conditions import Key from analytics.time_series import get_frequency from hashlib import sha1 from decimal import Decimal ...
import logging from warnings import warn from time import time from torrt.base_rpc import TorrtRPCException from torrt.utils import RPCClassesRegistry, TrackerClassesRegistry, TorrtConfig, get_url_from_string, \ get_iso_from_timestamp, import_classes, structure_torrent_data, get_torrent_from_url, iter_rpc, \ N...
import nengo import numpy as np import pytest from nengo_loihi import BlockShape, add_params def test_spike_units(Simulator, seed): with nengo.Network(seed=seed) as model: a = nengo.Ensemble(100, 1) p = nengo.Probe(a.neurons) with Simulator(model) as sim: sim.run(0.1) values = np...
import tensorflow as tf import argparse import numpy as np import PIL.Image import dnnlib import dnnlib.tflib as tflib from training import misc import os from metrics import metric_base from metrics.metric_defaults import metric_defaults import re import sys import pretrained_networks def read_image(img): I =...
import argparse from mmap import * from pathlib import Path from ctypes import * from .common import * class TouchArea(BigEndianStructure): _pack_ = 1 _fields_ = [("pic", Pic), ("area", Area), ("pic_next", Pic), ("pic_press", Pic), ("t...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from bert import modeling import collections import tensorflow as tf flags = tf.flags FLAGS = flags.FLAGS ## Required parameters flags.DEFINE_string( "bert_config_file", None, "The config j...
#!/usr/bin/python3 """ Copyright 2018 <NAME> <<EMAIL>> Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache Licens...
import pymongo import sys import time #Date enrichment needs to run on eff_date def getFieldValues(field,collection): #All the values of a specific field in a collection dollar_field = "$"+field field_group_pipeline = [ {"$group":{"_id":None,"values":{"$push":dollar_field}}} ] cursor_group_fields = db[collectio...
from PyQt5 import QtCore, QtGui, QtWidgets, uic import sys import cv2 import numpy as np import threading import time import queue import re from recordsave import Recorder from ssd_engine import SSD_Detector from motiondetector import MotionDetector from settings import EmailSender # Title WINDOW_TITLE = "DeepEye v1...
# -*- coding: utf-8 -*- import torch import numpy as np import matplotlib.pyplot as plt import torch.nn as nn from torch.autograd import Variable from torch.utils.data import Dataset, DataLoader import math from architectures import * import argparse from data_to_dict import get_data from dataset import OurDataset impo...
# SPDX-License-Identifier: MIT # Copyright (c) 2016-2020 <NAME>, <NAME>, <NAME>, <NAME> from __future__ import print_function import sys import os import gzip import subprocess import json from pyliftover import LiftOver class WLiftOver: @staticmethod def _validate(chrom, original, liftedover): ...
import cv2 import numpy as np from color_analysis import * from texture_analysis import * import keras import keras.backend as K import statsmodels.api as sm """ Functions: [TEST] get_color_measure(image, mask=None, type=None, verbose=True) [TEST] get_texture_measure(image, mask=None, type=None, verbose=True) [TEST] ...
""" Overview -------- general info about this module Classes and Inheritance Structure ---------------------------------------------- .. inheritance-diagram:: Summary --------- .. autosummary:: list of the module you want Module API ---------- """ from __future__ import absolute_import, division, print...
# -*- encoding: utf-8 -*- import inspect import time from functools import wraps, partial from inspect import signature def timethis(func): ''' Decorator that reports the execution time ''' @wraps(func) def wrapper(*args, **kwargs): start = time.time() result = func(*args, **kwarg...
""" This file implements a CLI to start the training, tuning and testing of the model. """ from typing import Dict, Optional, List import os import numpy as np import pandas as pd import click from sklearn.model_selection import StratifiedKFold, RepeatedStratifiedKFold from src.utils.io import load_data, load_obj, sav...
import tensorflow as tf import re from collections import Counter import string ''' This file is taken and modified from R-Net by HKUST-KnowComp https://github.com/HKUST-KnowComp/R-Net ''' def get_record_parser(config, is_test=False): """ Get the tfrecords sample parser. :param config: Contains the confi...
# encoding: utf-8 # --------------------------------------------------------------------------- # Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc. # Distributed under the terms of the BSD License. See COPYING.rst. # --------------------------------------------------------------------------- """...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Nanjing University, Vision Lab. # Last update: # 2019.10.27 # 2019.11.14 # 2020.11.26 import os import time import numpy as np import tensorflow as tf import matplotlib.pylab as plt import pandas as pd import subprocess import glob import configparser import arg...
import os import rospy import math import sys from glob import glob from sensor_msgs.msg import PointCloud2, PointField import std_msgs.msg import sensor_msgs.point_cloud2 as pcl2 import numpy as np import pickle from pathlib import Path import pykitti import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import ...
# -*- coding: utf-8 -*- # Original file: https://github.com/bolunwang/backdoor # Original Author: <NAME> (<EMAIL>) # Original License: MIT # Adpated to evaluate pytorch models import os import time import argparse import numpy as np import random import torch from tensorboard.backend.event_processing import event_acc...
############################################################################### # The MIT License (MIT) # # 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...
from collections import deque from datetime import datetime, timezone from typing import TextIO, Callable from xml.dom import pulldom from xml.dom.minidom import Element import xml.dom.minidom as minidom from xml.sax._exceptions import SAXParseException import json import os import pika from cacahuate.errors import Pr...
#!/usr/bin/env python # Copyright 2002 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of c...
# Copyright 2017–2019 Forschungszentrum Jülich GmbH # Copyright 2019–2020 CEA # # Author: <NAME> <<EMAIL>> # # Licensed under the Apache Licence, Version 2.0 (the "Licence"); # you may not use this file except in compliance with the Licence. # You may obtain a copy of the Licence at # # http://www.apache.org/licens...
import ast, errors, runtime, sys from env import Env NATIVE = { 'print': lambda values, env: print(*[a.render() for a in values]), 'str': lambda values, env: values[0].render() } class Interpreter: def __init__(self, node, env): self.node = node self.env = env self.definition = N...
#!/usr/bin/env python u""" spatial_operators.py Written by <NAME> (05/2021) Performs basic operations on spatial files CALLING SEQUENCE: python spatial_operators.py --operation add infile1 infile2 outfile INPUTS: path to input spatial files path to output spatial file COMMAND LINE OPTIONS: -O X, --op...
from gensim.models.doc2vec import Doc2Vec, TaggedDocument import numpy as np from elasticsearch import Elasticsearch import os.path from rp import random_projection #logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) class Split(): def __init__(self, vecs, depth=10): ...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
from __future__ import annotations from typing import Callable, Generic, TypeVar T = TypeVar("T") U = TypeVar("U") class DoubleLinkedListNode(Generic[T, U]): """ Double Linked List Node built specifically for LRU Cache >>> DoubleLinkedListNode(1,1) Node: key: 1, val: 1, has next: False, has prev: F...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
"""Reference training script Only Criteo data is supported at the moment, one hot embedding. """ import datetime import functools import itertools import json import os from pprint import pprint from time import time from absl import app from absl import flags import torch from apex import amp from dlrm import dist_...
class Cell: def __init__(self, r, c, colour, group_id): self.r = r self.c = c self.colour = colour self.group_id = group_id def __repr__(self): return "({},{})-{}".format(self.r,self.c, self.colour) class Group: def __init__(self, group_id): self.group_id = ...
# Copyright 2020 Google Research. 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 law...
#!/usr/bin/env python3 import tensorflow as tf import numpy as np from context import libspn as spn import time import argparse import colorama as col import sys from tensorflow.python.client import timeline import os from itertools import product col.init() red = col.Fore.RED blue = col.Fore.BLUE green = col.Fore.GR...
# # This file is part of PyFOPPL, an implementation of a First Order Probabilistic Programming Language in Python. # # License: MIT (see LICENSE.txt) # # 17. Jan 2018, <NAME> # 01. Feb 2018, <NAME> # from .code_objects import * from .code_types import * from enum import * ##############################################...
# import the necessary packages from __future__ import print_function from imutils.object_detection import non_max_suppression from imutils import paths import numpy as np import argparse import imutils import cv2 from matplotlib import pyplot as plt def filterLargeBoxes(boxArr): arr = boxArr[:] for i in range...
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
''' This software is derived from the OpenNMT project at https://github.com/OpenNMT/OpenNMT. Modified 2017, Idiap Research Institute, http://www.idiap.ch/ (Xiao PU) ''' # -*- coding: utf-8 -*- import torch import torch.nn as nn from torch.autograd import Variable import onmt.modules from onmt.modules.GlobalAttention ...
# -*- coding: utf-8 -*- import os import json import csv import logging import numpy as np from copy import deepcopy from collections import OrderedDict _LOGGER = logging.getLogger(__name__) class Settings(OrderedDict): """Settings is a simple extention of :class:`OrderedDict` with the addition of some uti...
# -*- coding: utf-8 -*- # Copyright (C) 2019 Machine Learning Group of the University of Oldenburg. # Licensed under the Academic Free License version 3.0 import torch as to import tvo import numpy as np from typing import Dict from tvo.variational._set_redundant_lpj_to_low_CPU import set_redundant_lpj_to_low_CPU de...
"""Routes for CoVID-19 dashboard app.""" from flask import render_template from app import covid_app from app import data from app import plotting from app import config as cfg from app import constants as cts from bokeh.embed import components def filter_secondary_links(region, num_links=2): """Return `num_link...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch.nn as nn import logging import torch from contrib import varprop def keep_variance(x, min_variance): return x.clamp(min=min_variance) def finitialize(modules, small=False): logging.info...
import json import hmac import os import hashlib try: from urllib.parse import urlencode import unittest.mock as mock except ImportError: from urllib import urlencode import mock from tornado.testing import AsyncHTTPTestCase from conda_forge_webservices.webapp import create_webapp class TestHandlerB...
#! -*- coding: utf-8 -*- # bert做Seq2Seq任务,采用UNILM方案 # 介绍链接:https://kexue.fm/archives/6933 from __future__ import print_function import glob, os, json import numpy as np from tqdm import tqdm from bert4keras.backend import keras, K from bert4keras.bert import build_bert_model from bert4keras.tokenizer import Tokenizer,...
# 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...
import json as jsonlib from html import unescape from django import template from django.template import engines, TemplateSyntaxError from django.template.base import NodeList, token_kwargs from django.template.defaulttags import IfNode from django.template.loader import get_template from django.template.loader_tags i...
import numpy as np import torch import os import pandas as pd import pickle import json import os.path as op import re import pathlib def nparams(model): return sum([p.numel() for p in model.parameters()]) def get_eval_idx(save_dir): model_dir = op.join(save_dir, 'model_ckpt') filenames = os.listdir(mo...
# Copyright (c) 2018 <NAME>, Inc. # # This file is part of Mycroft Skills Manager # (see https://github.com/MycroftAI/mycroft-skills-manager). # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional informa...
# Copyright (c) 2010, individual contributors (see AUTHORS file) # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" ...
import numpy as np import itertools import sys import os from qmla.exploration_strategies import connected_lattice import qmla.shared_functionality.probe_set_generation import qmla.shared_functionality.latex_model_names from qmla import construct_models # flatten list of lists def flatten(l): return [item for sublist...
import asyncio import tornado.ioloop import tornado.web import zipfile, io import base64 import docker import json import uuid import shutil import urllib import sys import shutil import hashlib import os CONFIG_PORT = 8080 endpoint_container = {} function_handlers = {} def create_endpoint(meta_container, coapPort, h...
# To do # - Criar função que sort a lista com objetos asa em função de pontuação. Ou de outro parâmetro. # - Ajeitar a função visualizador. Ela só ta mostrando a última geração. # - Gerar mais de 1 filho # - Ta mostrando só o msm indivíduo no final import random as rd from random import uniform as random import os imp...
import copy from collections import defaultdict import torch import torch.nn as nn from torch.nn import BatchNorm1d from torch.nn import Sequential, Linear, ReLU, ELU import torch.nn.functional as F from torch_geometric.nn import GINConv, global_add_pool, global_mean_pool from slgnn.models.gcn.layers import GraphConv...
# -*- coding: utf-8 -*- # @Author: gunjianpan # @Date: 2019-03-26 10:21:05 # @Last Modified by: gunjianpan # @Last Modified time: 2019-08-10 16:56:44 import aiohttp import asyncio import codecs import json import logging import os import re import shutil import struct import sys import time from collections import...
#!/usr/bin/python from re import T from typing import Dict, List import logging import time import random from abc import ABC, abstractmethod import speechbrain as sb import torch from speechbrain.dataio.dataset import ( DynamicItemDataset, FilteredSortedDynamicItemDataset ) from speechbrain.utils.data_utils i...
from __future__ import division from __future__ import print_function import time import matplotlib.pyplot as plt import tensorflow as tf from tqdm import tqdm from models import GCN_1_strati_1, GCN_1_strati_4, GCN_2_strati_1, GCN_2_strati_4, MLP from utils import * # Set random seed seed = 123 np.random.seed(seed)...
import os import sys import boto3 # pip install elasticsearch==7.13.4 # More recent versions of the elasticsearch python library do not support AWS, see https://www.theregister.com/2021/08/09/elasticsearch_python_client_change/ from elasticsearch import Elasticsearch, RequestsHttpConnection, helpers # pip install reque...
"""" Copyright © Krypton 2021 - https://github.com/kkrypt0nn Copyright © Rainb0wCodes 2021 - https://github.com/Rainb0wCodes Description: This is my personal Discord bot, Rainb0t Version: 0.1.0 """ import discord, asyncio, os, platform, sys, json from discord.ext.commands import Bot, when_mentioned_or, has_permission...
# # laaso/_subscriptions.py # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # ''' Objects and operations related to subscription defaults. Does not include operations that manipulate subscriptions. ''' import copy import re import threading import uuid import laaso._path...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Objective: The purpose of this script is to get taxonomic tree from given file contaning the NCBI taxID column. Required arguments: --input (str) a file containing a column with NCBI taxID --output (str) the out...
import csv import json from detector_core import ObjectDetectorAI, load_image_into_numpy_array, get_bounding_boxes, visualize_result from estimate_calories_from_image import compute_volume, compute_calories, FOOD_LABELS FOOD_LABEL_NAMES = [ 'apple', 'banana', 'bread', 'bun', 'doughnut', 'egg', 'fired d...
import os, argparse from scipy.io import wavfile import numpy as np from scipy.ndimage.filters import gaussian_filter import SyncNetInstance import avsnap_utils as utils import imageio import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt parser = argparse.ArgumentParser() parser.add_argument('--moda...
#!/usr/bin/env python # # These are required fields # import os import subprocess from time import sleep try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse try: import socketserver as SocketServer # Py3 except ImportError: import SocketServer # Py2 try: imp...
# Volatility # Copyright (C) 2007-2014 Volatility Foundation # Copyright (C) 2014 <NAME> <<EMAIL>> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either ver...
from __future__ import absolute_import import time import traceback from multiprocessing import Process import pytest import six from thriftpy2.thrift import TType, TPayloadMeta try: from thriftpy2.protocol import cybin except ImportError: cybin = None import thriftpy2 from thriftpy2.http import ( make_s...
import subprocess from scipy.optimize import curve_fit from numpy import linspace, logspace, log, polyfit, isnan from random import randint from os import listdir from os.path import isfile, isdir, join from time import sleep def file_len(fname): with open(fname) as f: for i, l in enumerate(f): ...
""" Support for Tuya Wifi smart switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.tuyawifiplug/ """ import base64 from hashlib import md5 import json import logging import socket import time import voluptuous as vol from homeassistant.com...
from __future__ import unicode_literals from builtins import object from django.template.loader import render_to_string import warnings class MenuItem(object): """ A menu item. Basically a pythonic interface to create a HTML element. If you want to make major changes to the look and feel of the ...
import os import pandas as pd import numpy as np import sys import seaborn as sns import matplotlib.pyplot as plt sys.path.append('../') from load_paths import load_box_paths datapath, projectpath, wdir,exe_dir, git_dir = load_box_paths() from processing_helpers import * """Define function methods""" def load_data(col...
""" This module provides the python implementation of the functions for each mathematical nodes used in Agraph Attributes ---------- FORWARD_EVAL_MAP : dictionary {int: function} A map of node number to evaluation function REVERSE_EVAL_MAP : dictionary {int: function} A map of nod...
import rvo.math as rvo_math from .obstacle import Obstacle MAX_LEAF_SIZE = 10 class AgentTreeNode: def __init__(self): self.begin_ = None self.end_ = None self.left_ = None self.right_ = None self.maxX_ = None self.maxY_ = None class ObstacleTreeNode: def __...
"""Functions relating to filepaths and filenames. """ from difflib import get_close_matches from itertools import takewhile import os import re import string # ------------------------------------------------------------------------------ CHAR_ESC = str.maketrans({p: '\{}'.format(p) for p in string.punctuation}) has_d...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.7 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + # Import Scripts # %r...
import os import cv2 import numpy as np import numpy.random as random import tensorflow as tf from keras.utils import to_categorical from classification import squeezenet_v1_1 n_test = 4000 n_class = 43 image_width_height = 90 # https://jdhao.github.io/2017/11/06/resize-image-to-square-with-padding/ def resize_ima...
#!/usr/bin/env python import datetime import logging import os import re from urllib.parse import urljoin from utils import utils, inspector # https://www.oig.doc.gov/Pages/Audits-Evaluations.aspx?YearStart=01/01/1996&YearEnd=12/31/2014 archive = 1996 # options: # standard since/year options for a year range to f...
import torch import torchvision import torch.nn as nn import torch.nn.functional as F from torchvision import datasets from torchvision import transforms from torchvision.utils import save_image from torch.autograd import Variable import numpy as np import matplotlib.pyplot as plt from datetime import datetime import o...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) University of St Andrews 2020-2021 # (c) University of Strathclyde 2020-2021 # (c) James Hutton Institute 2020-2021 # # Author: # <NAME> # # Contact # <EMAIL> # # <NAME>, # Biomolecular Sciences Building, # University of St Andrews, # <NAME>, # St And...
# Copyright (C) 2020 Assured Information Security, 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 applicabl...
# Code snippet from https://gist.github.com/Tey/ded2486da8a69bb84d2dce94e2e09ff7#file-requests_digest_proxy-py # Found via https://stackoverflow.com/a/60031108/1665217 import sys import re if sys.version_info[0] == 2: import httplib import urlparse else: import http.client as httplib import urllib.par...