text
stringlengths
3.07k
22.1k
# (c) Copyright [2018-2020] Micro Focus or one of its affiliates. # 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 applicabl...
""" A module of slope plot which made only some elements stand out. """ import numpy as np from plot_playground.common import d3_helper from plot_playground.common import data_helper from plot_playground.common import js_helper_template_path PATH_CSS_TEMPLATE = 'storytelling/slope_plot.css' PATH_JS_TEMPLA...
import argparse import numpy as np from osgeo import gdal from util.load_data import ( get_map_from_i_j_to_example_index, read_education_records, read_water_records, read_wealth_records, ) class MapGeometry(object): """ This class is an eyesore, but unfortunately it's necessary for finding ...
from utils import (set_seed, set_dist, load_and_preprocess_dataset, build_example_object, get_elapse_time, get_output_path, get_checkpoint_path, get_batch_size, get_model_name, save_config) from torch.utils.data import DataLoader from transformers import AdamW, get_linear_sched...
import logging import os from collections.abc import Mapping from enum import Enum from pathlib import Path from typing import Dict, List import yaml # Paths BOT_DIR = os.path.dirname(__file__) PROJECT_ROOT = os.path.abspath(os.path.join(BOT_DIR, os.pardir)) DEFAULT_CONFIG_FILE = os.path.join(PROJECT_ROOT, "default_c...
import imageio import numpy as np import scipy.fft from .axis import Order, RegularAxis, FFTRegularAxis, RFFTRegularAxis class RegularGrid: """Regular, i.e., equally spaced, points on a grid. Args: axis_x (RegularAxis): horizontal axis axis_y (RegularAxis): vertical axis """ def __...
from tkinter import* from tkinter import ttk import tkinter as tk from PIL import Image, ImageTk root=Tk() frame=Frame(root,width=800 , height=600) color= open('bin/color.txt','r').read() frame.config(bg=color) root.title("micromouse results") frame.pack(fill="both",expand="yes" ) #_______________________...
"""Reshapes data stored in factor files into data stored in rho files At the end of a variable scan after all factor CSV files are saved, reshaper can be called to load in all data stored in each factor file, and then reshape and save the data in new rho files. In each factor file, variables are dependent on the radi...
#!/usr/bin/env python ''' file: ssvc_tests author: secursive reference: https://blog.secursive.com/posts/critical-look-stakeholder-specific-vulnerability-categorization-ssvc/ ''' import unittest import itertools import pprint from ssvc import _app_cols, _dev_cols, _app_lookup, _dev_lookup, _df_applier, _df_developer, ...
import numpy as np import torch import os import sys import torch NUM_HEADING_BIN = 12 NUM_SIZE_CLUSTER = 8 # one cluster for each type 每种类型一个集群 NUM_OBJECT_POINT = 512 g_type2class={'Car':0, 'Van':1, 'Truck':2, 'Pedestrian':3, 'Person_sitting':4, 'Cyclist':5, 'Tram':6, 'Misc':7} g_class2type = {g_type2cla...
import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from rtnn import inputUtil as Iu # -------------------------Initialize input series------------------------------- data = pd.read_csv( '/home/mario/Dokumente/Transmitterbased Model/Modularized/iris.csv') species_dummy = p...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import sys from numpy import array from numpy import eye from numpy import zeros from numpy import float64 from numpy.linalg import cond from scipy.linalg import solve from scipy.linalg import lstsq from com...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @created: 21.05.2014 # @author: <NAME> # @contact: <EMAIL> from pymongo import MongoClient from trseeker.tools.sequence_tools import get_revcomp from collections import defaultdict class AbstractKmerDBConnector(object): """ Abstract connector to datastore. ""...
#!/usr/bin/env python3 """ AWS helper script writtin in Python script to connect to CAS/Shibboleth via Selenium/webdriver and retrieve a SAML manifest. SAML manifest is saved locally to disk By default, script then connects to AWS and retrieves STS credentials for each account/role, and writes the output to a json...
import os import sys import re from time import sleep from setproctitle import setproctitle import multiprocessing from multiprocessing.managers import SyncManager import concurrent.futures from ctypes import cdll, CFUNCTYPE, c_char_p, c_int from contextlib import contextmanager import shlex import pyaudio import subpr...
# Copyright (C) PROWLER.io 2017-2019 # # Licensed under the Apache License, Version 2.0 """ Prototype Code! This code may not be fully tested, or in other ways fit-for-purpose. Use at your own risk! """ from typing import Optional import gpflow import numpy as np import tensorflow as tf from functools import reduce f...
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2019 <NAME> # # 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 # ...
from efficientnet_pytorch import EfficientNet import torch.nn as nn import torch import numpy as np import torch.nn.functional as F from util import IMG_HEIGHT, IMG_WIDTH device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class double_conv(nn.Module): '''(conv => BN => ReLU) * 2 基本卷...
""" clang_parser.py Parse C code into a map which maps from (struct name) to (base-class- and record-type- expanded fields list). """ import logging from dataclasses import dataclass from pathlib import Path from typing import List, Mapping, Tuple import clang.cindex logger = logging.getLogger("tscout") # Expected...
#!/usr/bin/env python import sys import argparse import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.autograd import Variable import torchvision.transforms as tfs from torchvision.datasets import ImageFolder, CIFAR10 from torch.utils.data import DataLoader from miscs.pgd import attack_lab...
# Copyright 2017-2018 <NAME> # License: BSD (see file COPYING for details) from __future__ import unicode_literals from builtins import str from django.utils.translation import ugettext_lazy as _ from django.utils.translation import pgettext_lazy as pgettext from lino_xl.lib.courses.models import * from lino.modlib...
DEFAULT_FADE_TIME = 50 # ms PROTOCOL = { 1: "DALI", 2: "DIGIDIM", 3: "SDIM", 4: "DMX", } UNKNOWN_PROTOCOL = "Unknown Protocol" DALI_TYPES = { 1: "Fluorescent Lamps", 2: "Self contained emergency lighting", 3: "Discharge lamps", 4: "Low voltage halogen lamps", 5: "Conversion ...
import argparse import logging import os import re import subprocess import sys import time import uuid CONTAINER_ID_LENGTH = 7 def remap_command(command, container_prefix='/inputs'): new_command = [] volume_map = {} pieces = re.split(r'\s+', command) for piece in pieces: if piece[0] != '-' an...
#!/usr/bin/env python3 # # GET NIST DATA # This script downloads atomic data from the American National Institute of # Standards and Technology's (NIST) Atomic Spectra Database (ASD). It generates # a request in the manner of the Ionization Energy form at # # https://physics.nist.gov/PhysRefData/ASD/ionEnergy.html # ...
from __future__ import absolute_import from copy import copy from itertools import chain import os import re import sys import shlex from tempfile import NamedTemporaryFile from django.utils.encoding import smart_text try: from urllib.request import pathname2url from urllib.parse import urljoin except Import...
# -*- coding: utf-8 -*- """ Created on Thu Jun 3 20:27:23 2021 @author: shristy requests==2.18.4:pip install """ # Module 2 --> Cryptocurrency import datetime # Each block will have exact date when its mined import hashlib # We will work with hash functions import json # Encode the block from flask import Flask, ...
import cv2 import numpy as np import math as m import sys # for gamma function, called from scipy.special import gamma as tgamma import os # import svm functions (from libsvm library) # if python2.x version : import svm from libsvm (sudo apt-get install python-libsvm) from libsvm.python.svm import ONE_CLASS, EPSIL...
# Copyright 2022 MosaicML Composer authors # SPDX-License-Identifier: Apache-2.0 """Core Exponential Moving Average (EMA) classes and functions.""" from __future__ import annotations import copy import itertools import logging from typing import Any, Dict, List, Optional, Union import torch from composer.core impo...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import xgboost as xgb from sklearn.multiclass import OneVsRestClassifier from datasets_get import get_modelar_data, get_estimar_data, getX, getY, get_modelar_data_ids, get_categories_list from scipy.spatial import cKDTree from scipy.special i...
from __future__ import unicode_literals import datetime from decimal import Decimal from django.core.exceptions import FieldError from django.db.models import ( Sum, Count, F, Value, Func, IntegerField, BooleanField, CharField) from django.db.models.fields import FieldDoesNotExist from django.test import T...
"""Template for the build file used in android_sdk_repository.""" # Copyright 2016 The Bazel 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.ap...
# -*- coding: utf-8 -*- import subprocess import logging import os import time import sys import json import datetime import sys import uuid LOG_LEVEL = logging.INFO LOG_FORMAT = "%(asctime)-15s - %(name)s - %(levelname)s - %(message)s" MODULE_NAME = "SPS-Tester-via-steempy.Tools-Py" logger = logging.getLogger(MODUL...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import csv import argparse import logging from typing import Any, Dict, List import json import numpy as np from tqdm import tqdm def main(): logging.basicConfig( level=logging.DEBUG, format="%(asctime)s [%(levelname)s] - %(message)s", datefmt="...
from ontology.interop.System.Storage import GetContext, Get, Put, Delete from ontology.interop.System.Runtime import Notify, CheckWitness from ontology.interop.System.Action import RegisterAction from ontology.interop.Ontology.Runtime import AddressToBase58, Base58ToAddress from ontology.interop.System.ExecutionEngine ...
# -*- coding: utf-8 -*- """Beatles Dataset Loader .. admonition:: Dataset Info :class: dropdown The Beatles Dataset includes beat and metric position, chord, key, and segmentation annotations for 179 Beatles songs. Details can be found in http://matthiasmauch.net/_pdf/mauch_omp_2009.pdf and http://iso...
#!/usr/bin/python # # Copyright (C) 2010 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 ...
#!/bin/env python # SPDX-License-Identifier: BSD-3-Clause AND Apache-2.0 # Copyright 2018 Regents of the University of California # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributi...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import tools from odoo import api, fields, models class SaleReport(models.Model): _name = "sale.report" _description = "Sales Analysis Report" _auto = False _rec_name = 'date' _order = 'da...
"""Support for Amcrest IP camera binary sensors.""" from __future__ import annotations from contextlib import suppress from dataclasses import dataclass from datetime import timedelta import logging from typing import TYPE_CHECKING, Callable from amcrest import AmcrestError import voluptuous as vol from homeassistan...
import os import glob class ConstTree(object): def __init__(self): self.left = None self.right = None def size(self): self.size = 1 if self.left is not None: self.size += self.left.size() if self.right is not None: self.size += self.right.size() ...
import matplotlib.pyplot as plt import numpy as np import os import PIL import cv2 import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.models import Sequential import tensorflow as tf from tensorflow import keras print(tf.__version__) from t...
import datetime import logging import boto3 from dagster import Field, StringSource, check, logger, seven from dagster.core.utils import coerce_valid_log_level # The maximum batch size is 1,048,576 bytes, and this size is calculated as the sum of all event # messages in UTF-8, plus 26 bytes for each log event. MAXIM...
""" Copyright (C) by stella or something if you copy this but make your repository private, ur weird pls be nice to me if you do copy it that's all i want :pleading: """ from __future__ import annotations import contextlib import inspect import itertools import typing from typing import TYPE_CHECKING, Any, Callable, ...
import typing import discord from discord import AllowedMentions, File, InvalidArgument, abc, http, utils from discord.ext import commands from discord.http import Route class ComponentMessage(discord.Message): __slots__ = tuple(list(discord.Message.__slots__) + ["components"]) def __init__(self, *, state, ...
#!/usr/bin/env python3 -u # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Translate pre-processed data with a trained model. """ import ast import logging import math import os import sy...
#!/usr/bin/env python3 """Fetch alerting and aggregation rules from provided urls into this chart.""" import textwrap from os import makedirs import requests import yaml from yaml.representer import SafeRepresenter # https://stackoverflow.com/a/20863889/961092 class LiteralStr(str): pass def change_style(style...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -*- mode: Python; tab-width: 4; indent-tabs-mode: nil; -*- # Do not change the previous lines. See PEP 8, PEP 263. # import sys import os import hashlib import mmap import datetime import time import threading import queue import logging from watchdog.observers import O...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from threading import Thread from os import getenv import json import requests import traceback from flask import Flask, abort, request, current_app, views from flask_restful import Resource, Api import signal from task_manag...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import defaultdict, Iterable try: from itertools import izip as zip from itertools import imap as map from itertools ...
import argparse import math import os import numpy as np import pandas as pd import torch from torch import nn from torch import optim from torch.autograd import Variable from torch.nn import functional as F from torch.utils.data import DataLoader from tqdm import tqdm from build_vocab import WordVocab from dataset i...
import os import time import math import random import shutil import logging import torch import torch.nn as nn import models import numpy as np from options import parser from collections import OrderedDict from dataloader import getDataLoader from utils import * from regularization import * args = parser.parse_args(...
#!usr/bin/python2.7 import requests import multiprocessing.pool import sys import re import os import urlparse import logging import argparse import time logging.basicConfig(format='\r%(message)s', level=logging.INFO) reload(sys) sys.setdefaultencoding('utf-8') ENGINE = { 'google': ('https://www.google.com/searc...
# pylint: disable=missing-module-docstring # pylint: disable=missing-class-docstring # pylint: disable=missing-function-docstring from copy import deepcopy from quantify_scheduler.enums import BinMode import numpy as np import pytest from quantify_scheduler import Schedule from quantify_scheduler.compilation import ( ...
import attr import numpy as np from mbf_nested_intervals import IntervalSet from .common import reverse_complement @attr.s(slots=True) class Gene: gene_stable_id = attr.ib() name = attr.ib() chr = attr.ib() start = attr.ib() stop = attr.ib() strand = attr.ib() biotype = attr.ib() trans...
import logging from typing import Iterable import pendulum from prompt_toolkit.completion import ( CompleteEvent, Completer, Completion, FuzzyWordCompleter, WordCompleter, ) from prompt_toolkit.contrib.regular_languages.completion import GrammarCompleter from prompt_toolkit.document import Document...
## ####################################################################################################################### # # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated ...
# -*- coding: utf-8 -*- # Metropolis Drift-Diffusion-Model # Copyright 2018 <NAME>, <NAME>, <NAME> # This file is released under the MIT licence that accompanies the code ## This file contains the core computational routines import numpy as np import ddm as dm from numbers import Real, Integral ## Some auxiliary fu...
""" Support for RFXtrx binary sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.rfxtrx/ """ import logging import voluptuous as vol from homeassistant.components import rfxtrx from homeassistant.components.binary_sensor import ( ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import kadi.events.query as events # This import style (instead of "from kadi import events") is required due to a # conflict with how the django app is initialized and standalone usage since # django 2+. Basically `events/__init__.py` in a django app doe...
import argparse import os import json import cv2 import numpy as np import pandas as pd import cooler from cooltools import numutils import warnings warnings.filterwarnings('ignore') ############################################# # Compartment signal processing functions ############################################# d...
""" eve_mongoengine.datalayer ~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements eve's data layer which uses mongoengine models instead of direct pymongo access. :copyright: (c) 2014 by <NAME>. :license: BSD, see LICENSE for more details. """ # builtin import ast import json from uuid import U...
# -*- coding: utf-8 -*- # Copyright (c) 2020-2021 <NAME>. # All rights reserved. # Licensed under BSD-3-Clause-Clear. See LICENSE file for details. """ Maak template bestanden vanuit de wiki export """ import os import sys import xml.etree.ElementTree import copy_of_settings # wordt door maak_hand...
""" RL training utilities""" import math from time import time from datetime import timedelta from toolz.sandbox.core import unzip from cytoolz import concat import numpy as np import torch from torch.nn import functional as F from torch import autograd from torch.nn.utils import clip_grad_norm_ from metric import c...
from boa.interop.Neo.Blockchain import GetHeight from boa.interop.Neo.Runtime import CheckWitness from boa.interop.Neo.Action import RegisterAction from boa.interop.Neo.Storage import Get, Put from boa.builtins import concat from boa_test.example.demo.token.nep5 import TOKEN_TOTAL_SUPPLY from boa_test.example.demo.toke...
# -*- coding: utf-8 -*- #BEGIN_HEADER import errno as _errno import os as _os import subprocess as _subprocess import time as _time import uuid import uuid as _uuid import psutil from Bio import SeqIO as _SeqIO from installed_clients.AssemblyUtilClient import AssemblyUtil as _AssClient from installed_clients.DataFile...
# ****************************************************************************** # Copyright 2017-2020 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.apa...
import asyncio from . import mod_abc, types from typing import Union, Optional, List, Callable from opentrons.drivers.thermocycler.driver import ( Thermocycler as ThermocyclerDriver) import logging MODULE_LOG = logging.getLogger(__name__) class SimulatingDriver: def __init__(self): self._target_temp ...
import mock import pytest from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.db.models import F from rest_framework.test import ( APIRequestFactory, #RequestsClient, Not supported in older rest_framework versions force_authenticate, ) from open...
import os import requests import pytest from civic_jabber_ingest.models.title import Title import civic_jabber_ingest.regs.va as regs import civic_jabber_ingest.external_services.aws as aws import civic_jabber_ingest.utils.database as database from civic_jabber_ingest.utils.environ import modified_environ TEST_ARCH...
# -*- coding: utf-8 -*- """ Created on Fri Jan 27 19:12:53 2017 @author: <NAME> @Description: This is the file used for training, loading images, annotation, training with model. """ import numpy as np import pdb import os import matplotlib.pyplot as plt from generator import ImageDataGenerator from model import bui...
from datetime import timedelta from unittest import mock import pytest from hypothesis import given, settings import astropy.units as u from astropy.time import Time, TimeDelta import sunpy.net.dataretriever.sources.norh as norh from sunpy.net import Fido from sunpy.net import attrs as a from sunpy.net.dataretriever...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from multiprocessing import Pool from timeit import default_timer as timer import requests from bs4 import BeautifulSoup from apps.base import models from apps.base.models import reset_db BASE_URL = 'http://books.toscrape.com/' def get_page...
from selenium import webdriver # from selenium.webdriver.common.keys import Keys from selenium.webdriver import ChromeOptions from pyquery import PyQuery as pq import requests import pymongo import pymysql from time import sleep from lxml import etree import os from io import StringIO option = ChromeOptions() option....
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from collections import OrderedDict from typing import Any, List, Optional, Union class ConfigBaseMeta(type): def annotations_and_defaults(cls): annotations = OrderedDict() defaults = {} for base ...
#! coding:utf -8 import os from external_cmd import TimedExternalCmd from defaults import * from utils import * FORMAT = '%(levelname)s %(asctime)-15s %(name)-20s %(message)s' logFormatter = logging.Formatter(FORMAT) logger = logging.getLogger(__name__) consoleHandler = logging.StreamHandler() consoleHandler.setFormat...
# -*- coding=utf-8 -*- # Copyright (c) 2019 <NAME> import concurrent import concurrent.futures import fnmatch import gzip import hashlib import json import os import shutil import tempfile from datetime import date, datetime, timedelta from functools import partial from pathlib import Path from typing import Any, Dict...
# Copyright 2021 New York University <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 agreed to ...
import numpy as np import pandas as pd from sklearn import clone from sklearn.base import BaseEstimator, TransformerMixin, MetaEstimatorMixin from sklearn.utils.validation import check_is_fitted, check_X_y, check_array, FLOAT_DTYPES from sklego.base import ProbabilisticClassifier from sklego.common import as_list, Tra...
from __future__ import division import time import torch import copy from torch.autograd import Variable import numpy as np import cv2 from util import * from darknet import Darknet from preprocess import prep_image, inp_to_image, letterbox_image import pandas as pd import random import pickle as pkl import argparse fr...
import json from django.conf import settings from django.db import connections from django.http import HttpResponseForbidden, HttpResponseNotFound, JsonResponse from django.http.request import QueryDict from django.views.decorators.csrf import csrf_exempt from django.views.static import serve from openslides.core.mod...
import pickle import time from pathlib import Path import numpy as np import torch from google.protobuf import text_format import torchplus from second.builder import target_assigner_builder, voxel_builder from second.data.preprocess import merge_second_batch from second.protos import pipeline_pb2 from second.pytorch...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not...
# -*- coding:utf-8 -*- # Author: <NAME> <<EMAIL>> # # License: Apache-2.0 license from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import time import cv2 import pickle import numpy as np import argparse from tqdm ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import os import sys from codecs import open as codecs_open from pelican import signals from pytz import timezone if sys.version_info >= (3, 0): from urllib.parse import urljoin else: from urlparse import urljoin class Config...
"""Support for user- and CDC-based flu info sensors from Flu Near You.""" from datetime import timedelta import logging from pyflunearyou import Client from pyflunearyou.errors import FluNearYouError import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import (...
# 生成图谱,存入neo4j数据库 from py2neo import Graph, Node, Relationship, NodeMatcher, RelationshipMatcher import json import csv from similarity_calculate import sim_cal from knowledge_verify import solution_verify # 读取知识抽取结果csv文件,日志所属模板结果json文件,初步创建节点和关系 def build_graph(graph, knowledge_extract_result_file_path, template_res...
from datetime import datetime import os import csv import re from Event import Event from functionality.create_event_type import create_event_type from functionality.export_file import load_key, encrypt_file, decrypt_file async def find_avaialbleTime(ctx, client): """ Function: find_avaialbleTime ...
__all__ = ['AdaptiveKLController', 'FixedKLController', 'PPOTrainer'] import numpy as np import torch.nn.functional as F from torch.optim import Adam import torch import collections import time import random from .core import (logprobs_from_logits, whiten, clip_by_val...
import pygame import math from random import randint from pygame import mixer # Initialized pygame library pygame.init() # created game window screen = pygame.display.set_mode((772, 600)) # setting the background background = pygame.image.load('m_background.jpg') background_y = 0 background_y2 = background.get_heigh...
""" This module provides a FITS file reader. Notes ----- 1. FITS files allow comments to be attached to every value in the header. This is implemented in this module as a KEYCOMMENTS dictionary in the sunpy header. To add a comment to the file on write, add a comment to this dictionary with the same name as ...
from __future__ import print_function import numpy as np from collections import defaultdict from sklearn.linear_model import LogisticRegression from sklearn.metrics import f1_score from copy import deepcopy try: from sklearn.model_selection import cross_val_score, KFold, StratifiedKFold except ImportError: fr...
from __future__ import print_function import inspect import logging import sys import time import progressbar import six from decorator import decorate from future.utils import raise_with_traceback from .config import config config.register('logging_level', description='Set the default logging level...
import inspect import types import gc import functools from typing import Union, Callable, Any from .typecheck import typecheck from .container import SetOnceDict try: _get_argspec = inspect.getfullargspec argspec_type = inspect.FullArgSpec except AttributeError: _get_argspec = inspect.getargspec ar...
"""Data Equivalence Tests""" from __future__ import print_function # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import os.path as op import inspect from nose.tools import assert_equal, assert_true from numpy.testing import assert_array_almost_equal, assert_array_equal from nump...
import time import os import glob import argparse import sys import collections import datetime import pandas as pd import mdtraj as md import fahmunge # Reads in a list of project details from a CSV file with Core17/18 FAH projects and munges them. def setup_worker(terminate_event, delete_on_unpack, compress_xml): ...
from typing import List, Tuple from flask import request, g from sqlalchemy import or_, desc, collate from sqlalchemy.exc import SQLAlchemyError from webargs import fields, validate from webargs.flaskparser import use_args from .authentication import TokenRequiredResource from .post import post_schema from ..helpers ...
from app.logic import vectors as v, learning as lrn, load as l import numpy as np import time import nmslib import random import json ''' This is the logic interface for all services provided by flask view functions. ''' '''Word-embedding, vocabulary, dimensions, index, training data-container''' words, voc, dims, ...
import os import argparse import json import torch from torch import nn from torch.optim.lr_scheduler import ReduceLROnPlateau import pytorch_lightning as pl from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping from asteroid.engine.system import System from asteroid.losses import PITLossWrapper, pair...
# -*- coding: utf-8 -*- # # 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 #...
from __future__ import print_function import codecs from collections import OrderedDict import fnmatch import logging import os import uuid import yaml import yaml.constructor from esphomeyaml import core from esphomeyaml.core import EsphomeyamlError, HexInt, IPAddress, Lambda, MACAddress, TimePeriod _LOGGER = logg...