text stringlengths 6.04k 39.5k |
|---|
import numpy as np
import logging
import time
import math
import copy
import collections
from typing import Optional
from sklearn.metrics import mean_squared_error, mean_absolute_error
from flaml.tune import Trial
logger = logging.getLogger(__name__)
def get_ns_feature_dim_from_vw_example(vw_example) -> dict:
""... |
# Copyright (c) 2020 Industrial Technology Research Institute.
#
# 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 ... |
import traceback
import xml.etree.ElementTree as ET
from datetime import datetime, timedelta
from pprint import pprint
import requests
import re
from bs4 import BeautifulSoup, NavigableString
from zope.interface import implementer
import numpy as np
from matilda.data_pipeline.data_preparation_helpers import flatten_d... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% _uuid="8f2839f25d086af7... |
"""
Implementation of the method proposed in the paper:
'Adversarial Attacks on Graph Neural Networks via Meta Learning'
by <NAME>, <NAME>
Published at ICLR 2019 in New Orleans, USA.
Copyright (C) 2019
<NAME>
Technical University of Munich
"""
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as ... |
import time
import struct
try:
# Try to import the Python 3.x enum module
from enum import IntEnum
except:
# If we're on Python 2.x we need to define
# a dummy replacement
class IntEnum:
pass
# <pep8 compliant>
LOG_READ_TIME = False
LOG_WRITE_TIME = False
LOG_ANIM_HEADER = False
LOG_ANIM... |
#!/usr/bin/python
#
# Copyright 2010, <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 applicable la... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
# -*- coding: utf-8 -*-
#
# Copyright © 2010 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... |
# -*- coding: utf-8 -*-
# Copyright 2018 the HERA Project
# Licensed under the MIT License
'''Tests for firstcal.py'''
import nose.tools as nt
import os
import json
import numpy as np
import aipy
import optparse
import sys
from pyuvdata import UVCal, UVData
import hera_cal.firstcal as firstcal
from hera_cal.omni impo... |
from __future__ import print_function
import argparse
from datetime import datetime
import os
import re
import signal
import ssl
import subprocess
import sys
import tempfile
import time
from werkzeug.serving import make_ssl_devcert
# pylint: disable=wrong-import-order
try:
from urllib.parse import urlsplit, splitpo... |
import os
import re
import locale
import json.decoder
import traceback
import common.vars
from jsonschema import validate
from common.json_shema import JSONSchemaGenerator
def trim_lang(text: str = None) -> str:
if text is not None:
return text.replace('{APP_NAME}', common.vars.app_name)
else:
... |
# ========================================================================================
#
# Description:
#
# Emulates execution of VM code.
#
# Attribution:
#
# Code by www.jk-quantized.com
#
# Redistribution and use of this code in source and binary forms must retain
# the above attribution notice and th... |
import numbers
from typing import Optional, Tuple
import warnings
import torch
from torch import Tensor
"""
We will recreate all the RNN modules as we require the modules to be decomposed
into its building blocks to be able to observe.
"""
class LSTMCell(torch.nn.Module):
r"""A quantizable long short-term memory... |
#!/usr/bin/env python
from __future__ import division
import sys
import os
import re
gen_dir = os.path.dirname(os.path.abspath(__file__))
csv_dir = os.path.join(gen_dir, "csv")
tmpl_dir = os.path.join(gen_dir, "templates")
dest_dir = os.path.abspath(os.path.join(gen_dir, "..", "src", "generated"))
class Template(ob... |
import requests
from requests import Request, Session
from requests.packages.urllib3.util import Retry
from requests.adapters import HTTPAdapter
from datetime import datetime, timezone
from time import sleep
import lxml
import lxml.html as lh
from urllib.parse import quote, urlsplit
import re
from operator import itemg... |
from contextlib import contextmanager
import tensorflow as tf
from tfsnippet.ops import log_mean_exp, convert_to_tensor_and_cast
from tfsnippet.utils import (add_name_arg_doc, get_static_shape,
get_dimension_size, is_tensor_object, assert_deps)
from .utils import _require_multi_samples
_... |
import socket
import argparse
import time
from threading import Thread
import os
import threading
import requests
import ctypes
from bs4 import BeautifulSoup
import re
import urllib3
from scapy.all import *
import base64
urllib3.disable_warnings()
def check_admin_rights():
if ctypes.windll.shell32.IsUs... |
from dal import autocomplete
from extra_views import InlineFormSetFactory
from django import forms
from django.urls import reverse
from django.forms.models import model_to_dict
from django.db.models import Q
from KlimaKar.widgets import PrettySelect
from KlimaKar.forms import ToggleInput
from apps.invoicing.models i... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 13 17:59:26 2015
@author: jasperlinthorst
"""
from intervaltree import IntervalTree, Interval
import networkx as nx
import sys
import math
import logging
import utils
import traceback
from utils import mem2mums
import math
# from matplotlib import pyplot as plt
def cha... |
# -*- coding: utf-8 -*-
import sys, os, subprocess, random, time
global w, ansi, g, enableRemovedFeatures
subprocess.call('', shell=True) #This makes it possible to use color graphics on Windows
enableRemovedFeatures = False
#init graphics and stuff
class ANSI:
def __init__(self):
self.BLACK = "\u... |
# encoding: utf-8
# ---------------------------------------------------------------------------
# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.
# Distributed under the terms of the BSD License. See COPYING.rst.
# ---------------------------------------------------------------------------
"""... |
"""
The MIT License (MIT)
Copyright (c) 2017 SML
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish,... |
"""
A suite of functions for finding sources in images.
:Authors: <NAME>, <NAME>
:License: :doc:`LICENSE`
"""
import sys
import math
import numpy as np
from scipy import signal, ndimage
import stsci.imagestats as imagestats
from . import cdriz
__all__ = ['gaussian1', 'gausspars', 'gaussian', 'moments', 'errfunc'... |
"""
Constants and functions pertaining to tseep species classifier datasets.
"""
from collections import defaultdict
import math
from tensorflow.data import TFRecordDataset
from tensorflow.io import FixedLenFeature
import tensorflow as tf
import vesper.util.signal_utils as signal_utils
import vesper.util.time_frequ... |
import networkx as nx
from openomics.database.annotation import *
class Interactions(Dataset):
def __init__(self, path, file_resources, source_col_name, target_col_name, source_index, target_index,
edge_attr=None, directed=True, rename_dict=None, npartitions=0):
"""
This is an ab... |
# modified from: https://github.com/NVlabs/latentfusion/blob/master/latentfusion/three/quaternion.py
import math
import torch
from torch.nn import functional as F
@torch.jit.script
def acos_safe(t, eps: float = 1e-7):
return torch.acos(torch.clamp(t, min=-1.0 + eps, max=1.0 - eps))
@torch.jit.script
def ensure... |
#!/usr/bin/python
# Copyright: (c) 2019, DellEMC
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils import dellemc_ansible_utils as utils
import logging
import copy
import re
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
... |
from .visual import CocoPart
import numpy as np
from helpers import *
from default_params import *
def match_ip(ip_set, new_ips, lstm_set, num_matched, consecutive_frames=DEFAULT_CONSEC_FRAMES):
len_ip_set = len(ip_set)
added = [False for _ in range(len_ip_set)]
new_len_ip_set = len_ip_set
for new_ip... |
import os
import re
import cv2
import sys
import glob
import json
import shutil
import numpy as np
import torch
from PIL import Image
from easydict import EasyDict
from torchvision.transforms import transforms
# Profile
def load_profile(filepath):
"""
Load experiment profile as EasyDict
:param filepath... |
"""Classes and functions for batching multiple heterographs together."""
from collections.abc import Iterable
from . import backend as F
from . import heterograph_index
from .base import ALL, is_all
from .frame import FrameRef, Frame
from .heterograph import DGLHeteroGraph
__all__ = ['BatchedDGLHeteroGraph', 'unbatch... |
"""
CNN-DQN based RL agent for Pong
Requirements (model training):
- pytorch
- gym
- matplotlib
- numpy
- pillow
- opencv-python
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import math
import random
import os
import sys
from collections import... |
#!/usr/bin/env python
# Copyright (C) 2010-2015 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import argparse
import json
import os
import socket
import sys
import tarfile
from datetime import datetime
from StringIO import ... |
# Copyright 2015, 2017 IBM Corp.
#
# 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 require... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# coding: utf-8
from __future__ import print_function
from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from libcity.model.abstract_model import AbstractModel
from math import sin, cos, sqrt, atan2, radians
import numpy as np
def identity_loss(y_true, y_pred):
re... |
"""Compute evaluating results of fitted models
The main structure used on this functions is a dictionary in which
each the keys are the model name, and the elements are list of dictionaries.
Each of the dictionaries contain two keys: true, predicted.
Those elements are list of the predictions
"""
import logging
fro... |
# Copyright 2019-2020 <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, sof... |
import os
import logging
import numpy as np
import multiprocessing
from pathlib import Path
from tabulate import tabulate
import pandas as pd
from sklearn.model_selection import GroupShuffleSplit, train_test_split
from tqdm import tqdm_notebook as tqdm
import pickle
import torch
from torch.utils.data import Dataset, ... |
'''
Name: color_segmentation.py
Version: 1.0
Summary: K-means color clustering based segmentation. This is achieved
by converting the source image to a desired color space and
running K-means clustering on only the desired channels,
with the pixels being grouped into a desired number
... |
import numpy as np
import pandas as pd
import matplotlib.lines as mlines
import seaborn as sns
import hr_edl_data.experiment_parameters as xp
# Algorithm labels
_alg_label_map = {
'CFR': r'$\\\text{CF}$',
'A-EFR': r'$\\\text{ACT}$',
'CFR_IN': r'$\\\text{CF}_{\text{IN}}$',
'A-EFR_IN': r'$\\\text{ACT}_{\... |
from datetime import timedelta
from ebu_tt_live.bindings import get_xml_parsing_context
from ebu_tt_live.errors import LogicError, SemanticValidationError, OutsideSegmentError, OverlappingActiveElementsError
from ebu_tt_live.strings import ERR_SEMANTIC_VALIDATION_TIMING_TYPE
import itertools
class TimingValidationMi... |
import numpy as np
import csv
from scipy.optimize import minimize
from scipy.spatial.transform import Rotation as R
ID = np.array([
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
])
def random_unit_vector():
"""Generate a random 3D unit vector
Returns:
np.array: a random 3D un... |
#! python3
# Your one stop destination for all your assignment needs
# Convert your assignments to PDFs, watermark them, merge them and encrypt them, all in one place
# Get to know the birthdays of your classmates and send them a birthday wish to show you care
# Convert your PDF into audiobook and learn on the go
#W... |
import csv
import datetime
import logging
import time
from io import StringIO
import numpy as np
import pandas as pd
from django.db.models import Q
from django.utils import timezone
from iotile_cloud.utils.gid import IOTileBlockSlug, IOTileDeviceSlug, IOTileStreamSlug, IOTileVariableSlug
from apps.physicaldevice.mo... |
from datetime import datetime
from sqlite3 import connect
from typing import Dict, NamedTuple, Optional, Mapping
import json
from black import line_to_string
import kfp.dsl as dsl
import kfp
from kfp.components import func_to_container_op, InputPath, OutputPath
import kfp.compiler as compiler
from kfp.dsl.types import... |
import pandas as pd
try:
from pandas.io.formats.excel import ExcelFormatter
except ImportError:
from pandas.formats.format import ExcelFormatter
from pandas.io.common import _stringify_path
from .xl_types import XLCell
from .chart_wrapper import create_chart, SINGLE_CATEGORY_CHARTS, CATEGORIES_REQUIRED_CHART... |
import argparse
import os
import random
import time
import warnings
import sys
import numpy as np
from sklearn.metrics import pairwise_distances
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.multiprocessing as mp
import torch.utils.data
... |
from corehq.apps.app_manager import id_strings
from corehq.apps.app_manager.suite_xml import xml_models as sx
from corehq.apps.app_manager.suite_xml import const
from corehq.apps.app_manager.util import is_sort_only_column
from corehq.apps.app_manager.xpath import (
CaseXPath,
CommCareSession,
IndicatorXpat... |
# -*- codiEEG_dsddsdsng: utf-8 -*-
"""
Created on Mon Jun 29 20:08:11 2020
@author: mahjaf
"""
#%% Import libs
#####===================== Importiung libraries =========================#####
import mne
import numpy as np
from scipy.integrate import simps
from numpy import loadtxt
import h5py
import time
import os
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unit tests for gluon.sql
"""
import sys
import os
if os.path.isdir('gluon'):
sys.path.append(os.path.realpath('gluon'))
else:
sys.path.append(os.path.realpath('../'))
import unittest
import datetime
from dal import DAL, Field, Table, SQLALL
ALLOWED_DATATY... |
import argparse
import glob
import math
import os
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from numba import jit, prange
from sklearn import metrics
from utils import *
@jit(nopython=True, nogil=True, cache=True, parallel=True, fastmath=True)
def compute_tp_tn_fp_fn(y_true,... |
import sys
def my_except_hook(exctype, value, traceback):
print('There has been an error in the system')
sys.excepthook = my_except_hook
import warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")
import parselmouth
from parselmouth.praat import call, run_file
import glob
import errno
import csv... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LogisticRegression
# from sklearn.tree import DecisionTreeClassifier
# from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_... |
import matplotlib.path as mplPath
from abc import ABCMeta
import abc
from protodata.utils import read_json
from protodata.columns import create_image_column
import numpy as np
import os
import tensorflow as tf
import logging
logger = logging.getLogger(__name__)
""" General functions for data manipulation """
cla... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 Alibaba Group Holding Limited.
#
# 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/LI... |
import math
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
from rlbot.utils.game_state_util import GameState, BallState, CarState, Physics, Vector3 as vector3, Rotator
from Utilities import *
from States import *
import cProfile, p... |
"""
registerSegments.py
---------------
Main Function for registering (aligning) colored point clouds with ICP/feature
matching as well as pose graph optimizating
"""
# import png
from PIL import Image
import csv
import open3d as o3d
import pymeshlab
import numpy as np
import cv2
import os
import glob
from utils.ply... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from analysis.analysis_testcase import AnalysisTestCase
from analysis.callstack_detectors import StartOfCallStack
from analysis.stacktrace import FunctionLin... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as layers
from ray.rllib.models import ModelCatalog
def _build_p_network(registry, inputs, dim_actions, config):
"""
map a... |
from .main import *
engine = create_engine('postgresql+psycopg2://' + POSTGRES_USER + ':' + POSTGRES_PASSWORD + '@' + POSTGRES_HOST + ':' + POSTGRES_PORT + '/' + POSTGRES_DB, pool_size=num_fetch_threads+num_fetch_threads_agg, convert_unicode=True)
# Create database if it does not exist.
if not database_exists(engine.u... |
import argparse
import os, time
import torch
import shutil
import numpy as np
import torch.nn as nn
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import models
import torch.backends.cud... |
#########################################################################
#
# perceptron.py - This file is part of the Spectral Python (SPy) package.
#
# Copyright (C) 2001-2014 <NAME>
#
# Spectral Python is free software; you can redistribute it and/
# or modify it under the terms of the GNU General Public Lic... |
import time
import argparse
from copy import deepcopy
from progress.bar import IncrementalBar
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import utils as vutils
from itertools import chain
from gan.generator import MuseGenerator
from ... |
#!/usr/bin/env python
# This document is part of CrowdProjects
# https://github.com/skytruth/CrowdProjects
# =========================================================================== #
#
# Copyright (c) 2014, SkyTruth
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without... |
# Copyright 2020 <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 ... |
#!/usr/bin/env python2
"""
Utilities for performing stochastic matrix and vector compressions.
"""
import numpy
import misc_c_utils
import near_uniform
def fri_subd(vec, num_div, sub_weights, n_samp):
""" Perform FRI compression on a vector whose first elements,
vec[i] are each subdivided into equal segments... |
from torch.utils.data import Dataset
import numpy as np
import os
import random
import torchvision.transforms as transforms
from PIL import Image, ImageOps
import cv2
import torch
from PIL.ImageFilter import GaussianBlur
import trimesh
import logging
import json
from math import sqrt
import datetime
log = logging.getL... |
__all__ = ('log', 'progress_callback_factory', 'progress_callback_divisions', 'BadUserError', 'setup')
import binascii
import hashlib
import mimetypes
import mmap
import os
import posixpath
import re
import time
import boto3
import botocore
import termcolor
log = lambda msg: None
progress_callback_factory = lambda: ... |
import argparse
from itertools import product
import warnings
from joblib import Parallel, delayed
import librosa
import numpy as np
import pandas as pd
from scipy import signal, stats
from sklearn.linear_model import LinearRegression
from tqdm import tqdm
from tsfresh.feature_extraction import feature_calculators
fr... |
#!/usr/bin/env python
'''
Generate compilable .osl files from .mx templates
<NAME>
TODO: Some functionalization in place, can it be expanded?
Add ability to specify shader and shader type to compile to osl
Is there a more compact representation of the BUILD_DICT we can employ?
'''
import os
import sys... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 6 16:59:19 2016
@author: tvzyl
"""
import data
from sklearn.datasets import make_spd_matrix
from pandas import DataFrame
from numpy import mean, diag, eye, rot90, dot, array, abs
from numpy import zeros, ones, arange
from numpy.random import uniform
from scipy.stats ... |
"""
Binary vectors provide the basis for a representational approach
developed by <NAME> known as the Binary Spatter Code, with
the following key components:
(1) Randomly generated bit vectors with a .5 probability of a set bit in each component
(2) A *superposition* operator: this combines bit vectors elementwise via ... |
from __future__ import unicode_literals
from itertools import repeat
from onmt.utils.logging import init_logger
from onmt.utils.misc import split_corpus
from onmt.translate.translator import build_translator
import onmt.opts as opts
from onmt.utils.parse import ArgumentParser
import pandas as pd
import numpy as np
... |
from copy import deepcopy
from random import randint, uniform, choice
class EAConfig:
"""
This class sets up the parameters for EA
"""
def __init__(self,
mut = 0.30,
cross = 0.30,
cand_size = 10,
max_cand_value = 8, # for real and ... |
from datetime import datetime
from datetime import timedelta
from django.db import models
from django.db.models import Q
from django.core import serializers
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.utils.timezone import get_current_timezone
from django.utils imp... |
#!/usr/bin/env python3
import os, sys, subprocess
from dataclasses import dataclass
# Input variables:
# INPUT_CHECKS
# INPUT_DEPENDENCIES
# INPUT_DIRECTORY
# INPUT_BUILDDIR
# INPUT_CC
# INPUT_CFLAGS
# INPUT_CXXFLAGS
# INPUT_CONANFLAGS
# INPUT_CMAKEFLAGS
# INPUT_CTESTFLAGS
# INPUT_MAKEFLAGS
# ... |
import urllib, json
import urllib.request,os
import socket
import random
import re
socket.setdefaulttimeout(50)
#https://www.hide-my-ip.com/fr/proxylist.shtml
# .*(\[\{.*\]).*
KEY="A00239D3-45F6-4A0A-810C-54A347F144C2"
KEY="<KEY>"
KEY="35d28185-0ca1-47f0-8caf-edc457802c9d"
KEY="B36714DE794D0080A183B5A12BEA... |
import os
import logging
import time
import unittest
import urllib.parse
import xml.etree.ElementTree as ElementTree
from streamsx.topology.tester import Tester
from streamsx.topology.context import ConfigParams, JobConfig
from streamsx.build import BuildService
from streamsx.rest_primitives import *
logger = loggin... |
# -*- coding: utf-8 -*-
import uuid
import functools
from copy import deepcopy
from lxml import etree
from .namespaces import (XML_NS_URI, STREAM_NS_URI,
CLIENT_NS_URI, SERVER_NS_URI,
STANZA_ERROR_NS_URI, STREAM_ERROR_NS_URI)
from .jid import Jid
XML_LANG = "{%s}lang" ... |
import argparse
import cv2
from models import * # set ONNX_EXPORT in models.py
from utils.datasets import *
from utils.utils import *
###############################################################
class_index = { '0':0, '1':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9,\
'A':10, 'B':11,... |
import re
from collections import defaultdict
from copy import deepcopy
import numpy as np
import tensorflow as tf
from utils.model_utils import get_shape_list
def build_optimizer_from_config(loss, optimizer_config, device_config=None):
"""
This is a utility to build an optimizer from optimizer_config.
... |
import ctypes
import csv
import os
import numpy as np
import tflite_runtime.interpreter as tflite
import time
import platform
import collections
import operator
'''
source /home/cristian/virtualenvs/coral/bin/activate
python test_accuracy.py
'''
# Configuration parametres
print_results = True
load_results = False
writ... |
#FLM: Adjust Anchors
__copyright__ = __license__ = """
Copyright (c) 2010-2012 Adobe Systems Incorporated. All rights reserved.
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 restrictio... |
import os, sys, copy
import pickle
import math
import time
import numpy as np
from typing import Dict, Any, List, Set, Tuple
import torch
import torch.nn.functional as F
from torch import nn
from torch.nn.utils.rnn import pad_sequence
import torch.nn.utils.rnn as rnn_utils
from agent.environment.position import Pos... |
from __future__ import print_function
import os, sys
if sys.version_info[0] != 3 or sys.version_info[1] < 0:
print('Your Python version is too old! Please use Python 3.0 or higher.')
sys.exit(1)
import hashlib
import fnmatch
import configparser
import argparse
import platform
os.chdir(os.path.di... |
"""PURPOSE: Converters: Lexemes towards encodings UTF8/UTF16/UTF32.
During exical analysis matches delivers lexemes in the encoding of the buffer.
The functions develops converters of those lexemes to standard encodings, so
that they can easily be reflected.
Let 'Character' be a character in the buffer's encoding, '... |
import asyncio
import discord
import os
import json
import time
from datetime import datetime
from config import get_configuration
departements = json.loads(open("departements.json").read())
regions = json.loads(open("regions.json").read())
async def log(self, guild, message) :
config = get_configuration(guild.... |
import open3d as o3d
from open3d import *
import numpy as np
import sys, os
import matplotlib.pyplot as plt
import cv2
import torch
import glob
import copy
import mathutils
from PIL import Image
from pytorch3d.loss import chamfer_distance
from tk3dv.nocstools.aligning import estimateSimilarityUmeyama
import math
from ... |
import os
import re
import zlib
from typing import List, Dict, Union, Optional, Generator, Iterable
from collections import defaultdict
import logging
import requests
from .data import Language
from .tools import write_file_or_remove
from .storage import (
BaseVersion,
Storage,
Patch,
PatchElement,
... |
# the source codes of transE are from https://github.com/mklimasz/TransE-PyTorch
from absl import app
from absl import flags
import os
import numpy as np
import torch.optim as optim
from torch.utils import data as torch_data
from torch.utils import tensorboard
from collections import Counter
from torch.utils import dat... |
import os
import logging
import avalon.maya
import avalon.io
from collections import defaultdict
from avalon.maya.pipeline import (
AVALON_CONTAINER_ID,
AVALON_CONTAINERS,
containerise,
)
from maya import cmds
from . import lib
from .vendor import sticker
from .capsule import namespaced, nodes_locker
from... |
"""
__author__: HashTagML
license: MIT
Created: Sunday, 28th March 2021
"""
import json
import io
import os
import shutil
import warnings
from pathlib import Path, PosixPath
from typing import Any, Callable, Dict, Optional, Union
import pandas as pd
from lxml import etree as xml
from PIL import Image
import xml.etree... |
#!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2020 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-... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.normal import Normal
from monai.networks.nets import UNet,Classifier,DenseNet,BasicUNet,DynUNet
import numpy as np
import math
from kornia.geometry.transform import get_perspective_transform,get_affine_matrix2d
from .MultiLevelN... |
import numbers
import os
import sys
import warnings
from typing import List
import numpy as np
import scipy.signal
import scipy.sparse
from scipy.sparse.linalg import cg, LinearOperator
from . import Backend, ComputeDevice
from ._backend_helper import combined_dim
from ._dtype import from_numpy_dtype, to_numpy_dtype,... |
import os
from collections import defaultdict
import logging
from operator import itemgetter
from pathlib import Path
from typing import List, Optional, Tuple, Dict, Iterable, Iterator
import time
import numpy as np
import torch as T
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
fro... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import abc
import clu.abstract
import copy
import os
import pytest
abstract = abc.abstractmethod
@pytest.fixture(scope='module')
def strings():
yield ('yo', 'dogg', 'iheard', 'youlike')
@pytest.fixture(scope='module')
def capstrings():
yield ('Y... |
"""Tools to aid in parallelizing a function call.
Default method is MPI, if available. Fallback is concurrent.futures. If all
else fails, final fallback is serial.
Author: <NAME>
Email: <EMAIL>
"""
import os
import sys
import logging
from copy import copy
import multiprocessing
try:
from itertools import izip as ... |
#!/usr/bin/env python3
import math
import sys
import os
import time
import pybullet as p
from time import sleep
import time
import rospy
import tf
from scipy import signal
import pybullet_data
import rospkg
from transforms3d.quaternions import quat2mat
from wolfgang_pybullet_sim.terrain import Terrain
import numpy as... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.