text
stringlengths
3.07k
22.1k
from aitlas.datasets.crops_classification import CropsDataset import os import zipfile import tarfile import urllib import numpy as np import pandas as pd from tqdm import tqdm import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import seaborn as sns import h5py from ..base import ...
#!/usr/bin/env python # coding: utf-8 # ### - Calculate the signature strength and Transcriptional Activity Score for each compound based on its replicates for Cell painting Level-4 profiles # # # #### Definitions from [clue.io](https://clue.io/connectopedia/signature_quality_metrics) # # - **Signature strength -*...
import os from PyQt5.QtGui import QIcon from PyQt5.QtCore import Qt from PyQt5.QtWidgets import * from cad.sketch import Sketch from cad.solver import * directory = os.path.dirname(__file__) def icon_path(name: str) -> str: return os.path.join(directory, 'icons', name) class Application(QMainWindow): de...
# -*- coding: utf-8 -*- # Copyright (c) 2019, VMRaid Technologies and contributors # For license information, please see license.txt import google.oauth2.credentials import requests from googleapiclient.discovery import build from googleapiclient.errors import HttpError import vmraid from vmraid import _ from vmraid...
import torch as to import torch.nn as nn from abc import ABC, abstractmethod from typing import Sequence, Callable, Tuple import pyrado from pyrado.policies.base_recurrent import RecurrentPolicy from pyrado.policies.fnn import FNN from pyrado.policies.initialization import init_param from pyrado.policies.rnn import de...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) The University of Strathclude 2019-2020 # Author: <NAME> # # Contact: # <EMAIL> # # <NAME>, # Strathclyde Institute of Pharmaceutical and Biomedical Sciences # The University of Strathclyde # 161 Cathedral Street # Glasgow # G4 0RE # Scotland, # UK # # The MIT Licens...
# -*- coding: utf-8 -*- from contextlib import closing from future.moves.urllib import request import json import codecs import sqlite3 from . import util class BitcoindConnection(object): def __init__(self, url, username, password): super(BitcoindConnection, self).__init__() self.id = 'bitcoin_...
# -*- coding = utf-8 -*- # @Time:2021/3/713:29 # @Author:Linyu # @Software:PyCharm import pymysql from pymysql import * from flask_wtf import FlaskForm from wtforms import StringField,SubmitField from wtforms.validators import DataRequired import random from matplotlib import pyplot as plt from wordcloud import WordCl...
#!/usr/bin/env python3 """Script to train a model through refined labels on ImageNet's train set.""" import argparse import logging import pprint import os import sys import time import torch from torch import nn from models import model_factory import opts import test import utils import mul_cifar100 import dateti...
import numpy as np import matplotlib.pyplot as plt import itertools import threading import imp """This module is for developing the machinery required to make neural nets and analyse local and global codes This module does stuff. """ __version__ = '0.1' __author__ = '<NAME>' __date__ = 'Jan 2017' class ThreadedR...
import arrow import datetime from converge import settings from apphelpers.rest.hug import user_id from apphelpers.errors import NotFoundError from app.models import Asset, PendingComment, Comment, Member, groups from app.libs import comment as commentlib from app.libs import member as memberlib from app.libs import p...
# -*- coding: utf-8 -*- """Tools for loading, shuffling, and batching ANI datasets The `torchani.data.load(path)` creates an iterable of raw data, where species are strings, and coordinates are numpy ndarrays. You can transform these iterable by using transformations. To do transformation, just do `it.transformation_...
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2018-2020 CNRS # 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 limita...
try: # import the important library from urllib import request from urllib.request import urlopen import threading # import threadding import json # import json import random # import random impo...
from __future__ import division import numpy as np from scipy.optimize import fmin_bfgs from itertools import combinations_with_replacement import causalinference.utils.tools as tools from .data import Dict class Propensity(Dict): """ Dictionary-like class containing propensity score data. Propensity score rel...
#!/usr/bin/env python import wx # use the numpy code instead of the raw access code for comparison USE_NUMPY = False # time the execution of making a bitmap? TIMEIT = False # how big to make the bitmaps DIM = 100 # should we use a wx.GraphicsContext for painting? TEST_GC = False #---------------------------------...
# Copyright 2011 OpenStack LLC. # 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...
""" Simple Plot Frame : supporting only copy, print, scale """ import wx from sas.sasgui.guiframe.local_perspectives.plotting.Plotter2D import ModelPanel2D as PlotPanel from sas.sasgui.plottools.toolbar import NavigationToolBar from sas.sasgui.plottools.plottables import Graph from sas.sasgui.guiframe.utils import Pane...
# -*- coding: utf-8 -*- """Tests for webhooks functions.""" import logging import json from types import SimpleNamespace as SimpleObject from urllib.parse import urlparse from flask_login import login_user from unittest.mock import MagicMock, patch from orcid_hub import utils from orcid_hub.models import Client, Orc...
# TM35FIN.py # # convert WGS84 (or other) lat/lon to ETRS-TM35FIN # and figure out their TM35 map tiles # # 2012-2014 <NAME> # License: ICCLEIYSIUYA (http://evvk.com/evvktvh.html) import numpy # ['L4', 'L4L', 'L41', 'L41L', 'L411', 'L411R', 'L4113', 'L4131R', 'L4113H', 'L4113H3'] # list for using r...
#!/usr/local/bin/python """ vector to matrix """ from __future__ import print_function from __future__ import division import sys import argparse import subprocess import shlex import logging import itertools import time import gzip import re import os import math import uuid import socket from datetime import datet...
# Lint as: python3 """ Main module to run the algorithms. """ import os import atexit import csv import itertools import multiprocessing import socket import random import time import psutil # absl needs to be upgraded to >= 0.10.0, otherwise joblib might not work from absl import app from absl import flags import nu...
# Generated from /Users/nhphung/Documents/fromSamsungLaptop/Monhoc/KS-NNLT/Materials/Assignments/MC/MC1-Python/Assignment2/upload/src/main/mc/parser/MC.g4 by ANTLR 4.7.1 # encoding: utf-8 from antlr4 import * from io import StringIO from typing.io import TextIO import sys def serializedATN(): with StringIO() as bu...
# -*- coding: utf-8 -*- """ This module contains a definition of a simple helper class "SnappiFanoutManager" which can be used to manage cards and ports of Snappi chassis instead of reading it from fanout_graph_facts fixture. """ from tests.common.helpers.assertions import pytest_assert from tests.common.snappi.common...
#!/usr/bin/env python # -*- coding:utf-8 -*- # @author : Feifei # @IDE : Pycharm # @file : VGGNet.py # @time : 2019/5/22 16:27 # @info : 实现VGG16的版本 from datetime import datetime import math import time import tensorflow as tf def conv_op(input_op,name,kh,kw,n_out,dh,dw,p): ''' :param inpu...
import json import re import os from enum import Enum from collections import defaultdict import yaml class SwaggerJSONEncoder(json.JSONEncoder): def default(self, obj): if 'serialize' in dir(obj): return obj.serialize() return json.JSONEncoder.default(self, obj) class SwaggerModel(...
import board import busio import digitalio import analogio import time import neopixel from random import randint import os import adafruit_dht from adafruit_wiznet5k.adafruit_wiznet5k import * import adafruit_wiznet5k.adafruit_wiznet5k_socket as socket from adafruit_io.adafruit_io import IO_MQTT impo...
# # Copyright 2019 Xilinx 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 or agreed to in writi...
# controller for mspdebug subprocess (that can talk to an actual msp430 chip) import sys import re import subprocess import time import signal import utils ###################################################################### # non-blocking read support for subproces.PIPE # see: http://stackoverflow.com/questions/3...
from flask import Flask,render_template, request, redirect, url_for, abort, flash, session import sqlalchemy from werkzeug.security import generate_password_hash from flask_login import login_manager, login_user, login_required,logout_user,current_user,LoginManager from flask_user import roles_required from datetime im...
""" 生成电池系统模拟数据帧 Author: 孙昊阳 Created on: 2022/03/14 API: - generate_module_id(_id=None) - generate_common_frame_id(num) - generate_feedback_frame_id(num) - generate_data(Type) - generate_verification(module_id, frame_id, data) - generate_frame(module_id, frame_id, data, veri) """ import random from mqtt.d...
# -*- coding: UTF-8 -*# import datetime def pretty_area(x): return int(x) / 1000000 def pretty_seconds(x): return datetime.timedelta(seconds=x) def pretty_time(x): return datetime.datetime.fromtimestamp(x) class VacuumStatus: """Container for status reports from the vacuum.""" def __init__(s...
# Copyright 2018 The Texar 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 ...
"""An AccountScanner scans a set of accounts using an AccountScanPlan to define scan parameters""" from collections import defaultdict from concurrent.futures import Future, ThreadPoolExecutor, as_completed from dataclasses import dataclass import random import time import traceback from typing import Any, DefaultDict,...
from __future__ import print_function import torch import torch.utils.data as data import torchvision from torchvision import transforms import random import os import numpy as np from PIL import Image class Base_Dataset(data.Dataset): def __init__(self, root, partition, target_ratio=0.0): super(Base_Datas...
# Copyright 2022 The Brax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
import logging import sys from collections import namedtuple from queue import Empty from time import sleep from types import GeneratorType from bonobo.config import create_container from bonobo.config.processors import ContextCurrifier from bonobo.constants import NOT_MODIFIED, BEGIN, END, TICK_PERIOD, Token, Flag, I...
import pickle import select import socket import sys import pygame from pygame.locals import K_DOWN, K_LEFT, K_RIGHT, K_UP, KEYDOWN, KEYUP, QUIT from hogpong.constants import ( BOTTOM_SIDE, LEFT_SIDE, RIGTH_SIDE, SIDE_ENUMERATION, TOP_SIDE, ) # General Parameters WHITE = (255, 255, 255) BLACK = (...
# Copyright (c) 2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Meteogram ========= Plots time series data as a meteogram. """ import datetime as dt import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from metpy.ca...
import sys import json import string import datetime import os output_file = open("mpd_dataset.txt", "w", encoding='raw_unicode_escape') #uniquePlaylists = open("challenge_playlists_unique.txt", "w", encoding='raw_unicode_escape') #uniqueTracks = open("challenge_tracks_unique.txt", "w", encoding='raw_unicode_e...
from __future__ import print_function import numpy as np from . import utils from numpy import linalg as LA import math def ODL_updateD(D, E, F, iterations=100, tol=1e-8): """ The main algorithm in ODL. Solving the optimization problem: D = arg min_D -2trace(E'*D) + trace(D*F*D') subject to: ||d_i||_...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the MIT License. See the LICENSE file in the root of this # repository for complete details. """ Processors and tools specific to the `Twisted <https://twistedmatrix.com/>`_ networking engine. See also :doc:`structlog's Twisted su...
# # Stripped version of "hookenv.py" (By <NAME>, 2020 <EMAIL>) # # # Copyright 2014-2015 Canonical Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
"""Description """ import sys, os, tempfile, argparse import tensorflow as tf import numpy as np from definitions import * from feeder import SampleReader from model import SptAudioGen, SptAudioGenParams from pyutils.iolib.audio import save_wav import myutils def parse_arguments(): parser = argparse.ArgumentPars...
"""Portfolio.""" import itertools from contextlib import contextmanager from enum import Enum, auto import numpy as np from .base import Quotes from .performance import BriefPerformance, Performance, Stats from .utils import fromtimestamp, timeit __all__ = ( 'Portfolio', 'Position', 'Order', ) class ...
from torch.utils.data import DataLoader import torch from tqdm import tqdm import os from shutil import copyfile import numpy as np import matplotlib.pyplot as plt from src.generic_model import Criterian from .dataloader import DataLoaderSYNTH from src.utils.data_manipulation import denormalize_mean_variance import tr...
import os, sys import argparse from collections import defaultdict import numpy as np from netCDF4 import Dataset import adios2 try: from mpi4py import MPI if MPI.COMM_WORLD.Get_size() > 1: parallel = True else: parallel = False except ImportError: parallel = False def progress(cou...
import argparse import collections import json import os import re import string import sys from copy import deepcopy from typing import List from bs4 import BeautifulSoup class EvalOpts: r""" The options which the matrix evaluation process needs. Arguments: data_file (str): the SQuAD-style ...
import queue import threading from time import sleep import grpc from koapy.backend.kiwoom_open_api_plus.core.KiwoomOpenApiPlusError import ( KiwoomOpenApiPlusError, KiwoomOpenApiPlusNegativeReturnCodeError, ) from koapy.backend.kiwoom_open_api_plus.core.KiwoomOpenApiPlusRealType import ( KiwoomOpenApiPl...
# -*- coding: UTF-8 -*- # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import mne import os.path import pytest import copy import itertools import numpy as np from mne.datasets import testing from mne.io.fieldtrip.utils import NOINFO_WARNING, _create_events from mne.utils import _c...
# # Copyright 2018 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
import os import collections import copy from openpype.api import Anatomy from openpype_modules.ftrack.lib import BaseAction, statics_icon class CreateFolders(BaseAction): identifier = "create.folders" label = "Create Folders" icon = statics_icon("ftrack", "action_icons", "CreateFolders.svg") def dis...
########################################################################## # # Copyright (c) 2008-2011, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
import json import sys import fileinput data = dict() def read_out_experiment(experiment): global data with open(experiment) as json_file: data = json.load(json_file) # print(data) def node_id_to_hostname(hostname=None): if hostname is None: raise Exception('Given hostname is None...
import boto3 import pandas as pd import numpy as np # user analysis def get_user_log(): s3 = boto3.resource('s3', region_name='us-east-2') bucket = s3.Bucket('nlprankings') logs = pd.DataFrame(columns=['datetime','IP','startYear','endYear','num_uni','num_author','CL','TACL','ACL_C','NAACL_C','EMNLP_C', ...
""" Module containing all segmentation related functions. """ from typing import List, Tuple, NamedTuple, Generator import cv2 as cv import numpy as np from skimage import measure, morphology, segmentation as segment from scipy import ndimage # ========================================================== # SETTINGS # ...
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import socket import network import wifi_secrets import machine import uos import usys import gc import utime import ure import hashlib from sparkle import Sparkle import ubinascii import uio from irq_counter import IRQCounter from bme280_sensor import BME280Sensor from dht22_sensor import DHT22Sensor from mhz19_sensor...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown copyright. The Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are me...
import numpy as np import numpy.matlib from ..core import Agent class FPSP(Agent): """ Fast Periodic Switching between high and low beta policy. Implementation of https://robertshorten.files.wordpress.com/2020/03/fpsr_title.pdf Agent returns [0, ... suppression start]: beta_high ...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # Copyright (c) 2018-2019 NVIDIA CORPORATION. All rights reserved. import torch from torch.nn import functional as F from maskrcnn_benchmark.layers import smooth_l1_loss from maskrcnn_benchmark.structures.bounding_box import BoxList from maskrcnn_...
#!python from __future__ import print_function import sys import ctypes from ctypes import byref, sizeof from ctypes.wintypes import BOOL, DWORD import select import socket import struct try: import servicemanager import win32api import win32con import win32security import win32service import ...
"""Test the Shark IQ vacuum entity.""" from copy import deepcopy import enum from typing import Dict, List from sharkiqpy import AylaApi, Properties, SharkIqAuthError, SharkIqVacuum, get_ayla_api from homeassistant.components.sharkiq import SharkIqUpdateCoordinator from homeassistant.components.sharkiq.vacuum import ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import collections import hashlib from django_prbac.utils import has_privilege from corehq import privileges, toggles from corehq.apps.hqwebapp.templatetags.hq_shared_tags import toggle_enabled from corehq.apps.linked_domain.util import is_linked_report from corehq.apps.userreports.adapter import IndicatorAdapterLoad...
""" change all linking keys from chars to id's. Revision ID: 20671b28c538 Revises: <PASSWORD> Create Date: 2012-07-07 21:49:21.906150 """ from __future__ import unicode_literals import sqlalchemy as sa from alembic import op from alembic.context import get_context # noqa: F401 from sqlalchemy.dialects.mysql.base imp...
import json import sys from collections import defaultdict from LifFileParser import LifFileParser import copy import re # Split the tokens containing hyphen inside into separate tokens # Return a new annotation list for LIF file def split_hyphen(annotations): update_annotations = [] current_id = 0 for ann ...
import os import argparse import time import gc # spark imports from pyspark.sql import SparkSession, Row from pyspark.sql.functions import col, lower from pyspark.ml.evaluation import RegressionEvaluator from pyspark.ml.recommendation import ALS class AlsRecommender: """ This a collaborative filtering recom...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2017, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
import numpy as np from landlab import Component _VALID_METHODS = set(["Grid"]) def _assert_method_is_valid(method): if method not in _VALID_METHODS: raise ValueError("%s: Invalid method name" % method) class Radiation(Component): """Compute 1D and 2D total incident shortwave radiation. Land...
import random from kf_lib.kung_fu import styles, style_gen from kf_lib.ui import get_int_from_user, menu from kf_lib.utils import rnd, rndint from . import names from .fighter import Fighter, Challenger, Master, Thug from .human_controlled_fighter import HumanControlledFighter # levels BEGGAR_LV = (8, 12) BODYGUARD_...
# -*- coding: utf-8 -*- """trail.trail: provides entry point main().""" import sys # for proper exit. import os # for OS path checking. import datetime import calendar __version__ = "0.1.0" py3 = sys.version_info[0] > 2 # creates boolean value for test that Python major version > 2 global_flag_used = F...
from __future__ import absolute_import, print_function import sys import math import time import socket from operator import itemgetter from dpark.util import ( get_logger, make_progress_bar ) from dpark.hostatus import TaskHostManager from six.moves import range logger = get_logger(__name__) def readable(size):...
import requests from bespin.exceptions import JobDoesNotExistException, ShareGroupNotFound, JobStrategyNotFound, WorkflowNotFound CONTENT_TYPE = 'application/json' class BespinApi(object): """ Communicates with Bespin API via REST """ def __init__(self, config, user_agent_str): self.config = ...
############################################################# # MIT License, Copyright © 2020, ETH Zurich, <NAME> ############################################################# import numpy as np import tensorflow as tf import os from tqdm import trange from config import get_config from util import * from styler_2p imp...
"""This module contains the detection code for integer overflows and underflows.""" import json from typing import Dict, cast, List from mythril.analysis import solver from mythril.analysis.report import Issue from mythril.analysis.swc_data import INTEGER_OVERFLOW_AND_UNDERFLOW from mythril.exceptions import UnsatErro...
# Copyright (c) 2018 Intel Corp. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
import json import django_rq from rest_framework import status from rest_framework.decorators import api_view from rest_framework.generics import ListAPIView, GenericAPIView from rest_framework.mixins import RetrieveModelMixin from rest_framework.response import Response from src.clustering.models import Clustering f...
from functools import partial from tsfresh.feature_extraction.extraction import _do_extraction_on_chunk from tsfresh.feature_extraction.settings import ComprehensiveFCParameters import pandas as pd def _feature_extraction_on_chunk_helper(df, column_id, column_kind, column_sor...
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import logging import uuid from c7n_azure.provider import resources from c7n_azure.resources.arm import ArmResourceManager from c7n_azure.utils import StringUtils, PortsRangeHelper from azure.core.exceptions import AzureError from c7n_azur...
import sys from enum import Enum import dataclasses import serial import mp import mp.micropythonshell from mp.mpfshell import RemoteIOError from mp.firmware.update import URL_README FILENAME_IDENTIFICATION = mp.micropythonshell.FILENAME_IDENTIFICATION class BoardqueryException(Exception): pass @dataclasses.da...
import networkx as nx import pandas as pd from src.cegpy import StagedTree, Evidence, ChainEventGraph from pathlib import Path class TestUnitCEG(object): def setup(self): self.node_prefix = 'w' self.sink_suffix = '&infin;' df_path = Path(__file__).resolve( ).parent.parent.joinp...
import os import numpy as np from .filewrappers import * from .from_binary import bioptigen_binary_reader as bioptigen from .from_binary import heidelberg_binary_reader as heidelberg from .from_binary import bioptigen_scan_type_map from ..utilities import get_lut from ..exceptions import FileLoadError import matplotlib...
# -*- coding: utf-8 -*- """ Functions for generating spatial permutations """ import warnings import numpy as np from scipy import optimize, spatial def _gen_rotation(seed=None): """ Generates random matrix for rotating spherical coordinates Parameters ---------- seed : {int, np.random.RandomSt...
# -*- coding: utf-8 -*- """ Library for computing features that describe the local boundary curvature This module provides functions that one can use to obtain, visualise and describe local curvature of a given object. Available Functions: -circumradius:Finds the radius of a circumcircle -local_radius_curvature: Com...
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from decimal import Decimal import discord from discord.ext import commands import user_db import config rpc_connection = 'http://{0}:{1}@{2}:{3}'.format(config.rpc_user, config.rpc_password, config.ip, config.rpc_port) def str_isfloat(str): try...
# Copyright (c) 2013 Yubico AB # 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 conditi...
import argparse import logging import os import shutil import sys import tensorboardX as tb import numpy as np import torch import yaml from configs import * from runners import * def parse_args_and_config(): parser = argparse.ArgumentParser(description=globals()['__doc__']) parser.add_argument('--config',...
from random import choice import pygame import pygame.freetype import sys class Node: def __init__(self, id, x, y): self.x = x self.y = y self.north = None self.south = None self.east = None self.west = None self._id = id def setConnections(self, nodeNorth, nodeSouth, nodeEast, nodeWest...
# This file is part of PyTMM. # # PyTMM 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 3 of the License, or # (at your option) any later version. # # PyTMM is distributed in t...
""" Various utilities used in the main code. NOTE: there should be no autograd functions here, only plain numpy/scipy """ import numpy as np from scipy.linalg import toeplitz from scipy.optimize import brentq def ftinv(ft_coeff, gvec, xgrid, ygrid): """ Returns the discrete inverse Fourier transform over a ...
import alpaca_trade_api as tradeapi import datetime ALPACA_API_KEY = "<KEY>" ALPACA_SECRET_KEY = "<KEY>" USE_POLYGON = False # Utility to truncate a float value to a certain number of decimal places. # We'll use this to see if a "penny level" was crossed when we compare prices. # This is necessary because a price ca...
from configs import EXP_CONFIGS import xml.etree.cElementTree as ET from xml.etree.ElementTree import dump from lxml import etree as ET import os E = ET.Element def indent(elem, level=0): i = "\n " + level*" " if len(elem): if not elem.text or not elem.text.strip(): elem.text = i + "" ...
import logging from logging.handlers import RotatingFileHandler import os import sys from flask import Flask, request, session, g, redirect, url_for, abort, \ render_template, flash, jsonify, has_request_context, send_from_directory, send_file from common import constants from common.db import GarageDb from comm...
from matplotlib import pyplot from math import cos, sin, atan import numpy as np import time import seaborn from matplotlib.animation import FuncAnimation import sys import json class Neuron(): def __init__(self, x, y): self.x = x self.y = y def draw(self, neuron_radius): circle = pyp...
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.core.bbox.coder import (DeltaXYWHBBoxCoder, DistancePointBBoxCoder, TBLRBBoxCoder, YOLOBBoxCoder) def test_yolo_bbox_coder(): coder = YOLOBBoxCoder() bboxes = torch.Tensor([[-42....
import socket import select import ipaddress import ifaddr from collections import OrderedDict from unittest.mock import patch, MagicMock as Mock, PropertyMock, call from soco import discover from soco import config from soco.discovery import ( any_soco, by_name, _find_ipv4_addresses, _find_ipv4_netw...