text stringlengths 6.04k 39.5k |
|---|
import os
from typing import List
import psycopg2
from serenity.model.exchange import Exchange, ExchangeTransferMethod, ExchangeTransferType, \
ExchangeInstrument, ExchangeOrder, ExchangeAccount, ExchangeFill, ExchangeTransfer
from serenity.model.instrument import InstrumentType, Instrument, Currency, CurrencyPai... |
import cmd
import os # for system("clear")
import re
from database import api
from database.datehandler import GetDateString, GetYear, GetDaysAgo
from database.macros import foodIds, Macros, units # Just for names
import config
dateMatch = re.compile("^(\d+)[/\.](\d+)[/\.]?(\d+)?") # Matches both d/m/y and d.m.y with ... |
# Copyright (c) 2019 Graphcore Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
import logging
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import rcParams
import statsmodels.api as sm
rcParams.update({'figure.autolayout': True})
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
try:
import scipy... |
from __future__ import absolute_import, division, print_function
import pytest
import random
from cctbx import sgtbx
from dials.algorithms.symmetry.cosym._generate_test_data import generate_intensities
from dials.array_family import flex
from dxtbx.model.experiment_list import ExperimentList
from dxtbx.model import C... |
import functools
import inspect
import itertools
from textwrap import dedent
from typing import (
Any,
Callable,
Iterable,
Iterator,
List,
NoReturn,
Optional,
Tuple,
)
from blessed import Terminal
from blessed.formatters import FormattingString
from .compat import link
from .keys impor... |
#
# Functions to manage inventory and eqipment
#
import time
from botlib import *
foodList = [
"Sweet Berries",
"Bread"
]
def js_Minecart_With_Chest(entity):
if entity.name == "chest_minecart":
return True
else:
return False
class Chest:
def __init__(self,pybot,chesttype="Chest",sil... |
"""Interactive operations."""
import copy
import warnings
from astropy import log
try:
import matplotlib.pyplot as plt
from matplotlib import gridspec
HAS_MPL = True
except ImportError:
HAS_MPL = False
import numpy as np
from .fit import linear_fit, linear_fun, align
from .utils import compare_anyt... |
import json
import base64
from urllib.parse import quote_from_bytes, unquote, urlunparse, urlparse, urlencode, parse_qs
from django.conf import settings
from django.core.paginator import InvalidPage
from rest_framework import pagination, serializers
from rest_framework.exceptions import NotFound
from rest_framework.re... |
#!/usr/bin/env python
from __future__ import print_function, unicode_literals, division
import argparse
import re
import sys
import threading
import uuid
import shlex
import subprocess
import time
from pprint import pprint
import requests
import paramiko
NAME_SITE = "http://www.mess.be/inickgenwuname.php"
BACKUP_S... |
"""
Base strategy class.
Gets inherited by specific strategies.
"""
from ast import Raise
from fractions import Fraction as frac
import pandas as pd
class LoopComplete(Exception):
"""
Raised to indicate that the loop has reached the end of the price_period csv.
"""
def unfrac(fraction, round_to=4):
""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: <NAME> (<EMAIL>)
# @Date: 2019-11-12
# @Filename: cli.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
from __future__ import annotations
import asyncio
import logging
import os
import signal
import socket
import sys
import warnin... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2020, <NAME> (<EMAIL>)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ... |
# Copyright (c) 2017 Midokura SARL
# 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... |
# Copyright 2013 OpenStack Foundation
#
# 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 ... |
# -*- coding:utf-8 -*-
import json
from . import models
import datetime
def log(log_type, msg=None, asset=None, new_asset=None, request=None):
"""
记录日志
"""
event = models.EventLog()
if log_type == "upline":
event.name = "%s <%s> : 上线" % (asset.name, asset.sn)
event.asset = asset
... |
"""Common data model"""
from enum import Enum, IntEnum
from pydantic import BaseModel
from typing import List, Optional, Union, Dict, Any, Type
from pydantic.types import StrictBool
class SourceName(str, Enum):
"""Resources we import directly."""
CIVIC = 'civic'
MOA = 'moa'
class XrefSystem(str, Enum):... |
import numpy as np
from modules import Amino_acid_dictionaries as ad, functions as f
tolist = np.ndarray.tolist
flat = lambda x: [i for j in x for i in j]
unq = lambda x: np.array(np.unique(x))
def toint(j):
j = j.strip()
if j[0] != '-':
j = int(j) if j.isdigit() else int(j[:-1])
else:
... |
# Standard imports
from pymongo import MongoClient
import logging
import sys
import os
import numpy as np
import scipy as sp
import time
import json
import copy
# Get the configuration for the classifier
import emission.analysis.config as eac
# Our imports
import emission.storage.timeseries.abstract_timeseries as est... |
import rospy
from pointcloud_to_rangeimage.msg import RangeImage as RangeImage_msg
from pointcloud_to_rangeimage.msg import RangeImageEncoded as RangeImageEncoded_msg
import cv2
from cv_bridge import CvBridge
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input,... |
#!/usr/bin/env python3
from inspect import signature
from typing import Callable, List, Tuple, Union
import torch
from torch import Tensor
from torch.nn import Module
from captum.attr._core.deep_lift import DeepLift, DeepLiftShap
from captum.attr._core.integrated_gradients import IntegratedGradients
from tests.helpe... |
from configparser import ConfigParser
from cmd import Cmd
import sys
import time
import json
import random
import web3
from eth_abi import encode_single, decode_single
# CLI app to test Interledger interactively
# The app connects to two ethereum instances, whose connection data are provided
# by a configuration fil... |
""" Test module for nc
"""
from __future__ import print_function
import future
import os
from warnings import warn
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_almost_equal
try:
import netCDF4
except:
pytestmark = pytest.mark.skipif(True, reason="netCDF4 is not installed")
... |
#!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2017 UnitedStack 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/licen... |
from app.admin_panel import main
from app.crowd_control import crowd_control
from app import db
import datetime
# from app.admin_panel.models import Book, Publication
from app.admin_panel.models import Project, Task
from app.crowd_control.models import LiveStatus, WorkerStatus, Worker, Message, Robot, \
... |
""" Utilities for IGMSystem and IGMSurvey
Best to keep these separate from the Class modules
"""
from __future__ import print_function, absolute_import, division, unicode_literals
# Python 2 & 3 compatibility
try:
basestring
except NameError:
basestring = str
import warnings
import pdb
import numpy as np
from... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
BALANCED_ROC_CURVES
Based on simulated data that was created by MIX_HAPLOIDS and analyzed by
ANEUPLOIDY_TEST, balanced ROC (Receiver Operating Characteristic) curves
for predicting BPH (both parental homologs) and SPH (single parental homologs)
are created.
The balan... |
import numpy as np
import nibabel as nib
from dipy.segment.mask import median_otsu
import AFQ.registration as reg
import AFQ.utils.volume as auv
__all__ = ["MaskFile", "FullMask", "RoiMask", "B0Mask", "LabelledMaskFile",
"ThresholdedMaskFile", "ScalarMask", "ThresholdedScalarMask",
"CombinedMa... |
import os
import requests
import time
import traceback
from collections import defaultdict
from functools import wraps
from getpass import getuser
from threading import Thread
import ftrack_api
from Qt import QtCore, QtGui, QtWidgets
from vfxwindow import VFXWindow
def errorHandler(func):
"""Catch any exception ... |
# Copyright 2007 <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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the foll... |
from bottle import response, request, abort, run, default_app, cached_property
from datetime import datetime
from typing import List, Union, Set, Tuple
from collections import OrderedDict
from operator import attrgetter
import uuid
import re
import inflect
import simplejson as json
import shelve
import atexit
from func... |
#!/usr/bin/env python
# coding: utf-8
# <p style="color:#e8574d; font-size:30px; font-weight:bold; font-family:Helvetica"> Content </p>
#
# <ul style="font-size:16px; font-family:Helvetica">
# <li><a href='#copyright' style="color:#696969; text-decoration: none">Copyright and License</a></li>
# <li><a href='#... |
from os.path import abspath
from os.path import sep
from os import makedirs
import os
import logging
from copy import deepcopy
import numpy as np
from typing import Optional, Tuple
import functools
import time
import matplotlib.pyplot as plt
from pyqtgraph.multiprocess.remoteproxy import ClosedError
import qcodes as q... |
import contextlib
import distutils.version as dist_version # pylint: disable=E0611
import os
import tempfile
import shutil
import subprocess
import pdb
import urllib2
import cinder.compute.nova as nova
from cinder.image import image_utils
from oslo.config import cfg
from cinder import exception
from cinder.i18n impor... |
from __future__ import absolute_import, division, print_function
from blaze import into
from blaze.compute import compute, compute_up
from blaze.compatibility import xfail
from blaze.expr import *
from blaze.expr.functions import *
from datashape.predicates import iscollection
import pytest
data = [['Alice', 100, 1... |
# Copyright 2018 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... |
# Copyright 2019-2020 Nvidia Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
# wavfile.py (Enhanced)
# Date: 2017/01/11 <NAME>
#
# URL: https://gist.github.com/josephernest/3f22c5ed5dabf1815f16efa8fa53d476
# Source: scipy/io/wavfile.py
#
# Added:
# * read: also returns bitrate, cue markers + cue marker labels (sorted), loops, pitch
# See https://web.archive.org/web/20141226210234/http:/... |
"""
Plot the markups of the block level and
Full IIM controls as a function of the
Field Budget for different values of
beta.
Used for figures 1c, 1d, 1e, 1g & 1F.
<NAME>, Dec 2019.
"""
#Python modules:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import ast
impor... |
from optimizers.lmo import LMO
from optimizers.buffer import DataLoaderBufferFW
from models.fwdefs import *
from optimizers.linesearch import *
from optimizers.sgd import TorchSGD as SGD
from config import *
import copy
from launcher import get_criterion
import time
class Model:
"""
Implementation of Pairwise... |
import random
CRNI = 'X'
BELI = 'O'
PASS = 'P'
PREDAJA = 'PR'
class Grupa:
def __init__(self, barva, koordinata, go):
self.barva = barva
self.koordinate = {koordinata}
self.igra = go
self.sosedje = self.igra.sosedje(koordinata)
def zdruzi_se(self, others, koordinata... |
import logging
import numpy as np
from gym.spaces import Dict, Discrete
from rlkit.data_management.replay_buffer import ReplayBuffer
import rlkit.data_management.images as image_np
class ObsDictReplayBuffer(ReplayBuffer):
"""
Save goals from the same trajectory into the replay buffer.
Only add_path is im... |
import os
import sys
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(ROOT_DIR) # model
sys.path.append(os.path.join(ROOT_DIR, 'models'))
sys.path.append(os.path.join(ROOT_DIR, 'utils'))
sys.path.append(os.path.join(ROOT_DIR, 'external/ScanNet/BenchmarkScripts'))
import tensorflow as tf
import nump... |
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http:##www.qt-project.org/legal
##
## This file is part of the Qt Solutions component.
##
## $QT_BEGIN_LICENSE:BSD$
## You may use this file under the terms of the BS... |
import torch
from torch import nn
import torch.nn.functional as F
import math
import numpy as np
import torch_geometric as G
import copy
from torch_scatter import scatter_sum
import poptorch
class DataWrapper(torch.utils.data.IterableDataset):
def __init__(self, data, partition):
super(DataWrapper).__init_... |
"""This module defines functions to parse Google-style docstrings into structured data."""
from __future__ import annotations
import re
from ast import PyCF_ONLY_AST
from contextlib import suppress
from typing import TYPE_CHECKING, Any, List, Pattern, Tuple
from griffe.agents.nodes import get_annotation
from griffe.... |
"""
Serve web page and handle web sockets using Tornado.
"""
import json
import time
import asyncio
import socket
import mimetypes
import traceback
import threading
from urllib.parse import urlparse
# from concurrent.futures import ThreadPoolExecutor
import tornado
from tornado import gen, netutil
from tornado.web im... |
import sys
import pytest
from gmpy_cffi import (
log, log2, log10, exp, exp2, exp10, cos, sin, tan, sin_cos, sec, csc, cot,
acos, asin, atan, atan2, cosh, sinh, tanh, sinh_cosh, sech, csch, coth,
acosh, asinh, atanh, factorial, log1p, expm1, eint, li2, gamma, lngamma,
lgamma, digamma, zeta, erf, erfc,... |
# BSD 3-Clause License
#
# Copyright (c) 2016, 2017, The University of Sydney. 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 no... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
from copy import deepcopy
from django import forms
from django.conf import settings
from django.core.validators import MaxValueValidator
from django.db import models
import django_filters
from django_filters.constants import EMPTY_VALUES
from django_filters.utils import get_model_field, resolve_field
from nautobot.dc... |
import base64
import hashlib
import logging
import os
import uuid
from datetime import datetime
from pathlib import Path
from tempfile import TemporaryFile
from typing import Optional, Sequence
from urllib.parse import urlparse
from colorama import Fore, Style
from feast.constants import (
AWS_LAMBDA_FEATURE_SERV... |
#!/usr/bin/env python3
"""PyTorch Inference Script
An example inference script that outputs top-k class ids for images in a folder into a csv.
Hacked together by / Copyright 2020 <NAME> (https://github.com/rwightman)
"""
import os
import time
import argparse
import logging
import numpy as np
import torch
from timm.m... |
import typing as tp
import pygame
from pygame.locals import *
import numpy as np
import math
from model import ArrowDraw
import angles
import config as cfg
class Node:
def __init__(self, text: tp.Optional[str], big_font, small_font, tiny_font, \
pos: tp.Tuple[int, int], colour: tp.Tuple[int, int,... |
'''(Currently experimental, use at own risk)
Vaex can cache task results, such as aggregations, or the internal hashmaps used for groupby to make recurring calculations much faster, at the cost of calculating cache keys and storing/retrieving the cached values.
Internally, Vaex calculates fingerprints (such as hashes ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Onset detection
===============
.. autosummary::
:toctree: generated/
onset_detect
onset_backtrack
onset_strength
onset_strength_multi
"""
import numpy as np
import scipy
from ._cache import cache
from . import core
from . import util
from .util.e... |
#!/usr/bin/env python3
from deap import cma
from deap import algorithms
from deap import tools
from deap import creator
from deap import base
from collections import OrderedDict
import pathlib
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
import random
import subprocess
import multiprocessin... |
"""
assemble.py
This module contains functions for interpretting the output from our EM
algorithm: the vector of haplogroup contributions and the matrix of
read-haplogroup assignments. From these two data sets, we want to extract the
number of contributors and the fraction of the sample that is attributible to
each a... |
from functools import partial
import json
import os
import posixpath
import shutil
from . import scheduler
from .provenance import DataLayerProvenance
from cloudfiles import CloudFiles, compression
from cloudfiles.interfaces import COMPRESSION_EXTENSIONS
from .lib import (
Bbox, colorize, jsonify, mkdir,
toabs,... |
# Copyright 2017 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... |
import torch.nn as nn
import functools
import torch
import functools
import torch.nn.functional as F
from torch.autograd import Variable
import math
import torchvision
class Bottleneck(nn.Module):
# expansion = 4
def __init__(self, inplanes, outplanes, stride=1, downsample=None):
super(... |
# Copyright 2015 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
#!/usr/bin/env python
"""
Search the Fortran source code for procedures marked with !$gpu in their specification part:
subroutine sub(a)
integer :: a
!$gpu
...
end subroutine sub
For each one, generate a device copy by prepending attributes(device) prior to the procedure statement:
attributes(... |
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import ast
import inspect
import itertools
import sys
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from t... |
#!/usr/bin/env python
#
# Copyright (C) 2013-2014 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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 a... |
#test main
import os
import glob
import pytest
import pandas as pd
import numpy as np
import cv2
import shutil
import torch
import tempfile
import copy
import albumentations as A
from albumentations.pytorch import ToTensorV2
from deepforest import main
from deepforest import get_data
from pytorch_lightning import Tra... |
from Framework.Utilities import Farbe, Messaging
from Framework.Utilities import YAML as UtilYaml
from Framework.Mongo import Uccount
from Framework.ErrorHandler import YAMLError
import yaml
import discord
from discord.ext import commands
import random
import asyncio
import requests
import os
class Object(object):
... |
import logging
import sys
from jyotisha.panchaanga.temporal import PeriodicPanchaangaApplier, interval, get_2_day_interval_boundary_angas
from jyotisha.panchaanga.temporal import time
from jyotisha.panchaanga.temporal.zodiac.angas import AngaType, Anga
from sanskrit_data.schema import common
def get_tithi(jd):
"... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI 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 ... |
# -*- coding: utf-8 -*-
# $Id: testcaseargs.py 69111 2017-10-17 14:26:02Z vboxsync $
"""
Test Manager - Test Case Arguments Variations.
"""
__copyright__ = \
"""
Copyright (C) 2012-2017 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This fil... |
"""
Methods to characterize image textures.
"""
import numpy as np
from .._shared.utils import assert_nD
from ..util import img_as_float
from ..color import gray2rgb
from ._texture import (_glcm_loop,
_local_binary_pattern,
_multiblock_lbp)
def greycomatrix(image, distan... |
import os
import random
import threading
import tensorflow as tf
import numpy as np
import pandas as pd
import logging
import scipy as sp
import scipy.io
pd.options.mode.chained_assignment = None
class Config():
seed = 100
use_seed = False
n_channel = 1
n_class = 2
num_repeat_noise = 1
sampling_rate = 100... |
"""A handler for generating tasks and datasets and evaluating ml frameworks."""
import itertools
import logging
import numpy as np
import warnings
from functools import partial
from sklearn.base import clone
from sklearn.preprocessing import label_binarize
from sklearn.utils.validation import check_is_fitted
from .... |
# Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
import os
import pytest
import shutil
import tempfile
import coremltools
from coreml... |
import logging
import os
import time
import sqlite3
from twisted.internet import threads, defer
from twisted.python.failure import Failure
from twisted.enterprise import adbapi
from lbrynet.core.HashBlob import BlobFile, TempBlob, BlobFileCreator, TempBlobCreator
from lbrynet.core.server.DHTHashAnnouncer import DHTHash... |
#
# <EMAIL>
# 2017-10-10
# Codigo que faz regressao simples e encontra embeddings
#
# a ideia aqui e a seguinte:
# - carregar dados do movielens
# - inicializar o embedding de forma aleatoria
# - encontrar os embeddings de filmes e de usuarios que gerem o menor erro possivel
# t8: retira os bias de filmes e usuario... |
# This file is part of
# the galxy-chop project (https://github.com/vcristiani/galaxy-chop)
# Copyright (c) 2020, <NAME>
# License: MIT
# Full Text: https://github.com/vcristiani/galaxy-chop/blob/master/LICENSE.txt
"""Fixtures input data."""
# ==========================================================================... |
import sys
import os
import unittest
from collections import Counter
import joblib
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
class RottenTomatoesLoader(object):
def __init__(self, mode, gra... |
from dataclasses import fields
from email import message
from turtle import up
import shopify
from shopify.resources import fulfillment_service
from pyactiveresource.activeresource import ActiveResource
from shopify.resources.custom_collection import CustomCollection
import logging
logger = logging.getLogger('__default... |
"""
Creates a MobileNetV2 Model as defined in:
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>. (2018).
MobileNetV2: Inverted Residuals and Linear Bottlenecks
arXiv preprint arXiv:1801.04381.
import from https://github.com/tonylins/pytorch-mobilenet-v2
"""
import torch.nn as nn
import torch
import math
__all__ = ['i2rnetv5',]... |
"""
A fake implementation of the GitHub REST API.
"""
from __future__ import annotations
import dataclasses
import datetime
import itertools
import random
import re
from dataclasses import dataclass, field
from typing import Any, Dict, Iterable, List, Optional, Set
from urllib.parse import unquote
from openedx_webho... |
import csv
import json
class ForceRunType:
DD = "A"
ANNUAL = "B"
NONE = "C"
class ReportingFreq:
DETAILED = "Detailed"
TIME_STEP = "Timestep"
HOURLY = "Hourly"
DAILY = "Daily"
MONTHLY = "Monthly"
RUN_PERIOD = "RunPeriod"
ENVIRONMENT = "Environment"
ANNUAL = "Annual"
cla... |
# imports
import os
import time
import numpy as np
from six.moves import range
from six import string_types
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import gen_nn_ops
from skimage.restoration import denoise_tv_bregman
from .utils import *
from .utils import con... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module contains some useful hard-coded data and equations for calculations
in the other modules.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
import numpy as np
import astropy.units as u
from war... |
from collections import defaultdict
import keras.backend as K
import pickle
import pathlib
import pandas as pd
import scipy.special
import scipy.stats
from keras.models import Model
import gc
import palmnet.hunt
from palmnet.core.layer_replacer_TT import LayerReplacerTT
from palmnet.core.layer_replacer_palm import Lay... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import numpy as np
from scipy.linalg import eigh, LinAlgError
from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
from sklearn.metrics.pairwise import pairwise_kernels, euclidean_distances
from sklearn.utils import check_random_state
from skle... |
import numpy as np
import math
import time
import bisect
import sys
from statistics import mean
from multiprocessing import Pool
class SimpleCluster:
"""Cluster a set of entites
"""
def __init__(self, config, entities, features):
"""Init
Args:
entities (list): list of entity m... |
"""Module for the Risk-Exploiting Graph Scenario with variable input parameters
- Network of agents are to act as a connecition between origin and destination terminals of
known (observed).
- This is a simplified, surrogate scenario for the more complex communication relay scenario
since would be expected to produc... |
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.sh... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import logging
import ipaddress
import email.utils
from email import policy, message_from_bytes
from email.utils import parsedate_to_datetime
from email.message import EmailMessage
from io import BytesIO
from pathlib import Path
from typing import Union, List, T... |
"""
Parsers for ISO8583 messages.
The iso8583 module provides ISO8583 message parsing functions.
See `ISO8583 Wikipedia page <https://en.wikipedia.org/wiki/ISO_8583>`_. for more details.
Also supports Mastercard |reg| PDS field structures.
The parsing functions are modelled on the python standard json library.
The fu... |
# coding: utf-8
import scipy
import json
import re
import traceback
import allennlp
from allennlp.predictors.predictor import Predictor
import sys
from allennlp.commands.elmo import ElmoEmbedder
from spacy.lang.en import English
import numpy as np
# import tensorflow as tf
import torch
from hyperpara import *
impor... |
# Copyright (c) 2018, ETH Zurich and UNC Chapel Hill.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this ... |
import json
import time
import logging
from typing import Optional, Any
import torch
import shutil
import os
import numpy as np
import collections
import datetime
import traceback as traceback_module
import io
import torch.nn as nn
from ..basic_typing import History, DatasetsInfo
from .options import Options
logger =... |
#!/usr/bin/python
#-*-coding:utf-8-*-
"""Sequence logo
"""
import os, sys, re, math
class PWM( object ):
"Positional weight matrix providing index proposed by Pan and Pan (2007)"
def __init__( self, motif_id, name, species, accession=None, medline=None ):
self.__id = motif_id
self.__name = na... |
import tensorflow as tf
import cv2
import numpy as np
from PIL import Image
from tqdm import tqdm
## Note that the code of Score-CAM referenced the following github repository under MIT license.
## - https://github.com/tabayashi0117/Score-CAM
## - https://github.com/haofanwang/Score-CAM
## Note that the code of Grad-C... |
import traceback
import re
from json import loads, dumps
import xmltodict
from BeautifulSoup import BeautifulStoneSoup
from collections import OrderedDict
from HTMLParser import HTMLParser
from flask import current_app
def get_dict_element(key, dict):
if hasattr(dict,'iteritems'):
for k, v in dict.iteri... |
# -*- coding: UTF-8 -*-
# Copyright 2017-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""The :xfile:`models.py` module for this plugin.
See :doc:`/specs/avanti/avanti`.
"""
from __future__ import unicode_literals
from builtins import str
from lino.api import dd, rt, _
from django.db import mod... |
from keras.layers import Dropout, Embedding, LSTM, Dense, BatchNormalization, Input
from keras.models import Model
from tensorflow.python.autograph.pyct import transformer
import tensorflow as tf
import numpy as np
from PIL import Image
import pickle
from keras.models import load_model
import os
from keras.preprocessin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.