text
stringlengths
3.07k
22.1k
import torch import torch.nn.functional as F import torch.distributions.utils as dist_utils import torch.distributions as torchdist from torch.distributions import transforms import pyro import pyro.distributions as dist from pyro.nn import PyroModule, PyroSample __all__ = ["Bernoulli", "Categorical", "Homoskedastic...
# required packages import discord import datetime import time import os from dotenv import load_dotenv from selenium import webdriver from discord.ext import commands from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive # all secret keys and google drive fileId are store in the '.env' ...
import numpy as np import chainer from chainer import cuda import chainer.functions as F import chainer.links as L def _augmentation(x): xp = cuda.get_array_module(x) MAX_SHIFT = 2 batchsize, ch, h, w = x.shape h_shift, w_shift = xp.random.randint(-MAX_SHIFT, MAX_SHIFT + 1, size=2) a_h_sl = slice...
__author__ = "<NAME>" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules: import os import numpy as np import bson # RiBuild Modules: from delphin_6_automation.database_interactions.db_templates import delph...
import os import glob import sys import json import datetime import numpy as np import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import matplotlib.ticker as mticker import cartopy.crs as ccrs import cartopy.feature as cfeature from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatt...
#!/usr/bin/env python3 """ Copyright 2010-2018 <NAME> <<EMAIL>> Copyright 2008-2009 <NAME> This file is part of PyCAM. PyCAM 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 (...
""" Represent the user's database of version classifications. """ import os import re import yaml class ReportedUpdateTypes(object): """ Represent which types of updates are of interest to a client. """ TYPE_TO_FLAGS = { 'all': dict( ignore_alpha_beta_rc_releases=False, ...
# Part 1 - Data Preprocessing # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd import datetime import warnings warnings.filterwarnings('ignore') # Importing the training set df_raw = pd.read_csv('Google_Stock_Price_Train.csv') df = df_raw df.columns df = df_raw.drop(['O...
# Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Invoke remote procedure call for interaction with shopfloor backend. Description ----------- The Chromium OS Factory Software has defined a protocol, ...
#!/usr/bin/env python3 import glob import os import sys import tempfile from typing import List, Collection, Set from unittest import TestCase from pathlib import Path from hwsuite import stage from hwsuite.stage import Stager, GitRunner from random import random import logging import hwsuite.tests from hwsuite.tests i...
import numpy as np import matplotlib.pyplot as plt plt.switch_backend('agg') from matplotlib import animation, cm from numpy.linalg import inv from mpl_toolkits.mplot3d import Axes3D import tables as tb import subprocess from scipy.optimize import brentq import sys def quick_plot(input_filename=None, filename=None, st...
"""Performance metrics for photo-z prediction.""" import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.colors import ListedColormap import mpl_scatter_density import numpy as np import scipy from scipy.special import softmax from scipy.stats import gaussian_kde params = { "legend.fontsize": ...
import logging import re import sqlite3 import sys from argparse import ArgumentParser from rdflib import Graph from .helpers import add_labels, get_connection, get_ids, get_terms """ Usage: python3 extract.py -d <sqlite-database> -t <curie> > <ttl-file> Creates a TTL file containing the term, predicates, and ancest...
## # Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U. # This file is part of OSM # 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.or...
""" Import as: import helpers.hasyncio as hasynci """ import asyncio import contextlib import datetime import logging import math import random from typing import ( Any, Callable, Coroutine, Dict, Iterator, List, Optional, Tuple, Union, cast, ) import async_solipsism import pan...
"""Augmentations.""" # pylint: disable=invalid-name from pylint.checkers.base import DocStringChecker, NameChecker from pylint.checkers.design_analysis import MisdesignChecker from pylint.checkers.classes import ClassChecker from pylint.checkers.newstyle import NewStyleConflictChecker from pylint.checkers.variables im...
import torch import json from typing import List, Callable, Union device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') class CTCLabelConverter(object): """ Convert between text-label and text-index """ def __init__(self, character): # character (str): set of the possible characters....
""" This is abstract class for ion mass-analyzer traps. It creates needed PA file, and works with it :auther: <NAME> <EMAIL> """ import os import subprocess from abc import ABCMeta, abstractmethod from dataclasses import dataclass import typing import numpy as np from math import ceil from tqdm import tqd...
_SCRIPT_VERSION = "Script version: Nuthouse01 - 6/10/2021 - v6.00" # This code is free to use and re-distribute, but I cannot be held responsible for damages that it may or may not cause. ##################### # first, import system stuff import copy # second, wrap custom imports with a try-except to catch it if fil...
reservadas = { 'smallint' : 'SMALLINT', 'integer' : 'INTEGER', 'bigint' : 'BIGINT', 'numeric' : 'NUMERIC', 'real' : 'REAL', 'mode' : 'MODE', 'double' : 'DOUBLE', 'precision': 'PRECISION', 'money' : 'MONEY', 'charact...
import argparse import sys import time from itertools import izip from string import ascii_uppercase import numpy as np from .volume import Volume from .structure import Ligand, Structure from .transformer import Transformer from .solvers import QPSolver, MIQPSolver from .validator import Validator def parse_args()...
from typing import List, Set, Dict, Any, Union def get_bdf_stats(model, return_type='string', word=''): # type: (Any, str, str) -> Union[str, List[str]] """ Print statistics for the BDF Parameters ---------- return_type : str (default='string') the output type ('list', 'string') ...
# -*- coding: utf-8 -*- from odoo import api, fields, models from odoo.exceptions import Warning as UserError from odoo.tools import html_escape as escape from odoo.tools.translate import _ SUBTASK_STATES = { "done": "Done", "todo": "TODO", "waiting": "Waiting", "cancelled": "Cancelled", } class Proj...
import os import platform import sys from pathlib import Path from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5.QtCore import * from PyQt5.QtCore import QTimer from PyQt5.QtGui import QKeySequence from PyQt5.QtWidgets import QShortcut, QWidget, QColorDialog, QLabel, QLineEdit, QPushButton from res.ui import Ui_Ma...
import abc import multiprocessing import os import six import dbt.exceptions import dbt.flags from dbt.api import APIObject from dbt.compat import abstractclassmethod, get_ident from dbt.contracts.connection import Connection from dbt.logger import GLOBAL_LOGGER as logger from dbt.utils import translate_aliases cla...
# Copyright 2021 The Flax 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...
from conftest import * def delay_rerun(*args): time.sleep(90) return True pytestmark = [pytest.mark.flaky(rerun_filter=delay_rerun)] # thanks to <NAME> on S.O. for this bit of code @contextmanager def captured_output(): """ Capture stdout and stderr """ try: from StringIO import St...
import math from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter supported_rnns = { 'lstm': nn.LSTM, 'rnn': nn.RNN, 'gru': nn.GRU } supported_rnns_inv = dict((v, k) for k, v in supported_rnns.items()) class Sequen...
from torch import nn import torch import numpy as np # from layers import Linear, GRUCell, Embedding from utils import cov_diag def vec_translate(a, Dict): return np.vectorize(Dict.__getitem__)(a) class MasterModel(nn.Module): def __init__(self, keys, mask_ops, n=32): super().__init__() s...
import os, glob import numpy as np import subprocess import ete3 from Bio import Entrez from time import sleep from Bio.Align.Applications import ClustalwCommandline from Bio.Phylo.Applications import RaxmlCommandline from Bio.Align import MultipleSeqAlignment as MSA import Bio.Blast.NCBIXML as BlastXML import Bio.Bla...
#!/usr/bin/env python3 # vim: set expandtab shiftwidth=4: # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # # Copyright © 2017 Red Hat, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal ...
import typing import enum import io import collections import click import json from dataclasses import dataclass from typing import List, Dict, TypeVar, Union, Generic, Optional from ontobio.validation import metadata from ontobio.io import assocparser from ontobio.io import gafparser from ontobio.io import assocwri...
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# Copyright 2021 Northern.tech AS # # 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 ag...
#!/usr/bin/env python3 import csv import logging import subprocess import os import sys from github import Github from s3_helper import S3Helper from get_robot_token import get_best_robot_token from pr_info import PRInfo, get_event from build_download_helper import download_all_deb_packages from upload_result_helper...
# postgresql/hstore.py # Copyright (C) 2005-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import re from .array import ARRAY from ... import types as sqltypes from ... ...
import collections from xml.sax.saxutils import escape from census.helpers import domain_from_url, is_chaff_domain, is_known from census.html_writer import HtmlOutlineWriter from census.report_helpers import get_known_domains, hash_sites_together, sort_sites CSS = """\ html { font-family: sans-serif; ...
import os import subprocess from datetime import datetime from pathlib import Path from .trops import Trops from .utils import absolute_path class TropsCapCmd(Trops): """Trops Capture Command class""" def __init__(self, args, other_args): super().__init__(args, other_args) # Start setting ...
import abc import logging import numpy as np from sklearn import svm as sklearn_svm from sklearn import calibration as sklearn_clb import pickle from joblib import Parallel, delayed logger = logging.getLogger(__name__) PRIMITIVE_TYPES = ['exsvms'] class IPrimitiveCollection(metaclass=abc.ABCMeta): def __init__(...
""" IRMAS Loader .. admonition:: Dataset Info :class: dropdown IRMAS: a dataset for instrument recognition in musical audio signals This dataset includes musical audio excerpts with annotations of the predominant instrument(s) present. It was used for the evaluation in the following article: .. ...
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
import socket import threading import socketserver import pdb def recvuntil(s, marker, szlimit): data = b"" while True: d = s.recv(1) if d == "": raise Exception("disconnected") data += d if marker in data: return data if len(data) > szlimit: raise Exception("too much data")...
# 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. """ Helpers that make development with ``structlog`` more pleasant. See also the narrative documentation in `development`. """ import sy...
"""A variant of the versioned_rows example built around the concept of a "vertical table" structure, like those illustrated in :ref:`examples_vertical_tables` examples. Here we store a dictionary of key/value pairs, storing the k/v's in a "vertical" fashion where each key gets a row. The value is split out into two se...
"""MySensors platform that offers a Climate (MySensors-HVAC) component.""" from __future__ import annotations from typing import Any from homeassistant.components import mysensors from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( ATTR_TARGET_TEMP_HIGH,...
""" Copyright (c) 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved. This file contains the mechanisms to do logging from within the test infrastructure. todo: this is the 1st shot. More stories are stacked up to add readmes, examples, et al. """ from logging import Logger, setLoggerClass, _levelNames, add...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # PROGRAMMER: <NAME>. # DATE CREATED: 28 May 2020 # REVISED DATE: 31 May 2020 # PURPOSE: Train, validate and test a deep neural network to classify flower images # using different pretrained CNN models, save the checkpoint to...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
""" Remote controlling of nodes: copying files, executing commands Copyright (c) 2010-2012 <NAME> See LICENSE for details. """ from __future__ import with_statement from io import BytesIO import errno import logging import os import select import shutil import subprocess import sys import tarfile import time from ....
from uuid import uuid4 from cqlengine.query import QueryException, ModelQuerySet, DMLQuery from cqlengine.tests.base import BaseCassEngTestCase from cqlengine.exceptions import ModelException, CQLEngineException from cqlengine.models import Model, ModelDefinitionException, ColumnQueryEvaluator from cqlengine import co...
""" Logic to support exporting figures drawn on canvases to SVG. """ import math TOP_LEVEL_SVG_TEMPLATE = """ <svg viewBox="0 0 {width} {height}" xmlns="http://www.w3.org/2000/svg"> <g transform="scale({x_scale} {y_scale}) translate({x_translate} {y_translate})">{draw_operations}</g> </svg> """ VERBOSE = False cl...
#!/bin/env python import torch as t; import torchvision as tv; import torch.nn as nn; from torch.optim import Adam; from torch.utils.data import DataLoader; BATCH_SIZE = 32; mnist = DataLoader( tv.datasets.MNIST( root='./dataset/', train = True, # download = True, transform = tv.transforms.Compose([ ...
# global import ivy import numpy as np import ivy.numpy as ivy_np try: import tensorflow as tf except ImportError: pass # local import ivy_vision_tests.helpers as helpers from ivy_vision import two_view_geometry as ivy_tvg from ivy_vision_tests.data import TestData class TwoViewGeometryTestData(TestData): ...
# Copyright 2019 The TensorFlow 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 applica...
"""Translation string lookup helpers.""" import asyncio from collections import ChainMap import logging from typing import Any, Dict, List, Optional, Set from homeassistant.core import callback from homeassistant.loader import ( Integration, async_get_config_flows, async_get_integration, bind_hass, ) f...
"""Tracks the latency of a host by sending ICMP echo requests (ping).""" from __future__ import annotations import asyncio from contextlib import suppress from datetime import timedelta import logging import re import sys from typing import Any from icmplib import NameLookupError, async_ping import voluptuous as vol ...
#!/usr/bin/env python # Dependency Generator for C/C++ and Fortran # # Language: Python (2.7 or 3.x) # # Version: 1.0.0 # # Copyright (c) 2000-2018 Objexx Engineering, Inc. All Rights Reserved. # Notes: # . Dependency files for use with GNU make # . Only processes files with supported source C/C++ extensions # . Leav...
#!/usr/bin/env python3 # 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. r""" Utility functions for constrained optimization. """ from __future__ import annotations from functools import par...
import re import sys from collections import defaultdict from dataclasses import dataclass from pathlib import Path from subprocess import check_call, SubprocessError from typing import Optional, List from jinja2 import Environment @dataclass(frozen=True) class GoType: type: str import_path: str = '' sug...
import time import os import cv2 import argparse import numpy as np from scipy import signal from math import ceil, floor import matplotlib.pyplot as plt from matplotlib.colors import LogNorm def align_images(input_img_1, input_img_2, pts_img_1, pts_img_2, save_images=False): # Load images ...
"""Typing information for Ecole. Ecole flexibility relies on `structural subtyping <https://mypy.readthedocs.io/en/stable/protocols.html>`_ and therefore requires to explicit the structures at hand. """ from typing import TypeVar, Tuple, Dict, Iterator, Any, overload, Protocol import ecole Action = TypeVar("Action...
""" Script to preprocess the dataset: * Creates comma-separated CSV file * Converts images to GGB (grayscale) * Creates subsets for training and validation * Adds columns to indicate training or validation (useful for analysis of the deployed model) * Creates zip archive """ import pandas as pd import numpy as np impo...
# Copyright 2017 The TensorFlow 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 ...
import json import os import re from collections import OrderedDict from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseBadRequest from django.shortcuts import get_object_or_404, render from django.utils import timezone from django.views.generic import TemplateView, View from...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 <NAME> for the Wikimedia Foundation # # 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/li...
import random import torch from torch.utils.data import Dataset, DataLoader from torch.utils.data.sampler import Sampler from dataset.texts import phonemes_to_sequence import numpy as np from dataset.texts import text_to_sequence from utils.util import pad_list, str_to_int_list, remove_outlier def get_tts_dataset(pat...
"""ShutIt module. See http://shutit.tk """ from shutit_module import ShutItModule class docker_selinux(ShutItModule): def build(self, shutit): # Some useful API calls for reference see shutit's docs for more info and options: # shutit.send(send) - send a command # shutit.multisend(send,send_dict) - send a co...
import copy import importlib import json import logging import os from trellio.services import TCPService, HTTPService from ..utils.log_handlers import BufferingSMTPHandler logger = logging.getLogger(__name__) GLOBAL_CONFIG = { "RONIN": False, "HOST_NAME": "", "ADMIN_EMAILS": [], "SERVICE_NAME": "", ...
#!/usr/bin/env python2.7 # Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT) # Bespoke Link to Instruments and Small Satellites (BLISS) # # Copyright 2015, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. Any # commercial use m...
import sys sys.path.append('../../') from collections import Counter from sklearn.linear_model import LinearRegression import os import numpy as np from numpy.random import seed seed(1) from tensorflow import set_random_seed set_random_seed(2) from nfp.preprocessing import MolPreprocessor, GraphSequence import gzip ...
# CUDA_VISIBLE_DEVICES=0 python exps-tf/GDAS.py import os, sys, time, random, argparse import tensorflow as tf from pathlib import Path lib_dir = (Path(__file__).parent / '..' / 'lib').resolve() if str(lib_dir) not in sys.path: sys.path.insert(0, str(lib_dir)) # self-lib from tf_models import get_cell_based_tiny_net ...
from functools import partial from wtforms import BooleanField, validators, HiddenField, widgets, StringField, DateField, TextAreaField from wtforms import SelectField as SelectFieldW from wtforms.ext.sqlalchemy.fields import QuerySelectField from wtforms_alchemy import ModelFieldList from dexter.forms import ModelFo...
from data.data_iterator import DataIterator from data.dataset import CWSDataset import torch from torch.nn import functional as F from transformers import BertTokenizer import numpy as np import time import math import sys def safe_exp(value): """Exponentiation with catching of overflow error.""" try: ...
import argparse import os import random import sys import albumentations as A import cv2 import numpy as np import segmentation_models_pytorch as smp import torch import torchvision from albumentations.pytorch import ToTensorV2 from torch import optim from torch.utils.data import DataLoader from torch.utils.tensorboar...
''' Script: aggMaxFit.py For each run, grab the maximum fitness organism at end of run. ''' import argparse, os, copy, errno, csv, re, sys import json csv.field_size_limit(sys.maxsize) run_dir_identifier = "SEED_" # all legit run directories will have this substring in their name config_exclude = { "STOP_ON_SO...
"""Pyro-specific conversion code.""" import logging import numpy as np from packaging import version import xarray as xr from .inference_data import InferenceData from .base import requires, dict_to_dataset, generate_dims_coords, make_attrs from .. import utils _log = logging.getLogger(__name__) class PyroConverter...
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Most of this work is copyright (C) 2013-2021 <NAME> # (<EMAIL>), but it contains contributions by others. See # CONTRIBUTING.rst for a full list of people who may hold copyright, and # consult the git log if yo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Estimate image statistics (2D or 3D). Combination of ct_segnet.stats and ct_segnet.measurements. 1. signal-to-noise ratio (SNR) for binarizable datasets. 2. accuracy metrics for segmentation maps. """ import numpy as np from multiprocessing import cpu_c...
''' Mimo_RL_simple an an OpenAI gym environment Globecom Tutorial - December 7, 2021 Tutorial 29: Machine Learning for MIMO Systems with Large Arrays <NAME> (NCSU), <NAME> (UFPA) and <NAME>. (NCSU) ''' import numpy as np from numpy.random import randint import itertools import gym from gym import spaces from beamformin...
import json import sys import time import wtforms from eth_utils import decode_hex from tornado.escape import json_decode from tornado.web import Application, url from wtforms_tornado import Form from raiden_installer import log from raiden_installer.base import RaidenConfigurationFile from raiden_installer.constants...
import numpy as np from keras.layers import Input from models.graphs import * from models.deep_model import DeepModel from dataset import pad_sequences from constants import PARAMS class PairwiseModel(DeepModel, CharLSTM, ContextualLSTM): def __init__(self, model_name, embeddings, num_chars, batch_size, early_st...
#! /usr/bin/python # -*- coding: utf-8 -*- import time import numpy as np import tensorflow as tf import tensorlayer as tl from tensorlayer.layers import * tf.logging.set_verbosity(tf.logging.DEBUG) tl.logging.set_verbosity(tl.logging.DEBUG) sess = tf.InteractiveSession() X_train, y_train, X_test, y_test = tl.files...
#//////////////////////////////////////////////////////////////////////////////////// #// Authors: <NAME> and <NAME> #// (Ph.D. advisor: <NAME>), #// Many subsequent changes for open-sourcing were made by <NAME> #// (Ph.D. advisor: <NAME>) #// #// BSD 3-Clause License #// #// Copyright (c) 20...
import pandas as pd from pathlib import Path, PosixPath import pickle import dill import os from typing import Type, Any import yaml class DataInterfaceBase: """ Govern how a data type is saved and loaded. This class is a base class for all DataInterfaces. """ file_extension = None @classmethod ...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import sys if not (sys.version_info.major == 3 and sys.version_info.minor > 5): print("Python version %s.%s not supported version 3.6 or above required - exiting" % (sys.version_info.major,sys.version_info.minor)) sys.exit(1) import os import time import shutil fo...
# -*- coding: utf-8 -*- """ Created on Mon Mar 23 11:56:05 2020 @author: <NAME> """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy import optimize import requests import io import datetime import csv import urllib if True: url = 'https://raw.githubusercontent.com/datasets/covid-19...
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, t...
#!/usr/bin/env python3 # Copyright (c) 2018 <NAME>, for HAW Hamburg <<EMAIL>> # # This file is subject to the terms and conditions of the MIT License. See the # file LICENSE in the top level directory for more details. # SPDX-License-Identifier: MIT """This module generates output files based on memory maps.""" imp...
import matplotlib matplotlib.use('PS') import matplotlib.pyplot as plt import pickle from keras.layers import Conv2D, BatchNormalization, Input, concatenate, ZeroPadding2D # from keras.layers import Dense, Activation, Lambda, Conv2D, MaxPool2D, Flatten, BatchNormalization, Input, concatenate from keras.layers.advanced...
import os from django.utils import timezone from reportlab.graphics import renderPDF from reportlab.graphics.barcode import qr from reportlab.graphics.shapes import Drawing from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib.units import cm, mm from reportlab....
import face_recognition from .models import Attendance, AttendanceReport, Batch, Instructor, Notification,Students,Mark,MarkReport from django.shortcuts import redirect, render,HttpResponseRedirect, HttpResponse from django.contrib import messages from django.urls import reverse import os import cv2 import numpy as n...
# Copyright 2016 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 or agreed to in writing, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import os import time import base64 import requests class RepoNotFoundError(Exception): """Custom exception when repo is missing.""" pass class CommitNotFoundError(Exception): """Custom exception when commit is missing.""" p...
from django import forms from django.utils.translation import pgettext_lazy from ...account.i18n import COUNTRY_CHOICES from ...core.weight import WeightField from ...shipping import ShippingMethodType from ...shipping.models import ShippingMethod, ShippingZone from ...site.models import SiteSettings def currently_u...
import xml.etree.ElementTree as ElementTree import requests from castero.config import Config from castero.episode import Episode from castero.net import Net class FeedError(Exception): """An ambiguous error while handling the feed. """ class FeedLoadError(FeedError): """A feed could not be found at t...
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
""" This module contains the core `.Task` class & convenience decorators used to generate new tasks. """ from copy import deepcopy import inspect import types try: from .vendor import six except ImportError: import six from .context import Context from .parser import Argument, translate_underscores if six.P...
import cv2 import os import datetime import numpy as np from modules.clstm import Conv import pickle import torch from torchvision import transforms, utils import torch.backends.cudnn as cudnn from torch import nn from torch.utils import data from torch.autograd import Variable from data_loader import DHF1K_frames dty...
#!/usr/bin/env python # # Author: <NAME> (mmckerns @caltech and @uqfoundation) # Copyright (c) 2008-2016 California Institute of Technology. # Copyright (c) 2016-2017 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/proj...
# -*- coding: utf-8 -*- from sys import platform as sys_platform import os.path import re from shutil import copyfile import subprocess from CPPGeneratorBase import CPPGeneratorBase, ensure_exists_dir, unsupported_key import datetime internal_json_writer_map = dict({ "int": "Int", "short": "Int", "enum": "...