text
stringlengths
8.04k
46.5k
import numpy as np import cv2 as cv from matplotlib import pyplot as plt from PyQt5 import QtCore from PyQt5.QtWidgets import * from PyQt5.QtGui import * import win32gui import win32print import win32con import win32api import win32com.client import map_insert import sys import re import pickle import os import pythonc...
""" ### env textacy==0.9.0 ... ### fetch source data - **Tatoeba:** A crowd-sourced collection of sentences and their translations into many languages. Style is relatively informal; subject matter is a variety of everyday things and goings-on. Source: https://tatoeba.org/eng/downloads. - **Leipzig Corpora:** A colle...
# Copyright 2010 by 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 writin...
import tvm from tvm import relay from . import layers from .init import create_workload, QuantizeInitializer def Conv(data, num_filter, input_channels, qconfig, kernel=(1, 1), stride=(1, 1), pad=(0, 0), name=None, suffix='', data_layout="NCHW", kernel_layout="OIHW"): if input_channels != 3: data = layer...
import logging import os from collections import defaultdict import tensorflow as tf from tqdm import tqdm from .losses import GeneratorMLELoss, PolicyGradientLoss from .models import Generator, Discriminator from .utils import set_seed, MultiCheckpointManager logger = logging.getLogger(__name__) class MonteCarloR...
""" ============ Polarization ============ Provides functions for: - Creating initial belief configurations for various scenarios. - Creating influence graphs for various scenarios. - The Esteban-Ray polarization measure. - Discretizing a belief state into a distribution. - Updating the belief state of an agent, see t...
from generator.actions import Actions import string import random import numpy as np import binascii import struct class CROMU_GENWORK(): def __init__(self, magic_page): self.magic_page = magic_page self.magic_page_position = 0 self.magic_page_size = len(magic_page) self.magic_matrix = None self.magic_matr...
#! /usr/bin/env python # Copyright (c) 2016-2018, Rethink Robotics 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...
#!/usr/bin/env python import io import json import logging import pathlib import zipfile from types import SimpleNamespace import boto3 import botocore import click import click_log import retrying from config import config logger = logging.getLogger(__name__) class AWS: class LeftoversError(Exception): ...
#!/usr/bin/env python3 # # Copyright (c) 2018 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of...
import sys import time import resource import argparse from enum import IntEnum from abc import ABC, abstractmethod from collections import defaultdict import yaml from termcolor import colored import mido from durations_nlp import Duration def defaultdict_rec(): return defaultdict(defaultdict_rec) ### Stat...
import argparse from pathlib import Path import networkx as nx import nxmetis import torch import torch.nn as nn import torch.multiprocessing as mp from torch_geometric.data import Data, DataLoader, Batch from torch_geometric.nn import SAGEConv, GATConv, GlobalAttention, graclus, avg_pool, global_mean_pool from tor...
"""This module contains the classes used for constructing and conducting an Experiment (most notably, :class:`CVExperiment`). Any class contained herein whose name starts with "Base" should not be used directly. :class:`CVExperiment` is the preferred means of conducting one-off experimentation Related ------- :mod:`hy...
import os import io import sys import gzip import re import sqlite3 import dbm from glob import glob from datetime import datetime, date, timedelta from pprint import pprint from math import nan, inf, pi as π, e import math from random import seed, choice, randint, sample from contextlib import contextmanager from coll...
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init import torch.backends.cudnn as cudnn import numpy as np from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from torch.nn.utils.clip_grad import clip_grad_norm def l1norm(matrix, dim, eps=1e-8): ...
from argparse import ArgumentParser from bayeformers import to_bayesian from collections import namedtuple from examples.hypersearch import HyperSearch from tensorboardX import SummaryWriter from torch.utils.data import DataLoader from torch.utils.data import Dataset from transformers import AutoConfig from transformer...
""" Created by <NAME> on Apr 24 2021 purpose: easily compare values between helita and aux vars from a simulation. Highest-level use-case: compare all the aux vars with their helita counterparts! #<< input: from helita.sim import aux_compare as axc from helita.sim import ebysus as eb dd = eb.EbysusDat...
import re from operator import attrgetter # My files from args import * from error import * from files import * from find_page import * from easy import * from trie import * from parse import * from cache import * glossary_taxon_dict = {} class Glossary: pass def __init__(self, name): self.name = na...
""" Multigrid --------- multigrid.py This file contains the MultiGrid class """ import numpy as np import os from tempfile import mkdtemp import yaml import copy import sys import matplotlib.pyplot as plt from .__metadata__ import __version__ from . import figures from .common import load_or_use_default, GridSize...
""" Authors: xnaas (2021-2022+), Nachtalb (2021) License: The Unlicense (public domain) """ import re import time from datetime import timedelta from math import floor as round_down from random import choices from secrets import choice as choose, randbelow from sopel import plugin, tools from sopel.formatting import bo...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications copyright (C) 2019 Uber Technologies, 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.apa...
""" Mininet: A simple networking testbed for OpenFlow/SDN! author: <NAME> (<EMAIL>) author: <NAME> (<EMAIL>) Mininet creates scalable OpenFlow test networks by using process-based virtualization and network namespaces. Simulated hosts are created as processes in separate network namespaces. This allows a comple...
# #Copyright Odin Solutions S.L. All Rights Reserved. # #SPDX-License-Identifier: Apache-2.0 # from http.server import HTTPServer, BaseHTTPRequestHandler import ssl import http.client import logging import sys import json import configparser import UtilsPEP from subprocess import Popen, PIPE import html import os imp...
import os import sys from PIL import Image from glob import glob import csv from multiprocessing import Pool import numpy as np from scipy.ndimage import gaussian_filter import torch from utils import ensure_dir, get_max_xy_in_paths from utils import find_str_in_list, compute_tile_xys, compute_patch_xys def get_wsi...
# -*- coding: utf-8 -*- import os import time import logging import glob import random import shutil from dateutil import tz import re import faiss import gevent from gevent.pool import Pool from gevent.threadpool import ThreadPool import numpy as np from tensorflow.python.lib.io import file_io from sklearn.metrics.pa...
# # Obtain smooth performance curves using artificial signals. # import os from pccf.detector import make_cusum_pccf, cusum, make_cusum_single_ref, \ make_cusum_single_pccf_ref from numpy.random import randn from pccf.examples.proof_of_concept_console import results_example from pccf.examples.common import save_jso...
from datetime import date, time, datetime, timedelta from dateutil.relativedelta import relativedelta from dateutil.tz import gettz from vobject.icalendar import utc from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from django.utils.safestring import mark...
from googleapiclient import discovery from httplib2 import Http from oauth2client import file, client, tools import json import os import random import re import requests import string import sqlite3 import time import urllib import yaml import collections import io import csv import zipfile from flask import Flask f...
# Copyright 2018 <NAME> & <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 i...
from .helper import match_with_text, match_with_class __version__ = "1.0" __api__ = "4.9" class Contact: def __init__(self, msg): self.phone_number = msg['phone_number'] self.first_name = msg['first_name'] self.last_name = match_with_text('last_name', msg) self.user_id = match_with_text('user_i...
# Copyright 2018 <NAME> # Copyright (C) 2008-2011 <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 app...
r"""@package motsfinder.numutils Miscellaneous numerical utilities and helpers. @b Examples ``` >>> binomial(5, 3) 10 ``` """ from contextlib import contextmanager import warnings from scipy.linalg import LinAlgWarning from scipy.integrate import fixed_quad, IntegrationWarning from scipy.interpolate impor...
# -*- coding: utf-8 -*- import time from time import strftime, localtime from datetime import datetime import numpy as np import tensorflow as tf from sklearn.metrics import classification_report import logging logger = logging.getLogger(__name__) # todo: hooks should also have prefixes so that one can use the sa...
import json import pickle import matlab import scipy import numpy as np import os import yaml from EDL.dialogue.MatEngine_object import eng1 from EDL.dialogue.func_helpers import CalculateFuncs, ScorecardDataFrameFuncs, get_variable_info, correlation_multiprocessing from EDL.models import EDLContextScorecards from d...
#====================== 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 vers...
""" Main Robinhood Client """ from datetime import datetime import requests import time import tradinhood.endpoints as URL from tradinhood.util import * from tradinhood.errors import * from tradinhood.models import * # jUsT a ChRoMe bRowSer Bro API_HEADERS = { "Accept": "*/*", "Connection": "keep-alive", ...
import math import time import numpy as np import matplotlib.pyplot as plt from functions import * import multiprocessing as mp from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * hist_all_nodes = [] hist_remaining_nodes = [] # COMMIT TEST hist_time_for_method = [] hist_time_for_tarjan = [] c...
import traceback import threading from tabulate import tabulate import time import collections import grp import base64 import pwd from contextlib import contextmanager import platform from pathlib import Path import importlib.util import random from copy import deepcopy import subprocess import importlib import sys im...
from olnet import run_sim, save_sim, save_sim_hdf5 from olnet.tuning import get_orn_tuning, get_receptor_tuning, create_stimulation_matrix, gen_shot_noise, combine_noise_with_protocol, gen_gauss_sequence from brian2 import * import numpy as np import olnet.models.droso_mushroombody_apl as droso_mb from olnet import Att...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ _____________________________________________________________________________ Created By : <NAME> - Nghiann3 Created Date: Fri March 12 13:00:00 VNT 2021 Project : AkaOCR core _____________________________________________________________________________ This file con...
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. '''Module for doing template translations from VarInstructions to BpfInstructions. We deliberat...
import pandas as pd import numpy as np # makes multiple instances of the object available. from logistics.plugins.metaclass import Meta # imports all data types. from logistics.plugins.types import * # stores menu options over functions and class methods for listing. class Record(metaclass = Meta): # initializ...
import copy import json import os import re import shutil import sys from collections import defaultdict from datetime import datetime from pathlib import Path from typing import Any, Dict, List, Optional, TextIO, Tuple, Type, Union import click import htmlmin import jinja2 import markdown2 from jinja2 import FileSyst...
# -*- coding: utf-8 -*- from warnings import warn import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.stats from ..complexity import (complexity_lempelziv, entropy_approximate, entropy_fuzzy, entropy_multiscale, entropy_sample, ...
import csv import datetime import os import sqlite3 import sys import time import discord from discord.ext import commands sys.path.insert(0, '') from TypeRacerStats.config import BOT_ADMIN_IDS, MAIN_COLOR from TypeRacerStats.file_paths import DATABASE_PATH, TEMPORARY_DATABASE_PATH from TypeRacerStats.Core.Common.accou...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: <NAME> # email: <EMAIL> import errno import glob import os import shutil import subprocess import sys import importlib import time import numpy as np import matplotlib.pyplot as plt from astropy.io import ascii, fits from astropy.table import Table from astropy ...
from django.http.response import HttpResponse, JsonResponse from django.urls import reverse from django.shortcuts import redirect, render, get_object_or_404 from django.views.decorators.csrf import csrf_exempt ######## csrf token 오류 날 경우 추가! from django.db.models import Q from django.core.paginator import Paginator fr...
""" entities """ from __future__ import absolute_import, division, print_function, unicode_literals import logging import uuid from mceditlib import nbt from mceditlib.blocktypes import VERSION_1_7, VERSION_1_8 from mceditlib.blocktypes.itemtypes import ItemType from mceditlib.geometry import Vector from mceditlib...
from redis.exceptions import ( ConnectionError, DataError, RedisError, ) from redis.crc import key_slot from .core import DataAccessCommands from .helpers import list_or_args class ClusterMultiKeyCommands: """ A class containing commands that handle more than one key """ def _partition_ke...
# load file from torch.utils.data import Dataset, DataLoader,SubsetRandomSampler import os from torch.nn.utils import clip_grad_norm_ from torch.nn.utils.rnn import pad_packed_sequence, pad_sequence, pack_padded_sequence from io import open import unicodedata import string import re import random import torch...
# Copyright 2020 Huawei Technologies Co., Ltd.All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
""" Module for generating images and animations. Code for 'generating an unsig' was extracted from minting transaction of unsig00000: tx_id = e4a90da18935e73f7fd6ffaa688b35b011a1a8a710b47bdb5d7103a05afc0197 """ import os import math import asyncio from typing import List, Optional import numpy as np from PIL import ...
import seaborn as sns import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import SymmetricalLogLocator, FixedLocator import pandas as pd from ops.io import GLASBEY import random from itertools import combinations from functools import partial from adjustText import adjust_text plt.rcParams['font....
# before running this code, set Working Directory to Project Directory in Run->Edit Configurations->Working Directory import operator import csv import pickle import shutil import math, random from datetime import datetime import multiprocessing as mp, os import util import pandas as pd import random import numpy as n...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import sympy import matplotlib.pyplot as plt from scipy import integrate from scipy.special import legendre from numpy.polynomial.legendre import Legendre import matplotlib.ticker as mtick import itertools # Legendre polynomial def leg(n, x): r...
# Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved. from collections import OrderedDict import torch import torch.nn as nn def make_layers(block, no_relu_layers): layers = [] for layer_name, v in block.items(): if 'pool' in layer_name: layer = nn....
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Created by <NAME> import json import requests import click import asyncio import aiohttp import aiofiles import os import pandas as pd from typing import Union import vcfpy2 as vcfpy import subprocess import allel from collections import defaultdict _FIELDS_BASIC = ( ...
# <NAME> 23 July 2018 # This module holds a variety of functions that are used for printing info to the terminal or to a log file. # astroconda packages import os import time as t import numpy as np import astropy.units as u from astropy.time import Time from astropy import coordinates #gemini packages from dt import...
import torch import sys import ccs import constants from data_loaders import data_loader from data_loaders.data_loader import Data, DataLoader, RestorableData import dictionary class SegmentationDataLoader(DataLoader): def __init__( self, use_bigram=False, use_chunk_trie=False...
#!/usr/bin/env python # coding: utf-8 # # 02__pairwise_alignment # # in this notebook, i determine the pairwise seq alignment scores between non-conserved TSS regions vs. closest TSS # In[1]: import warnings warnings.filterwarnings('ignore') import pandas as pd import math import matplotlib.pyplot as plt import n...
# Import libraries import pandas as pd import psycopg2 # information used to create a database connection sqluser = 'postgres' dbname = 'mimic4' hostname = 'localhost' port_number = 5434 schema_name = 'mimiciv' # Connect to postgres with a copy of the MIMIC-III database con = psycopg2.connect(dbname=dbname, user=sql...
import glob, re, html, nltk, os, heapq, argparse, sys, time, statistics, shutil from w3lib.html import replace_entities from collections import Counter from collections import OrderedDict from nltk.stem.porter import PorterStemmer # global variable size_limit = 1000 single_term_idx = Counter() sti_fn = 0 sin...
#! /usr/bin/env python3 # <<BEGIN-copyright>> # Copyright 2021, Lawrence Livermore National Security, LLC. # See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: BSD-3-Clause # <<END-copyright>> import os, sys from argparse import ArgumentParser from xData import standards as standardsModule f...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import logging from collections import OrderedDict import numpy as np from astropy import units as u from astropy.units import Quantity from astropy.table import Table, Column from astropy.coordinates import SkyCoord, Angle from gammapy.catalog import Sour...
import functools import time import pygad import numpy as np import pylab as pl NUM_GAUSSIANS = 4 MIN_A = 0.1 MAX_A = 10 MIN_X = -10 MAX_X = 10 MIN_SIGMA = 0.1 MAX_SIGMA = 4 def gaussian(x, A, x0, sigma): return A * np.exp(-(x-x0)**2/(2 * sigma**2)) def get_function(x_array, magnitudes, center...
from __future__ import print_function from builtins import zip from builtins import range from builtins import object from cosmosis.gaussian_likelihood import GaussianLikelihood from cosmosis.datablock import names from twopoint_cosmosis import theory_names, type_table from astropy.io import fits from scipy.interpolate...
#!/usr/bin/python3 from hashlib import sha1 import requests import threading import time from eth_abi import decode_abi from hexbytes import HexBytes from .history import ( TxHistory, _ContractHistory ) from .event import ( decode_logs, decode_trace ) from .web3 import Web3 from brownie.convert impor...
import math import torch from torch import nn import matplotlib.pyplot as plt import numpy as np import os.path from matplotlib.lines import Line2D from mpl_toolkits.mplot3d import Axes3D import matplotlib.patches as patches import pandas as pd import seaborn as sns import gpytorch import copy import matplotlib as mpl ...
""" Script used to test the adaptive interpolation and the evaluation of said interpolant """ from __future__ import absolute_import import ctypes import ctypes.util import os import time import numpy as np import numpy.linalg as la import scipy.special as spec import matplotlib as mpl from tempfile import TemporaryD...
# SD AWG M3202A from colorama import init, Fore, Back init(autoreset=True) #to convert termcolor to wins color from os.path import basename as bs mdlname = bs(__file__).split('.')[0] # module's name e.g. PSG from numpy import zeros, ceil, where from pyqum.instrument.logger import address, set_status from pyqum.instrum...
#!/usr/bin/python # Filename: grids.py # # Code by <NAME>, distributed under an MIT License # Any publication benefitting from this piece of code should cite # Jucker, M 2014. Scientific Visualisation of Atmospheric Data with ParaView. # Journal of Open Research Software 2(1):e4, DOI: http://dx.doi.org/10.5334/jors.al ...
#!/usr/bin/python # Main library file containing all the protocol generation logic. def generate_main_code(type, main_header_file, resolver_cc_file, metrics_header_file, input_files): """ Main code generator. Takes input files and processes them into structures representing a Kafka message (request or res...
import torch import torch.utils.data import numpy as np import cv2 import math import os from abc import ABC, abstractmethod try: import face_alignment from face_alignment.detection.sfd import FaceDetector except ImportError: raise ImportError( "Please install face alignment package from " ...
"""Run the E2E workflow. This script submits Argo workflows to run the E2E tests and waits for them to finish. It is intended to be invoked by prow jobs. It requires the workflow to be expressed as a ksonnet app or a Python function. The script can take a config file via --config_file. The --config_file is expected ...
import itertools from itertools import starmap from toolz.utils import raises from functools import partial from random import Random from pickle import dumps, loads from toolz.itertoolz import (remove, groupby, merge_sorted, concat, concatv, interleave, unique, ...
import numpy as np import pytest from scipy.sparse import issparse from scipy.sparse import coo_matrix from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import dok_matrix from scipy.sparse import lil_matrix from sklearn.utils.multiclass import type_of_target from sklearn.util...
""" The most ridiculous implementation of Pong you will see on CodeSkulptor Update 7/1/15: Made all Ahnold voice clips permalinks on Dropbox NOTE: may consume a lot of memory on your computer try restarting the game or app once in a while NOTE 2: In order to experience the full game please make sure to have Quicktim...
# -*- coding: utf-8 -*- import csv import datetime import logging import requests import tempfile import zipfile from collections import OrderedDict from datetime import date from decimal import Decimal from django.core.management.base import BaseCommand from django.db import connection from requests_oauthlib import O...
#!/usr/bin/python2 """ (C) Copyright 2018-2019 Intel 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 appli...
""" Copyright 2020 Nvidia Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Re...
import inspect import types from collections import defaultdict from datetime import datetime from enum import Enum from typing import Callable from flask import jsonify, request, url_for from werkzeug.datastructures import MultiDict, ImmutableMultiDict from appkernel.http_client import RequestHandlingException from ...
# Copyright 1999-2021 Alibaba Group Holding 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 a...
# coding: utf-8 from flask import render_template, Blueprint, Markup, g from flask_googlemaps.icons import dots import json DEFAULT_ICON = dots.red DEFAULT_CLUSTER_IMAGE_PATH = "static/images/m" class Map(object): def __init__(self, identifier, lat, lng, ...
import numpy as np import pandas as pd from scipy.stats import mode from tqdm import tqdm from geopy.geocoders import Nominatim from datetime import datetime def handle_bornIn(x): skip_vals = ['16-Mar', '23-May', 'None'] if x not in skip_vals: return datetime(2012, 1, 1).year - datetime(int(x), 1, 1)...
from collections import namedtuple import json import numpy as np from numpy.linalg import lstsq from scipy.optimize import nnls from lmfit import Parameters, minimize, fit_report from xraydb import (material_mu, mu_elam, ck_probability, xray_edges, xray_lines, xray_line) from xraydb.xray import...
# Copyright (c) 2011 <NAME> <<EMAIL>> # Copyright (c) 2010 <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...
# SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT """ `adafruit_clue` ================================================================================ A high level library representing all the features of the Adafruit CLUE. * Author(s): <NAME> Implementation Notes -----...
# ========================================================================= # Copyright <NAME> # # Licensed under the 3-Clause BSD-License (the "License"); # you may not use this file except in compliance with the License. # # Unless required by applicable law or agreed to in writing, software # distributed under ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re, logging, operator, json, urllib, difflib from math import radians, cos, sin, asin, sqrt from collections import OrderedDict import facebook, twitter from google.appengine.api import memcache from google.appengine.api import urlfetch from django.template.defa...
## @package train # Module caffe2.python.models.seq2seq.train from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import collections import logging import math import numpy as np import random import time i...
# Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved. import torch from torch.nn import functional as F import numpy as np def rotation_matrix_to_quaternion(rotation_matrix, eps=1e-6): """Convert 3x4 rotation matrix to 4d quaternion vector This algorithm is based on al...
# Copyright 2015 Google 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 applicable law or a...
import json, logging from django.core.exceptions import ValidationError try: from django.urls import reverse except ImportError: from django.core.urlresolvers import reverse from django.core.validators import validate_ipv4_address, validate_ipv6_address from django.http import HttpResponse from django.shortcut...
""" Code for "Invertible Residual Networks" http://proceedings.mlr.press/v97/behrmann19a.html ICML, 2019 """ import numpy as np import torch import torch.nn as nn import torch.distributions as distributions import torch.nn.functional as F from .model_utils import injective_pad, ActNorm2D, Split from .model_utils impor...
# -*- coding: utf-8 -*- from ..logger import logger logger.debug("Started 'reading process/file_.py'") import pyqtgraph as pg import pyqtgraph.exporters import time import os.path import sys import numpy as np from qtpy import uic, QtGui, QtCore, QtWidgets import shutil, subprocess import datetime import json import re...
"""Common functionality for multiprocess system basees built with the python 'multiprocess' module. Intended as a base class, not for direct usage.""" import signal import sys from functools import partial from thespian.actors import * from thespian.system.addressManager import ActorLocalAddress, CannotPickleAddress...
from __future__ import print_function, division import os import struct import hashlib from copy import deepcopy import h5py import numpy as np from ..util.meshgrid import meshgrid_nd from ..util.functions import FreezableClass, link_or_copy from astropy import log as logger from .grid_helpers import single_grid_dim...
import torch import torch.nn as nn import torchvision import matplotlib.pyplot as plt import numpy as np from brancher.variables import RootVariable, ProbabilisticModel from brancher.standard_variables import NormalVariable, EmpiricalVariable, BinomialVariable, DeterministicVariable, RandomIndices, CategoricalVariabl...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import argparse import collections import functools import json import logging import os import sys import warnings from typing import (IO, Any, Callable, Dict, List, Text, Tuple, Union, cast, Mapping...