text
stringlengths
2
999k
import requests import json import logging from .api_client import APIClient from ..exceptions.UnauthorizedException import UnauthorizedException from requests_toolbelt.multipart.encoder import MultipartEncoder # child class of APIClient --> Extends error handling functionality # MessageClient class contains a series...
import torch import torch.nn as nn from typing import Union, Sequence from .backbone import MLP class QNet(nn.Module): """ A simple network for DQN and its variants. Parameters ---------- state_dim : int Dimension of state space action_dim : int Dimension of action space ...
from django.test import TestCase from ..core import CalculatedExtractionProduct class TestCalculatedExtractionProduct(TestCase): def test_should_create_list(self): # given ores = {"1": 100, "2": 200} # keys are string because they come from JSON # when lst = CalculatedExtractionP...
import json import sys import uuid import dcoscli import docopt import rollbar import six from concurrent.futures import ThreadPoolExecutor from dcos import http, mesos, util from dcoscli.constants import (ROLLBAR_SERVER_POST_KEY, SEGMENT_IO_CLI_ERROR_EVENT, ...
# Generated by Django 3.2.8 on 2021-11-05 15:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sentirsebien', '0014_retroalimentacion'), ] operations = [ migrations.RenameField( model_name='retroalimentacion', o...
import scadnano as sc import modifications as mod def create_design(): # helices helices = [sc.Helix(max_offset=48), sc.Helix(max_offset=48)] # left staple stap_left_ss1 = sc.Domain(helix=1, forward=True, start=8, end=24) stap_left_ss0 = sc.Domain(helix=0, forward=False, start=8, end=24) stap...
import sys import argparse import matplotlib.pyplot as plt import seaborn as sns import numpy as np import torch from torch.autograd import Variable from dataset.dataset import * from utility.utils import * from model_History import * from domains.gridworld_LP import * from generators.obstacle_gen import * def m...
# ********************************************************************************* # REopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions a...
import random def scramble(input_file="autoAnnotated.jsonl"): """ This function scrambles the lines in a text document (Can be removed since doccano already has a scrambler, if doccano is run from a common server) """ with open(input_file, encoding='utf-8') as file: lines = file.readli...
""" Base class for FFC unit tests. """ from functools import wraps from unittest import TestCase from numpy import arange, prod from numpy.random import randn, seed as random_seed from pandas import date_range, Int64Index, DataFrame from six import iteritems from zipline.finance.trading import TradingEnvironment from...
#!/usr/bin/env python """Tests for the Rekall profile server.""" import urllib2 import zlib from rekall import constants from grr.lib import aff4 from grr.lib import config_lib from grr.lib import flags from grr.lib import rdfvalue from grr.lib import rekall_profile_server from grr.lib import test_lib from grr.lib ...
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name="dispersion", # Replace with your own username version="0.1.0-beta.5", author="Phillip Manley", author_email="phillip.manley@helmholtz-berlin.de", description="support for li...
n = float(input('quanto de dinheiro tem a sua carteira ?:')) d = n / 3.27 print('com R${} vc pode compra US${:.2f}'.format(n, d))
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-2020 Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free...
import random import time # Binary Search algorithm def naive_search(l, target): # example l = (,. 3. 10. 12) for i in range(len(l)): if l[i] == target: return i return -1 def binary_search(l, target, low=None, high=None): if low is None: low = 0 if high...
""" Dummy conftest.py for tdde13. If you don't know what this is for, just leave it empty. Read more about conftest.py under: - https://docs.pytest.org/en/stable/fixture.html - https://docs.pytest.org/en/stable/writing_plugins.html """ # import pytest
#!/usr/bin/env python # encoding: UTF-8 """ 网易云音乐 Api https://github.com/bluetomlee/NetEase-MusicBox The MIT License (MIT) CopyRight (c) 2014 vellow <i@vellow.net> modified by """ import json import requests from PyQt5.QtCore import pyqtSignal, QObject from constants import DATA_PATH from base.common import singlet...
import doctest import pytest from insights.parsers import engine_db_query, ParseException, SkipException from insights.tests import context_wrap OUTPUT = """ { "id_host": "None", "when": "2020-06-21 12:45:59", "time": "0.00263094902039", "name": "None", "description": "None", "type": "None", "kb": "None...
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Anima Istanbul # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause """Fix Bound Joint v0.1.0 Description ----------- Fixes bound joints to the correct worldOrientation in connected skinClu...
# -*- coding: utf-8 -*- import xlrd from collections import OrderedDict import simplejson as json import sys import traceback import os import pwd import grp import shutil dbginfo = 1 dbgdetail = 2 dbg = os.environ.get("DBG") confdir=os.environ.get("CONFDIR") gitrepodir=os.environ.get("GITREPODIR") homedir=os.enviro...
from tests.pages.components.page import Page from tests.parameters.locators import locator class YnetHomePage(Page): def c3_Hor(self): return self.find_all(locator.c3_Hor) def evritiframe_1(self): return self.find_all(locator.evritiframe_1) def multiarticles_15(self): return self...
import pandas as pd import csv import math import datetime as dt import os import sys import csv import statistics import matplotlib.pyplot as plt from sko.GA import GA def selecting_buildings_EP(path_test): editable_data_path =os.path.join(path_test, 'editable_values.csv') editable_data = pd.read...
""" Temporal NDL For reference see Temporal Planning with Clock-Based SMT Encodings Jussi Rintanen Proceedings of the 26th Int'l Joint Conference on Artificial Intelligence (IJCAI) 2017 """ from ..syntax import Atom, CompoundTerm, CompoundFormula, Constant, symref, Connective, Tautology from ....
import logging from mayan.apps.documents.models.document_models import Document from mayan.apps.documents.permissions import ( permission_document_create, permission_document_new_version ) from mayan.apps.documents.tests.base import DocumentTestMixin from mayan.apps.documents.tests.literals import TEST_SMALL_DOCUM...
from __future__ import absolute_import from ...ags._geoprocessing import * from ...common.geometry import Polygon, Polyline, Point, SpatialReference, Envelope from ..._abstract import abstract ######################################################################## class hydrology(abstract.BaseAGOLClass): """ ...
#! /usr/bin/env python # -*- coding: utf-8 -*- import DateParser ''' TESTE DIAS DA SEMANA ''' def test_day_of_week_domingo(): date = DateParser.DateParser() date.convert("22/02/2015") assert date.dayOfWeek() == "Domingo" def test_day_of_week_terca(): date = DateParser.DateParser() date.convert("25/11/2014") ...
"""project bootstrap for various frameworks and languages """ __author__ = "Gaurav Verma" __email__ = "diszgaurav@gmail.com" #---------------------------------------------------------------------- import os import logging import shutil import re import fileinput import time #-----------------------------------------...
from functools import lru_cache, partial from pathlib import Path from typing import Tuple, Union from matplotlib.axes._subplots import Axes import pandas as pd import pyproj from shapely.geometry import Point, base from shapely.ops import transform class DataFrameMixin(object): """DataFrameMixin aggregates a ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import functools from contextlib import contextmanager from inspect import isfunction from typing import Callable, Optional, Union from zhtools import ignore_exception from zhtools.exceptions import ModuleRequired _redis_pool = None _redis_client = None def init(redis_client=None, redis_pool=None): global _redi...
class Solution(object): def XXX(self, n): """ :type n: int :rtype: List[str] """ #已放入的左括号数目至少要大于等于右括号 #二叉树,一个字典存入每层树节点,另一个字典存入相对应每个节点的左括号个数 #剪枝 r_map = {1:['(']} count_map = {1:[1]} #左括号个数字典 layers = 2*n for i in ra...
# 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 a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np from Text_A_yolo_model_file.common_yolo.text_proposal_graph_builder import TextProposalGraphBuilder class TextProposalConnector: def __init__(self, MAX_HORIZONTAL_GAP=30, MIN_V_OVERLAPS=0.6, MIN_SIZE_SIM=0.6): self.graph_builder = TextProp...
import logging from pathlib import Path from typing import Dict, List from overhave.entities.feature.abstract import IFeatureExtractor from overhave.entities.feature.errors import FeatureTypeExtractionError, ScenariosTestFileNotFound from overhave.entities.feature.types import FeatureTypeName from overhave.entities.se...
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
# Copyright 2021-2022 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 # """ Pytest shell utilities plugin. """ import pytest from pytestshellutils.shell import Subprocess @pytest.fixture # type: ignore[misc] def shell() -> Subprocess: """ Shell fixture. """ return Subprocess()
import os from pathlib import Path import time from anuvaad_auditor.errorhandler import post_error from anuvaad_auditor.errorhandler import post_error_wf import config class FileOperation(object): def __init__(self): self.download_folder = None # creating directory if it is not existed before. de...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
"""Conversations API Version 1.0. This API client was generated using a template. Make sure this code is valid before using it. """ import logging from datetime import date, datetime from .base import BaseCanvasAPI from .base import BaseModel class ConversationsAPI(BaseCanvasAPI): """Conversations API Version 1....
#!/usr/bin/env python """ Project1 is Steve's example project for the blog. It contains sample code here and there. """
# -*- coding: utf-8 -*- # Copyright 2018, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """Schemas test.""" import json import logging import os from marshmallow import ValidationError from qiskit.qobj._schema_...
#!/usr/bin/env python '''@package docstring Just a giant list of processes and properties ''' processes = { # inclusive NLO V+jets 'DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8':('ZJets_nlo','MC',6025.2), 'DYJetsToNuNu_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8':('ZtoNuNu_nlo','MC',1...
"""Livestreamer extracts streams from various services. The main compontent of Livestreamer is a CLI program that launches streams the streams in a video player. An API is also provided that allows direct access to stream data. Full documentation is available at http://livestreamer.tanuki.se/. """ __title__ = "li...
# # Copyright (c) 2021 Project CHIP 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 # # ...
from src.config import config from src.model import param_universe_dao from src.model.EventEnumerator import EventEnumerator from src.model.LogUniverseGenerator import * class PartitionedUniverseIndexer(object): def __init__(self, scoring_param_info_id): self.scoring_param_info_id = scoring_param_info_id ...
import requests import os from pathlib import Path URL = '' p = Path('~/fotoparadies_api_endpoint.txt').expanduser() if p.exists(): with p.open() as f: URL = f.readline() if 'FOTOPARADIES_API_URL' in os.environ: URL = os.environ['FOTOPARADIES_API_URL'] def get_order_info(shop, order): p = {'con...
""" requested_toppings = [] if requested_toppings: for requested_topping in requested_toppings: print("Adding " + requested_topping + ".") print("\nFinished making your pizza!") else: print("Are you sure you want a plain pizza?") """ available_toppings = ['mushrooms', 'olives', 'green peppers', ...
class Solution(object): def longestIncreasingPath(self, matrix): """ :type matrix: List[List[int]] :rtype: int """
#!/usr/bin/env python3 # coding: utf-8 import gettext import hashlib import os import re import shutil import sys from functools import lru_cache from pathlib import Path from urllib.parse import unquote import click from loguru import logger import requests from .config import HOME, GetConfig, SetConfig _ = gettex...
""" Django settings for app project. Generated by 'django-admin startproject' using Django 3.0.5. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # Bui...
from collections import defaultdict from scrapy import log from scrapy.exceptions import NotConfigured from scrapy.utils.misc import load_object from scrapy.utils.defer import process_parallel, process_chain, process_chain_both class MiddlewareManager(object): """Base class for implementing middleware managers"""...
# Copyright 2015 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...
import numpy as np from multiagent.core import World, Agent, Landmark, Border from multiagent.scenario import BaseScenario class Scenario(BaseScenario): def make_world(self): world = World() # set any world properties first world.dim_c = 2 num_agents = 10 num_landmarks = 10...
from datetime import datetime import json import logging from kubernetes import client, config from kubernetes.client import api_client # Configs can be set in Configuration class directly or using helper utility from rules import * def main(): aConfiguration = config.load_kube_config() aAp...
import os import dlib import numpy as np from deepface.confs.conf import DeepFaceConfs from deepface.utils.bbox import BoundingBox from .detector_base import FaceDetector class FaceDetectorDlib(FaceDetector): """ reference : https://www.pyimagesearch.com/2017/04/03/facial-landmarks-dlib-opencv-python/ ...
# Generated by Django 3.2.3 on 2021-05-30 00:22 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0003_alter_student_phone_number'), ] operations = [ migrations.AlterField( model_name='stu...
import re from pathlib import Path from nameparser import HumanName from clldutils.misc import slug from pylexibank.providers import abvd from pylexibank.util import progressbar from pylexibank import FormSpec def normalize_contributors(l): for key in ['checkedby', 'typedby']: l[key] = normalize_names(l[...
from ..web import Links from ..web.html import unescape from . import Public, Secure from . import WebEntity from . import Post from . import Image __all__ = ['Thread'] class Thread (WebEntity): """ Represents a thread. """ default_object = {'posts':[]} def __init__ (self, board, thread): ...
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
from math import sin, radians, cos, tan ang = float(input('Digite o valor: ')) sen = sin(radians(ang)) cose = cos(radians(ang)) tang = tan(radians(ang)) print('No angulo de {}, O Seno é {:.2f}, Cosseno é {:.2f} e a Targente é {:.2f}'.format(ang, sen, cose, tang,))
import functools import logging from pip._vendor import six from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.resolvelib import BaseReporter, ResolutionImpossible from pip._vendor.resolvelib import Resolver as RLResolver from pip._internal.exceptions import InstallationError from pip._interna...
class AbsAlgorithm(object): def output(self): pass
"""Top-level package for brawl_stars_agent.""" __author__ = """Research 2 use""" __email__ = 'research2use@hotmail.com' __version__ = '0.1.0'
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt """ record of files naming for same name files: file.gif, file-1.gif, file-2.gif etc """ from __future__ import unicode_literals import base64 import hashlib import imghdr import io import json import mimetypes impor...
"Provides basic training and validation with `Learner`" from .torch_core import * from .basic_data import * from .callback import * from .data_block import * from .utils.ipython import gpu_mem_restore import inspect from fastprogress.fastprogress import format_time from time import time __all__ = ['Learner', 'LearnerC...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-15 14:20 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('logger', '0005_requestlogger_modified'), ] operations = [ migrations.Create...
"""This module provides an utility function to retrieve the global hook_manager singleton in a Kedro's execution process. """ # pylint: disable=global-statement,invalid-name import logging from typing import Any, Iterable from pluggy import PluginManager from .markers import HOOK_NAMESPACE from .specs import ( Da...
M, P, N = [int(x) for x in input().split()] s = [int(x) for x in input().split()] + [P] now = 0 pos = 0 step = 0 if M >= P: print('0') exit() for x in s: if x <= M: pos = x else: break while pos < P: if s[now] < pos: now += 1 else: step += 1 pos = s[now] +...
from jobtech.common import *
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads/v6/services/ad_group_simulation_service.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf...
import numpy as np from argparse import ArgumentParser from cufacesearch.imgio.imgio import get_buffer_from_URL from cufacesearch.featurizer.sbtf_img_featurizer import SentiBankTensorflowImgFeaturizer from cufacesearch.featurizer.featsio import featB64decode from cufacesearch.indexer.hbase_indexer_minimal import HBaseI...
#!/usr/bin/env python """OSX specific actions. Most of these actions share an interface (in/out rdfvalues) with linux actions of the same name. OSX-only actions are registered with the server via libs/server_stubs.py """ from __future__ import absolute_import from __future__ import division from __future__ import unic...
# nxpy_svn -------------------------------------------------------------------- # Copyright Nicola Musatti 2018 - 2019 # Use, modification, and distribution are subject to the Boost Software # License, Version 1.0. (See accompanying file LICENSE.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # See https://git...
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """ Common data processing utilities that are used in a typical object detection data pipeline. """ import logging import numpy as np import pycocotools.mask as mask_util import torch from fvcore.common.file_io import PathMa...
#MenuTitle: Insert Brace Layers for Movement along Background Path # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Add a single path in the background and it will be used to create intermediate brace layers for OTVar animation. """ from Foundation import NSPoint, N...
from policy.models import DcPolicy, DcPolicyHistory from rest_framework import serializers class DcPolicyStateHistorySerializer(serializers.ModelSerializer): created_at = serializers.DateTimeField(format="%d %B, %Y %H:%M:%S") class Meta: model = DcPolicyHistory fields = ('state','created_at')...
''' Inference code for VisTR Modified from DETR (https://github.com/facebookresearch/detr) ''' import argparse import datetime import json import random import time from pathlib import Path import numpy as np import torch from torch.utils.data import DataLoader, DistributedSampler import datasets import util.misc as ...
from collections import OrderedDict from unittest import TestCase from pyjsonnlp import validation from flairjsonnlp import FlairPipeline from . import mocks import pytest text = "Autonomous cars from the countryside of France shift insurance liability toward manufacturers. People are afraid that they will crash." ...
""" `digitalio` ======================================================== Copyright 2020 Alorium Technology. All rights reserved. Contact: info@aloriumtech.com Description: This file is part of the Alorium Technology CiricuitPython Library Bundle and provides a custom CircuitPython digitialio library for Evo M51. ""...
import os, traceback, atexit, logging import iglesia from iglesia.utils import message, warning, error # these are set up in init ROOTDIR = None # SERVER_BASEDIR is set up in iglesia (as e.g. /home/user/path) SHADOW_URL_PREFIX = None # URL prefix for HTTP server serving shadow tree (e.g. http://localhost:port/{S...
import cnode Service = cnode.cleinit() #define input point class WhenAnyPointClass = Service.CNodePointBase('WhenAnyPointClass') @WhenAnyPointClass._RegScriptProc_P('OnExecute') def OnExecute(self,CNodeSet,CNode) : node_active_flag = self.GetSourceActiveFlag() for flag in node_active_flag : if flag == True : ...
#! /usr/bin/env python '''test_mandelbrot_2 Test the Numba compiler on several variants of Mandelbrot set membership computations. ''' from numba import * import unittest import numpy as np from numba.testing import test_support def mandel_1(real_coord, imag_coord, max_iters): '''Given a the real and imaginary p...
import os class Config(object): SECRET_KEY = os.environ['SECRET_KEY'] DEBUG = os.environ['DEBUG'] MONGODB_HOST = os.environ['MONGODB_HOST'] MONGODB_PORT = int(os.environ['MONGODB_PORT']) MONGODB_DB = os.environ['MONGODB_DATABASE'] MONGODB_USERNAME = os.environ['MONGODB_USER'] MONGODB_PASS...
"""HTTP/1.1 client library <intro stuff goes here> <other stuff, too> HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram details these state transitions: (null) | | HTTPConnection()...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# coding=utf-8 # Copyright 2018 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# Copyright 2008-2018 Univa Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
import numpy as np import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func from flask import Flask, jsonify import datetime as dt from dateutil.relativedelta import relativedelta ##############################################...
# Задача 6. Вариант 23 #1-50. Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее количество попыток. # Сароквашин Максим # 13.05.2016 import random print("Компьютер загадал название одного из семи дней недели, а Вы должны его угадать.\n"...
# Copyright 2012 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/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import typing import logging import operator import pyfastaq from cluster_vcf_records import vcf_file_read, vcf_record_cluster class VcfClusterer: """Class to cluster one (or more) VCF files. Records in the VCf files can be in any order. Required parameters: vcf_files: list of VCF files ...
import matplotlib.pyplot as plt import numpy as np from time import time import pandas as pd from scipy.stats import norm # Underlying informations S0 = 100.0 sigma = 0.2 # European option informations T = 1.0 K = 100.0 r = 0.05 # Simulation parameters nbr_steps = 100 dt = T/nbr_steps t = np.linspa...
def resolve_tasks(taskset, manifest): import tasks taskset.add(tasks.EnableInsecureAccess)
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
import torch import torch.nn as nn import torch.nn.functional as F class Generator(nn.Module): r"""Generator class Args: model_dim(int): dimension of the model vocab(int): vocab size """ def __init__(self, model_dim, vocab): super(Generator, self).__init__() self.dense ...
from algo.mappo.elements.loss import create_loss
# # Copyright 2013-2021 [The Foundry Visionmongers 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 a...
from bs4 import BeautifulSoup import time from getpass import getpass import colorama from colorama import Fore import subprocess import os import sys from datetime import datetime import re import urllib import webbrowser from getpass import getpass import requests from pync import Notifier f = open('SourceCode/UserA...
import os from dataclasses import dataclass from typing import List, Optional @dataclass class Sample: annotation_label_name: Optional[str] prediction_label_name: Optional[str] prediction_label_confidence: Optional[float] sample_file: str @dataclass class Function: name: Optional[str] modali...
import os import pickle import numpy as np from tensorflow import keras class MyPredictor(object): """An example Predictor for an AI Platform custom prediction routine.""" def __init__(self, model, embedder): """Stores artifacts for prediction. Only initialized via `from_path`. """ s...