text stringlengths 6.04k 39.5k |
|---|
import sys
sys.setrecursionlimit(20000) # to allow the e2wrn28_10R model to be exported as a torch.nn.Module
import os.path
from typing import Tuple
import torch.nn.functional as F
from e2cnn import nn
from e2cnn import gspaces
from e2cnn.nn import init
import torch
import math
import numpy as np
STORE_PATH = "./mo... |
from typing import Union
from functools import lru_cache
import torch
import os.path
class DiagonaledMM(torch.autograd.Function):
'''Class to encapsulate tvm code for compiling a diagonal_mm function, in addition to calling
this function from PyTorch
'''
function_dict = {} # save a list of function... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict
from logging import getLogger
import os
from os.path import join
from subprocess import CalledProcessError, check_call
import sys
from traceback import format_exc
import warnin... |
#Imports
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep
import smtplib
import sys
import credentials #The file which stores passwords and guest id's
#All the rides with fastpasses: ak = animal kingd... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import copy
import torchvision
import torchvision.transforms as transforms
import numpy as np
from PyHessian.pyhessian import hessian # Hessian computation
from ResNet_CIFAR10 import *
fro... |
# Copyright 2021 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 agreed to in writing, ... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
# Copyright 2021 Phonetics and Speech Laboratory, Trinity College, Dublin
#
# Based on Corpus Crawler (utils.py):
# Copyright 2017 Google Inc. All rights reserved.
#
# Based on Corpus Crawler's Irish crawler (crawl_ga.... |
import os.path as osp
import random
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal, assert_array_equal
from mmaction.core import (ActivityNetLocalization,
average_recall_at_avg_proposals, confusion_matrix,
get_weighted_score, ... |
#
# 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... |
# Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
'''
This file contains a set of functions to plot models for Matisse. Including
- Map of ScS, SKS and SKKS data
- Global map of the Trigonal domains
- Regional view showing phases and domains
- Global view showing Reciever Side corrections
- Regional map showing the number of ScS, SKS and SKKS paths in each domain f... |
"""Converter from TypeDoc output to IR format"""
from codecs import getreader
from errno import ENOENT
from json import load, dump
from os.path import basename, join, normpath, relpath, sep, splitext
import re
import subprocess
from tempfile import NamedTemporaryFile
from typing import List, Optional, Tuple, Union
fr... |
import itertools
import logging
import numpy as np
import pandas as pd
import scipy.stats
def create_regression_dataset(metafeatures, experiments):
X = []
X_indices = []
Y = []
for dataset_name in experiments:
experiment = experiments[dataset_name]
mf = metafeatures.loc[dataset_name]
... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian
from a2c_ppo_acktr.utils import init
class Flatten(nn.Module):
def forward(self, x):
return x.view(x.size(0), -1)
class Policy(nn.Module):
... |
"""
Fit zero-mean GPCSD to baseline period of auditory LFP recordings.
Investigate power and extract phases for coupling analysis in Matlab.
Creates Figure 2 in the paper.
"""
# %% Imports
import autograd.numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import scipy.io
import pickle
import os.path... |
import os
import sys
sys.path.append('.')
import cv2
import numpy as np
import time
from Utilities import drawRegion, drawBox, col_rgb, CVConstants
try:
import pyMTF
mtf_available = 1
except ImportError as e:
print('MTF unavailable: {}'.format(e))
mtf_available = 0
from siamfc.SiamFC import SiamFC... |
# Copyright 2018-2021 The glTF-Blender-IO 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 or ... |
"""
Mask R-CNN
Copyright (c) 2018 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
------------------------------------------------------------
Minor Changes applied from <NAME>
Applied for:
IEEE Intelligent Vehicles Symposium - IV2020:
"Vehicle Position Estimation with A... |
"""
Tests for attack.dictionaries module.
"""
import math
import os
import dataclasses
import pytest
import tempfile
from typing import List
from test_common.fs.ops import copy_files
from test_common.fs.temp import temp_dir
from cifra.attack.dictionaries import Dictionary, get_words_from_text, \
NotExistingLangua... |
import os
import sys
#import pip.utils.logging
#import pip
import socket
import tempfile
import threading
import subprocess
import xmlrpclib
import re
from cStringIO import StringIO
import sys
import shutil
import time
#import zipfile
from distutils.version import LooseVersion
if __name__ == "__main__":
import doc... |
#!/usr/bin/env python3
# coding: utf-8
"""The game logic.
This should be independent of media used to interact with player."""
from typing import Tuple, List, Set, Dict
from const import PLAYER_SHIFT, LAST_ON_PATH, END_PROGRESS
from piece import Piece
from player import Player
from util import progress_to_positio... |
import os
import shutil
import argparse
import time
import json
from datetime import datetime
from collections import defaultdict
from itertools import islice
import pickle
import copy
import numpy as np
import cv2
import torch
from torch import nn
from torch import autograd
import torch.nn.functional as F
import tor... |
# Copyright (c) 2020 Leiden University Medical Center
#
# 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, me... |
import tkinter
from math import sqrt, sin, cos, atan, radians, pi
from evolution import *
def magnitude(vector):
# Take a list/tuple that represents a vector and return its magnitude.
return sqrt(sum([i ** 2 for i in vector]))
def direction(td_vector):
# Take a 2d vector (list with two elements) and retu... |
"""
This modules performs spectral analysis of EEG signals (sometimes
refered as quantitative EEG) on a mne object. EEG Sleep EEG is ideally suited
to frequency and time-frequency analysis, since different stages or
micro-elements (such as spindles, K-complexes, slow waves) have
specific frequency characteristics [1].
... |
"""Logic to handle custom_cards."""
import json
import os
from typing import IO, Any
import requests
from requests import RequestException
import yaml
from pyupdate.ha_custom import common
from pyupdate.log import Logger
class Loader(yaml.SafeLoader):
"""YAML Loader with `!include` constructor."""
def __ini... |
"""
MIT License
Copyright (c) 2017 s0hvaperuna
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, d... |
class Color:
pass
class rgb(Color):
"A representation of an RGBA color"
def __init__(self, r, g, b, a=1.0):
self.r = r
self.g = g
self.b = b
self.a = a
def __repr__(self):
return "rgba({}, {}, {}, {})".format(self.r, self.g, self.b, self.a)
@property
... |
# -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
from functools import reduce
import unittest
import numpy
from pyscf import lib
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import ao2mo
from pyscf import fci
from pyscf.tools import molden
from pyscf.grad import rhf as rhf_grad
f... |
import datetime as dtm
from profile_plot import profile_plot
import matplotlib.pyplot as plt
from matplotlib.font_manager import fontManager, FontProperties
from matplotlib import ticker, cm
import sys
import pandas as pd
import numpy as np
import os
import re
from dateutil import parser
import errno
from shutil import... |
# pylint: skip-file
# type: ignore
# -*- coding: utf-8 -*-
#
# tests.analyses.milhdbk217f.models.relay_unit_test.py is part of The RAMSTK
# Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Test class for the relay module."""
# Thir... |
import logging
import vision
from django.contrib.auth.models import User
from django.db import models
from django.utils.timezone import now, timedelta
from django.utils.translation import ugettext_lazy as _
from survey.models import Survey, Video, VideoCategory
from vision.track.interpolation import LinearFill
from p... |
#! /usr/bin/env python
"""
Module for generating an RBF approximation
of temporal dynamics in POD basis space
"""
import numpy as np
import scipy
from scipy.spatial.distance import cdist
from numpy.lib.scimath import sqrt as csqrt
from scipy import interpolate
import pod as pod
import greedy as gdy
import rom as rom... |
# -*- coding: utf-8 -*-
import tkinter
import serial
import serial.tools.list_ports
import threading
from tkinter import filedialog
from tkinter import *
import sys
import os
from tkinter import messagebox
from tkinter.scrolledtext import ScrolledText
import matplotlib.pyplot as plt
import matplotlib.animat... |
#===============================================================================
# Copyright 2022 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.a... |
# -*- coding: utf-8 -*-
""" VITA Person Registry, Controllers
@author: nursix
@see: U{http://eden.sahanafoundation.org/wiki/BluePrintVITA}
"""
prefix = request.controller
resourcename = request.function
# -----------------------------------------------------------------------------
# Options Menu (availabl... |
# pylint: disable=too-many-instance-attributes
import logging
import os
from operator import itemgetter
import json
import codecs
from typing import List, Dict
from server import base_dir, mc, TOOL_API_KEY
from server.auth import user_mediacloud_client
from server.cache import cache
from server.util.stringutil import... |
# =============================================================================
# Copyright (c) 2016, Cisco Systems, 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:
#
# Redistributions ... |
# coding=utf-8
import os
import sdl2
from renderable_sprite import UISpriteRenderable
from ui_dialog import UIDialog, Field
from ui_button import UIButton
from art import UV_NORMAL, UV_ROTATE90, UV_ROTATE180, UV_ROTATE270, UV_FLIPX, UV_FLIPY
from ui_colors import UIColors
class ChooserItemButton(UIButton):
... |
""" This module implements the definition of the different configuration.
NOTE: Make sure to run the function 'save_common_default_template'
to save the default config after altering CompleteConfiguration.
Write the default raw configuration template
>>> import muteria.configmanager.conf... |
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from horch.common import tuplify
from horch.models import get_default_activation, get_default_norm_layer
from horch.config import cfg
# sigmoid = torch.nn.Sigmoid()
class SwishFunction(torch.autograd.Function):
... |
import pickle
import keras
import uuid
#pytorch
import torch as t
import torch.nn as nn
from torch.autograd import Variable
import torch.utils.data as Data
import torchvision
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import... |
"""
OpenVINO DL Workbench
Enumerates classes
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-2.0
Unless requ... |
# Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import time
import multiprocessing as mp
from multiprocessing import Pool as ProcessPool
import numpy as np
import pandas as pd
from floris.utils.tools import valid_ops as vops
from floris.utils.tools import farm_config as fconfig
from floris.utils.visualization import wflo_eval as vweval
from floris.utils.visualizat... |
# Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Test that `LocalSnapshot` and `LocalSnapshotGPU` work."""
from copy import deepcopy
import hoomd
from hoomd.data.array import HOOMDGPUArray
import numpy as n... |
"""
相比于原始的plot.py文件,增加了如下的功能:
1.可以直接在pycharm或者vscode执行,也可以用命令行传参;
2.按exp_name排序,而不是按时间排序;
3.固定好每个exp_name的颜色;
4.可以调节曲线的线宽,便于观察;
5.保存图片到本地,便于远程ssh画图~
6.自动显示全屏
7.图片自适应
8.针对颜色不敏感的人群,可以在每条legend上注明性能值,和性能序号
9.对图例legend根据性能从高到低排序,便于分析比较
10.提供clip_xaxis值,对训练程度进行统一截断,图看起来更整洁。
seaborn版本0.8.1
"""
import seaborn as sns
import p... |
# -*- coding: utf-8 -*-
"""Bytecode Interpreter operations base class
Note: this is subclassed. Later versions use operations from here.
"""
from __future__ import print_function, division
import inspect
import operator
import logging
import sys
from xdis import PYTHON_VERSION
from xpython.pyobj import Function
from ... |
from django.contrib import auth
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.core.mail import send_mail
from django.contrib import messages
from django.http import HttpResponseRed... |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 28 16:23:37 2016
@author: <NAME> (<EMAIL>)
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import sys
import time
import numpy as np
from six.moves import xrange # pylint: disable=r... |
# Created byMartin.cz
# Copyright (c) <NAME>. All rights reserved.
from pero.properties import *
from pero import StraitAxis
from pero import Scale, ContinuousScale, LinScale, LogScale, OrdinalScale
from pero import Ticker, LinTicker, LogTicker, FixTicker, TimeTicker
from pero import Formatter, IndexFormatter
from ... |
#!/usr/bin/env python
import sys
import binascii
from struct import pack, unpack
###############################################################################
# color crap
###############################################################################
palette = [0xbccbde, 0xc2dde6, 0xe6e9f0, 0x431c5d, 0xe05915, 0x... |
import numpy as np
import nanocut.common as nc
from nanocut.output import error, printstatus
__all__ = [ "Periodicity", ]
def gcd(numbers):
"""Calculates greatest common divisor of a list of numbers."""
aa = numbers[0]
for bb in numbers[1:]:
while bb:
aa, bb = bb, aa % bb
re... |
from __future__ import unicode_literals
import io
import json
import os
import re
from collections import OrderedDict
VALID_COUNTRY_CODE = re.compile(r"^\w{2,3}$")
VALIDATION_DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
VALIDATION_DATA_PATH = os.path.join(VALIDATION_DATA_DIR, "%s.json")
FIELD_MAPPING =... |
# -*- coding: utf-8 -*-
# TODO Licence:
#
# TODO: move library intensive functions to vtool
from __future__ import absolute_import, division, print_function, unicode_literals
import operator
import six
from six.moves import zip, range, reduce
from utool import util_type
from utool import util_inject
from utool import ... |
from __future__ import print_function
import argparse
import os
import random
import sys
sys.path.append(os.getcwd())
import pdb
import time
import numpy as np
import json
import progressbar
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.backends.cudnn as cudn... |
# Input Optimization Algorithm
# ReverseLearning, 2017
# Import dependencies
import tensorflow as tf
import numpy as np
from time import time
import pandas
# Suppress warnings
from warnings import filterwarnings
filterwarnings("ignore")
class IOA:
def __init__(self, model, ins, tensorBoardPath = None):
#... |
#!/usr/bin/env python3
"""
This executable builds takes RST files comprising the SE manual and outputs final PHP files for publication to the SE website.
"""
import os
import argparse
from html import escape
from pathlib import Path
import subprocess
import sys
import tempfile
from bs4 import BeautifulSoup, NavigableS... |
import bpy
import os
bl_info = {
"name" : "plantFEM_export", # プラグイン名
"author" : "<NAME>", # 作者
"version" : (0,1), # プラグインのバージョン
"blender" : (2, 80, 0), # プラグインが動作するBlenderのバージョン
"location" : "File > Export > plantFEM_export", # Blender内... |
from typing import Optional, Dict, List, Callable
from Crypto.Cipher import DES, AES
from Crypto.Util.Padding import pad
from datetime import datetime
from httpx import AsyncClient
from copy import deepcopy
import base64, json, uuid
import hashlib
from loguru import logger
from .base import AsyncBaseTask
from ..cpdail... |
#!/usr/bin/python3
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, Interface Innovations"
__credits__ = ["<NAME>"]
__license__ = "Apache 2.0"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
import os
import sys
import inspect
try:
import simplejson as json
exc... |
import sys
import os
from collections import OrderedDict
from ttfautohint._compat import (
ensure_binary, ensure_text, basestring, open, IntEnum,
)
USER_OPTIONS = dict(
in_file=None,
in_buffer=None,
out_file=None,
control_file=None,
control_buffer=None,
reference_file=None,
reference_bu... |
import os
import uuid
import re
import mimetypes
from django.shortcuts import render
from .forms import FormUserCreation, FormLogin, FormJobPost, FormApply, FormUploadImage, FormUploadResume, FormApplicantsInfo
from django.http import HttpResponse, JsonResponse
from django.core.mail import send_mail
from django.templat... |
# -*- coding: utf-8 -*-
# loader.py
# Copyright (c) 2014-?, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice,... |
import matplotlib
matplotlib.use('tkagg')
import os
import subprocess
import sys
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
import tensorflow as tf
from ampligraph.common.aux import rel_rank_stat, load_data, eige... |
# **********************************************************************
# Copyright (C) 2020 Johns Hopkins University Applied Physics Laboratory
#
# All Rights Reserved.
# For any other permission, please contact the Legal Office at JHU/APL.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# y... |
import pandas as pd
import numpy as np
from .basecomparison import BaseTwoSorterComparison
from .comparisontools import (do_score_labels, make_possible_match,
make_best_match, make_hungarian_match, do_confusion_matrix, do_count_score,
compute_performance)
cl... |
import tensorflow as tf
import numpy as np
from utils.environ import env
from utils.helpers import *
from utils.mlogging import mlogging
from utils.model_config import ModelConfig
from utils.layers import Dense, build_mlp
from utils.word_embeddings import WordHashing
from utils.vsm import vsm_search
from dataclasse... |
#!/usr/bin/python3
# <---------------------------------------------------------------------------- general imports --->
import os
import sys
import datetime
import configparser
from random import random
import math
# <---------------------------------------------------------------------------- numeric imports --->
imp... |
import argparse
import math
import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as Data
from torch.autograd import Variable
from torch.utils.data import Dataset
import math
from model import HierachyVAE
from read_data import *
from util... |
import argparse
import collections
import time
import numpy as np
import torch as th
import torch.nn.functional as F
import torch.nn.init as INIT
import torch.optim as optim
from torch.utils.data import DataLoader
from gene_dataset import Datagenerator
import torch
# from sklearn.decomposition import PCA
from sklearn.f... |
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""
This module provides a function to evaluate potential outliers in the aseg.stats
values.
"""
# ------------------------------------------------------------------------------
# subfunctions
def readAsegStats(path_aseg_stats):
"""
A function to read aseg.stats files.
"""
# read file
with open... |
#!/usr/bin/env python
# coding:utf8
# -*- coding: utf-8 -*-
"""
Main Program: Run MODIS AGGREGATION IN PARALLEL
Created on 2019
@author: <NAME>
"""
import os
import sys
import h5py
import timeit
import random
import numpy as np
from mpi4py import MPI
from netCDF4 import Dataset
def read_filelist(loc_dir,prefix,yr,... |
"""
Delete idea, idk if it's gonna work or not
https://photos.google.com/_/PhotosUi/data/batchexecute?rpcids=XwAOJf&f.sid=-8354753373044497059&bl=boq_photosuiserver_20210722.08_p0&hl=en&soc-app=165&soc-platform=1&soc-device=1&_reqid=2110374&rt=c
https://photos.google.com/_/PhotosUi/data/batchexecute?rpcids=XwAOJf&f.... |
#!/usr/bin/env python3
import json
import urllib.request
import configparser
import sys
import os.path
import argparse
def main():
try:
# Obligatory Variables
ios_neigh_grp_v4 = None
ios_neigh_grp_v6 = None
xr_neigh_grp_v4 = None
xr_neigh_grp_v6 = None
op_sys = No... |
# -*- coding: utf-8 -*-
import collections
import logging
import threading
import time
from contextlib import closing
from .block import Block, BlockHeader
from .bitcoin import Bitcoin
from .serialize import Serialize
from .script import Script
from .util import bytes_to_hexstring, target_to_bits, bits_to_target
from... |
#!/usr/bin/env python
# pylint: disable=unexpected-keyword-arg,too-few-public-methods
"""
Test suite for data processing, dummy data and input/output functions.
"""
import os
import sys
import shutil
import unittest
import warnings
import numpy as np
import numpy.testing
import nestcheck.data_processing
import nestchec... |
from collections import Counter
from tqdm import tqdm
import itertools
import pandas as pd
import numpy as np
from db import get_annotation_db
from journal import get_journal_text, get_journal_info, get_journal_text_representation
responsibility_labels = ["communicating", "info_filtering", "clinical_decisions", "prep... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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,... |
#!/usr/bin/env python
# coding: utf-8
import sys
import logging
from amulog import cli
from amulog import common
from amulog import config
_logger = logging.getLogger(__package__.partition(".")[0])
def get_targets_conf(conf):
from amulog import __main__ as amulog_main
return amulog_main.get_targets_conf(co... |
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Dataset, Subset
from torch.cuda import amp
import numpy as np
import logging
import time
import os
from os import mkdir, listdir, getcwd
from os.path import join, exists
from copy import deepcopy
class EarlyStopping(object):
'''
Per... |
"""Test the build_featurizer code."""
import os
import random
import warnings
import logging
import keras.backend as K
import numpy as np
import pytest
from keras.layers import Dense, Activation, Input
from keras.layers.merge import add
from keras.models import Sequential, Model
from pic2vec.build_featurizer import (... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 11 14:34:08 2020
@author: <NAME> (<EMAIL>),
Finnish Meteorological Institute)
Olli's python implementation of ESA SNAP s2toolbox biophysical processor and
computation of vegetation indices.
See ATBD at https://step.esa.int/docs/extra/ATBD_S2ToolBox_L2B_V1.1.pdf
And java... |
import pandas as pd
import os
from tqdm import tqdm
from model.bert_things.pytorch_pretrained_bert.tokenization import BertTokenizer
from model.bert_things.pytorch_pretrained_bert import BertConfig, BertModel, BertPreTrainedModel
from model.bert_text_model import BertTextModel
from data_loader.utils.vocab import Vocab
... |
#!/usr/bin/env python3
## TODO: optimize c-mcpu metric; early-stop handler; fp16/int8; Kill pyRPC;
import numpy as np
import tvm
import logging
import math
import re
import sys, time, subprocess, os, random, hashlib
from tvm import autotvm
import topi
import json
from topi.util import get_const_tuple
import importlib... |
import re
import torch
from torch import nn
import pandas as pd
import numpy as np
from torch._six import container_abcs, string_classes, int_classes
from torch.nn.utils import rnn as rnn_utils
from typing import TypeVar, Dict, List, Tuple
from ..typing import SocSeqList, SocSeqBatch, SocSeqPolicyBatch, SocSeqPolicyLis... |
"""
SPIL: ScratchPy Intermediate Language
An extremely simple assembly-like language that ScratchPy compiles to that can then
be directly converted into real Scratch code
There are no registers, instructions manipulate scratch variables directly.
In place of registers, temporary variables 0-63 are created to evaluate... |
# By: <NAME>, 2018
# Ported to Keras from the official Tensorflow implementation by Magenta
# Most utilities in 'utils' remained the same as in the official implementation
""" SketchRNN data loading, callbacks and image manipulation utilities. """
from __future__ import absolute_import
from __future__ import division... |
# coding: utf-8
# DMUtils.py
# Dark Matter rate calculator as part of WIMpy_NREFT
#
# Author: <NAME>
# Email: <EMAIL>
# Last updated: 02/03/2018
import numpy as np
from numpy import pi, cos, sin
from scipy.integrate import trapz, cumtrapz, quad
from scipy.interpolate import interp1d
from numpy.random import rand
fro... |
from datetime import datetime, date, timedelta, time
from django.contrib.auth.models import User
from django.utils.text import slugify
from api.helper import EMP_GROUP2, EMP_GROUP3
from api.utils import to_int
from restapi.serializers.team import PendingInwardPaymentEntrySerializer, OutWardPaymentSerializer
from rest... |
# Copyright 2013 Google Inc. All Rights Reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""A simple, direct connection to the vtgate proxy server, using gRPC.
"""
import datetime
import logging
import re
from urlparse import urlparse
from grpc.beta impo... |
import pandas as pd
import csv
import math
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
#################################################################
# #
# #
# ... |
# -*- coding: utf-8 -*-
import os
import re
import sys
import json
import shutil
import hashlib
import inspect
import datetime as dt
import click
import requests
import sqlalchemy
import textdistance
from rich.table import Table
from rich.console import Console
try:
import bs4
import git
import pandas
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This module implements the Estrangement Confinement Algorithm (ECA) and various functions necessary
to read the input snapshots, process information and return the results and/or print them to file.
"""
__all__ = ['make_Zgraph','read_general','maxQ','repeated_runs','ECA... |
from enn import *
import numpy as np
from grid_LSTM import netLSTM, netLSTM_full
from grid_data_v2 import TextDataset
import grid_data_v2 as grid_data
from grid_configuration import config
from util import Record, save_var, get_file_list, Regeneralize, list_to_csv
from torch.autograd import Variable
from torch.utils.da... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Nipype translation of ANTs' workflows."""
import numpy as np
# general purpose
from pkg_resources import resource_filename as pkgr_fn
# nipype
from nipype.pipeline import engine as pe
from nipype.interf... |
"""Easy context-based interface for generating a sheet and cells.
Comparable to matplotlib pylab interface, this interface keeps track of the current
sheet. Using the ``cell`` function, ``Cell`` widgets are added to the current sheet.
"""
__all__ = ['sheet', 'current', 'cell', 'calculation', 'row', 'column', 'cell_ran... |
from subprocess import STDOUT
import sys
from tf.transformations import rotation_matrix
sys.path.insert(0, './yolov5')
from yolov5.utils.datasets import LoadImages, LoadStreams,LoadWebcam,LoadRealsense
from yolov5.utils.general import check_img_size, non_max_suppression, scale_coords
from yolov5.utils.torch_utils impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.