text
stringlengths
8.04k
46.5k
"""Module for global optimization using the Neighbourhood algorithm. """ from pytomo.inversion.inversionresult import InversionResult from pytomo.inversion import modelutils from pytomo.inversion.umcutils import UniformMonteCarlo from pytomo.inversion.umcutils import get_best_models, process_outputs import pytomo.inv...
from typing import Any, Dict, List, Optional, Union from copy import copy from random import randint import datetime as dt import re from lunchbox.enforce import Enforce from pandas import DataFrame, DatetimeIndex from schematics.exceptions import DataError import cufflinks as cf # noqa: F401 import lunchbox.tools a...
import csv import cv2 import matplotlib matplotlib.use('Agg') # For AWS compatibility from matplotlib import pyplot as plt import random import numpy as np from keras.preprocessing.image import random_shift, flip_axis from sklearn.utils import shuffle ## DONE: Visualize normal distribution for steering angles ## TODO:...
from django.shortcuts import render,redirect from .forms import StudentSignupForm, StudentProfile, PostAnAdForm, AboutStudentForm, ProfilePicture from django.contrib.auth.models import Group from django.contrib.auth.models import User from django.views.generic import RedirectView from .decorators import unauthentic...
""" Django settings for glitchtip project. Generated by 'django-admin startproject' using Django 3.0rc1. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ import lo...
r""" This module is designed for use in co-processing Python scripts. It provides a class, Pipeline, which is designed to be used as the base-class for Python pipeline. Additionally, this module has several other utility functions that are approriate for co-processing. """ from paraview import simple, servermanager fr...
# SPDX-License-Identifier: Apache-2.0 """ python -m tf2onnx.convert : api and commandline tool to convert a tensorflow model to onnx """ # pylint: disable=unused-argument,unused-import,ungrouped-imports,wrong-import-position import argparse import os import sys from distutils.version import LooseVersion os.environ...
"""Implementation of code management magic functions. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 The IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with th...
# -*- coding: utf-8 -*- """ Created on Wed Jan 26 00:33:29 2022 @author: <NAME> """ from Bio.Blast import NCBIWWW #, NCBIXML from deepdiff import DeepDiff from pprint import pprint from warnings import warn from chemw import Proteins #from pprint import pprint from math import ceil from glob import glob import request...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
# vim: set fileencoding=<utf-8> : '''Mash functions for database construction''' # universal import os import sys import subprocess # additional import collections import pickle import time from tempfile import mkstemp from multiprocessing import Pool, Lock from functools import partial from itertools import product f...
# -*- coding: utf-8 -*- """ docutils_rst_writer ~~~~~~~~~~~~~~~~~~~ Custom docutils writer for ReStructuredText. :copyright: Copyright 2012-2022 by <NAME> and contributors. :license: BSD, see LICENSE.txt for details. This was adapted by Antmicro for standalone docutils use from https://github...
import threading from collections import OrderedDict from random import Random from typing import Dict, Iterator, List, Optional, Union, Tuple import numpy as np from torch.utils.data import DataLoader, Dataset, Sampler from rdkit import Chem from .scaler import StandardScaler from chemprop.features import get_featur...
""" Holds classes and utility methods related to build graph """ import copy import logging import os import threading from pathlib import Path from typing import Sequence, Tuple, List, Any, Optional, Dict, cast, NamedTuple from copy import deepcopy from uuid import uuid4 import tomlkit from samcli.lib.build.excepti...
""" ACME client API (like :mod:`acme.client`) implementation for Twisted. """ import re import time from acme import errors, jose, jws, messages from acme.messages import STATUS_PENDING, STATUS_PROCESSING, STATUS_VALID from eliot.twisted import DeferredContext from treq import json_content from treq.client import HTTP...
# Copyright 2020 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/python # # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
#!/usr/bin/env python # # Copyright 2018 Espressif Systems (Shanghai) PTE LTD # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
""" DynamoDB access """ import io import decimal import pickle import time from collections import OrderedDict, defaultdict, namedtuple import datetime from pathlib import Path from os.path import getsize, getmtime from typing import List, Union, Any, Type, Dict, Callable from pprint import pformat from itertools impo...
# -*- coding: utf-8 -*- # daemon/daemon.py # Part of ‘python-daemon’, an implementation of PEP 3143. # # Copyright © 2008–2015 <NAME> <<EMAIL>> # Copyright © 2007–2008 <NAME>, <NAME> # Copyright © 2004–2005 <NAME> # Copyright © 2003 <NAME> # Copyright © 2002 <NAME> # Copyright © 2001 <NAME> # # This is free software: ...
import time from config import parse_args, parse_class_weights from seg_helper import * from tfsolver import TFSolver, DELIMITER from network_factory import seg_network from dataset_iterator import * from dataset_preloader import * from data_augmentation import * from libs import points_property, octree_property,check_...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # "Reducing Failure-Inducing Inputs" - a chapter of "The Fuzzing Book" # Web site: https://www.fuzzingbook.org/html/Reducer.html # Last change: 2021-11-03 13:08:27+01:00 # # Copyright (c) 2021 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarl...
#!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
# Standard Library from up.utils.general.fp16_helper import to_float32 import time # Import from third library import numpy as np import torch from up.utils.general.global_flag import ALIGNED_FLAG from up.extensions import gpu_iou_overlap GPU_MEMORY = None def allow_empty_tensor(num=1, empty_shape=(0, 4)): """...
''' utils used for transitioning to new component-descriptor v2 see: https://github.com/gardener/component-spec ''' import dataclasses import enum import hashlib import io import json import logging import os import shutil import tempfile import typing import yaml import dacite import deprecated import gci.componen...
# Copyright 2011 <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 ...
""" Tests for the Deep explainer. """ from distutils.version import LooseVersion from urllib.error import HTTPError import numpy as np import pandas as pd import pytest import shap from shap import DeepExplainer #os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # pylint: disable=import-outside-toplevel def test_tf_eager()...
name = "PCBpy" # -*- coding: utf-8 -*- """ Created on Wed Sep 28 10:04:07 2016 @author: msilvaol """ #### human sorting #### import re import sys import csv def atoi(text): return int(text) if text.isdigit() else text def natural_keys(text): ''' alist.sort(key=natural_keys) sorts in human order ...
# Copyright (c) Django Software Foundation and individual contributors. # 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 copyright no...
from functools import partialmethod, partial, update_wrapper import json import inspect import math from requests.packages.urllib3.util.retry import Retry import requests from gevent.pool import Pool as GeventPool import gevent from .util import get_id, get_ids, find_item, get_uri, get_uris, chunked, extract_list d...
import argparse import json import os from datetime import datetime from os.path import join import random import shutil import warnings import pathlib import time import repackage repackage.up() import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import...
# Copyright 2018, The TensorFlow Federated 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 o...
#from matplotlib.figure import Figure import plotly.express as px import plotly.graph_objects as go import plotly.figure_factory as ff from collections import OrderedDict import numpy as np import sys def GET_COLOR(x): if str(x)[:3].lower() == "rgb": vals=x.split("rgb(")[-1].split(")")[0].split(",") ...
# To run the simulator: python3 ls372_simulator.py -p 7777 # (Since it automatically tries nearby ports, sometimes it will connect to 7778 when restarted, # so you may need to temporarily change the port in Lakeshore372.py or just try running it again) # # To interact with the simulator: # Connect 372 agent: python3 -i...
from torchtools import * from data import MiniImagenetLoader, TieredImagenetLoader from model import EmbeddingImagenet, GraphNetwork, ConvNet import shutil import os import random #import seaborn as sns import sys import dgl from mlp_layer import MLPReadout class ModelTrainer(object): def __init__(self, ...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
# Anatomical ontology management # Author: <NAME>, 2019 """Handle ontology lookup. """ import os from collections import OrderedDict from enum import Enum import json import numpy as np import pandas as pd from magmap.settings import config from magmap.io import libmag NODE = "node" PARENT_IDS = "parent_ids" MIRROR...
""" Copyright 2019 <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, software distribut...
import sys from pypy.lang.smalltalk.tool.bitmanipulation import splitter from pypy.rpython.lltypesystem import lltype, rffi from pypy.rlib.objectmodel import we_are_translated if rffi.sizeof(lltype.UniChar) == 4: MAXUNICODE = 0x10ffff else: MAXUNICODE = 0xffff BYTEORDER = sys.byteorder if MAXUNICODE > sys.max...
""" pyart.io.nexrad_level2 ====================== .. autosummary:: :toctree: generated/ :template: dev_template.rst NEXRADLevel2File .. autosummary:: :toctree: generated/ _decompress_records _get_record_from_buf _get_msg31_data_block _structure_size _unpack_from_buf _unpack_s...
## import wx ## import os ## from wx.lib.agw import fourwaysplitter as FWS from pandac.PandaModules import * from direct.wxwidgets.WxPandaShell import * from direct.directtools.DirectSelection import SelectionRay #from ViewPort import * from .ObjectPaletteUI import * from .ObjectPropertyUI import * from .SceneGraphUI...
import csv import os import logging import random import shelve import numpy import arrow import matplotlib as mpl from matplotlib import pyplot as plt from platypus import NSGAII, OMOPSO, EpsNSGAII, SMPSO, GDE3, SPEA2, nondominated from eflows_optimization import settings from belleflopt import models from belleflop...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 30 15:33:38 2020 @author: enzo """ import matplotlib.pyplot as plt import numpy as np import cv2 print(f"CV2 Version: {cv2.__version__}") from pathlib import Path #%% Detector1 def calculate_keypoints(img, method, single_channel, graphics=False):...
#!/usr/bin/env python # ----------------------------------------------------------------------------- # Name: filelist.py # Purpose: File listing class/functions. # # Author: <NAME> # # Created: Mon Apr 10 11:01:06 2006 # Copyright: (c) 2006, California Institute of Technology. # U.S....
# -*- coding: utf-8 -*- # # MNE documentation build configuration file, created by # sphinx-quickstart on Fri Jun 11 10:45:48 2010. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
""" This file defines the 'subset' SomeValue classes. An instance of a SomeValue class stands for a Python object that has some known properties, for example that is known to be a list of non-negative integers. Each instance can be considered as an object that is only 'partially defined'. Another point of view is th...
# Atlas measurements and statistics # Author: <NAME>, 2019 """Low-level measurement of atlases and statistics generation. Typically applied to specific types of atlases and less generalizable than measurements in :module:`vols`. """ import os import numpy as np import pandas as pd from magmap.plot import colormaps f...
#!/usr/bin/env python from math import pi, cos, sin import numpy as np import diagnostic_msgs import diagnostic_updater import roboclaw_driver.roboclaw_driver_new as roboclaw import rospy import tf from geometry_msgs.msg import Quaternion, Twist from nav_msgs.msg import Odometry import sys __author__ = "<EMAIL> (<NA...
# ##################################################################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
import enum import json from acconeer.exptool import utils from acconeer.exptool.modes import Mode, get_mode from acconeer.exptool.structs import configbase cb = configbase # Workaround for Python 3.6 issue 30024 class ConfigEnum(enum.Enum): @property def label(self): return self.value[0] @pr...
from dolfin import * comm = MPI.comm_world rank = MPI.rank(comm) rank_string = str(rank) size = MPI.size(comm) import numpy as np import multiprocessing import logging, logging.handlers import inspect import time, os, gc, sys import ctypes myeps = 1e-10 def human_time(tt): seconds = tt % 60 if seconds > 0....
# semantic segmentation with Unet # heavily inspired on https://github.com/zhixuhao/unet # uses isbi dataset import os import matplotlib.pyplot as plt import skimage.io as skimage_io import skimage.transform as skimage_transform import random as r import numpy as np import datetime import tensorflow as tf print("Tens...
# LIBTBX_SET_DISPATCHER_NAME phenix.table_one from __future__ import absolute_import, division, print_function from mmtbx.validation import dummy_validation from mmtbx.validation import molprobity import mmtbx.command_line.molprobity from iotbx import file_reader import iotbx.table_one from libtbx import object_orient...
""" This file should contain only functions that operates on pixels, not on images, so no references to PIL are necessary and the module can be used also through Jython """ import numpy import sys import time from worldengine.common import get_verbose, count_neighbours from worldengine.common import anti_alias as anti...
# -*- coding: utf-8 -*- """Async Bayesian optimization classes""" import sys import time from typing import Optional, Callable import numpy as np import pandas as pd from bayesopt.acquisition import AcquisitionWithOffset from bayesopt.util import add_hallucinations_to_x_and_y, stable_cholesky from ml_utils import tim...
# !/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/8/8 12:49 # @Author : Tao.Xu # @Email : <EMAIL> """ :description: shell operations related module """ from __future__ import print_function import os import sys import time import uuid import tempfile import shutil import signal import random imp...
import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np import matplotlib.pyplot as plt FLAGS = tf.app.flags.FLAGS import sys def MLP(input_x, output_size, name, weights_regularizer): with tf.variable_scope(name): x = slim.fully_connected(input_x, 1024, weights_regularizer = wei...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ sfftk.notes.find ======================= Search for terms and display ontologies """ from __future__ import division, print_function import math import textwrap import backports.shutil_get_terminal_size from styled import Styled from . import RESOURCE_LIST from ..co...
# Copyright 2016 OVH SAS # 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Mail users about cloud stuff # # === Authors # # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> import functools import os import configparser import sys import syslog import argparse import pprint from keystoneauth1 import session from keystone...
import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm from math import sqrt from math import floor from matplotlib.finance import candlestick_ohlc import csv import pandas as pd plt.rc('text', usetex=True) #Parameters brownian() # #x[0]: X(0), initial stock price #N: number of i...
#!/usr/bin/env python # # Copyright (C) 2006 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 ...
"""GANomaly """ # pylint: disable=C0301,E1101,W0622,C0103,R0902,R0915 ## from collections import OrderedDict import os from re import I import time import numpy as np from tqdm import tqdm import torch.optim as optim import torch.nn as nn import torch.utils.data import torchvision.utils as vutils import pandas as pd...
import copy from .lib import ( OverrideState, NOT_SET ) from openpype.settings.constants import ( METADATA_KEYS, M_OVERRIDEN_KEY, KEY_REGEX ) from . import ( BaseItemEntity, ItemEntity, GUIEntity ) from .exceptions import ( SchemaDuplicatedKeys, EntitySchemaError, InvalidKey...
__all__ = ['planet_orbit', 'planet_star_projected_distance', 'planet_phase', 'transit', 'transit_integrated', 'transit_depth', 'transit_duration', 'eclipse', 'eclipse_integrated', 'eclipse_depth', 'eclipse_duration', 'eclipse_mid_time'] import numpy as np from pylightcurve.analysis.numerical_i...
import numpy as np from sqlalchemy.orm import * # session from sqlalchemy import create_engine from obspy.core import UTCDateTime from obspy.geodetics import locations2degrees, degrees2kilometers from .table_tt_curve import * from .table_nsta24 import * from .tables3D import * from .search_hypo import * #from .pbr imp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 23 20:08:46 2020 @author: ryanday """ # -*- coding: utf-8 -*- #Created on Thu Feb 01 08:56:54 2018 #@author: ryanday #MIT License #Copyright (c) 2018 <NAME> #Permission is hereby granted, free of charge, to any person obtaining a copy #of this ...
#!/usr/bin/env python import argparse import json from copy import copy, deepcopy from os import path from sys import stderr import math import pprint __author__ = 'senorrift' # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import errno import functools import os import platform import subprocess import sys import time from contextlib impo...
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.runner import force_fp32, auto_fp16 from mmcv.cnn import ConvModule, build_upsample_layer from mmdet.core import bbox_rescale from mmdet.models.builder import HEADS, build_loss from mmdet.models.roi_heads.mask_...
#!/usr/bin/env python3 import ambit import sys, traceback import numpy as np from pathlib import Path import results_check def main(): basepath = str(Path(__file__).parent.absolute()) IO_PARAMS = {'problem_type' : 'flow0d', # solid, fluid, flow0d, solid_flow0d, fluid_flow0d ...
import functools import operator as op from functools import partial import jax import jax.lax as lax import jax.numpy as np import jax.random as random from jax.experimental import stax from jax.experimental.stax import elementwise from jax.flatten_util import ravel_pytree from jax.nn.initializers import glorot_norma...
#!/usr/bin/env python import sys import os import re import glob import shutil import argparse import logging import common log = common.get_log() # Global paths base_path = os.path.normpath(os.path.dirname(os.path.normpath(sys.argv[0]))) output_path = os.path.join(base_path, "images") tmp_path = os.path.join(base...
""" Functions for surface visualization. Only matplotlib is required. """ import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.colorbar import make_axes from matplotlib.cm import ScalarMappable, get_cmap from matplotlib.colors import Normalize, LinearSegmentedCol...
# moma.py # This python script automates MOMA as described in Ishibuchi (2009). # Author: <NAME> # i - bin index # j - item index # k - algorithm index # m - solution index # t - generation index from __future__ import print_function import binpacking as bp import constraints import ga import mop im...
# Tools to load and save midi files for the rnn-gan-project. # # This file has been modified by <NAME> to support # operations in c-rnn-gan.pytorch project. # # Written by <NAME>, http://mogren.one/ # # This file has been modified by <NAME> to support # c-rnn-gan.pytorch operations. Original file is available in: # #...
from xml.etree import ElementTree from configurationParser import Configuration from flask import Flask, request, abort from flask_restful import Api, Resource, reqparse from flask_sqlalchemy import SQLAlchemy from flask_oauthlib.provider import OAuth2Provider from cryptography.hazmat.backends import default_backend fr...
# MIT License # # Copyright (c) 2021 ben # # 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, pu...
import cv2 import os import matplotlib.pyplot as plt import pandas as pd import pathlib import string from datetime import datetime def create_output_dir_if_needed(directory): output_dir = pathlib.Path(directory) if not output_dir.is_dir(): os.mkdir(str(output_dir)) print("Created: {}".format(s...
# # NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System # # All trademark and other rights reserved by their respective owners # # Copyright 2008-2021 Neongecko.com Inc. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the foll...
import powerlaw import pandas as pd import numpy as np from collections import defaultdict import datetime import math from tqdm import tqdm from ..utils import constants, utils from scipy.sparse import lil_matrix import random import logging import inspect from ..core.trajectorydataframe import TrajDataFrame from ..mo...
""" 获取敏感词 get_sensitive_words 获取重要词 get_important_words 获取近义词 get_synonym_words 获取停用词 获取随机回复 get_random_resp 检测敏感词 sensitive_words_find 检测重要词 important_words_find 同义词替换 synonym_replace 停用词去除 dfa查找 dfa """ from snownlp import SnowNLP from utils import logger, flatten fro...
import sys import svtools.l_bp as l_bp from svtools.breakpoint import Breakpoint import svtools.logspace as ls from svtools.vcf.file import Vcf from svtools.vcf.variant import Variant from svtools.utils import parse_bnd_alt_string, InputStream from svtools.exceptions import MissingProbabilitiesException import sys im...
# -*- coding: utf-8 -*- """Tests for the Data Retriever""" import os import subprocess import random import retriever as rt from retriever.lib.engine import Engine from retriever.lib.table import TabularDataset from retriever.lib.templates import BasicTextTemplate from retriever.lib.cleanup import correct_invalid_val...
import mmcv import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init from scipy import ndimage from mmdet.core import matrix_nms, multi_apply from ..builder import HEADS, build_loss from .base_dense_seg_head import BaseDense...
################################################################## # <NAME> # # https://www.linkedin.com/in/haosleeper/ # ################################################################## import logging import sys import copy import nump...
''' This code is due to <NAME> (@yutongD), <NAME> (@YingtongDou) and UIC BDSC Lab DGFraud (A Deep Graph-based Toolbox for Fraud Detection) https://github.com/safe-graph/DGFraud ''' from base_models.inits import * import tensorflow as tf flags = tf.app.flags FLAGS = flags.FLAGS # global unique layer ID dictionary for ...
# -*- coding: UTF-8 -*- import unittest import common import basics from common import urlquote from common import Int4, Int8, Text, Int4Array, TextArray, Timestamptz, \ Ermrest_rid, Ermrest_rct, Ermrest_rmt, Ermrest_rcb, Ermrest_rmb, \ RID, RCT, RMT, RCB, RMB, RidKey, \ ModelDoc, SchemaDoc, TableDoc, Co...
import abc import copy import itertools import logging from collections import defaultdict from tempfile import NamedTemporaryFile from typing import List, Optional, Set, Tuple, TypeVar, Union import numpy from openff.toolkit.topology import Molecule from openff.toolkit.utils import ( OpenEyeToolkitWrapper, RD...
# lm_units: A pure_python dg_units workalike import sys import re import copy import ast import math try: import builtins # python3 pass except ImportError: import __builtin__ as builtins # python2 pass if not hasattr(builtins,"unicode"): unicode=str # python3 pass UnitDict={} # of cla...
import math import cmath def conjugate(num: (int, float, complex)): """ int -> int float -> float complex -> complex Return the conjugate of a number if it is complex. """ #if input is int or float, return it (no complex conjugate needed) if isinstance(num, (int, float)): retu...
import json import unittest import uuid import os import believe as B class BaseClass: def gen_sha1(self): return os.urandom(20).hex() def fail_validate_with(self, v1, v2, xss_unsafe_message, xss_safe_message=""): try: B.validate(v1, v2) assert not "should fail" ...
# Formations for Warband by Motomataru # rel. 06/08/11 # EDIT FOR ORDER DISPLAY 11/19/10 by Caba'drin # EDIT TO USE SLOTS 02/23/11 by Caba'drin from header_common import * from header_operations import * from module_constants import * from header_mission_templates import * # Formations triggers v3 by moto...
import time from os import environ import numpy as np from smartredis import Client, Dataset from ..error import SmartSimError from ..log import get_logger logger = get_logger(__name__) def form_name(*args): return "_".join(str(arg) for arg in args if arg is not None) class TrainingDataUploader: """A cla...
# Copyright 2015 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, ...
from __future__ import print_function import numpy as np from copy import deepcopy import os def dense_to_one_hot(labels_dense, num_classes): """Convert class labels from scalars to one-hot vectors.""" sample_size = len(labels_dense) labels_one_hot = np.zeros((sample_size, num_classes)) labels_one_hot...
# byteplay: CPython assembler/disassembler # Copyright (C) 2006 <NAME> | Version: http://code.google.com/p/byteplay # Rewritten 2009 <NAME> | Version: http://github.com/serprex/byteplay # Screwed the style over, modified stack logic to be more flexible, updated to Python 3 # # This library is...
import warnings import librosa import pandas as pd import soundfile as sf from pathlib import Path from joblib import delayed, Parallel NAME2CODE = { 'Empidonax alnorum_Alder Flycatcher': 'aldfly', 'Recurvirostra americana_American Avocet': 'ameavo', 'Botaurus lentiginosus_American Bittern': 'amebit', ...
import sys import os import getopt from six.moves import xrange import h5py, time import tensorflow as tf import numpy as np from utils import leaky_relu, leaky_relu2, batch_norm_wrapper from data_loader import load_data_new, load_neighbour, load_labelMatrix, load_structMatrix from meshvae import meshVAE ### Some hyp...
import abc import logging from types import MappingProxyType from typing import Dict, Mapping, Optional, Set, Type, Union from uuid import UUID, uuid4 from supriya.enums import AddAction, CalculationRate from supriya.typing import Default import tloen.domain # noqa from tloen.midi import NoteOffMessage from .bases ...