text
stringlengths
8.04k
46.5k
# -*- coding: utf-8 -*- from dcicutils import ff_utils from core.pony_utils import ( FormatExtensionMap, get_extra_file_key, ProcessedFileMetadata, Awsem, Tibanna, create_ffmeta_awsem, parse_formatstr ) from core.utils import ( powerup, printlog, TibannaStartException, send_notification_em...
import random, time, argparse, os.path from automata_learning_with_policybank import aqrm from automata_learning.aqrm import run_aqrm_experiments from automata_learning.qlearning import run_qlearning_experiments from baselines.run_dqn import run_dqn_experiments from baselines.run_hrl import run_hrl_experiments from tes...
""" This file contains a couple of S/N estimation codes designed for use during SAMI observing runs. UPDATED: 08.04.2013, <NAME> - Edited to comply with new conventions in sami_utils. - Edited to accept new target table format. 23.08.2012, <NAME> - Changed name of "sn" function...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Experiment. We will vary: - type of noise - type of matrix - support of noise - amplitude of noise - type Laplacian - size of embedding - parameter k of local neighborhood """ import os import re import numpy as np import matplotlib.pyplot a...
from printing import dprint, eprint, qprint, oprint import os import sys import binascii import fnmatch import tempfile """ Many of the functions defined in this file are sent to the remote upy board for execution. Some of them can run either on the host or remote, with small differences. IS_UPY is used to determine...
""" Clustered Hierarchical Entropy-scaling Manifold Mapping. # TODO: https://docs.python.org/3/whatsnew/3.8.html#f-strings-support-for-self-documenting-expressions-and-debugging """ import logging import pickle import random from collections import deque from operator import itemgetter from queue import Queue from thr...
"""Widget base classes. All magicgui ``Widget`` bases compose a backend widget that implements one of the widget protocols defined in ``magicgui.widgets._protocols``. ``` class Widget: _widget: protocols.WidgetProtocol def __init__(self, widget_type: Type[protocols.WidgetProtocol]): self._widget = wi...
""" SIMPAR Simulação de Passageiros em Partida Aérea """ #Imports from pythonds.basic import Queue import random import names #Main Classes class Passageiro: def __init__(self, bag_pass, ciclo_in): self.bag_pass=bag_pass self.ciclo_in=ciclo_in def obtem...
#!/usr/bin/python # # google_api.py - a Google plugin for Vcycle # # THIS FILE HAS BEEN UPDATED FOR Vcycle 3.0 BUT NEEDS VALIDATING # USING THE GOOGLE CLOUD SERVICE # # <NAME>, University of Manchester. # Copyright (c) 2013-9. All rights reserved. # # Redistribution and use in source and binary forms, with or # ...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- import argparse import itertools import math import os import re import random import time from collections import defaultdict, deque from typing import Dict from tabulate import tabulate from tensorboardX import SummaryWriter from torch import optim from torchtext impo...
import math from PIL import Image import numpy as np from numpy.ma import masked_array from matplotlib import colors, cm import matplotlib.gridspec as gridspec from matplotlib.lines import Line2D import matplotlib.pyplot as plt from tensorboard import summary as summary_lib from tensorboard.plugins.custom_scalar impor...
import glob import os import random import numpy as np import pandas as pd import torch import torch.nn as nn from torch.utils.data import Dataset import matplotlib.pyplot as plt import cv2 import scipy.ndimage as ndimage import torch.optim as optim import time import shutil from sklearn.metrics import roc_curve, auc f...
#!/usr/bin/python3 import argparse import json import os import random import re import socket import sys import time from argparse import RawTextHelpFormatter from os import path import bs4 import matplotlib.pyplot as plt import networkx as nx import requests from colorama import Fore, Style try: _ROOT = os.pat...
import sys import random import numpy as np import pandas as pd def euclidean(a,b): return (sum([(i-j)**2 for i,j in zip(a,b)]))**0.5 def index_map(letter): """ Defines the index of each letter in the sequence :param letter: an a(A), c(C), t(T), or g(G) :return: 0, 1, 2, 3 """ ...
# Lint as: python3 from absl import app from absl import flags import re import yaml FLAGS = flags.FLAGS flags.DEFINE_string("def_file", None, "path to list of ops") flags.DEFINE_string("cc_output", None, "path for the generated cc file") flags.DEFINE_string("swift_output", None, "path for the generated swift file")...
import asyncio import logging from collections import defaultdict, deque from datetime import datetime, timezone from decimal import Decimal from typing import Any, AsyncGenerator, DefaultDict, Deque, Dict, List, NoReturn, Optional, Set, Tuple, cast from aiohttp import ClientResponseError from aiosignalrcore.hub.base_...
import collections import itertools import string import numpy as np import re import copy import os import json import munch import pickle from copy import deepcopy from .lexicons import LexiconsDict from .viewer.template_editor import TemplateEditor from .multilingual import multilingual_params, ge...
import numpy as np from tqdm import tqdm import time import setproctitle import argparse import json import pandas as pd from scipy import stats from sklearn import metrics from sklearn.metrics import roc_curve, auc import os import seaborn as sns import matplotlib.pyplot as plt import torch import torch.nn.functional...
# Copyright 2014 The Oppia 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 applicable ...
import json import argparse import copy import joblib import torch.backends.cudnn as cudnn import nibabel as nib import sys import platform import multiprocessing import re from ivadomed.loader.bids_dataframe import BidsDataframe from ivadomed import evaluation as imed_evaluation from ivadomed import config_manager as...
#!/usr/bin/python # -*- coding: utf-8 -*- # ====================================================================== # Copyright 2018 <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 # #...
# # Copyright (c) 2021 The Markovflow Contributors. # # 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...
import torch import torch.nn as nn import torch.nn.functional as F import utils # Apply unfold operation to input in order to prepare it to be processed against a sliding kernel whose shape # is passed as argument. def unfold_map2d(input, kernel_height, kernel_width): # Before performing an operation between an input...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations Classes for obtaining upstream sources for the BitBake build tools. """ # Copyright (C) 2003, 2004 <NAME> # # This program is free software; you can redistribute it and/or modify # it under t...
# pylint: disable=super-init-not-called from typing import AbstractSet, Any, Dict, List, Mapping, NamedTuple, Optional, Set, Union, cast import dagster._check as check from dagster.config import Shape from dagster.core.definitions.composition import PendingNodeInvocation from dagster.core.definitions.dependency import...
import torch import torch.nn as nn import torch.nn.functional as F from model.backbone.Res2Net import res2net50_v1b_26w_4s from model.backbone.pvtv2 import pvt_v2_b2 from model.refineUnet import RefineUNet class BasicConv2d(nn.Module): def __init__(self, in_planes, out_planes, kernel_size, stride=1, padding=0...
# Copyright 2020 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
#pylint: disable=line-too-long, len-as-condition, missing-docstring, too-many-instance-attributes import numpy as np import scipy.linalg as scipy_la from shenfun.optimization import optimizer from shenfun.optimization.cython import la from shenfun.la import TDMA as la_TDMA from shenfun.matrixbase import TPMatrix, Spec...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import itertools import logging from typing import Dict, NamedTuple, Optional, Tuple, Union import numpy as np import torch import xgboost as xgb from ml.rl.evaluation.cpe import CpeEstimate, bootstrapped_std_error_of_mean ...
import functools import locale import platform import re import string import warnings import sqlalchemy as sa import sqlalchemy.dialects.postgresql as pg from sqlalchemy.ext.compiler import compiles from sqlalchemy.sql import expression from sqlalchemy.sql.functions import GenericFunction import ibis import ibis.com...
""" Custom layers to build an ALAE generative network. Author: <NAME> Date: Jul-6-2020 PYTHON SOFTWARE VERSIONS: - tensorflow 2.2.0 - tensorflow-addons 0.10.0 - scikit-image 0.17.2 - numpy 1.17.2 - matplotlib 3.1.3 - Keras 2.3.1 - h5py ...
import os import sys import argparse from functools import partial import time import matplotlib.pyplot as plt # import seaborn.apionly as sns import seaborn as sns import torch.nn as nn import torch.nn.utils.spectral_norm as spectral_norm from torch import autograd from torch.autograd import Variable import ray.tun...
# Copyright 2015 Knowledge Economy Developments Ltd # # <NAME> # <EMAIL> # # 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 noti...
#!/usr/bin/env python import sys, json, re, time from dateutil.relativedelta import relativedelta from snimpy.snmp import SNMPException from walt.common.tools import get_mac_address, format_sentence from walt.server import const from walt.server.threads.main import snmp from walt.server.threads.main.snmp import NoSNM...
"""Unit test VTA's instructions """ import tvm import numpy as np import topi from tvm.contrib import util import vta import vta.testing from vta.testing import simulator def test_save_load_out(): """Test save/store output command""" def _run(env, remote): n = 6 x = tvm.placeholder( ...
# This file is covered by the GNU General Public License. # A part of NonVisual Desktop Access (NVDA) # See the file COPYING for more details. # Copyright (C) 2016-2022 NV Access Limited, <NAME>, <NAME> from typing import ( Optional, Dict, ) import enum from comtypes import COMError import winVersion i...
import os import re import sys import glob import json import time import shlex import hashlib import tarfile import tempfile import threading import subprocess from itertools import chain from urllib.request import urlopen from .base import Base repo_dirs = set(['.git', '.hg', '.svn']) flag_pattern = ''.join(r"""" ...
import io import itertools import os import socket import threading import time import unittest import zipfile from datetime import date, datetime import pytest import pytz import yaml from localstack.utils import common from localstack.utils.bootstrap import extract_port_flags from localstack.utils.common import is_...
"""Config flow for Smart Irrigation integration.""" from .OWMClient import OWMClient from .helpers import ( map_source_to_sensor, check_all, check_reference_et, check_time, ) from .const import ( # pylint: disable=unused-import CONF_API_KEY, CONF_REFERENCE_ET, CONF_REFERENCE_ET_1, CONF_...
#!/usr/bin/env python import sys sys.path.append('../../utils') import numpy as np import pandas as pd from os import mkdir from os.path import join, exists from preproc_utils import voi_id_name_mapping from preproc_utils import get_datapath datapath = get_datapath() outputpath = join(datapath, 'misc_derived', 'phar...
# -*- coding: utf-8 -*- """ engine ~~~~~~ Implements scan engine :author: Feei <<EMAIL>> :homepage: https://github.com/wufeifei/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 Feei. All rights reserved """ import os import re import json import port...
# Copyright (c) 2005, 2006 <NAME> <<EMAIL>> # 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 conditio...
#!/usr/bin/env python # snakeoil.py # <NAME> <<EMAIL>> # Snake Oil is a Python library for interfacing with a TORCS # race car simulator which has been patched with the server # extentions used in the Simulated Car Racing competitions. # http://scr.geccocompetitions.com/ # # To use it, you must import it and create a "...
import transformers import deepspeed import logging import argparse import os import torch import random import numpy as np import os os.environ["NCCL_DEBUG"] = "INFO" os.environ["NCCL_SOCKET_IFNAME"] = "virbr0" from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset from torch.utils....
# Copyright 2012 NetApp # 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 applic...
"""Hermes MQTT server for Rhasspy Dialogue Mananger""" import asyncio import logging import typing from collections import defaultdict, deque from dataclasses import dataclass from pathlib import Path from uuid import uuid4 from rhasspyhermes.asr import ( AsrStartListening, AsrStopListening, AsrTextCapture...
"""Filter for visualizing invisible things""" from collections import defaultdict import math from distance.base import Transform, NoDefaultTransformError from distance.classes import DefaultClasses from .base import ObjectFilter, DoNotApply, create_replacement_group SKIP_REASONS = { 'unknown_version': ("Versi...
import os, time, pprint, logging from collections import OrderedDict import qt, ctk, slicer from CIP.logic import EventsTrigger from CIP.logic.SlicerUtil import SlicerUtil from CIP.ui.CollapsibleMultilineText import CollapsibleMultilineText class CaseReportsWidget(EventsTrigger): # Events triggered by the widget...
""" 08/18/21 Updated from version 1 to allow separate annotation mask for creating bounding box for .xml files """ import argparse import glob import sys import os from xml.etree.ElementTree import Element, SubElement, tostring import xml.dom.minidom import cv2 import numpy as np import random from PIL import Image im...
import logging import pytz import json import itertools from django.contrib.auth.models import User from django.conf import settings from rest_framework import serializers from copy import deepcopy from .iiif_utils import get_first_canvas, get_iiif_resource_thumbnail_json, format_thumbnail_url from .indexable_utils imp...
import matplotlib; import torch import imp matplotlib.use('Agg'); import inspect import copy import glob import json import argparse import os import time import datetime import numpy as np from torch import autograd from torch.optim import Adam from functools import partial from bridgedata.utils.general_utils import...
__author__ = "<NAME>" __date__ = "Dec 14, 2010" import csv import json from pathlib import Path from numpy import NaN, concatenate from openpyxl import load_workbook from pandas import DataFrame, ExcelWriter, read_excel from corems.mass_spectrum.output.export import HighResMassSpecExport from corems.molecular_id.ca...
from sympy import sqrt, pi, E, exp, Rational from sympy.core import S, symbols, I from sympy.discrete.convolutions import ( convolution, convolution_fft, convolution_ntt, convolution_fwht, convolution_subset, covering_product, intersecting_product) from sympy.utilities.pytest import raises from sympy.abc import...
# TODO: consider using JSON logging so that it's easier to dashboard errors # TODO: integrate this workflow into when new players join the discord as well as re-validation of old players # TODO: more scoped try/except blocks # TODO: let the user know when a bug report was successful # TODO: give users a step by step in...
import torch import numpy as np import copy import shelve import collections from collections import OrderedDict import matplotlib as mpl import matplotlib.pyplot as plt import random import math import os import enum import yaml from termcolor import colored from . import Distribution from .. import util class Empi...
import numpy as np import os import time from abc import abstractmethod import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from argparse import ArgumentParser import galsim as gs from galsim.angle import Angle, radians import utils import basis import likelihood import parameters f...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team. # Copyright (c) 2018, <NAME>. 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. # Yo...
""" Algorithms for computing the skeleton of a binary image """ import numpy as np from scipy import ndimage as ndi from ._skeletonize_cy import (_fast_skeletonize, _skeletonize_loop, _table_lookup_index) from .._shared.utils import assert_nD # --------- Skeletonization by morphologic...
#copy from https://github1s.com/LeeSureman/Flat-Lattice-Transformer/blob/HEAD/fastNLP_module.py#L1-L423 from fastNLP.embeddings.embedding import TokenEmbedding from fastNLP.core import Vocabulary from fastNLP.io.file_utils import PRETRAIN_STATIC_FILES, _get_embedding_url, cached_path import os import warnings from col...
"""Unit tests and integration tests for GitGeo.""" # pylint: disable=no-self-use, too-many-locals import csv import glob import os import textwrap import pandas as pd import pytest from custom_csv import create_csv, add_committer_to_csv from geolocation import get_country_from_location from github import ( get_...
#!/usr/bin/env python # ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - <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 obta...
#!/usr/bin/env python """ BarMap.py -- cotranscriptional folding using *barriers* and *treekin* """ from __future__ import absolute_import, division, print_function, unicode_literals import os import re import sys import argparse import numpy as np import subprocess as s # barmap_treekin() import collections as c...
# Standard Python Libraries import logging from collections import OrderedDict # Third Party Libraries from PyQt5.QtCore import QVariant, pyqtProperty, pyqtSlot, pyqtSignal, QObject import arrow from apsw import ConstraintError import apsw import xmlrpc.client as xrc # Project Libraries from py.common.FramListModel i...
"""python 3.7+, PneumoKITy run initialisation. Set up command line arguments, custom error, Enum categories initialise analysis run object and deal with options from command line arguments <NAME> 2019-2022 """ import argparse import glob import sys import os import ctvdb import pandas as pd from enum import Enum from ...
""" Write spectrum files from MS2PIP predictions. """ __author__ = "<NAME>" __credits__ = ["<NAME>", "<NAME>", "<NAME>"] __license__ = "Apache License, Version 2.0" __version__ = "0.2" __email__ = "<EMAIL>" # Native libraries from time import localtime, strftime from ast import literal_eval from operator import ite...
# PuLP : Python LP Modeler # Version 1.4.2 # Copyright (c) 2002-2005, <NAME> (<EMAIL>) # Modifications Copyright (c) 2007- <NAME> (<EMAIL>) # $Id:solvers.py 1791 2008-04-23 22:54:34Z smit023 $ # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentatio...
from __future__ import annotations from typing import List, Union, Optional, Any, TYPE_CHECKING import numpy as np from pyNastran.bdf.cards.aero.utils import ( points_elements_from_quad_points) from pyNastran.converters.avl.avl_helper import integer_types, get_spacing, save_wing_elements if TYPE_CHECKING: # prag...
# -*- coding: utf-8 -*- """ Created on Jul 21 2017, Modified Nov 15 2019. @authors: <NAME> Compute prosody features based on pitch, loudness, duration, ratios, rhythm, and perturbations (apq/ppq) OUTPUT OF THE FUNCTION "prosody_features": """ import os path_base = os.path.dirname(os.path.abspath(__file__)) impor...
import math import os import unittest import numpy as np import pandas as pd from scripts.utils.import_patstat import convert_patstat_data_to_data_frame def create_df_with_unused_columns(df_dict, unused_keys): dict_key = list(df_dict.keys())[0] num_copies = len(df_dict[dict_key]) for unused_key in unuse...
# Copyright (c) 2018-2019 <NAME> and contributors. # bibmanager is open-source software under the MIT license (see LICENSE). import os import re import argparse import textwrap import prompt_toolkit from prompt_toolkit.history import FileHistory from . import bib_manager as bm from . import latex_manager as lm f...
from typing import Optional import logging import sys import pytest logging.basicConfig( level=logging.INFO, format="%(asctime)s test %(levelname)s: %(message)s", datefmt='%Y-%m-%d %H:%M:%S' ) logger = logging.getLogger("ambassador") from ambassador import Config, IR from ambassador.fetch import Resour...
import math from abc import ABC, abstractmethod from enum import Enum from typing import Dict, List, Callable from qrogue.game.logic import Message from qrogue.game.logic.actors import Robot, Riddle from qrogue.game import target_factory from qrogue.game.logic.collectibles import Instruction from qrogue.game.world.nav...
#!/usr/bin/env python3 # ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/export.py # # 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, th...
""" Copyright 2019 Inmanta 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 ...
from collections import defaultdict import datetime from datetime import date from django.utils import timezone from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.decorators import action from rest_framework import viewsets from rest_...
#!/usr/bin/env python import pygame from .music_generation import * from .sound_generation import * from .constants import * from .helpers import * import math import random as rd import time import threading import sys import random class MusGUI(object): def __init__(self): pygame.mixer.pre_init(44100...
""" Sentence Pair Classification with XLNet """ import io import os import time import argparse import random import logging import warnings import sys import multiprocessing import numpy as np import mxnet as mx from mxnet import gluon import gluonnlp as nlp from model.XLNet_classifier import XLNetClassifier from tran...
from PyQt5.QtWidgets import QLineEdit, QDialog, QFileDialog, QWidget, QTreeWidget, QToolButton, QRadioButton, QMessageBox, QTreeWidgetItem, QTabWidget, QLabel, QCheckBox, QPushButton, QSpinBox from os.path import basename from PyQt5.QtGui import QIcon from PyQt5.QtGui import QColor, QBrush from PyQt5.QtCore import Qt f...
import struct import os import sys import json from enum import Enum from . import ma_util, sma_functions #entries and data types from smallamx - now known as pawn. A c-like scripting engine #globals because i dont want to rewrite this - make sure to set them to the correct value - xbox default endian='little' float...
from __future__ import print_function """ Copyright [2009-2017] EMBL-European Bioinformatics 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 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 30 21:55:38 2020 @author: <NAME> (British Geological Survey) Based on code from : chaosmagpy, Clemens Kloss (DTU Space) : spherical harmonic code from David Kerridge (BGS) Functions for computing main field, ...
from __future__ import absolute_import import numpy as np from ctypes import c_void_p, c_int, c_int64, c_size_t, c_long, c_longlong, POINTER, byref from numba import cuda from numba.cuda.cudadrv.drvapi import cu_stream from numba.cuda.cudadrv.driver import device_pointer, device_ctypes_pointer, host_pointer from pycul...
# -*- coding: utf-8 -*- r""" Manage Local Policy Group Policy Objects on Windows. This module uses ``Apply_LGPO_Delta.exe``, the license for which restricts it from being distributed by a third-party application. According to Microsoft[1], users must obtain it from the site below[2] and may then distribute it within t...
""" Module containing functions which plot univariate histograms (`distpy.util.TrianglePlot.univariate_histogram`), bivariate histograms (`distpy.util.TrianglePlot.bivariate_histogram`), and triangle plots (`distpy.util.TrianglePlot.triangle_plot`), which are really just combinations of the previous two types. **File*...
#!/usr/bin/env python3 import sys import io import re import functools import logging import csv import unicodedata import requests import pymarc.marcxml from rdflib import Graph, Namespace, URIRef, Literal, RDF, RDFS from SPARQLWrapper import SPARQLWrapper, JSON SKOS=Namespace("http://www.w3.org/2004/02/skos/core#"...
from collections import namedtuple import re from AHParserVisitor import AHParserVisitor from CompilerException import CompilerException, NameError from IREntityVisitor import EntityVisitor, EntityVisitorWithModuleStack from AHParser import AHParser from IREntity import Module, ImportedEntity, FunctionDef, TypeVariabl...
from cmd import Cmd import os import sys from types import FunctionType import usb_receive as _usb from time import time, sleep from functools import wraps import numpy as np import pylab as plt import ms_random as random import cmdcolor as _cmd class CmdException(Exception): def __init__(self, *args, level=None)...
# coding=utf-8 from mock import ANY, patch from nose.tools import eq_, ok_, assert_raises, assert_not_equal # Test that __all__ is sufficient: from pyelasticsearch import * from pyelasticsearch.tests import ElasticSearchTestCase class IndexingTestCase(ElasticSearchTestCase): def tearDown(self): try: ...
#!/usr/bin/env python # Copyright 2015-2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# coding: utf-8 """ The initial motivation for this wrapper is to abstract away the mturk functionality from the shell """ from __future__ import print_function from __future__ import absolute_import from functools import wraps import urllib.error import urllib.parse import urllib.request from .utils import * from .m...
from math import pi, tan, atan2, degrees from timeit import default_timer import abc from PyQt5.QtCore import Qt from lib.vectors import Vector3, Plane, Vector2 from gizmo import AXIS_X, AXIS_Y, AXIS_Z import numpy MOUSE_MODE_NONE = 0 MOUSE_MODE_MOVEWP = 1 MOUSE_MODE_ADDWP = 2 MOUSE_MODE_CONNECTWP = 3 MODE_TOPDOWN = ...
# Copyright 2019 DeepMind Technologies Limited. 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 ...
from collections import OrderedDict from dataclasses import dataclass from typing import Tuple, Union, Callable import numpy as np import torch import torch.nn.functional as F from torch import nn try: import timm from timm.models.layers import Mlp, to_2tuple from timm.models.layers.attention_pool2d impor...
############################################################################# # NOTICE # # # # This software (or technical data) was produced for the U.S. Government # # under ...
from __future__ import annotations from typing import * import datetime import random import time import os import copy import numpy as np import pandas as pd from tqdm import trange import torch import torch.nn as nn import torch.optim as optim from scipy import sparse as sp import src.utils from src import trainin...
"""NEXT STEPS: DATA: 1. STORE HISTORICAL DATA a. Get recession dates loaded b. Convert all series to daily (generic function) https://stackoverflow.com/questions/19324453/add-missing-dates-to-pandas-dataframe c. Adjust for inflation where necessary (generic function) 2. DATA UPDATE PROCESS a. dail...
from lz import * import torch import torch.nn as nn import torch.nn.functional as F from config import conf __all__ = ['singlepath'] use_hard = True def conv_bn(inp, oup, stride, conv_layer=nn.Conv2d, norm_layer=nn.BatchNorm2d, nlin_layer=nn.ReLU): return nn.Sequential( conv_layer(inp, oup, 3, stride, 1...
from pathlib import Path from functools import partial import numpy as np import torch import torch._utils import torch.nn as nn import torch.nn.functional as F from torch.nn import BatchNorm2d from src.registry import SEGMENTATION_MODELS # The code is based on https://github.com/HRNet/HRNet-Semantic-Segmentation/tre...