text
stringlengths
6.04k
39.5k
"""Audio queue management.""" import asyncio import atexit import collections import copy import discord import enum import json import os import queue import subprocess import threading import time import uuid from typing import cast, Any, Awaitable, Callable, Deque, List, Optional import uita.exceptions import uita....
# 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 # distributed under the Li...
#!/usr/bin/env python """ AER1415 Computer Optimization - Assignment 1 Author: <NAME> Submitted: Feb 25, 2021 Email: <EMAIL> Descripton: """ from numpy import * import os from matplotlib import pyplot as plt from IPython import embed from mpl_toolkits import mplot3d from matplotlib import cm import...
import pygame import random class stobs: def __init__(self, x, y): self.x = x self.y = y self.wd = 50 self.ht = 50 self.plimg = pygame.image.load('./images/cone.jpeg') self.plimg = pygame.transform.scale( self.plimg, (self.wd, self.ht)) self.surf...
import tensorflow as tf import numpy as np from edward.models import RandomVariable from tensorflow.contrib.distributions import (Distribution, FULLY_REPARAMETERIZED) # from tensorflow.python.ops.distributions.special_math import log_ndtr from tf_gbds.utils import pad_extra...
""" Tests shelflist-app classes derived from `export.exporter.Exporter`. """ import pytest import importlib import random # FIXTURES AND TEST DATA # Fixtures used in the below tests can be found in ... # django/sierra/base/tests/conftest.py: # derive_exporter_class, new_exporter, record_sets, # sierra_full_obj...
# This work developed by NOAA/NWS/EMC under the Apache 2.0 license. import cartopy.crs as ccrs class Domain: def __init__(self, domain='global', dd=dict()): """ Class constructor that stores extent, xticks, and yticks for the domain given. Args: domain : (str; default=...
import socket import numpy as np from select import select import threading import time def clamp(x,min,max): "Clamps the value x between `min` and `max` " if x < min: return min elif x > max: return max else: return x def check_server(ip='192.168.127.12', port=23, timeout=3)...
# =================================================================================================== # _ __ _ _ # | |/ /__ _| | |_ _ _ _ _ __ _ # | ' </ _` | | _| || | '_/ _` | # |_|\_\__,_|_|\__|\_,_|_| \__,_| ...
from cuda.upfirdn_2d import * from cuda.fused_bias_act import fused_bias_act ################################################################################## # Layers ################################################################################## class Conv2D(tf.keras.layers.Layer): def __init__(self, fmaps,...
## ## Name: test_scrubby.py ## Purpose: Unit tests for scrubby.py ## ## Copyright (C) 2009, <NAME>, All Rights Reserved. ## import scrubby as S import unittest, functools # {{ class test_scanner class test_scanner(unittest.TestCase): """Low-level tests for the markup_scanner class. Only tests the internal ...
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import json import logging from dataclasses import dataclass import ijson from pants.backend.go.module import ( DownloadedExternalModule, Downl...
"""module for checking if source needs to be updated in Knowledge Network (KN). Contains the class SrcClass which serves as the base class for each supported source in the KN. Contains module functions:: get_SrcClass(args) compare_versions(SrcClass) check(module, args=None) main_parse_args() Example...
from django.contrib.auth import login, authenticate from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.utils import timezone import random from .forms import RegistrationForm, VehicleForm from django.contrib.auth.models import User from django.contrib imp...
# Generated by Django 4.0.3 on 2022-03-20 16:07 from django.db import migrations def seed_pickles(apps, schema_editor): pickles = [ ("Ahold", "Ahold Pickle Chips Hamburger Dills"), ("The Brinery", "The Brinery Pickles Jape Kin Cod"), ("Marco Polo", "Marco Polo Home Made Pickled Mushrooms"),...
"""Unit tests for stupendous_cow.db.core""" from stupendous_cow.db.core import * from stupendous_cow.testing import DatabaseTestCase import datetime import os import os.path import sqlite3 import unittest class ResultSetTests(DatabaseTestCase): def test_retrieve_all_items(self): def the_test(cursor): ...
"""Functions for reading and writing XDMF files.""" import logging import os from copy import deepcopy import h5py import lxml.etree as etree import numpy as np from mocmg.mesh import GridMesh, Mesh module_log = logging.getLogger(__name__) numpy_to_xdmf_dtype = { "int32": ("Int", "4"), "int64": ("Int", "8")...
import numpy as np import cv2 import operator import numpy as np from matplotlib import pyplot as plt def plot_many_images(images, titles, rows=1, columns=2): """Plots each image in a given list as a grid structure. using Matplotlib.""" for i, image in enumerate(images): plt.subplot(rows, columns, i+1) plt.imsh...
import bpy from . import settings, utils from bpy.props import (StringProperty, BoolProperty, IntProperty, FloatProperty, EnumProperty, PointerProperty, ) from bpy.types import (Pan...
################################################################################################################# #### GUI Interface for users ################################################################################################################# from tkinter import * import tkinter as tk import tkinter.messa...
import random import copy class PuzzleNode: def __init__(self, node_state, parent=None, depth=0): self.node_state = node_state self.parent = parent self.depth = depth self.dimension = int((len(node_state) - 1)**0.5) self.value = 0 if self.dimension ** 2 + 1 != len(no...
import logging from abc import ABCMeta, abstractmethod from collections import defaultdict from typing import List, Set, Union, Tuple, Any from ontobio import Ontology from ontobio.assocmodel import AssociationSet from genedescriptions.commons import CommonAncestor, TrimmingResult from genedescriptions.ontology_tools...
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
import re, hashlib, base64, os, sys from os.path import exists, dirname, basename, isdir from . import urlregexps from . import utils from .utils import join, normpath, abspath, relpath # from . import buildsystem #not directly used class RewriterError(Exception): def __init__(self, value): self.value = value...
from flask import render_template, flash, redirect, url_for, request from app import app, db, scheduler from app.forms import LoginForm, RegistrationForm, ResetPasswordRequestForm, ResetPasswordForm from flask_login import current_user, login_user, logout_user, login_required from app.models import User from werkzeug.u...
from inspect import getmembers, isclass, isfunction, ismethod, iscoroutinefunction from time import perf_counter, process_time from pathlib import PurePath from logging import getLogger, INFO from functools import wraps from smtplib import SMTP_SSL from email.mime.text import MIMEText from sanic import Sanic, response...
import sys import argparse import os.path import math as m import cv2 import numpy as np import yaml import traceback try: import quaternion except: print('Install numpy-quaternion %s (%s) (which also requires scipy and optionally numba)' % ("pip3 install numpy-quaternion", "https://github.com/moble/qua...
import sys import math import numpy as np from datetime import datetime import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence def ortho_weight(ndim): """ Random orthogonal weights Used...
import math from collections import OrderedDict import logging logger = logging.getLogger(__name__) import numpy as np import torch import tensorflow as tf from paragen.generators import AbstractGenerator, register_generator from paragen.utils.io import remove from paragen.utils.runtime import Environment @register...
''' Created on March 7, 2020 @author: flanagan.197 ''' from csv import * from random import * from sqlite3 import * def defineDatabase(cursor): # output file for DDL ddl = open('DDL.txt', 'w') cursor.execute('''CREATE TABLE BOOK ( ISBN VARCHAR(12) NOT NULL, ...
""" Data loader for TUM RGBD benchmark @author: <NAME> @date: March 2019 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys, os, random import pickle import numpy as np import os.path as osp import torch...
""" @Time : 2021/8/27 14:35 @Author : <NAME> @E-mail : <EMAIL> @Project : CVPR2021_PDNet @File : pdnet.py @Function: """ import torch import torch.nn as nn import torch.nn.functional as F import backbone.resnet.resnet as resnet class PM(nn.Module): """ positioning module """ def __init__(s...
#!/usr/bin/python # coding:utf8 """ @author: <NAME> @time: 2019-10-17 16:55 """ import tensorflow as tf import modeling import optimization as optimization # _freeze as optimization import os, math, json from sklearn.metrics import classification_report #使用GPU os.environ['CUDA_VISIBLE_DEVICES'] = '0' # 100167/64 = 1...
# -*- coding: utf-8 -*- # # Copyright (c) 2018-2020 <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, modif...
import collections import subprocess import contextlib import warnings from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio import SeqIO from Bio import BiopythonExperimentalWarning with warnings.catch_warnings(): warnings.simplefilter('ignore', BiopythonExperimentalWarning) from Bio import Sea...
import torch import math from data import pad, NODE_TYPE from dgl.nn.pytorch import edge_softmax from torch import nn from torch.nn.utils.rnn import pack_padded_sequence,pad_packed_sequence import torch.utils.data def replace_ent(x, ent, V, emb): # replace the entity mask = (x>=V).float() _x = emb((x*(1.-m...
from datetime import datetime, timezone from random import randint from typing import List, Union from sqlalchemy import select, UniqueConstraint from sqlalchemy import Table, Column, ForeignKey, Boolean, \ Integer, String, Text, Date, DateTime from sqlalchemy.orm import relationship from sqlalchemy.ext.hybrid impo...
# calculating the intragroup average distance, showing that is is significantly increases with age, # TRF is lower than 24-month-old AL. Make a figure # note about scaling - the metabolom matrix has the metabolites in rows (animals col), # and scaling normalizes the columns, so we need to scale the transpose o...
import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential, Model from tensorflow.keras.layers import Input, TimeDistributed, Activation, Lambda from tensorflow.keras.layers import Conv2D, MaxPool2D, Flatten, Dense, AvgPool2D from tensorflow.keras.layers import Concatenate, Subtract, Mult...
# pylint: disable=invalid-name, arguments-differ, missing-docstring, line-too-long, no-member, redefined-builtin, abstract-method from functools import partial from typing import List, Tuple import math import torch from e3nn import o3, rs from e3nn.linear_mod import KernelLinear from e3nn.util.eval_code import eval_c...
""" Functionality to perform inference. Acts as runner between image queue and GPU cluster containing trained models. inference_runner.py """ import os import os.path as op import time import base64 import json import tempfile from io import BytesIO from functools import partial import logging import requests import ...
from __future__ import (absolute_import, division, print_function) from collections import Iterable, OrderedDict import wrapt import numpy as np import numpy.ma as ma from .units import do_conversion, check_units, dealias_and_clean_unit from .util import iter_left_indexes, from_args, to_np, combine_dims from .py3co...
"""The basic reactor module. This has 'input' cells and compute cells, which are string names that are (nominally) mapped to the context module. The idea is that the compute cells take a context object, but also have predicates that are evalutated in an "or" fashion until either all of them are false, or one of them ...
#!/usr/bin/env python3 # Copyright 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """Full DrQA pipeline.""" import heapq import logging import math import time from multiprocessing import Pool...
import os import sys import csv import json import math import enum import numpy as np import matplotlib.pyplot as plt from matplotlib import colors from os import listdir from os.path import isfile, join from skimage import measure from skimage import filters from scipy import ndimage class OutputShapeType(enum.Enum...
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.5.0 # kernelspec: # display_name: Python [conda env:PROJ_irox_oer] * # language: python # name: conda-env-PROJ...
#!/usr/bin/env python # Created by <NAME> # https://github.com/ImreSamu/natural-earth-vector-qa # from SPARQLWrapper import SPARQLWrapper, SPARQLExceptions, JSON from urllib.error import URLError, HTTPError from sys import argv import argparse import datetime import editdistance import fiona import jellyfish im...
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from decimal import Decimal from datetime import date from django.apps import apps from django.conf import settings from django.core import mail from django.contrib import messages from django.shortcuts import redirect from django.core.ur...
import numpy as np import torch import matplotlib.pylab from fiery.utils.instance import predict_instance_segmentation_and_trajectories DEFAULT_COLORMAP = matplotlib.pylab.cm.jet def flow_to_image(flow: np.ndarray, autoscale: bool = False) -> np.ndarray: """ Applies colour map to flow which should be a 2 ch...
from functools import partial from . import utils import numpy as np import jax.numpy as jnp import jax.random as random from jax import grad, jit, vmap, lax, jacrev, jacfwd, jvp, vjp, hessian #class Lattice(seed, cell_params, sim_params, def random_c0(subkeys, odds_c, n): """Make random initial conditions g...
"""Test suit for the Blockschaltbild boilerplate generator.""" import unittest from ..bsb import Blockschaltbild, BlockschaltbildCoordinate, Block class TestBlock(unittest.TestCase): def test_no_pars(self): """Test if a block is initialised correctly if no parameters are specified.""" x, y = 3.1...
# Copyright (c) 2015 <NAME> # # See the file license.txt for copying permission. from datetime import datetime from hbmqtt.mqtt.packet import PUBLISH from hbmqtt.codecs import int_to_bytes_str import os import ssl import sys import json import random import asyncio import traceback import threading import importlib im...
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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: # # 1. Redistributions of source code must retain the above copyri...
#coding=utf-8 from __future__ import with_statement from itertools import chain from select import select import os import socket import sys import threading from ssdb._compat import (b, xrange, imap, byte_to_chr, unicode, bytes, long, BytesIO, nativestr, basestring, ...
import sys import time from concurrent.futures import ThreadPoolExecutor from os import mkdir, path from os.path import isdir from urllib.parse import urlparse import requests from bs4 import BeautifulSoup from PyQt5 import uic from PyQt5.QtCore import QObject, QRect, Qt, QThread, pyqtSignal, pyqtSlot from PyQt5.QtGui...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
from ._base import * from .types import CreateSchemaType, UpdateSchemaType from .models import LazyHasher, LazyUserSchema, LazyDBConfig, LazyDBSaveMetrics logger = get_logger('LazyDB', module='core') # Creates various lookup values for relationships class LazyDBIndex: pass class LazyDBModel: def __init__(...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: locationsharinglib.py # # Copyright 2017 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including withou...
import os from fnmatch import fnmatch import pickle # General Processing import numpy as np import pandas as pd import collections # DECOMPOSITION from sklearn.decomposition import NMF from scipy.linalg import svd # NLU from ibm_cloud_sdk_core.authenticators import IAMAuthenticator from ibm_watson import NaturalLan...
""" Copyright 2018 Novartis Institutes for BioMedical Research 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 agr...
#!/usr/bin/env python3 import tensorflow as tf import numpy as np import os import math import foolbox import scipy import matplotlib.pyplot as plt from PIL import Image #Utilizes the FoolBox Python library (https://github.com/bethgelab/foolbox) to implement a variety #of adversarial attacks against deep-learning mo...
# Author: <NAME> # Date: 5 Feb 2019 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
import time import sys import vlc #sudo pip3 install python-vlc from tkinter import Tk, StringVar,Frame,Label,Button,Scrollbar,Listbox,Entry,Text from tkinter import Y,END,TOP,BOTH,LEFT,RIGHT,VERTICAL,SINGLE,NONE,NORMAL,DISABLED class VideoPlayer(object): # used first time and for every other instance def...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import joblib import torch import torch.nn as nn import torch.nn.functional as F from torch.optim import Adam, SGD import tqdm import itertools from sklearn.linear_model import LogisticRegression from sklearn.neighbors import KNeighborsCla...
import asyncio import glob import importlib import inspect import logging import os import re import sys import time import sqlalchemy from cloudbot.event import Event from cloudbot.util import database logger = logging.getLogger("cloudbot") logger.setLevel(logging.DEBUG) ch = logging.StreamHandler(sys.stdout) ch.s...
""" Implement the Vanilla Interval domain based on PyTorch. Vanilla Interval: Simply propagates using interval arithmetic without any optimization. """ from __future__ import annotations from pathlib import Path from typing import Tuple, Union, Iterator, Callable, Iterable import torch from torch import Tensor, ...
""" CR module customisations for DRK License: MIT """ from gluon import current, URL, \ A, DIV, H2, H3, H4, P, TABLE, TR, TD, XML, HR from core import IS_ONE_OF # ------------------------------------------------------------------------- def check_in_status(site, person): """ De...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np activations = nn.ModuleDict([ ['sigmoid', nn.Sigmoid()], ['tanh', nn.Tanh()], ['lrelu', nn.LeakyReLU()], ['relu', nn.ReLU()], ['selu', nn.SELU()], ...
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2021 <NAME> (The Compiler) <<EMAIL>> # # This file is part of qutebrowser. # # qutebrowser 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, e...
from protocols.forms import verbs as verb_forms from protocols.forms import forms import time import pprint pp = pprint.PrettyPrinter(indent=4) def get_verb_list(): verb_list = [] for attr_name in dir(verb_forms): form_candidate = getattr(verb_forms, attr_name, None) try: if issubc...
"""main server script will sit onboard host and operate as Nebula --- its dynamic soul""" # -------------------------------------------------- # # Embodied AI Engine Prototype v0.10 # 2021/01/25 # # © <NAME> 2020 # <EMAIL> # # Dedicated to <NAME> # # -------------------------------------------------- from random impo...
#!/usr/bin/env python3 # pylint:disable=line-too-long """ The tool to check the availability or syntax of domains, IPv4 or URL. :: ██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗ ██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝ ███...
""" OpenCTM Exporter for Maya. """ import maya.api.OpenMaya as OpenMaya import maya.OpenMayaMPx as OpenMayaMPx import sys from ctypes import * import openctm __author__ = "<NAME>, <NAME>" __version__ = "0.2" kPluginTranslatorTypeName = "ctm" kOptionScript = "OpenCTMExporterScript" kOptionsTypes = { 'normals': bo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # wxgonk.py # TODO: # Eventually, index.html should be used # to present the data (i.e. build the display table). For troubleshooting # purposes, can also turn this into an AFI 11-202v3 tutorial. # -Include an option for using USAF rules vice FAA rules. Under FAA rule...
#!/usr/bin/env python # coding: utf-8 -*- # # GNU General Public License v3.0+ # # Copyright 2022 Arista Networks AS-EMEA # # 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.ap...
import json import os import pathlib import pickle import shutil import tempfile from abc import ABCMeta, abstractmethod from datetime import datetime from typing import Optional, Iterable, Mapping, Any, Set, Dict, List, MutableMapping, Union, Tuple import logging import arrow from anyio import open_file from deepdiff ...
import functools import jax from jax import lax import jax.numpy as jnp import math from distla_core.utils import misc from distla_core.utils import pops from distla_core.utils import vops ############################################################################## # TSQR ##########################################...
from base.base_sql import Sql import excel.excel_parse as ep from excel.excel_base import * from excel.excel_sql import * def load_lep_table(answers, comp_id): col_num_pp = None col_name_lep = None col_god_vvoda = None col_disp_name = None col_napr = None col_colcep = None col_dlpotr = Non...
# Copyright 2015 <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, s...
""" Serve as a convenient wrapper for validate.py. """ import gc import os import timeit import IPython import torch import numpy as np import scipy.misc as misc import yaml from torch.utils import data from ptsemseg.loader import get_loader from ptsemseg.utils import get_logger from utils import test_parser from ...
from datetime import datetime import numpy as np import pandas as pd from sklearn.utils import shuffle from data_process import data_process_utils from data_process.census_process.census_data_creation_config import census_data_creation from data_process.census_process.census_degree_process_utils import consistentize_...
import csv import sys import pandas as pd import os import glob import time import numpy as np from datetime import datetime import statistics import error from elaboratedata import * from sklearn.metrics import confusion_matrix, matthews_corrcoef from math import ceil SLEEP=10 #check if attack file exists def attack...
""" Fabric is used to deploy changes and run tasks on the remote staging and production environments. """ import json import os import shutil import zipfile import botocore.exceptions import botocore.session from fabric import Connection from fabric import SerialGroup as Group from fabric import task from invoke.exce...
import math from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union import moderngl as mgl import numpy as np import vpype as vp from ._utils import ColorType, load_program, load_texture_array if TYPE_CHECKING: # pragma: no cover from .engine import Engine ResourceType = Union[mgl.Buffer, mgl.Text...
""" Helper and utility functions for the library. """ from copy import deepcopy from dataclasses import asdict import hashlib import json import logging import os import platform import shutil import subprocess import sys from typing import Dict TIMESTAMP_FORMAT = "%Y-%m-%d-T%H%M%S" """The datetime format string used...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 29 16:10:21 2018 @author: michelcassard """ import seaborn as sns import numpy as np import matplotlib.pyplot as plt import matplotlib.pyplot as plt2 import pandas as pd from pandas import datetime import math, time import itertools from sklearn im...
#!/usr/bin/env python # Filename: planet_svm_classify """ introduction: Using SVM in sklearn library to perform classification on Planet images authors: <NAME> email:<EMAIL> add time: 4 January, 2019 """ import sys, os from optparse import OptionParser import rasterio import numpy as np HOME = os.path.expanduser('~...
#!/usr/bin/env python3 from __future__ import division from builtins import str from builtins import range from builtins import object from past.utils import old_div import isce from isceobj.Scene.Frame import Frame from isceobj.Planet.AstronomicalHandbook import Const from isceobj.Planet.Planet import Planet from Sen...
# -*- coding: utf-8 -*- import urllib, urllib2, re, os, sys, math import xbmcgui, xbmc, xbmcaddon, xbmcplugin from urlparse import urlparse, parse_qs import urlparse from BeautifulSoup import BeautifulSoup import time, datetime import HTMLParser #todo: BeautifulSoup scriptID = 'plugin.video.mrknow' scriptname = "Film...
import numpy as np import cv2 as cv import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt def read_gray_image(path): img = cv.imread(path) img_gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) plt.imshow(img_gray, cmap='gray', interpolation='nearest') plt.savefig('./results/img_gray.png') plt.clos...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 11 11:16:27 2020 @author: hiroyasu """ import cvxpy as cp import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import control import SCPmulti as scp import pickle DT = scp.DT TSPAN = scp.TSPAN M = scp.M II = s...
#!/usr/bin/python3 '''Routines useful in generation and processing of synthetic data These are very useful in analyzing the behavior or cameras and lenses. All functions are exported into the mrcal module. So you can call these via mrcal.synthetic_data.fff() or mrcal.fff(). The latter is preferred. ''' import nump...
import tensorflow as tf from tensorflow.python.ops import tensor_array_ops from tensorflow.python.framework import ops from tensorflow.python.ops import nn_ops from tensorflow.python.ops import math_ops ### # custom loss function, similar to tensorflows but uses 3D tensors # instead of a list of 2D tensors def sequen...
"""Mean-scale hyperprior model (no context model), as described in "Joint Autoregressive and Hierarchical Priors for Learned Image Compression", NeurIPS2018, by Minnen, Ballé, and Toderici (https://arxiv.org/abs/1809.02736 Also see <NAME>, <NAME>, <NAME>: "Improving Inference for Neural Image Compression", NeurIPS 202...
""" Support functions for BIDS MRI fieldmap handling MIT License Copyright (c) 2017-2022 <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 th...
import uuid import datetime from enum import Enum from typing import Dict, List from reqif.models.reqif_core_content import ReqIFCoreContent from reqif.models.reqif_data_type import ( ReqIFDataTypeDefinitionString, ReqIFDataTypeDefinitionEnumeration, ReqIFEnumValue, ) from reqif.models.reqif_namespace_info...
import numpy as np import helper import tensorflow as tf from tensorflow.python.layers.core import Dense from datetime import datetime # Build the Neural Network # Components necessary to build a Sequence-to-Sequence model by implementing the following functions below: # # - model_inputs # - process_decoder_input # -...
''' DLRM Facebookresearch Debloating author: sjoon-oh @ Github source: dlrm/dlrm_s_pytorch.py ''' from __future__ import absolute_import, division, print_function, unicode_literals import argparse # miscellaneous import builtins import datetime import json import sys import time # data generation import dlrm_data a...
import inspect as inspect_ from heapq import heapify from random import sample, random _node_init_func = None _node_cls = None _null = None _left_attr = 'left' _right_attr = 'right' _value_attr = 'value' class Node(object): """Represents a binary tree node.""" def __init__(self, value): self.__setat...