text
stringlengths
6.04k
39.5k
""" Model """ import os from datetime import datetime from multiprocessing import Queue import csv import pickle import math import argparse import itertools import numpy as np import cv2 import json import tensorflow as tf from keras.layers.core import Lambda from keras.models import Sequential, load_model from keras....
""" In tabular MDP setting, evaluates the learning of optimal policy using different guidance discount factors On-policy means we run episodes, in each episode we generate roll-outs/trajectories of current policy and run algorithm to improve the policy. """ import numpy as np import matplotlib.pyplot as plt import a...
import crl_utils import utils import time import torch import torch.nn.functional as F import torch.nn as nn from torch.autograd import Variable import numpy as np def train(matrix_idx_confidence, matrix_idx_iscorrect, loader, model, wr, criterion_cls, criterion_ranking, optimizer, epoch, history, logger, a...
r""" Finding `F[x]`-roots for polynomials over `F[x][y]`, with`F` is a (finite) field, as used in the Guruswami-Sudan decoding. This module contains functions for finding two types of `F[x]` roots in a polynomial over `F[x][y]`, where `F` is a field. Note that if `F` is an infinite field, then these functions should w...
# # Copyright(c) 2019 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause-Clear # import pytest from core.test_run import TestRun from utils.afl import is_afl_installed, install_afl from utils.afl import create_patch_redirect_fuzz_to_file from utils.installer import install_iotrace_with_afl_support from utils.io...
import random import pytest import numpy as np import moldesign as mdt import moldesign.units as u from moldesign.utils import exports from .helpers import get_data_path __all__ = ['molecule_standards'] molecule_standards = {} def typedfixture(*types, **kwargs): """This is a decorator that lets us associate fi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Aug 28 15:16:56 2020 @author: dmattox """ #homeDir = '/dartfs-hpc/rc/home/y/f002tsy/cbklab/Mattox/lec_gly_binding/' homeDir = '/Users/dmattox/cbk/lec_gly_binding' if homeDir[-1] != '/': homeDir += '/' # import os import numpy as np # import sys f...
############################################################################ # Copyright 2019 <NAME> # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use...
import collections import enum import itertools import math from weakref import WeakSet # import pylru __all__ = [ "Node", "Driver", "make_driver", "setup_driver", ] from .config import config_getkey from .puzzle_type import PuzzleType from . import utils Node = collections.namedtuple("Node", "til...
import errno import io import os import pathlib import pytest import falcon from falcon.routing import StaticRoute, StaticRouteAsync from falcon.routing.static import _BoundedFile import falcon.testing as testing import _util # NOQA @pytest.fixture() def client(asgi): app = _util.create_app(asgi=asgi) cli...
from tkinter import * from tkinter.ttk import * import tkinter as tk from PIL import Image, ImageTk import glob import sys, os COMBOBOX_WIDTH = 40 SUB_FIGURES_SIZE = (400, 300) STATE_SIZE = (500, 300) TARGET_FEATURES_SIZE = (400, 300) STATE_W = 300 BL_W = 500 STATE_INFO_SIZE = (40, 50) BL_INFO_SIZE = (100, 25) BUTTON_...
# -*- coding: utf-8 -*- __all__ = ["CoreFuncTest", "TraceTest", "DataProxyTest", "WrapperTest"] import unittest from copy import deepcopy import numphy as ph if ph.HAS_NUMPY: import numpy as np else: np = None class CoreFuncTest(unittest.TestCase): if np: def test_is_numpy(self): ...
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- ''' TermPix Author: Hu, Ying-Hao (<EMAIL>) Version: 0.5.2 Last modification date: 2021-08-21 Copyright 2021 Hu, Ying-Hao 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 co...
from __future__ import print_function from inql.utils import string_join, open def detect_type(types): """ This function will replace known GraphQL arguments types with placeholder values (useful for Burp Suite Repeater) :param types: Known types: String, Boolean, Float, Int, NOT_NULL TO...
class ansi: ''' Contains ANSI escape characters for ANSI colour in the terminal. ''' BLUE = '\033[94m' YELLOW = '\033[93m' GREEN = '\033[92m' RED = '\033[91m' BOLD = '\033[1m' END = '\033[0m' version = "0.4.0" print("{}TxtToSL{} {}v{}{} - {}Made by{} {}Oojmed{}\n".format(ansi.YELLOW, ansi.END, an...
import os import time from rlib import jit from rlib.string_stream import encode_to_bytes from rlib.exit import Exit from rlib.osext import path_split from rlib import rgc from som.vm.symbols import symbol_for, sym_false, sym_true, sym_nil from som.vmobjects.array import Array from som.vmobjects.block_bc import block...
import math import nidmm import nimodinst import warnings import wx USE_WIT = True AppBaseClass = wx.App if USE_WIT: from wx.lib.mixins.inspection import InspectableApp AppBaseClass = InspectableApp def format_meas(reading, function, range, resolution): unit_modifiers = {-12: "p", -9: "n", -6: "u", -3: ...
from collections import namedtuple import tensorflow as tf import math import pge.layers as layers import pge.metrics as metrics from .prediction import BipartiteEdgePredLayer from .aggregators import MeanAggregator flags = tf.app.flags FLAGS = flags.FLAGS # DISCLAIMER: # Parts of this code file are derived from #...
import os import sys import subprocess import pickle from .utils import format_return, insert_list, docker_error, get_mdi_standard, get_compose_path, get_package_path, get_mdimechanic_yaml # Paths to enter each identified node node_paths = { "@DEFAULT": "" } # Paths associated with the edges for the node graph node_e...
#!/usr/bin/env python3 from os import listdir from os.path import join from fnmatch import filter from sys import exit from datetime import datetime from shared.random import Random from shared.utils import * from bot_utils import * HELP_TEXT = """<b>Help:</b> /help - This Message /start - Start the Bot /status - ...
#!/usr/bin/env python """ Thor shared HTTP infrastructure This module contains utility functions and a base class for the parsing portions of the HTTP client and server. """ from collections import defaultdict from enum import Enum from typing import ( Callable, Dict, List, Set, Tuple, Union,...
# # script.py # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import struct SIGHASH_ALL = 1 SIGHASH_NONE = 2 SIGHASH_SINGLE = 3 SIGHASH_ANYONECANPAY = 0x80 # push value OP_0 = 0x00 OP_FALSE = OP_0 OP_PUSHDATA1 = 0x4c OP...
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
import scipy.sparse as sparse import scipy.sparse.linalg as spLA from numpy import linalg as npLA import numpy as np import majoranaJJ.operators.potentials as potentials import majoranaJJ.modules.constants as const import majoranaJJ.modules.checkers as check import majoranaJJ.modules.plots as plots """Descritized k-x...
""" Calculate the cost basis. """ import csv import decimal import io from decimal import Decimal from typing import Sequence from yabc import coinpool from yabc import ohlcprovider from yabc import transaction from yabc.costbasisreport import CostBasisReport from yabc.transaction import Transaction from yabc.transact...
#!/usr/bin/env python3 from functools import reduce import glob import sys # Run from a terminal: # # python3 ais_reader.py | psql -d <database> # FIXME: # - update seconds to second of NMEA payload??? ASCII = ['@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',...
#!/usr/bin/env python # python 3 compatibility from __future__ import print_function # stdlib imports from datetime import datetime from collections import OrderedDict import tempfile import time import shutil import os.path # third party from mapio.shake import ShakeGrid from mapio.geodict import GeoDict import num...
import uuid import numpy as np from django.shortcuts import get_object_or_404 from projects.models import ( Bus, AssetType, Scenario, ConnectionLink, Asset, Project, EconomicData, ) import json from django.core.exceptions import NON_FIELD_ERRORS, ValidationError from projects.f...
import os import sys import json import time sys.path.append(os.path.abspath('../')) import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from scipy.interpolate import interp1d from scipy.integrate import simps from imageio import mimwrite from cytomata.model import sim_itransl...
from ui import core import pandas as pd from tqdm import trange import numpy as np from scipy.sparse import csr_matrix import string class Hybridization: def __init__(self): pass @staticmethod def mixed(lists): filled_lists = [] for i in lists: try: fil...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # License: ยฉ 2022 <NAME> All Rights Reserved # Author: <NAME> # Usage: python3 dikjstra.py import os import sys import json import uuid import time import folium import random from termcolor import colored from geojson import MultiLineString, Point from math import radian...
from utilities import get_closest_index, add_month_to_timestamp, get_dir, get_distance_between_points import numpy as np import shapefile from shapely.geometry import Point from shapely.geometry.polygon import Polygon import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.feature as cftr from netCDF4...
import numpy as np import pandas as pd import matplotlib from matplotlib import pyplot as plt import plotly.express as px import plotly from typing import Union from pandas.core.frame import DataFrame from scipy.stats import stats from sklearn.model_selection import train_test_split from sklearn.preprocessing import...
#!/usr/bin/env python3 import random import re import math import os import time import sys import textwrap import shutil from pathlib import Path import colorama # Style globals RED = "\033[31m" YELLOW = "\033[33m" GREEN = "\033[32m" CYAN = "\033[36m" BOLD = "\033[1m" DEFAULT = "\033[0m" # Display globals WIDTH =...
# ----------------------------------------------------------------------------# # Imports # ----------------------------------------------------------------------------# from datetime import datetime import dateutil.parser import babel from flask import Flask, render_template, request, flash, redirect, url_for, jsonify...
import os import sys import datetime import pathlib import glob import argparse import configparser import re import multiprocessing from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor import win32com.client import pythoncom import colorama from colorama import Fore, Back, Style ...
# encoding: utf-8 # # Standalone RDF extractor for the Biomarker Database import pymysql, argparse, getpass, sys, rdflib, logging # Get logging going logging.basicConfig(level=logging.INFO, format='%(levelname)-8s %(message)s') # RDF Namespaces _bmdb = rdflib.Namespace('http://edrn.nci.nih.gov/rdf/rdfs/bmdb-1.0.0#'...
# # Indentation finder, by <NAME> <phil at freehackers dot org> # Copyright 2002-2008 <NAME> # # This program is distributed under the BSD license. You should have received # a copy of the file LICENSE.txt along with this software. # # http://www.freehackers.org/Indent_Finder # # modifications done by jfcherng <<EMAIL>...
# Copyright (c) 2018, 2019, Nordic Semiconductor ASA # # SPDX-License-Identifier: Apache-2.0 '''West configuration file handling. West follows Git-like conventions for configuration file locations. There are three types of configuration file: system-wide files apply to all users on the current machine, global files a...
# 2020-09-14 # This code was made for use in the Fu lab # by <NAME> # based on ideas and code of <NAME> # Added/Edited by Chris on 2020-09-21 import numpy as np import pandas as pd import scipy.optimize as spo import warnings from typing import List, Union from .constants import n_air from .constants import conversio...
#!/usr/bin/env python """\ Transform a DAWNet file into a PDDL planning problem """ from builtins import range from builtins import object import os import sys import logging import pprint import re from jinja2 import Environment, FileSystemLoader, TemplateNotFound import shutil from dawnet.parser.dawnet import readD...
import re from .types import Module, ResultCode, UNKNOWN_MODULE, UNKNOWN_ERROR, NO_RESULTS_FOUND """ This file contains all currently known 2DS/3DS result and error codes. There may be inaccuracies here; we'll do our best to correct them when we find out more about them. It is also worth noting that apparently Ninten...
# Copyright (c) 2016, <NAME> <<EMAIL>> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaime...
# Copyright 2013 <NAME>, Univ.Politecnica Valencia, Consejo Superior de # Investigaciones Cientificas # # 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/LI...
#!/usr/bin/python3 # -*- coding: utf-8 -*- from typing import Dict, Optional, Text, Tuple, Union, Sequence, List import abc import contextlib import tensorflow as tf import faiss import numpy as np @contextlib.contextmanager def _wrap_batch_too_small_error(k: int): """ Candidate batch too small error """ tr...
#!/usr/bin/env python3 # # Forked from LiteX-Boards, with additions to support USB debugging. # # Copyright (c) 2020 <NAME> <<EMAIL>> # Copyright (c) 2018-2019 <NAME> <<EMAIL>> # Copyright (c) 2018 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause import os import argparse import sys from migen import * from...
''' Created on 29.10.2018 @author: <NAME>, <NAME> ''' import csv import os import sys import sqlite3 import tempfile # add local modules folder # file_path = os.path.join('..', 'Python_Modules') # sys.path.append(file_path) from osgeo import gdal, ogr, osr import click # import netCDF4 as nc import pandas as pd impo...
import sys try: import jnupy except ImportError: jnupy = None if jnupy: func2name = {} name2func = {} x = {"a":32} exec(""" def hello(): if callable(value): try: hash(value) except TypeError: return func2name[value] = k2 = "{}.{...
""" Module implementing varying metrics for assessing model robustness. These fall mainly under two categories: attack-dependent and attack-independent. """ from __future__ import absolute_import, division, print_function, unicode_literals import config import numpy as np import numpy.linalg as la import tensorflow as...
# -*- coding: utf-8 -*- """ Mastermind classes """ import json import pygame # Couleurs couleur = { "black": pygame.Color(0, 0, 0), "white": pygame.Color(255, 255, 255), "red": pygame.Color(255, 0, 0), "green": pygame.Color(0, 255, 0), "blue": pygame.Color(0, 0, 255), "yellow"...
import glob import json import os from argparse import ArgumentParser from collections import defaultdict from dataclasses import asdict, dataclass, field from statistics import mean from time import time from typing import Dict, List, Union from datetime import datetime import numpy as np import pandas as pd import s...
""" End-to-end example speech to text application in Relay. Reads weights and biases from a Keras h5 file (model_lstm_256.h5) """ import sys import tvm from tvm import relay from tvm import runtime from tvm.relay.testing import annotate_exact_matches from flexnlp.src.utils import tool import numpy as np...
import os from copy import ( copy, deepcopy ) from pyramid.view import view_config from pyramid.httpexceptions import HTTPBadRequest from snovault import CONNECTION from snovault.util import debug_log from .types.base import Item from .types.workflow import ( trace_workflows, DEFAULT_TRACING_OPTIONS, ...
# AsynQueue: # Asynchronous task queueing based on the Twisted framework, with task # prioritization and a powerful worker interface. # # Copyright (C) 2006-2007, 2015 by <NAME>, # http://edsuom.com/AsynQueue # # See edsuom.com for API documentation as well as information about # Ed's background and other projects, sof...
from __future__ import absolute_import, division import numpy as np from astropy.io import fits from scipy.signal import fftconvolve as conv from os import getcwd, mkdir, extsep from os.path import join, basename, dirname, isdir import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from matplotlib.wi...
from __future__ import division import math import random import logging from .utils import RandomShuffler from .batch import Batch from .dataset import Dataset logger = logging.getLogger(__name__) class Iterator(object): """Defines an iterator that loads batches of data from a Dataset. Attributes: ...
import torch from torch.utils.data import Dataset, DataLoader, sampler import pandas as pd from functools import lru_cache import numpy as np import logging class DataSplit: r""" Auxiliary class for splitting data in train, test and validation. """ def __init__(self, dataset, test_train_split=0.8, va...
import logging import logging import os import traceback from pathlib import Path from typing import List, Dict from databricks_cli.clusters.api import ClusterApi from databricks_cli.configure.provider import DatabricksConfig from databricks_cli.instance_pools.api import InstancePoolsApi from databricks_cli.jobs.api i...
"""Module containing low-level functions to classify gridded radar / lidar measurements. """ from dataclasses import dataclass import numpy as np import numpy.ma as ma import scipy.ndimage from scipy import stats from scipy.interpolate import interp1d from cloudnetpy import droplet, utils from cloudnetpy.constants impo...
import sys from collections import defaultdict import re import time DEBUG = False def load_rst(path, candidate): read_id = str() read_length = 0 file = open(path, 'r') for line in file: if line[0] == '>': wd = [s for s in re.split(' |,|\[|\]', line.strip()) if s != ''] ...
# -*- coding: utf-8 -*- import warnings import numpy as np import scipy.linalg as la from functools import lru_cache from ..base import Property from .base import Updater from ..types.array import CovarianceMatrix from ..types.prediction import MeasurementPrediction from ..types.update import Update from ..models.base...
#! /usr/bin/python3 from sys import exit from Debug import Debug from Utility import Utility from Opcode_Manager import Opcode_Manager from bitstring import BitArray class Condition (Debug): """Contains symbolic information to assemble the bit representation of a branch condition"...
from decimal import Decimal from django.urls import reverse from django.core.exceptions import ImproperlyConfigured from django.shortcuts import get_object_or_404 from django.views.generic import TemplateView, RedirectView, CreateView, UpdateView, View from django.db.models import Q from django.http import Http404, Ht...
from django.contrib.auth.models import User #from musica.models import Song, Album, Artist, PodcastEpisode, Podcast from musica.models import * from utils.podcasts.podcasts import Podcasts_api # para deshacer redirects from rest_framework import serializers from rest_framework.views import APIView from rest_frame...
import os,sys import pickle from scipy.spatial.distance import cdist import numpy as np import itertools import dgl import torch import torch.utils.data import time import csv from sklearn.model_selection import StratifiedShuffleSplit from scipy.stats import pearsonr #NODE_NUMS = 80 # MNIST #NODE_NUMS = 155 # CIFAR...
import copy import os import threading from datetime import datetime, timedelta from json import JSONDecodeError from flexget import plugin from flexget.entry import Entry from loguru import logger from requests import RequestException, Session logger = logger.bind(name='qbittorrent_client') def singleton(cls): ...
import random import synapse.common as s_common import synapse.neuron as s_neuron import synapse.lib.cell as s_cell import synapse.lib.crypto.vault as s_vault import synapse.tools.neuron as s_tools_neuron from synapse.tests.common import * logger = logging.getLogger(__name__) class TstCell(s_cell.Cell): def ...
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Herald HTTP transport discovery, based on a homemade multicast protocol :author: <NAME> :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 1.0.1 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, V...
#!/usr/bin/python3 # Using the pack: http://packs.download.atmel.com/Atmel.SAMD51_DFP.1.2.139.atpack # This script can be used to generate code from an atdf file: # - peripheral IDs for the GCLK device # - GPIO functions # - Device package with peripheral instances # - Main_Clock on/off procedures for peripherals # -...
# Copyright 2006-2013 by <NAME>. All rights reserved. # # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Bio.AlignIO support for "stockholm" format (used in the PFAM database). You are expected to...
''' Written by <NAME> <<EMAIL>> First version Nov 9, 2016 Restructured Feb 4, 2018 - get data Restructured Sep 19, 2018 - DNN training Restructured Oct 13, 2018 - DNN training Restructured Feb 18, 2020 - UTI to STFT Restructured March 2, 2020 - improvements by <NAME> <<EMAIL>> - swish, scaling to [-1,1], network struc...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
# Copyright 2018 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...
#!/usr/bin/env python # Copyright (c) 2014-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the Apache 2.0 license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree)...
import sys import time as time_lib import os from bin import spl_memory as mem def replace_bool_none(string: str): """ Returns a str with 'None', 'True', and 'False' replaced with 'null', 'true', and 'false'. This function also removes quotes generated by spl String object. :param string: the str ob...
############################################################################## # Author: <NAME> # Last Changed: 5/7/21 # # REQUIREMENTS # - Detailed dependencies in requirements.txt # - Directly referenced: # - prefect, boto3, tqdm, pandas, icecream, coiled # # - Infrastructure: # - Prefect: Script is registered as...
import argparse import os import random import time import warnings import sys import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import torch.multiprocessing as mp import torch.utils.data import torchvis...
from typing import Any, Dict, List, Optional import abc import os import numpy as np from mlagents.tf_utils import tf from mlagents import tf_utils from mlagents_envs.exception import UnityException from mlagents_envs.logging_util import get_logger from mlagents.trainers.policy import Policy from mlagents.trainers.acti...
''' Created on May 29, 2015 @author: mzwier ''' import collections import contextlib import errno import logging import json import multiprocessing import os import re import signal import socket import sys import tempfile import threading import time import traceback import uuid import zmq import numpy as np # Eve...
#!/usr/bin/env python3 # # Compare accounting of algod and indexer # # setup requires: # pip install msgpack py-algorand-sdk import base64 import json import logging import os import sqlite3 import sys import urllib.error import urllib.request import urllib.parse import msgpack import algosdk import psycopg2 logger...
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
import numpy as np import os import math import uuid from . import stl_combine def rotationMatrixToEulerAngles(R): sy = math.sqrt(R[0, 0] * R[0, 0] + R[1, 0] * R[1, 0]) singular = sy < 1e-6 if not singular: x = math.atan2(R[2, 1], R[2, 2]) y = math.atan2(-R[2, 0], sy) z = math.at...
import numpy as np import matplotlib.pyplot as plt import matplotlib from typing import List from ReinLife.World.entities import Agent from ReinLife.Models.utils import BasicBrain class Tracker: """ Used for tracking results of an experiment Variables tracked: * Avg Population Size * Avg Population A...
# Whatever the vision task (object detection, recognition, classification), # the work begins with image processing... # This program shows how numpy arrays may be generated from image files # using the Open CV library and various Python utilities. # We generate grayscale and color representations in numpy ar...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
# From https://github.com/Picarro-SzeMengTan/OptimalGridding written by Sze # CopyRight from typing import List import numpy as np from attr import attrib, attrs from scipy.linalg import solve_triangular from scipy.optimize import leastsq @attrs class OptFunc: W = attrib(type=int) x0 = attrib(type=float) ...
# -*- coding: utf-8 -*- # # Copyright 2018 Amazon.com, Inc. or 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. # A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or i...
# # (c) <NAME> 17/04/21 # # This work may be reproduced, modified, distributed, # performed, and displayed for any purpose. Copyright is # retained and must be preserved. The work is provided # as is; no warranty is provided, and users accept all # liability. # # This is a program of how the machine learn to play flap...
import re import six import logging import unicodedata import warnings from six import Iterator from pymarc.exceptions import BaseAddressInvalid, RecordLeaderInvalid, \ BaseAddressNotFound, RecordDirectoryInvalid, NoFieldsFound, \ FieldNotFound, BadSubfieldCodeWarning from pymarc.constants import LEAD...
# 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, software # distributed under t...
from __future__ import print_function import codecs import json import logging import os import re import shutil from esphome.config import iter_components from esphome.const import ARDUINO_VERSION_ESP32_1_0_0, ARDUINO_VERSION_ESP8266_2_5_0, \ ARDUINO_VERSION_ESP8266_DEV, CONF_BOARD_FLASH_MODE, CONF_BRANCH, CONF_...
import gc import logging import os from collections import defaultdict from typing import Sequence import numpy as np import torch from tqdm import tqdm import configs from functions.evaluate_roxf import DATASETS, configdataset, compute_map from functions.hashing import inverse_sigmoid, get_distance_func from functio...
from functools import reduce from collections import defaultdict import math class InverseException(Exception): pass class PolynomialMeta(type): cache = {} def __call__(cls, *args, **kwargs): ret = super(PolynomialMeta, cls).__call__(*args, **kwargs) if ret in cls.cach...
# Copyright 2017-2020 Amazon.com, Inc. or 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2020-2021 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC # File: findTheBits_18.py # Author: <NAME>...
# UVO Plugin # # Author: <NAME>, 2020 # """ <plugin key="bluvo" name="Kia UVO and Hyundai Bluelink" author="<NAME>" version="0.1.1"> <description> <h2>BlUvo Plugin</h2> A plugin for Kia UVO and Hyundai Bluelink EV's (generally MY2020 and beyond). Use at own risk! More...
# -*- coding:utf-8; python-indent:2; indent-tabs-mode:nil -*- # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
""" Contains backtesting logic and objects. """ from __future__ import division from copy import deepcopy import bt import ffn import pandas as pd import numpy as np from matplotlib import pyplot as plt import pyprind def run(*backtests): """ Runs a series of backtests and returns a Result object containi...
# Copyright 2019 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 pyramid.traversal import find_root from snovault import ( calculated_property, collection, load_schema, ) from .base import ( ALLOW_SUBMITTER_ADD, Item, paths_filtered_by_status, SharedItem ) from .dataset import Dataset from .shared_calculated_properties import ( CalculatedBiosampl...