text
stringlengths
6.04k
39.5k
""" Utilities to interact with Amazon S3 and occasionally the local file system. The basic location of a file depends on the data source and can be one of: .../schemas/{source_or_schema_name}/{source_schema_name}-{table_name}.yaml -- for table design files .../schemas/{schema_name}/{source_schema_name}-{table_name}.sq...
# -*- coding: utf-8 -*- """Implements JSON version of xonsh history backend.""" import os import sys import time import json import builtins import collections import threading import collections.abc as cabc from xonsh.history.base import History import xonsh.tools as xt import xonsh.lazyjson as xlj import xonsh.xoreu...
import argparse import time import math import os import unicodedata import torch import torch.nn as nn from torch.autograd import Variable from torch import optim import util.data as data from model.rnn_model import * # import util.printhelper as printhelper import util.masked_cross_entropy as masked...
from __future__ import annotations import math import typing as ty from dataclasses import dataclass from inspect import isfunction import pygame as pg from base.events import BaseEvent from base.group import Group from base.widget import BaseWidget from utils import load_image if ty.TYPE_CHECKING: from base.ty...
import math import os from typing import List, Union from argparse import Namespace import matplotlib.pyplot as plt import numpy as np from rdkit import Chem from rdkit.Chem.Draw import SimilarityMaps import torch import torch.nn as nn import torch.nn.functional as F from torch.optim import Optimizer from torch.optim....
# coding=utf-8 # Copyright 2019 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# -*- coding: utf-8 -*- """ Various additional utilities for ObsPy. :copyright: The ObsPy Development Team (<EMAIL>) :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html) """ from __future__ import (absolute_import, division, print_function, ...
import email from email.message import EmailMessage from app.config import MAX_ALERT_24H, EMAIL_DOMAIN from app.email_utils import ( get_email_domain_part, can_create_directory_for_address, email_can_be_used_as_mailbox, delete_header, add_or_replace_header, parseaddr_unicode, send_email_wit...
from apis import spotify from apis import send_grid import random from datetime import datetime def print_menu(): print(''' --------------------------------------------------------------------- Spotify Genius --------------------------------------------------------------------- 1 - Select your favorite genres 2 ...
import logging from common.document_parser.ref_utils import make_dict logger = logging.getLogger(__name__) ref_regex = make_dict() def check(check_str, ref_type, exp_result): count = 0 matches = ref_regex[ref_type][1].findall(check_str) for match in matches: num_match = ref_regex[ref_type][0].s...
import functools from typing import List, Any import numpy as np import scipy.sparse as sp import pytest from sklearn.metrics import euclidean_distances from sklearn.random_projection import johnson_lindenstrauss_min_dim from sklearn.random_projection import _gaussian_random_matrix from sklearn.random_projection imp...
''' Dts_Stream.py Copyright (c) 2003 - 2006 <NAME>(<EMAIL>) 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, merg...
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # Copyright (c) 2017 Tauranis # 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 ...
# -*- coding: utf-8 -*- """Utility function module. This module contains util functions. """ import torch import numpy as np import os, sys import anndata import scvelo as scv import scanpy as sc import argparse from matplotlib import pyplot as plt from sklearn.decomposition import PCA from .model ...
import matplotlib.pyplot as plt import seaborn as sns import numpy as np import umap import matplotlib.pyplot as plt from tqdm.autonotebook import tqdm import matplotlib.collections as mcoll import matplotlib.path as mpath from matplotlib import collections as mc import seaborn as sns from matplotlib.lines import Line2...
import copy import fnmatch import os import re import uuid from functools import update_wrapper from collections import OrderedDict import jinja2 from jinja2.loaders import split_template_path from babel import dates from inifile import IniFile from werkzeug.urls import url_parse from werkzeug.utils import cached_prop...
""" Wiki lua exporter Overview =============================================================================== +----------+------------------------------------------------------------------+ | Path | PyPoE/cli/exporter/wiki/parsers/skill.py | +----------+-----------------------------------...
import cmd import math import os import re import subprocess import sys import tempfile from collections import defaultdict from django.db import transaction from django.db.models import Model from django.db.models.fields import TextField, CharField import slavdict.dictionary.models as models from slavdict.dictionar...
import os import pytest from flexmock import flexmock import pyp2rpm.metadata_extractors as me from pyp2rpm.name_convertor import NameConvertor from pyp2rpm import utils tests_dir = os.path.split(os.path.abspath(__file__))[0] class TestMetadataExtractor(object): td_dir = '{0}/test_data/'.format(tests_dir) ...
# -*- coding: utf-8 -*- """Scattering unwarped vs warped echirp GIF, sweeping `tau`.""" # https://dsp.stackexchange.com/q/78512/50076 ################################ # https://dsp.stackexchange.com/q/78514/50076 ################################ import numpy as np import matplotlib.pyplot as plt import matplotlib.anima...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= ## @file ostap/parallel/pptunnel.py # Useful utilities for multiprocessing and parallel processing for Ostap # @author <NAME> <EMAIL> # @date 2016-02-23 # ==================================...
import math import torch import torchvision import torch.nn as nn # from data.config import TestBaseTransform, widerface_640 as cfg from face_detection_dsfd.data import TestBaseTransform, widerface_640 as cfg # from layers import Detect, get_prior_boxes, FEM, pa_multibox, mio_module, upsample_product from face_detectio...
# Copyright (C) DATADVANCE, 2010-2020 # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # ...
# coding=utf-8 # Copyright 2021 The Deeplab2 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
import json import os import time import sys import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F from dataset import prepare_dataset from experiments.utils import construct_passport_kwargs_from_dict from models.alexnet_passport import AlexNetPassport from models.al...
#! /usr/bin/python # -*- coding: utf-8 -*- # Copyright 2019 TensorLayer. 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....
''' Functions related to exporting animations. ''' from __future__ import annotations from typing import NamedTuple, Dict, Optional, List, Tuple, Set import math from dataclasses import dataclass, field from itertools import tee, islice import bpy import bpy_types import numpy as np from .json_tools import get_vect_...
# Copyright (c) 2018 PaddlePaddle Authors. 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 appli...
""" activitypub model functionality """ from base64 import b64encode from collections import namedtuple from functools import reduce import json import operator import logging from uuid import uuid4 import requests from requests.exceptions import RequestException from Crypto.PublicKey import RSA from Crypto.Signature ...
""" High level setup: Sacred (https://sacred.readthedocs.io/en/latest/) is used to configure, run, save the experiments. Please read the docs, otherwise the code below won't make much sense. In short: @ex.config changes configuration of experiment, @ex.command and @ex.capture makes configuration available and @ex.autom...
""" hydrofunctions.charts ~~~~~~~~~~~~~~~~~~~~~ This module contains charting functions for Hydrofunctions. ----- """ from __future__ import absolute_import, print_function, division, unicode_literals import matplotlib # Recommended that I use this line to avoid errors in TravisCI # See https://matplotlib.org/faq/ho...
#!/usr/bin/env python u""" ecco_llc_tile_harmonics.py Written by <NAME> (10/2021) Reads monthly ECCO ocean bottom pressure anomalies from LLC tiles and converts to spherical harmonic coefficients ECCO Version 4, Revision 4 https://ecco.jpl.nasa.gov/drive/files/Version4/Release4/nctiles_monthly ECCO Version 5,...
# File: ipcontrol_connector.py # # Copyright (c) 2021 Splunk 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 app...
#----------------------------------------------------------------------------- # Title : PyRogue base module - Device Class #----------------------------------------------------------------------------- # This file is part of the rogue software platform. It is subject to # the license terms in the LICENSE.txt file...
# -*- coding: utf-8 -*- """`tldextract` accurately separates the gTLD or ccTLD (generic or country code top-level domain) from the registered domain and subdomains of a URL. >>> import tldextract >>> tldextract.extract('http://forums.news.cnn.com/') ExtractResult(subdomain='forums.news', domain='cnn', suff...
''' Created on Jun 14, 2014 @author: $Author: tho $ This Library implements Date and Time manipulations in a convenient way. License : GPL ''' import datetime import os import time from PyQt5.QtCore import QDate from PyQt5.QtCore import QDateTime from PyQt5.QtCore import QTime def is_date(stamp): ''' This...
################################################################## ## (c) Copyright 2015- by <NAME> ## ################################################################## #====================================================================# # nexus.py ...
import argparse import os import threading import traceback from functools import partial from queue import Queue, Empty from time import perf_counter, time from uuid import uuid4 import cuml import numpy as np import tritonclient.http as triton_http import tritonclient.grpc as triton_grpc import tritonclient.utils.cu...
# Copyright 2017 VMware, Inc. # 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 a...
# -*- coding: utf-8 -*- # imageio is distributed under the terms of the (new) BSD License. """ Plugin for reading videos via AvBin Would be nice if we could capture webcam with this, but unfortunately, avbin does not currently support this. """ from __future__ import absolute_import, print_function, division import...
import math import os import unittest import torch import torchaudio import torchaudio.functional as F import torchaudio.transforms as T import pytest import common_utils from common_utils import AudioBackendScope, BACKENDS class TestFunctional(unittest.TestCase): data_sizes = [(2, 20), (3, 15), (4, 10)] nu...
"""Module to perform QC on the xiRT performance.""" import glob import logging import os import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import palettable import pandas as pd import seaborn as sns import statannot from matplotlib import ticker from matplotlib.lines import Line2D from scipy....
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import logging import rasterio import zipfile import numpy as np from pathlib import Path from tempfile import TemporaryDirectory from ost.generic import common_wrappers as common from ost.helpers import helpers as h, raster as ras from ost.helpers.errors impo...
# Copyright (c) 2012-2013, Canon Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted only for the purpose of developing standards # within the HTTPbis WG and for testing and promoting such standards within the # IETF Standards Process. The fo...
# # Copyright (c) 2022, NVIDIA CORPORATION. # # 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 ...
# Copyright ClusterHQ Inc. See LICENSE file for details. # -*- test-case-name: flocker.control.test.test_diffing -*- """ Code to calculate the difference between objects. This is particularly useful for computing the difference between deeply pyrsisistent objects such as the flocker configuration or the flocker state...
"""\ wxPanel objects @copyright: 2002-2007 <NAME> @copyright: 2014-2016 <NAME> @copyright: 2016-2018 <NAME> @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ import logging import wx import clipboard import common, compat, config, misc from tree import Node import new_properties as np from edi...
""" This module contains the ModelVariable class to define a working variable in the calculation flows. """ from pycalcmodel import core from pycalcmodel import model_type from pycalcmodel import model_instance as model_inst from collections import OrderedDict from enum import Enum, unique, EnumMeta, IntEnum from hos...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import cv2 def _neg_loss(pred, gt): ''' Modified focal loss. Exactly the same as CornerNet. Runs faster and costs a little bit more memory Arguments: pred (batch x c x h x w) #almost equal to zero ...
import logging import sys import traceback from abc import ABC from argparse import ArgumentParser from copy import copy from datetime import datetime from enum import IntEnum, Enum from typing import ( Optional, List, Dict, Iterator, Type, KeysView, Union, cast, Any, Tuple, ) fr...
# Copyright (c) 2022 PaddlePaddle Authors. 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 ap...
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# main class import symjax import numpy as np from symjax import nn import symjax.tensor as T from symjax.probabilities import Categorical, MultivariateNormal import math import matplotlib.pyplot as plt from collections import deque import gym import random import scipy.signal # https://gist.github.com/heerad/1983d...
# Copyright (c) 2016 NTT DATA # # 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...
#! /usr/bin/env python3 # # Copyright 2019 California Institute of Technology # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
import random import numpy as np import torch import queue as py_queue import time import torch.nn as nn from pprint import pprint from ddpg.nets import Actor, Critic from common.torch_util import to_numpy, to_tensor, soft_update from common.misc_util import create_if_need, set_global_seeds from common.logger import L...
from typing import List, Tuple, Optional, Union import numpy as np import pandas as pd from chemicalc.reference_spectra import ReferenceSpectra import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from matplotlib.ticker import StrMethodFormatter from matplotlib.lines import Line2D def plot_gradien...
import torch import cv2 import os import datetime import numpy as np import pandas as pd from tqdm import tqdm from network.utils import bbox_iou from datetime import datetime import multiprocessing class Node: def __init__(self, box): self.box = box class Track: ''' Track is the class of track...
import collections.abc import dis import functools import inspect import itertools import json import os import queue import threading import types import dask.distributed as dd import numpy as np import toolz def expand(func): """ Decorator to expand an (args, kwargs) tuple in function calls Intended f...
#!/usr/bin/env python3 import codecs from collections import UserList from copy import deepcopy from trabant.math import vec3 GRID = 0.5 W2E, NW2SE, N2S, NE2SW, E2W, SE2NW, S2N, SW2NE, F2B, B2F, NORMAL_COUNT = range(11) chars = r' X><^v`´\/|*ltrb' square_triangles = [ [[False,False],[False,False]], [[True ,True...
# Copyright (c) 2018, NVIDIA CORPORATION. import pytest import numpy as np import pandas as pd from numba import cuda import pygdf as gd from pygdf.dataframe import Series, DataFrame from pygdf.buffer import Buffer from pygdf.settings import set_options from . import utils def test_buffer_basic(): n = 10 ...
# -*- coding: utf-8 -*- import math import torch from torch.nn import LayerNorm from .utils import divide, split_tensor_along_last_dim from .image_attention import get_conv_mask, get_row_mask, get_col_mask def gelu(x): return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x * (1.0 + 0.044715 * x * x))) @tor...
from . import MTYPE_INVOKE, perform_request from ..Codec import Codec # rpc_wifi_connect(in string ssid, in string password @nullable, uint32 security_type,int32 key_id, uint32 semaphore) -> int32 def connect(ssid, password, security_type, key_id, semaphore) : codec = Codec(14, 1, MTYPE_INVOKE, "I{}b{}IiI", "i") ...
# -*- coding: utf-8 -*- # # Copyright © 2009-2010 <NAME> # Licensed under the terms of the MIT License # (see spyderlib/__init__.py for details) """ spyderlib.plugins ================= Here, 'plugins' are widgets designed specifically for Spyder These plugins inherit the following classes (SpyderPluginMix...
from __future__ import division from __future__ import print_function from operator import itemgetter from itertools import combinations import time import os import pandas as pd import random import copy import scipy.io as sio import tensorflow as tf import numpy as np import networkx as nx import scipy.sparse as sp f...
from __future__ import print_function import FWCore.ParameterSet.Config as cms import sys import six ## Helpers to perform some technically boring tasks like looking for all modules with a given parameter ## and replacing that to a given value # Next two lines are for backward compatibility, the imported functions an...
import numpy as np import matplotlib.pyplot as plt import math import copy # from mpc_func_with_cvxopt import MpcController as MpcController_cvxopt from extended_MPC import IterativeMpcController from animation import AnimDrawer # from control import matlab from coordinate_trans import coordinate_transformation_in_ang...
import copy import json import pathlib import pdb import pickle import shutil import subprocess import time import numpy as np from amptorch.trainer import AtomsTrainer from ase.io.trajectory import Trajectory from model_eval import constants, utils #structure for holding dataset and parameters class dataset: d...
# --------------------- IMPORT MODULES ------------------------------------ : # import numpy as np import matplotlib.pyplot as plt import pandas as pd import pickle import healpy as hp import time # -------------- USEFUL DEFINITIONS AND PARAMETERS ------------------------- : # c_luz = 2.99792458e+5 # Velocidad de ...
# coding: utf-8 import numpy as np import pylab as pl import h5py from sklearn.utils import shuffle import bisect import os from chinn import variables CHANNELS_FIRST = "channels_first" CHANNELS_LAST = "channels_last" def load_pairs_as_dict(files, min_length=1000, min_dist=5000, max_dist=2000000, max_length=None):...
# -*- coding: utf-8 -*- """Build script. This contains sub-project entry point to build and release the package. """ import logging import os import sys import os.path as op import platform import subprocess import tempfile import shutil import re import time if sys.version_info[0] >= 3: from urllib.request impo...
import logging import os from typing import List from git import Repo, RemoteProgress, GitCommandError, Commit, Actor from pythoncommons.git_constants import ORIGIN from pythoncommons.git_constants import HEAD, COMMIT_FIELD_SEPARATOR FORMAT_CODE_HASH = "%H" FORMAT_CODE_COMMIT_MSG = "%s" FORMAT_CODE_DATE_ISO_8601 = "%...
# Copyright 2021 <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 writing, softwa...
import argparse import cv2 import numpy as np import os # When the four corners are identified, we will do a four-point # perspective transform such that the outmost points of each # corner map to a TRANSF_SIZE x TRANSF_SIZE square image. TRANSF_SIZE = 512*4 # # Answer sheet properties. # K = 4 ANSWER_SHEET_WIDTH =...
from tinyflow import autodiff as ad from tinyflow import ndarray, gpu_op import numpy as np import argparse import six.moves.cPickle as pickle import gzip import os def load_mnist_data(dataset): """ Load the dataset Code adapted from http://deeplearning.net/tutorial/code/logistic_sgd.py :type dataset: s...
#!/usr/bin/env python import os import time import shutil import random import os.path import getpass import unittest import threading from subprocess import Popen, PIPE try: import cPickle as pickle except ImportError: import pickle # Imports for testing from WMQuality.TestInit import TestInit from WMQuali...
#!/usr/bin/env python3 import requests import io import os from datetime import datetime import random import time from urllib.parse import quote import multiprocessing, threading from detection import yolo_all import rtsp import cv2 import pygame import numpy as np IP_ADDRESS = "192.168.1.115" AUTH ...
import logging import os from utils import execute_alto_command, bash_execute_file def upload_cellranger_mkfastq_input(buckets, directories, sample_tracking, cellranger_version, diskspace, memory): run_id = os.path.basename(sample_tracking['seq_dir'].tolist()[0]) fastq_flowcell_bucket = "%s/%s_fastqs" % (buck...
import argparse import os import utils import numpy as np import pandas as pd import matplotlib.pyplot as plt from param_stamp import get_param_stamp_from_args from param_values import set_default_values description = 'Compare CL strategies using various metrics on each scenario of permuted or split MNIST.' parser = ...
# coding=utf-8 # Python 3 import itertools import json import os import sys import requests from concurrent.futures import ThreadPoolExecutor from keboola import docker from kbc_tools import read_csv, csv_writer, slice_stream, make_batch_request, parallel_map, serialize_data BASE_URL = 'https://api.geneea.com/keb...
import os from lxml import etree from shapely.wkt import loads from operator import attrgetter from django.db import models from django.db.models import Q from django.conf import settings from django.contrib.auth.models import User from django.template.defaultfilters import slugify from django.db.models.signals import...
import os import sys filePath = os.path.abspath(os.path.dirname(__file__)) projPath = os.path.split(filePath)[0] sys.path.append(projPath) from tptk.common.road_network import load_rn_shp from tptk.common.trajectory import parse_traj_file from tptk.common.grid import Grid from tptk.common.mbr import MBR from tptk.comm...
import copy import json import os import subprocess import sys import uuid from abc import ABC, abstractmethod from datetime import datetime from json import JSONEncoder from pathlib import Path from pprint import pformat from typing import Any, Dict, List, Optional, Sequence, Tuple, Union from unittest.mock import pat...
import torch import torch.nn as nn from torch_geometric.data import Data import numpy as np from itertools import product import sys import torch.nn.functional as F from itertools import combinations import pickle def calc_iou(a, b): area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1]) iw = torch.min(torch.unsque...
# Copyright 2016 <NAME> """ A program to set up simple label switched paths (LSPs) between two IP based hosts in a users network. We will set up bidirectional paths with forwarding equivalence classes based on the destination and source IP addresses. The first switch connected to a host along a path will act as t...
""" Figure1: execution time analysis, LFR_benchmark, with tables @auth: <NAME> @date: 2016/05/04 """ # import packages # import copy as c import matplotlib.pyplot as plt import numpy as np import sys import time # import modulars import util.handler.gpickle_handler as gh import util.handler.pickle_handle...
"""Code to help instantiate templated classes, methods and functions.""" # pylint: disable=too-many-arguments, too-many-instance-attributes, no-self-use, no-else-return, too-many-arguments, unused-format-string-argument, unused-variable import itertools from copy import deepcopy from typing import List import gtwrap...
""" Utility functions for RPE """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rig...
from sympy import * from time import time from mpmath import radians import numpy as np import tf ''' Format of test case is [ [[EE position],[EE orientation as quaternions]],[WC location],[joint angles]] You can generate additional test cases by setting up your kuka project and running `$ roslaunch kuka_arm forward_k...
# # This is where the fun stuff happens - simulating the boids # # This file includes Vector classes borrowed from Cocos2D # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either versio...
#!/usr/bin/env python from __future__ import print_function, division from collections import deque from util import cached_property, memoized, nop from copy import copy import numpy as np import random import sys if sys.version_info[0] < 3: range = xrange class Cell(): empty = 0 shape = 1 ...
import tkinter as tk from tkinter import messagebox import random from PIL import ImageTk, Image import time from os import system import psutil from sys import platform if platform == "win32": system("title Administrator: Command Prompt") system("ver") print("(c) Microsoft Corporation. All r...
"""Methods for creating and viewing HTML snapshots of notebooks. It is useful to create and retain HTML snapshots of notebooks to track how results within a notebook changes over time as analysis work proceeds. """ import collections import os import tempfile from typing import Dict from typing import List from IPyt...
import threading from typing import List, Union, Optional, Dict import time import asyncio import io import logging import sys import os import pathlib import contextlib import json from fastapi import FastAPI, Query, Path, Depends, Request, WebSocket, APIRouter, HTTPException from fastapi.security import OAuth2Passw...
import argparse import builtins import math import os import random import shutil import time import warnings import torch import torch.nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim import torch.multiprocessing as mp import torch.utils.data import ...
#!/usr/bin/env python import os import argparse import logging import subprocess import csv import xml.etree.ElementTree as ET from collections import defaultdict import yaml from jinja2 import Environment, PackageLoader, select_autoescape logger = logging.getLogger() ERROR = logging.ERROR WARNING = logging.WARNING I...
# Copyright 2017 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 argparse from teachDRL.spinup.utils.run_utils import setup_logger_kwargs from teachDRL.spinup.utils.logx import EpochLogger from teachDRL.teachers.teacher_controller import TeacherController from teachDRL.teachers.algos.alp_gmm import ALPGMM #from teachDRL.teachers.algos.egt import EGT from teachDRL.teachers.alg...
from pytti import DEVICE, named_rearrange, replace_grad, vram_usage_mode from pytti.Image import DifferentiableImage from pytti.LossAug import HSVLoss from pytti.ImageGuide import DirectImageGuide import numpy as np import torch, math from torch import nn, optim from torch.nn import functional as F from torchvision.tra...
# -*- coding: utf-8 -*- """ Created on Sun Jan 5 10:15:34 2014 @author: Ian """ import unittest import os import math import numpy as np from PIL import Image # import geosoft.gxpy.system as gsys # import geosoft.gxpy.gx as gxp # import geosoft.gxpy.gdb as gxgdb import mvar # import pylab as plt import matplotlib...