text
stringlengths
3.07k
22.1k
from __future__ import absolute_import from builtins import str from builtins import range from anuga.coordinate_transforms.geo_reference import Geo_reference, DEFAULT_ZONE from anuga.geometry.polygon import point_in_polygon, populate_polygon from anuga.utilities.numerical_tools import ensure_numeric import numpy as n...
from sandbox.crazyflie.src.gcg.envs.GibsonEnv.env_modalities import CameraRobotEnv, BaseRobotEnv from sandbox.crazyflie.src.gcg.envs.GibsonEnv.env_bases import * from sandbox.crazyflie.src.gcg.envs.GibsonEnv.robot_locomotors import Quadrotor3 from transforms3d import quaternions import os import numpy as np import sys ...
import re with open("in","r") as inf: string = inf.read() special_words = [("तो", "toh")] all_devanagari = ["्","़","ं","ँ"] class Vowel (): def __init__ (self, string, matra, latin, terminal = None): global all_devanagari self.string = string self.matra = matra all_devanagari += [string, matra] self.lati...
# gpl: authors Liero, Atom bl_info = { "name": "Unfold transition", "author": "Liero, Atom", "location": "3D View > Toolshelf > Create > Unfold Transition", "description": "Simple unfold transition / animation, will " "separate faces and set up an armature", "category": "Animatio...
#!/usr/bin/env python3 # Author: <NAME> # Copyright: 2017-2018 NVWA # # NVWA: Nederlandse Voedsel- en Warenautoriteit # Netherlands Food and Consumer Product Safety Authority # https://english.nvwa.nl/ # # Licence: GPLv3 import os import sys import subprocess import shutil import tempfile import unittest import itert...
# Copyright (c) 2021 Cisco Systems, Inc. and its affiliates # 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...
import datetime import os import re import shutil import tempfile import zipfile from typing import Optional import discord import py7zr from discord import HTTPException from discord.ext import commands import util from bot import COOL_CRAB, PENDING_FIXES_CHANNEL, FLASH_GAMES_CHANNEL, OTHER_GAMES_CHANNEL, ANIMATIONS...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Console script for daskerator.""" from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor import datetime as dt from functools import partial from hashlib import md5 import inspect from operator import methodcaller import os from pathlib import Path from...
from dataclasses import dataclass from enum import IntEnum, IntFlag, auto from functools import reduce from struct import Struct from typing import Any, Dict, List, Optional, Type from .datatypes import ( AerospikeDataType, AerospikeKeyType, AerospikeValueType, data_to_aerospike_type, parse_raw, ) ...
from sympy import (diff, expand, Eq, Integral, integrate, Interval, lambdify, log, oo, Piecewise, piecewise_fold, symbols, pi, solve, Rational, Basic) from sympy.utilities.pytest import XFAIL, raises x,y = symbols('x,y') def test_piecewise(): # Test canonization assert P...
from tkinter import * import math import pickle from game import Board, Game from mcts_alphaZero import MCTSPlayer from policy_value_net_tensorflow import PolicyValueNet # Tensorflow from policy_value_net_res_tensorflow import PolicyValueNetRes30 # Tensorflow from human_play import Human #定义棋盘类 class chessBoard() : ...
# Copyright 2021 Sony Semiconductors Israel, 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 b...
'''Borrowed utils file from <NAME>''' from datetime import datetime from decouple import config import pandas as pd import os import requests import nltk from nltk.stem import WordNetLemmatizer from nltk.sentiment.vader import SentimentIntensityAnalyzer from api.models import DB, Repo from api.queries import repo_query...
# # Copyright (c) 2018 CNRS INRIA # ## In this file, are reported some deprecated functions that are still maintained until the next important future releases ## from __future__ import print_function import warnings as _warnings from . import libpinocchio_pywrap as pin from .deprecation import deprecated, Deprecat...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from __future__ import annotations import dataclasses import datetime import hashlib import json import logging import os import uuid from contextlib import contextmanager from enum import Enum from pathlib import Path from typing import Any, Dict, Iterator, List, Optional, Union from minato.exceptions import CacheAl...
import copy import functools import gc import time from hfutils.constants import TASK_TO_LABELS from seaborn.distributions import histplot import torch import logging import numpy as np from transformers.data.data_collator import ( DataCollatorForSeq2Seq, default_data_collator, ) from transformers.utils.dummy_p...
# price.py from .helper_functions import (build_url, load_data, timestamp_to_date, date_to_timestamp) def get_current_price(fsyms, tsyms, e='all', try_conversion=True, full=False, format='raw'): """Get latest trading price or full trading information i...
from __future__ import print_function american_number_system = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9, 'ten': 10, 'eleven': 11, 'twelve': 12, 'thirteen': 13, 'fourteen': 14, 'fifteen...
# -*- coding: utf-8 -*- # Copyright 2020 The PsiZ 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 r...
import os import asyncio import chess import discord from discord.ext import commands, tasks from discord.ext.commands import Context from cogs.utils.chess_utils import ChessUtils import berserk """ {'type': 'gameState', 'moves': 'g1f3', 'wtime': datetime.datetime(1970, 1, 25, 20, 31, 23, 647000, tzinfo=datetime.t...
# helper function that are used by the settings for multidomain # import numpy as np import pickle import sys import struct import scipy.stats def load_mesh(fiber_file, sampling_stride_z, rank_no): # get the mesh nodes, either from a .bin file or a python pickle file if ".bin" in fiber_file: # data input from...
#!/usr/bin/env python # This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import os import re import subprocess import sys import click from babel.dates impo...
from django.shortcuts import render from django.http import HttpResponseRedirect from django.utils import timezone import datetime import time from django import forms from erp_app.models import Expenses from django.template import RequestContext, loader from django.contrib import messages from erp_app.models import *...
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. ''' This is intended to be a lightweight license class for verifying subscriptions, and parsing subscription data from entitlement certificates. The Licenser class can do the following: - Parse an Entitlement cert to generate license ''' import base64 import...
import logging import urllib.parse from collections import defaultdict import dask.array as da import dask.dataframe as dd import lightgbm import numpy as np import pandas as pd from dask import delayed from dask.distributed import wait, default_client, get_worker from lightgbm.basic import _safe_call, _LIB from toolz...
import tensorflow as tf import tensorflow.keras as keras from tensorflow.keras import layers import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import auc,precision_recall_curve,roc_curve,confusion_matrix import os,sys import pickle def draw_ROC(y_true,y_pred): fpr,tpr,_...
#!/usr/bin/env python # coding=utf-8 # Copyright © 2016 ButenkoMS. All rights reserved. Contacts: <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lice...
from flask_socketio import SocketIO from flask import Flask, render_template, request from time import sleep from threading import Thread, Event from flask_autoindex import AutoIndex import logging import os import getpass import sys from shongololo import start_up as SU from shongololo import sys_admin as SA from shon...
import time import mock from cacheorm.backends import MemcachedBackend, RedisBackend, SimpleBackend from cacheorm.types import to_bytes def test_general_flow_set_get_delete(backend): import pickle key = "foo" values = ("foo.test", "", 1, pickle.dumps({"test": "foo"})) year_ttl = 365 * 24 * 60 * 60 ...
import os import sys import numpy as np from copy import deepcopy from collections import deque import torch from torch import nn from torch import optim from torch.nn import functional as F sys.path.append(os.path.join(os.environ["HOME"], "TTTArena")) from environment import Environment from alphazero.mcts import ...
import PySimpleGUI as sg import pickle import platform if platform.system() == 'Linux': import Modulos.m_sonidosLINUX as sound else: import Modulos.m_sonidos as sound from Modulos.m_tablero import tomar_y_borrar from Modulos.m_carpeta import crear_carpeta def ganar(total_jugador,total_maquina): """Crea y ...
####################################### import numpy as np import pylab from scipy.interpolate import interp1d from scipy import optimize from numba import jit ####################################### @jit(nopython=True) def qr(t00,Start_time,heatscale): #interior radiogenic heatproduction t = t00 - Start...
# coding=utf-8 # Copyright 2018 The TF-Agents 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...
""" Example program to demonstrate how to send a PPG time series to LSL from the Arduino Uno by automatically connecting to it over serial. The sources for significant example code are cited below. """ import random import time from time import sleep import serial from serial import Serial import serial.tools.list_por...
""" Create an MSI package using the WIX toolset We adopt the rule of 'one file per component' as suggested although this requires thousands of components. Generation of GUIDs is accomplished by using the Python UUID library to generate the ID based on a hash of the file path. This should ensure that the GUIDs are spe...
# coding: utf-8 # In[1]: import requests import zipfile import os import shutil import StringIO #In Python 3.x substitute StringIO with io import argparse import codecs import json # In[2]: #This section parses arguments passed through it from command line parser = argparse.ArgumentParser() #Metadata url parser.ad...
"""Games, or Adversarial Search (Chapter 5)""" import collections import random from utils import argmax from canvas import Canvas infinity = float('inf') GameState = collections.namedtuple('GameState', 'to_move, utility, board, moves') # _____________________________________________________________________________...
#!/usr/bin/env python3 # # Copyright (c) 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 <NAME> # Copyright (C) 2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
""" Loaders for different formats provided by PubMed. """ __author__ = "<NAME>" __all__ = ['PXMLLoader', 'PXMLFetcher', 'PMCLoader', 'PMCFetcher'] import os import logging import urllib.parse import urllib.request import itertools as it from lxml import etree from ._load import DocIterator, text_node from ..doc....
__author__ = 'jparedes' import numpy as np from itertools import combinations, product, chain from .support_filter import support_basic_premises, support_premises_derived from .similarity_filter import similarity_basic_premises, similarity_derived_premises from .pcd_filter import pcd_basic_premises, pcd_derived_premis...
# coding=utf-8 import os import json import pytest import responses import watson_developer_cloud @responses.activate def test_success(): models_url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/models' models_response = '{"models": [{"url": "https://stream.watsonplatform.net/speech-to-text/api/v...
import chord_recognition import numpy as np import miditoolkit import copy # parameters for input DEFAULT_VELOCITY_BINS = np.linspace(0, 128, 32+1, dtype=np.int) DEFAULT_FRACTION = 16 DEFAULT_DURATION_BINS = np.arange(60, 3841, 60, dtype=int) DEFAULT_TEMPO_INTERVALS = [range(30, 90), range(90, 150), range(150, 210)] ...
# ! /usr/bin/env python from __future__ import print_function import random from terminalone import T1, filters from terminalone.utils import credentials from terminalone.vendor import six from terminalone.errors import AuthRequiredError from dotenv import load_dotenv import os dotenv_path = os.path.join(os.getcwd...
# =========================================================================== # This module is created based on the code from 2 libraries: Lasagne and keras # Original work Copyright (c) 2014-2015 keras contributors # Original work Copyright (c) 2014-2015 Lasagne contributors # Modified work Copyright 2016-2017 TrungNT...
## regression.py ## scalar regression ## note that `calcMargiProb`, `calcJointProb`, `calcCondiProb`, and `estEntropy` aren't currently used in any methods. import numpy as np import pandas as pd import tensorflow as tf import itertools as it import scipy.special as ss import time def eNet(alpha, lam, v)...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
import operator import random import time from inspect import signature from itertools import chain, count, islice, repeat from types import SimpleNamespace from about_time import about_time from .utils import fix_signature from ..utils.cells import fix_cells, is_wide, join_cells, strip_marks, to_cells from ..utils.c...
""" Challenge Exercises for Chapter 4. """ import timeit from algs.modeling import numpy_error from algs.table import DataTable, ExerciseNum, comma, caption from algs.modeling import n_log_n_model def merged_arrays(heap1, heap2): """Return combined array with sorted values.""" result = [None] * (heap1.N + he...
import subprocess import psycopg2 from subprocess import PIPE import json import re import os #class DoSOCSv2(object): #"""Uses the DoSOCSv2 database to return dataframes with interesting GitHub indicators""" def scan(repo_name): connection = psycopg2.connect( user = "augur", password = "****"...
from ..utils import to_value, len_batch from .callback_tensorboard import CallbackTensorboardBased from ..train import utilities from ..train import outputs_trw as O import functools import collections import torch import numpy as np import logging logger = logging.getLogger(__name__) def get_as_image(images): ...
#!/usr/bin/python3 import subprocess import re import argparse import logging import sys sysctl_conf_path: str = "/etc/" grub_conf_path: str = "/etc/default/" def run_cmd(cmd: str) -> None: logging.log(logging.INFO, f'Running {cmd}') result = subprocess.run(cmd, shell=True, capture_output=True) if result...
# # This file is part of LiteX. # # Copyright (c) 2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause import unittest import unittest import random import itertools import sys from migen import * from litex.soc.interconnect.stream import * # Function to iterate over chunks of data, from # https://docs.pyt...
# coding: utf-8 # pylint: disable=too-many-branches """Initialization helper for mxnet""" from __future__ import absolute_import import re import logging import numpy as np from .base import string_types from .ndarray import NDArray, load from . import random class Initializer(object): """Base class for Initializ...
""" ScanNet This file help you generate point clouds from RGB_D images. """ from __future__ import division import numpy as np import os, cv2, time, math, scipy import scipy.io as io import argparse def CameraParameterRead(dir): intrinsic_color_path = dir + 'intrinsic_color.txt' intrinsic_depth_path = dir ...
#!/usr/bin/env python3 # Test whether a CONNECT with a zero length client id results in the correct behaviour. # MQTT v3.1.1 - zero length is allowed, unless allow_zero_length_clientid is false, and unless clean_start is False. # MQTT v5.0 - zero length is allowed, unless allow_zero_length_clientid is false from mos...
import os import cv2 import math import shutil import pytesseract import numpy as np import scipy.stats as stats import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec #Module to detect whether the object in the video sequence is moving or not. def MovementDetection(VideoPath): if(os.path.exists(...
# coding: utf-8 from __future__ import division, unicode_literals """ This module defines PDEntry, which wraps information (composition and energy) necessary to create phase diagrams. """ __author__ = "<NAME>" __copyright__ = "Copyright 2011, The Materials Project" __version__ = "1.0" __maintainer__ = "<NAME>" __em...
#!/usr/bin/env python # coding: utf-8 import numpy as np import pandas as pd from pytorch_transformers import (WEIGHTS_NAME, BertConfig, BertForSequenceClassification, BertTokenizer, XLMConfig, XLMForSequenceClassification, XLMTokenizer, XLNetConfig,...
# Copyright 2021- imbus AG # # 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 writi...
# -*- coding:utf-8 -*- """ """ import numpy as np from hyperts.macro_estimators import ProphetForecastEstimator, \ VARForecastEstimator, TSFClassificationEstimator from hyperts.transformers import TimeSeriesHyperTransformer from hyperts.utils import consts from hypernets.tabular import column_selector as tcs fr...
# Copyright 2019-2020 The GPflow Contributors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
from pandac.PandaModules import * from direct.distributed import ParentMgr from direct.directnotify.DirectNotifyGlobal import directNotify from direct.task import Task from direct.showbase import LeakDetectors from otp.otpbase import OTPGlobals import random class AIZoneData: notify = directNotify.newCategory('AIZ...
# DebFile: a Python representation of Debian .deb binary packages. # Copyright (C) 2007-2008 <NAME> <<EMAIL>> # Copyright (C) 2007 <NAME> <<EMAIL>> # # 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 Softw...
# Copyright (c) 2021 OpenCyphal # This software is distributed under the terms of the MIT License. # Author: <NAME> <<EMAIL>> from __future__ import annotations import asyncio import sys from typing import Optional, Dict, TypeVar, Generic, cast, Any, TYPE_CHECKING import shutil import click import pycyphal from pycyph...
""" MIT License Copyright (c) 2021 UltronRoBo 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, di...
import lark from elasticsearch_dsl import Q, Text, Keyword, Integer, Field from optimade.models import CHEMICAL_SYMBOLS, ATOMIC_NUMBERS _cmp_operators = {">": "gt", ">=": "gte", "<": "lt", "<=": "lte"} _rev_cmp_operators = {">": "<", ">=": "<=", "<": ">", "<=": "=>"} _has_operators = {"ALL": "must", "ANY": "should"} ...
"""Callbacks available from R's C-API. The callbacks make available in R's C-API can be specified as Python functions, with the module providing the adapter code that makes it possible.""" from contextlib import contextmanager import logging import typing from rpy2.rinterface_lib import openrlib from rpy2.rinterface_...
import re import json import time from django.conf import settings from django.contrib.auth.decorators import login_required from django.db import transaction, IntegrityError from django.shortcuts import get_object_or_404 from django.views.decorators.http import require_safe, require_POST from ide.models.build import...
import numpy as np import tensorflow as tf from flask import Flask, render_template, jsonify, request, make_response, send_from_directory, abort from mnist import module as model from cnocr import CnOcr import mxnet as mx from werkzeug.utils import secure_filename import datetime import random import os import base64 ...
from douyin_spider.utils.common import parse_datetime, get_array_first from douyin_spider.models.video import Video from douyin_spider.models.music import Music from douyin_spider.models.user import User, Star from douyin_spider.models.address import Address def get_video_url(video_list): """ parse video url ...
from math import * from OpenGL.GLU import * from OpenGL.GL import * from OpenGL.GLUT import * import random import sys #Datatypes class PARTICLES: Xpos = 0.0 Ypos = 0.0 Zpos = 0.0 Xmov = 0.0 Red = 0.0 Green = 0.0 Blue = 0.0 Direction = 0.0 Acceleration = 0.0 Deceleration = 0.0 ...
# Copyright 2020 Open Source Robotics Foundation, 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...
#!/usr/bin/env python # This is a draft rewrite of specgen5, the family of scripts (originally # in Ruby, then Python) that are used with the Counter Ontology, Ordered Lists # Ontology and Info Service Ontology. # This version is based on danbri's specgen version (specgen5) and heavily extended # by <NAME> in July 201...
#!/usr/bin/python # -*- coding: utf-8 -*- """Hass.io Add-on EP-Solar MPPT Tracer MT-5 to MQTT bridge. This will read a UART serial port connected to a solar charger from EP-Solar, and pass the values to mqtt. Author: <NAME> <<EMAIL>> """ import json import logging import sys import serial import time from urllib.pa...
""" Interpreter-level implementation of structure, exposing ll-structure to app-level with apropriate interface """ from pypy.interpreter.baseobjspace import W_Root, Wrappable from pypy.interpreter.gateway import interp2app, ObjSpace from pypy.interpreter.typedef import interp_attrproperty from pypy.interpreter.argum...
from . import config import sys, os from .genelist import genelist as genelist_object from .location import location class tfbs_iter: def __init__(self, filename): self.oh = open(filename) def __iter__(self): """ This will output a tfbs_iter object that behaves as a list of ...
from __future__ import annotations import ast import builtins import gettext import json import os import re from functools import cache from pathlib import Path from textwrap import indent import asttokens.util from asttokens import ASTTokens from core.runner.utils import is_valid_syntax translation: gettext.GNUTr...
import collections import pytest from radon.cli import Config import radon.complexity as cc_mod import radon.cli.harvest as harvest BASE_CONFIG = Config( exclude='test_[^.]+\.py', ignore='tests,docs', ) CC_CONFIG = Config( order=getattr(cc_mod, 'SCORE'), no_assert=False, min='A', max='F', ...
import pandas as pd import numpy as np from matplotlib import pyplot as plt import seaborn as sns import math import re from ml_pipeline_lch import isolate_categoricals, is_category def view_dist(df, geo_columns = True, fig_size=(20,15), labels = None): ''' Plot distributions of non-categorical columns in a g...
import json import collections from PyQt5 import QtWidgets, QtCore from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from ui_res.json_win import Ui_MainWindow class QJsonTreeItem(object): def __init__(self, parent=None): self._parent = parent self._key = "" ...
# -*- coding: utf-8 -*- # Copyright 2018 Alibaba Cloud 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 r...
''' sympy helper functions ''' import sympy from sympy import * th,ph,psi,thd,phd,psid,thdd,phdd,psidd = symbols('theta,phi,psi,thetadot,phidot,psidot,thetaddot,phiddot,psiddot',real=True) w1,w2,w3 = symbols('omega_1,omega_2,omega_3',real=True) t,g,m,h = symbols('t,g,m,h',real=True) circmat = Matrix([eye(3)[2-j,:] fo...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import import numpy as np from scipy.ndimage.interpolation import map_coordinates from scipy.ndimage.filters import gaussian_filter def flip(imagelist, axis=1): """Randoml...
"""Control of an AVR over Telnet.""" import asyncio import telnetlib3 from typing import Any, List, MutableMapping, Optional, Type from .enums import InputSource, Power, SurroundMode class AvrError(Exception): """Base class for all errors returned from an AVR.""" pass class DisconnectedError(AvrError): ...
import copy import time import json import logging log = logging.getLogger(__name__) import torch from optim import lbfgs_modified import config as cfg def store_checkpoint(checkpoint_file, state, optimizer, current_epoch, current_loss,\ verbosity=0): r""" :param checkpoint_file: target file :param sta...
"""Treadmill commaand line helpers. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals # Disable too many lines in module warning. # # pylint: disable=C0302 import codecs import copy import functools import io impor...
import os from collections import defaultdict from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence from contextlib import contextmanager from copy import deepcopy from dataclasses import dataclass, field, replace from typing import Any, List, Optional, Union from funcy import identity from d...
#!/usr/bin/env python3 # file : pcap2raw.py # repo : https://github.com/fuzzah/fuzzaide # author : https://github.com/fuzzah # license : MIT # check repository for more information import os import sys import glob import argparse from hashlib import sha1 try: from scapy.all import rdpcap except: ...
# Author: <NAME> <<EMAIL>> import torch import torch.nn as nn from torch.nn import init import torch.nn.functional as F import functools from .networks import get_norm_layer, init_net, ResnetBlock from . import keypoint_detector as kpd # TriangleGAN: https://arxiv.org/pdf/1907.05916.pdf #-----------------------------...
import sys import requests import numpy as np import pandas as pd import kauffman.constants as c pd.set_option('max_columns', 1000) pd.set_option('max_info_columns', 1000) pd.set_option('expand_frame_repr', False) pd.set_option('display.max_rows', 30000) pd.set_option('max_colwidth', 4000) pd.set_option('display.float...
# The code is based on original repository https://github.com/OctoberChang/klcpd_code # !/usr/bin/env python # encoding: utf-8 import math import numpy as np import random import sklearn.metrics import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch.backends...
import numpy as np import random import os import sys from subprocess import call import nnabla as nn import nnabla.logger as logger import nnabla.functions as F import nnabla.parametric_functions as PF import nnabla.solver as S import nnabla.initializer as I from args import get_args class LSTMWrapper(PF.LSTMCell, ...
from __future__ import absolute_import import os import tempfile import zipfile import shutil import requests from lxml import etree import logging from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect, HttpRespo...
import datetime import pytest import pytz import urlparse from dateutil.parser import parse as parse_date from api.base.settings.defaults import API_BASE from framework.auth.core import Auth from osf.models import NodeLog from osf_tests.factories import ( ProjectFactory, AuthUserFactory, ) from tests.base imp...
# -*- coding: utf-8 -*- import time,sys,os from netCDF4 import Dataset import numpy as np from scipy.interpolate import griddata import matplotlib.pyplot as plt import matplotlib.cm as cm def readlatlon(file_path): arr = [] with open(file_path,'r') as f: for Line in f: arr.append(list(...
""" Copyright (c) 2018-2019 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 required by applicable law or agreed to i...
import torch from torch import nn, einsum import torch.nn.functional as F from einops import rearrange, reduce, repeat # helpers def exists(val): return val is not None def default(val, d): return val if exists(val) else d def pad_to_multiple(tensor, multiple, dim = -1, value = 0): seq_len = tensor.shap...
# -*- coding: utf-8 -*- """ Routines and Class definitions for the diffusion maps algorithm. """ from __future__ import absolute_import import numpy as np import scipy.sparse as sps import scipy.sparse.linalg as spsl import warnings from . import kernel from . import utils class DiffusionMap(object): """ Dif...