edited_code
stringlengths
17
978k
original_code
stringlengths
17
978k
import getpass import hashlib import math import traceback import aiohttp from discord import (AsyncWebhookAdapter, Embed, File, RawReactionActionEvent, Webhook) from discord.ext import commands as c from module import item, status async def _webhook(all_error, url, ctx): for i in range(len...
import getpass import hashlib import math import traceback import aiohttp from discord import (AsyncWebhookAdapter, Embed, File, RawReactionActionEvent, Webhook) from discord.ext import commands as c from module import item, status async def _webhook(all_error, url, ctx): for i in range(len...
import sys import platform import warnings from pathlib import Path from functools import wraps import matplotlib as mpl import matplotlib.pyplot as plt import pkg_resources import pytest import astropy from astropy.wcs.wcs import FITSFixedWarning import sunpy.map __all__ = ['skip_windows', 'skip_glymur', 'skip_ana...
import sys import platform import warnings from pathlib import Path from functools import wraps import matplotlib as mpl import matplotlib.pyplot as plt import pkg_resources import pytest import astropy from astropy.wcs.wcs import FITSFixedWarning import sunpy.map __all__ = ['skip_windows', 'skip_glymur', 'skip_ana...
import os, re from mutagen.mp3 import EasyMP3 regex_old = re.compile(r"^(?P<title>.*) - (?P<name>.*)-(?P<mess>.{11}).mp3$") regex_new = re.compile(r"^(?P<name>.*) - (?P<title>.*)-(?P<mess>.{11}).mp3$") for filename in os.listdir("."): if '.mp3' in filename: print(f"Old name: {filename}") match_old...
import os, re from mutagen.mp3 import EasyMP3 regex_old = re.compile(r"^(?P<title>.*) - (?P<name>.*)-(?P<mess>.{11}).mp3$") regex_new = re.compile(r"^(?P<name>.*) - (?P<title>.*)-(?P<mess>.{11}).mp3$") for filename in os.listdir("."): if '.mp3' in filename: print(f"Old name: {filename}") match_old...
from __future__ import annotations import collections import math from typing import Any import networkx as nx import pandas as pd ACTOR_LABEL = 'actor' TRANSITION_ACTOR_LABEL = 'transition_actor' SPAWN_LABEL = 'spawn' NODE_TYPE_LABEL = 'node_type' SAVEW_EDGE_LABEL = 'save_warp' DEATHW_EDGE_LABEL = 'death_warp' SONG...
from __future__ import annotations import collections import math from typing import Any import networkx as nx import pandas as pd ACTOR_LABEL = 'actor' TRANSITION_ACTOR_LABEL = 'transition_actor' SPAWN_LABEL = 'spawn' NODE_TYPE_LABEL = 'node_type' SAVEW_EDGE_LABEL = 'save_warp' DEATHW_EDGE_LABEL = 'death_warp' SONG...
#!/usr/bin/env python3 import argparse import os import sys import datetime import time import requests # Initialize some variables: start_date = datetime.datetime(1970, 1, 1).isoformat() def generate_auth_header(token: str): return {'Authorization': 'Bearer ' + token} # Necessary to list all announcements # W...
#!/usr/bin/env python3 import argparse import os import sys import datetime import time import requests # Initialize some variables: start_date = datetime.datetime(1970, 1, 1).isoformat() def generate_auth_header(token: str): return {'Authorization': 'Bearer ' + token} # Necessary to list all announcements # W...
#!/usr/bin/env python3 # # Copyright 2021 Graviti. Licensed under MIT License. # """The segment of remote dataset on TensorBay.""" import os import time from copy import deepcopy from itertools import zip_longest from typing import TYPE_CHECKING, Any, Dict, Generator, Iterable, Optional, Tuple, Union import filetype...
#!/usr/bin/env python3 # # Copyright 2021 Graviti. Licensed under MIT License. # """The segment of remote dataset on TensorBay.""" import os import time from copy import deepcopy from itertools import zip_longest from typing import TYPE_CHECKING, Any, Dict, Generator, Iterable, Optional, Tuple, Union import filetype...
# Copyright 2021 F5 Networks All rights reserved. # # Version 3.14.0 """Creates BIG-IP""" COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/' def Storage(context,storageName): # Build storage container storage = { 'name': storageName, 'type': 'storage.v1.bucket', 'properties': ...
# Copyright 2021 F5 Networks All rights reserved. # # Version 3.14.0 """Creates BIG-IP""" COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/' def Storage(context,storageName): # Build storage container storage = { 'name': storageName, 'type': 'storage.v1.bucket', 'properties': ...
#!/usr/bin/env python3 """Release script for ODL projects""" import re import os from subprocess import CalledProcessError from pkg_resources import parse_version from async_subprocess import ( call, check_call, check_output, ) from constants import ( GIT_RELEASE_NOTES_PATH, SCRIPT_DIR, YARN_P...
#!/usr/bin/env python3 """Release script for ODL projects""" import re import os from subprocess import CalledProcessError from pkg_resources import parse_version from async_subprocess import ( call, check_call, check_output, ) from constants import ( GIT_RELEASE_NOTES_PATH, SCRIPT_DIR, YARN_P...
import os import shutil from pathlib import Path from typing import Any, Dict, List, Optional, Tuple import yaml from chia import __version__ from chia.consensus.coinbase import create_puzzlehash_for_pk from chia.ssl.create_ssl import generate_ca_signed_cert, get_chia_ca_crt_key, make_ca_cert from chia.util.bech32m i...
import os import shutil from pathlib import Path from typing import Any, Dict, List, Optional, Tuple import yaml from chia import __version__ from chia.consensus.coinbase import create_puzzlehash_for_pk from chia.ssl.create_ssl import generate_ca_signed_cert, get_chia_ca_crt_key, make_ca_cert from chia.util.bech32m i...
## ## © Copyright 2021- IBM Inc. All rights reserved # SPDX-License-Identifier: MIT ## import logging from . import rdfxml from . import utils logger = logging.getLogger(__name__) ################################################################################################# class No_Type_System_Mixin(): de...
## ## © Copyright 2021- IBM Inc. All rights reserved # SPDX-License-Identifier: MIT ## import logging from . import rdfxml from . import utils logger = logging.getLogger(__name__) ################################################################################################# class No_Type_System_Mixin(): de...
import argparse from bs4 import BeautifulSoup import multiprocessing as mp from multiprocessing.pool import ThreadPool import os import pandas as pd import pathlib import requests import subprocess from tqdm.auto import tqdm from utils import load_config ''' load config and secrets ''' # config = load_config(path='...
import argparse from bs4 import BeautifulSoup import multiprocessing as mp from multiprocessing.pool import ThreadPool import os import pandas as pd import pathlib import requests import subprocess from tqdm.auto import tqdm from utils import load_config ''' load config and secrets ''' # config = load_config(path='...
from __future__ import annotations import json import typing from typing import Literal, TYPE_CHECKING, Union from lxml import html import pydantic from compass.core.interface_base import InterfaceBase from compass.core.schemas import hierarchy as schema from compass.core.settings import Settings from compass.core.u...
from __future__ import annotations import json import typing from typing import Literal, TYPE_CHECKING, Union from lxml import html import pydantic from compass.core.interface_base import InterfaceBase from compass.core.schemas import hierarchy as schema from compass.core.settings import Settings from compass.core.u...
""" Module containing Notes class """ import logging from ..common.common import SectionHandler # pylint: disable=too-few-public-methods class Notes(SectionHandler): """ Responsible for converting the Notes sections: - /cvrf:cvrfdoc/cvrf:DocumentNotes - /cvrf:cvrfdoc/vuln:Vulnerability[i+1]/vuln:Notes...
""" Module containing Notes class """ import logging from ..common.common import SectionHandler # pylint: disable=too-few-public-methods class Notes(SectionHandler): """ Responsible for converting the Notes sections: - /cvrf:cvrfdoc/cvrf:DocumentNotes - /cvrf:cvrfdoc/vuln:Vulnerability[i+1]/vuln:Notes...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import random import re openings_by_name, openings_by_pgn = {}, {} keys_by_name, keys_by_pgn = [], [] # Give me a new opening def get_random_opening(openings_by_name, keys_by_name): key = random.choice(keys_by_name) return openings_by_name[key] # Tel...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import random import re openings_by_name, openings_by_pgn = {}, {} keys_by_name, keys_by_pgn = [], [] # Give me a new opening def get_random_opening(openings_by_name, keys_by_name): key = random.choice(keys_by_name) return openings_by_name[key] # Tel...
import pandas as pd import os import sys from docx import Document from pathlib import Path from nbdev.showdoc import doc import ipywidgets as widgets import numpy as np from IPython.display import display from ipywidgets import HTML from functools import partial import openpyxl import json import sched, time import th...
import pandas as pd import os import sys from docx import Document from pathlib import Path from nbdev.showdoc import doc import ipywidgets as widgets import numpy as np from IPython.display import display from ipywidgets import HTML from functools import partial import openpyxl import json import sched, time import th...
class Song: song_lyrics=() def __init__(self, title="",author="",lyrics=()): self.__title=title self.__author=author self.__lyrics=lyrics #self.lines=lines print(f"New Song made {self.__title} by artist/group {self.__author}") def set_title(self, new_title): ...
class Song: song_lyrics=() def __init__(self, title="",author="",lyrics=()): self.__title=title self.__author=author self.__lyrics=lyrics #self.lines=lines print(f"New Song made {self.__title} by artist/group {self.__author}") def set_title(self, new_title): ...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # # thanks to the owner of X-tra-Telegram for tts fix # # Recode by @mrismanaziz # FROM Man-Userbot # t.me/SharingUserbot...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # # thanks to the owner of X-tra-Telegram for tts fix # # Recode by @mrismanaziz # FROM Man-Userbot # t.me/SharingUserbot...
import psutil import platform from datetime import datetime class SysInfo(object): def __init__(self): self.units = ["", "K", "M", "G", "T", "P"] self.factor = 1024 self.func_dict = { 'system': self.get_system, 'uptime': self.get_uptime, 'cpu': self.get_cpu_data, 'ram': self.get_ram_data, 'disk':...
import psutil import platform from datetime import datetime class SysInfo(object): def __init__(self): self.units = ["", "K", "M", "G", "T", "P"] self.factor = 1024 self.func_dict = { 'system': self.get_system, 'uptime': self.get_uptime, 'cpu': self.get_cpu_data, 'ram': self.get_ram_data, 'disk':...
import io import json import pathlib import sys import threading as th import time from base64 import b64decode, b64encode from io import open from os import path import serial import serial.tools.list_ports as stl from modi_firmware_updater.util.connection_util import list_modi_ports from modi_firmware_updater.util....
import io import json import pathlib import sys import threading as th import time from base64 import b64decode, b64encode from io import open from os import path import serial import serial.tools.list_ports as stl from modi_firmware_updater.util.connection_util import list_modi_ports from modi_firmware_updater.util....
import os import re from datetime import ( datetime as dt, timedelta ) import requests from requests.auth import HTTPDigestAuth from requests.exceptions import ConnectionError from typing import ( Optional, List, Dict, Union ) import amcrest from loguru import logger from reolink_api import Came...
import os import re from datetime import ( datetime as dt, timedelta ) import requests from requests.auth import HTTPDigestAuth from requests.exceptions import ConnectionError from typing import ( Optional, List, Dict, Union ) import amcrest from loguru import logger from reolink_api import Came...
""" Examines scaffold hypothesis on a particular user. Uses data from the MySQL Database. """ import csv import json import numpy as np import matplotlib.pyplot as plt import igraph PATH = "D:\\network_games\\" SAVE_PATH = "D:\\network_games\\scaffold\\" FILENAME = "scaffold_data_mysql.csv" # Specify the name of the ...
""" Examines scaffold hypothesis on a particular user. Uses data from the MySQL Database. """ import csv import json import numpy as np import matplotlib.pyplot as plt import igraph PATH = "D:\\network_games\\" SAVE_PATH = "D:\\network_games\\scaffold\\" FILENAME = "scaffold_data_mysql.csv" # Specify the name of the ...
"""Config Flow using OAuth2. This module exists of the following parts: - OAuth2 config flow which supports multiple OAuth2 implementations - OAuth2 implementation that works with local provided client ID/secret """ from __future__ import annotations from abc import ABC, ABCMeta, abstractmethod import asyncio impo...
"""Config Flow using OAuth2. This module exists of the following parts: - OAuth2 config flow which supports multiple OAuth2 implementations - OAuth2 implementation that works with local provided client ID/secret """ from __future__ import annotations from abc import ABC, ABCMeta, abstractmethod import asyncio impo...
import builtins import threading import time import traceback from typing import TypeVar, List, Optional, Match from Chainmail import Wrapper from Chainmail.Events import CommandSentEvent, PlayerConnectedEvent, Events from Chainmail.MessageBuilder import MessageBuilder, Colours from Chainmail.Player import Player from...
import builtins import threading import time import traceback from typing import TypeVar, List, Optional, Match from Chainmail import Wrapper from Chainmail.Events import CommandSentEvent, PlayerConnectedEvent, Events from Chainmail.MessageBuilder import MessageBuilder, Colours from Chainmail.Player import Player from...
import argparse import itertools import json import os import re from collections import Counter import pandas as pd from spacy.tokens import Doc import spacy from tqdm import tqdm from pig.data import SPLIT_SPEC DATA_DIR = "data/out/180x100/" REALIGNED_DATA_DIR = "data/out/realign/" DATA_EVAL_DIR = "data/eval/" F...
import argparse import itertools import json import os import re from collections import Counter import pandas as pd from spacy.tokens import Doc import spacy from tqdm import tqdm from pig.data import SPLIT_SPEC DATA_DIR = "data/out/180x100/" REALIGNED_DATA_DIR = "data/out/realign/" DATA_EVAL_DIR = "data/eval/" F...
#!/usr/bin/env python3 ''' # # Duplicator function - receives events from the Ingest function (via SQS) and copies objects into the Cheyenne Vault. # # Project Cheyenne # # @author Damian Bushong <dbushong@uncomn.com> # @copyright (c) 2021 UNCOMN LLC. # @license MIT License # ''' from datetime import datetime, timezon...
#!/usr/bin/env python3 ''' # # Duplicator function - receives events from the Ingest function (via SQS) and copies objects into the Cheyenne Vault. # # Project Cheyenne # # @author Damian Bushong <dbushong@uncomn.com> # @copyright (c) 2021 UNCOMN LLC. # @license MIT License # ''' from datetime import datetime, timezon...
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import abc import copy import os import signal import sys import time import weakref import reframe.core.logging as logging i...
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import abc import copy import os import signal import sys import time import weakref import reframe.core.logging as logging i...
# Copyright (c) 2011-2016 Godefroid Chapelle and ipdb development team # # This file is part of ipdb-extended. # GNU package 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 2 of the License, or ...
# Copyright (c) 2011-2016 Godefroid Chapelle and ipdb development team # # This file is part of ipdb-extended. # GNU package 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 2 of the License, or ...
try: import dask import dask.array from dask.array.utils import meta_from_array from dask.highlevelgraph import HighLevelGraph except ImportError: pass import collections import itertools import operator from typing import ( Any, Callable, DefaultDict, Dict, Hashable, Itera...
try: import dask import dask.array from dask.array.utils import meta_from_array from dask.highlevelgraph import HighLevelGraph except ImportError: pass import collections import itertools import operator from typing import ( Any, Callable, DefaultDict, Dict, Hashable, Itera...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import copy import logging import string import sys import warnings from argparse import ArgumentParser from collections import defaultdict from typing import Any, Callable, DefaultDict, List, Optional, Sequence, Type, Union from omegaconf import C...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import copy import logging import string import sys import warnings from argparse import ArgumentParser from collections import defaultdict from typing import Any, Callable, DefaultDict, List, Optional, Sequence, Type, Union from omegaconf import C...
# -*- coding: utf-8 -*- """ @created on: 3/1/21, @author: Shreesha N, @version: v0.0.1 @system name: badgod Description: ..todo:: """ import json import random import time import numpy as np import torch import torch.nn as nn import torch.optim as optim from covid_19.networks.conv_ae import ConvAutoEncoder from co...
# -*- coding: utf-8 -*- """ @created on: 3/1/21, @author: Shreesha N, @version: v0.0.1 @system name: badgod Description: ..todo:: """ import json import random import time import numpy as np import torch import torch.nn as nn import torch.optim as optim from covid_19.networks.conv_ae import ConvAutoEncoder from co...
import numpy as np # I used this class from our PPO group project class AnnealedParam(float): def __new__(cls, param_min, param_max, period, param_value=None, param_max_decay=1.0, param_min_decay=1.0, s...
import numpy as np # I used this class from our PPO group project class AnnealedParam(float): def __new__(cls, param_min, param_max, period, param_value=None, param_max_decay=1.0, param_min_decay=1.0, s...
import brownie import pytest from brownie import ZERO_ADDRESS from tests.conftest import approx REWARD = 10 ** 20 WEEK = 7 * 86400 LP_AMOUNT = 10 ** 18 @pytest.fixture(scope="module") def reward_contract_2(MobiusRewards, mock_lp_token, accounts, coin_a): contract = MobiusRewards.deploy(mock_lp_token, coin_a, {"...
import brownie import pytest from brownie import ZERO_ADDRESS from tests.conftest import approx REWARD = 10 ** 20 WEEK = 7 * 86400 LP_AMOUNT = 10 ** 18 @pytest.fixture(scope="module") def reward_contract_2(MobiusRewards, mock_lp_token, accounts, coin_a): contract = MobiusRewards.deploy(mock_lp_token, coin_a, {"...
# coding: utf-8 # Copyright 2020-2021 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 appli...
# coding: utf-8 # Copyright 2020-2021 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 appli...
def dobro(n, formatar=False): num = n * 2 return num if not formatar else moeda(num) def metade(n, formatar=False): num = n / 2 return num if not formatar else moeda(num) def aumentar(n, aumenta, formatar=False): num = (n * aumenta) / 100 num += n return num if formatar is False else moe...
def dobro(n, formatar=False): num = n * 2 return num if not formatar else moeda(num) def metade(n, formatar=False): num = n / 2 return num if not formatar else moeda(num) def aumentar(n, aumenta, formatar=False): num = (n * aumenta) / 100 num += n return num if formatar is False else moe...
# decorator function def mymypy(types): def wrap(func): def inner(*args): for t, a in zip(types, args): if not isinstance(a, t): raise TypeError(f'Argument: {a} is not type {t}') return func(*args) return inner return wrap # --- testi...
# decorator function def mymypy(types): def wrap(func): def inner(*args): for t, a in zip(types, args): if not isinstance(a, t): raise TypeError(f'Argument: {a} is not type {t}') return func(*args) return inner return wrap # --- testi...
import config import facebook graph = facebook.GraphAPI(access_token=config.fb_access_token, version="2.12") # graph.put_object(parent_object='me', connection_name='feed', message='Hello, world from rihanna') def fb(message): try: if {"facebook", "posts"} - set(message.split()) == set(): re...
import config import facebook graph = facebook.GraphAPI(access_token=config.fb_access_token, version="2.12") # graph.put_object(parent_object='me', connection_name='feed', message='Hello, world from rihanna') def fb(message): try: if {"facebook", "posts"} - set(message.split()) == set(): re...
import math import os import xml.dom.minidom from collections import defaultdict from datetime import datetime as dt from struct import unpack import fsspec import numpy as np from .parse_base import ParseBase FILENAME_DATETIME_AZFP = "\\w+.01A" class ParseAZFP(ParseBase): """Class for converting data from ASL...
import math import os import xml.dom.minidom from collections import defaultdict from datetime import datetime as dt from struct import unpack import fsspec import numpy as np from .parse_base import ParseBase FILENAME_DATETIME_AZFP = "\\w+.01A" class ParseAZFP(ParseBase): """Class for converting data from ASL...
# -*- coding: utf-8 -*- """ This module provides a wrapper around the VSO API. """ import os import re import cgi import socket import datetime import warnings import itertools import inspect from functools import partial from collections import defaultdict from urllib.error import URLError, HTTPError from urllib.requ...
# -*- coding: utf-8 -*- """ This module provides a wrapper around the VSO API. """ import os import re import cgi import socket import datetime import warnings import itertools import inspect from functools import partial from collections import defaultdict from urllib.error import URLError, HTTPError from urllib.requ...
""" To-do: - WSC requires free-form generation - ReCoRD """ import numpy as np import sklearn import transformers.data.metrics.squad_metrics as squad_metrics from . common import HFTask, yesno from lm_eval.base import rf from ..metrics import mean, acc_all, metric_max_over_ground_truths from ..utils import gene...
""" To-do: - WSC requires free-form generation - ReCoRD """ import numpy as np import sklearn import transformers.data.metrics.squad_metrics as squad_metrics from . common import HFTask, yesno from lm_eval.base import rf from ..metrics import mean, acc_all, metric_max_over_ground_truths from ..utils import gene...
import insightconnect_plugin_runtime from .schema import ConnectionSchema, Input # Custom imports below import requests from requests.auth import HTTPBasicAuth from icon_servicenow.util.request_helper import RequestHelper from insightconnect_plugin_runtime.exceptions import ConnectionTestException class Connection(i...
import insightconnect_plugin_runtime from .schema import ConnectionSchema, Input # Custom imports below import requests from requests.auth import HTTPBasicAuth from icon_servicenow.util.request_helper import RequestHelper from insightconnect_plugin_runtime.exceptions import ConnectionTestException class Connection(i...
import uuid from typing import Dict, List, Optional import pandas as pd from feast import RedshiftSource from feast.data_source import DataSource from feast.infra.offline_stores.redshift import RedshiftOfflineStoreConfig from feast.infra.offline_stores.redshift_source import SavedDatasetRedshiftStorage from feast.inf...
import uuid from typing import Dict, List, Optional import pandas as pd from feast import RedshiftSource from feast.data_source import DataSource from feast.infra.offline_stores.redshift import RedshiftOfflineStoreConfig from feast.infra.offline_stores.redshift_source import SavedDatasetRedshiftStorage from feast.inf...
#!/usr/bin/env python3 import json import os import urllib import requests from unidiff import PatchSet from env_helper import GITHUB_REPOSITORY, GITHUB_SERVER_URL, GITHUB_RUN_ID, GITHUB_EVENT_PATH DIFF_IN_DOCUMENTATION_EXT = [".html", ".md", ".yml", ".txt", ".css", ".js", ".xml", ".ico", ".conf", ".svg", ".png", ...
#!/usr/bin/env python3 import json import os import urllib import requests from unidiff import PatchSet from env_helper import GITHUB_REPOSITORY, GITHUB_SERVER_URL, GITHUB_RUN_ID, GITHUB_EVENT_PATH DIFF_IN_DOCUMENTATION_EXT = [".html", ".md", ".yml", ".txt", ".css", ".js", ".xml", ".ico", ".conf", ".svg", ".png", ...
import abc import copy import warnings from collections import OrderedDict from typing import Any from vyper import ast as vy_ast from vyper.exceptions import CompilerPanic, InvalidType from vyper.utils import BASE_TYPES, ceil32 # Data structure for a type class NodeType(abc.ABC): def __eq__(self, other: Any) ->...
import abc import copy import warnings from collections import OrderedDict from typing import Any from vyper import ast as vy_ast from vyper.exceptions import CompilerPanic, InvalidType from vyper.utils import BASE_TYPES, ceil32 # Data structure for a type class NodeType(abc.ABC): def __eq__(self, other: Any) ->...
import argparse from typing import ( Any, Dict, List, Optional, Sequence, Set, Tuple, Type, Union, TYPE_CHECKING, ) if TYPE_CHECKING: from ..config import PoeConfig ArgParams = Dict[str, Any] ArgsDef = Union[List[str], List[ArgParams], Dict[str, ArgParams]] arg_param_schem...
import argparse from typing import ( Any, Dict, List, Optional, Sequence, Set, Tuple, Type, Union, TYPE_CHECKING, ) if TYPE_CHECKING: from ..config import PoeConfig ArgParams = Dict[str, Any] ArgsDef = Union[List[str], List[ArgParams], Dict[str, ArgParams]] arg_param_schem...
from bokeh.embed import json_item from bokeh.plotting import figure from bokeh.models import FactorRange, ColumnDataSource, HoverTool, NumeralTickFormatter from django.http import JsonResponse from .helpers import * def _get_plot_data(_data_type): if _data_type == 'infections': df_dict = get_dataframe...
from bokeh.embed import json_item from bokeh.plotting import figure from bokeh.models import FactorRange, ColumnDataSource, HoverTool, NumeralTickFormatter from django.http import JsonResponse from .helpers import * def _get_plot_data(_data_type): if _data_type == 'infections': df_dict = get_dataframe...
import argparse import ast import codecs import collections import contextlib import keyword import re import string import sys import tokenize import warnings from typing import Any from typing import cast from typing import Container from typing import Dict from typing import Generator from typing import Iterable fro...
import argparse import ast import codecs import collections import contextlib import keyword import re import string import sys import tokenize import warnings from typing import Any from typing import cast from typing import Container from typing import Dict from typing import Generator from typing import Iterable fro...
import argparse import ast from datetime import datetime import json import matplotlib.pyplot as plt import numpy as np import os import time from typing import Optional, Dict, Union, List from warnings import warn from experiment.experiment_utils import get_args_string import snc from snc.agents.hedgehog.hh_agents.bi...
import argparse import ast from datetime import datetime import json import matplotlib.pyplot as plt import numpy as np import os import time from typing import Optional, Dict, Union, List from warnings import warn from experiment.experiment_utils import get_args_string import snc from snc.agents.hedgehog.hh_agents.bi...
import logging import re import typing from abc import ABC, abstractmethod from collections import Counter, defaultdict from functools import lru_cache from operator import itemgetter from pathlib import Path from typing import Callable, Dict, List, Optional, Union, cast import torch from deprecated import deprecated ...
import logging import re import typing from abc import ABC, abstractmethod from collections import Counter, defaultdict from functools import lru_cache from operator import itemgetter from pathlib import Path from typing import Callable, Dict, List, Optional, Union, cast import torch from deprecated import deprecated ...
# AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/00_datasets.internals.mangadex.ipynb (unless otherwise specified). __all__ = ['MangaDexClient', 'get_covers_for_all_tags'] # Cell import requests import json class MangaDexClient: """Client for the MangaDex API""" def __init__(self, credentials_file): ...
# AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/00_datasets.internals.mangadex.ipynb (unless otherwise specified). __all__ = ['MangaDexClient', 'get_covers_for_all_tags'] # Cell import requests import json class MangaDexClient: """Client for the MangaDex API""" def __init__(self, credentials_file): ...
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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/LI...
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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/LI...
# Copyright (c) FULIUCANSHENG. # Licensed under the MIT License. import os from collections import OrderedDict from lazydocs import generate_docs generate_docs( ["../"], output_path="./references", src_root_path="../", src_base_url="https://github.com/fuliucansheng/unitorch/blob/master/", ignored_...
# Copyright (c) FULIUCANSHENG. # Licensed under the MIT License. import os from collections import OrderedDict from lazydocs import generate_docs generate_docs( ["../"], output_path="./references", src_root_path="../", src_base_url="https://github.com/fuliucansheng/unitorch/blob/master/", ignored_...
from cscmiko.devices.base.device import Device from cscmiko.models import layer2, layer3, security, system from abc import ABC from cscmiko.exceptions import CscmikoNotSyncedError, CscmikoInvalidFeatureError _INVETORY_CMD = "show version" _VLAN_CMD = "show vlan" _INTERFACE_CMD = "show interface" _INTERFACE_CONF_CMD = ...
from cscmiko.devices.base.device import Device from cscmiko.models import layer2, layer3, security, system from abc import ABC from cscmiko.exceptions import CscmikoNotSyncedError, CscmikoInvalidFeatureError _INVETORY_CMD = "show version" _VLAN_CMD = "show vlan" _INTERFACE_CMD = "show interface" _INTERFACE_CONF_CMD = ...
import asyncio import click import logging import pprint from .session import Session from .socket import SocketSession _LOGGER = logging.getLogger(__name__) @click.group(chain=True) @click.option("-a", "--api-name", required=True, help="API name") @click.option( "-b", "--basic-auth-creds", required=True, help=...
import asyncio import click import logging import pprint from .session import Session from .socket import SocketSession _LOGGER = logging.getLogger(__name__) @click.group(chain=True) @click.option("-a", "--api-name", required=True, help="API name") @click.option( "-b", "--basic-auth-creds", required=True, help=...
# Exercício 13: Reajuste Salarial # Descrição: Faça um programa que leia o salário de um funcionário e mostre seu # novo salário, com 15% de aumento. class ReajustadorDeSalario(): porcentagem_de_reajuste = 0.15 def __init(self): self.salario_atual = 0 self.aumento = 0 self.novo_salario...
# Exercício 13: Reajuste Salarial # Descrição: Faça um programa que leia o salário de um funcionário e mostre seu # novo salário, com 15% de aumento. class ReajustadorDeSalario(): porcentagem_de_reajuste = 0.15 def __init(self): self.salario_atual = 0 self.aumento = 0 self.novo_salario...
""" COMBINED_SNAPSHOT should be set to create a new snapshot dataset while running this cleaning rule. """ # Python imports import logging # Project imports import constants.bq_utils as bq_consts import constants.cdr_cleaner.clean_cdr as cdr_consts from cdr_cleaner.cleaning_rules import domain_mapping, field_mapping i...
""" COMBINED_SNAPSHOT should be set to create a new snapshot dataset while running this cleaning rule. """ # Python imports import logging # Project imports import constants.bq_utils as bq_consts import constants.cdr_cleaner.clean_cdr as cdr_consts from cdr_cleaner.cleaning_rules import domain_mapping, field_mapping i...
from screen import Screen import cv2 from config import Config from template_finder import TemplateFinder from utils.misc import load_template, cut_roi import mouse import keyboard import os import shutil from pathlib import Path from typing import Tuple import math class NodeRecorder: def __init__(self, screen: ...
from screen import Screen import cv2 from config import Config from template_finder import TemplateFinder from utils.misc import load_template, cut_roi import mouse import keyboard import os import shutil from pathlib import Path from typing import Tuple import math class NodeRecorder: def __init__(self, screen: ...
# Copyright 2019 IBM 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 writing, ...
# Copyright 2019 IBM 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 writing, ...
import pandas as pd import numpy as np import json from tqdm import tqdm from scipy.stats import poisson from scipy.optimize import minimize from utils import odds, clean_sheet, score_mtx, get_next_gw, time_decay from ranked_probability_score import ranked_probability_score, match_outcome import warnings # Dangerous...
import pandas as pd import numpy as np import json from tqdm import tqdm from scipy.stats import poisson from scipy.optimize import minimize from utils import odds, clean_sheet, score_mtx, get_next_gw, time_decay from ranked_probability_score import ranked_probability_score, match_outcome import warnings # Dangerous...
#!/usr/bin/env python3 # ############################################################################# # Helper script to generate us-counties.csv file # * Download counties information from census.gov # * Download geo-location from datasciencetoolkit.org # Save result into the '../../common/us/counties.csv' file # # r...
#!/usr/bin/env python3 # ############################################################################# # Helper script to generate us-counties.csv file # * Download counties information from census.gov # * Download geo-location from datasciencetoolkit.org # Save result into the '../../common/us/counties.csv' file # # r...
import os import subprocess import sys environments = [ {"NAME": "latest", "PYTHON_VERSION": "3.9"}, {"NAME": "python3.9-alpine3.13", "PYTHON_VERSION": "3.9"}, {"NAME": "python3.9-slim", "PYTHON_VERSION": "3.9"}, {"NAME": "python3.9", "PYTHON_VERSION": "3.9"}, {"NAME": "mambaforge", "PYTHON_VERSION...
import os import subprocess import sys environments = [ {"NAME": "latest", "PYTHON_VERSION": "3.9"}, {"NAME": "python3.9-alpine3.13", "PYTHON_VERSION": "3.9"}, {"NAME": "python3.9-slim", "PYTHON_VERSION": "3.9"}, {"NAME": "python3.9", "PYTHON_VERSION": "3.9"}, {"NAME": "mambaforge", "PYTHON_VERSION...
# 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...
# 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...
import argparse import json import random from collections import defaultdict import deepspeed import torch from torch.utils.data import DataLoader from tqdm.auto import trange from gpt_neox import (GPTNeoX, AutoregressiveWrapper, TextSamplerDataset, download_dataset, cycle, prepare_optimizer_pa...
import argparse import json import random from collections import defaultdict import deepspeed import torch from torch.utils.data import DataLoader from tqdm.auto import trange from gpt_neox import (GPTNeoX, AutoregressiveWrapper, TextSamplerDataset, download_dataset, cycle, prepare_optimizer_pa...
import os import time import torch import numpy as np """[ElegantRL.2021.09.18](https://github.com/AI4Finance-LLC/ElegantRL)""" class Evaluator: def __init__(self, cwd, agent_id, device, eval_env, eval_gap, eval_times1, eval_times2, ): self.recorder = list() # total_step, r_avg, r_std, obj_c, ... ...
import os import time import torch import numpy as np """[ElegantRL.2021.09.18](https://github.com/AI4Finance-LLC/ElegantRL)""" class Evaluator: def __init__(self, cwd, agent_id, device, eval_env, eval_gap, eval_times1, eval_times2, ): self.recorder = list() # total_step, r_avg, r_std, obj_c, ... ...
""" Typeclass for Account objects Note that this object is primarily intended to store OOC information, not game info! This object represents the actual user (not their character) and has NO actual presence in the game world (this is handled by the associated character object, so you should customize that instead for ...
""" Typeclass for Account objects Note that this object is primarily intended to store OOC information, not game info! This object represents the actual user (not their character) and has NO actual presence in the game world (this is handled by the associated character object, so you should customize that instead for ...
import enum import logging import os import re import subprocess import sys import typing as t import unicodedata from typing import TYPE_CHECKING import pynvim from gkeep.config import KEEP_FT, Config, State from gkeepapi.node import List, NodeType, Note, TopLevelNode from pynvim.api import Buffer if sys.version_inf...
import enum import logging import os import re import subprocess import sys import typing as t import unicodedata from typing import TYPE_CHECKING import pynvim from gkeep.config import KEEP_FT, Config, State from gkeepapi.node import List, NodeType, Note, TopLevelNode from pynvim.api import Buffer if sys.version_inf...
"""CrowdStrike Falcon Discover Account registration utility Leverages the FalconPy uber class to perform check, update, register and delete operations within a customer Falcon Discover environment. """ ############################################################################## # fd_accounts - Creation date - 2020.1...
"""CrowdStrike Falcon Discover Account registration utility Leverages the FalconPy uber class to perform check, update, register and delete operations within a customer Falcon Discover environment. """ ############################################################################## # fd_accounts - Creation date - 2020.1...
import pdb from .types import Type, Atom, Functor, Box, Diamond, Proof, T from typing import NamedTuple class Leaf(NamedTuple): atom: Atom polarity: bool index: int def __repr__(self) -> str: return f'{self.atom}({'+' if self.polarity else '-'},{self.index})' class Unary(NamedTuple): p...
import pdb from .types import Type, Atom, Functor, Box, Diamond, Proof, T from typing import NamedTuple class Leaf(NamedTuple): atom: Atom polarity: bool index: int def __repr__(self) -> str: return f'{self.atom}({"+" if self.polarity else "-"},{self.index})' class Unary(NamedTuple): p...
""" Module implementing a client for the v2 docker registry API. See https://docs.docker.com/registry/spec/api/ """ import asyncio import hashlib import json import logging import ssl import urllib.parse from typing import AsyncIterable, Dict, List, Optional, Tuple, Union import aiohttp from .auth import CredentialS...
""" Module implementing a client for the v2 docker registry API. See https://docs.docker.com/registry/spec/api/ """ import asyncio import hashlib import json import logging import ssl import urllib.parse from typing import AsyncIterable, Dict, List, Optional, Tuple, Union import aiohttp from .auth import CredentialS...
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2021-01-06 16:12 from typing import List from elit.common.dataset import SortingSamplerBuilder from elit.common.transform import NormalizeToken from elit.components.mtl.multi_task_learning import MultiTaskLearning from elit.components.mtl.tasks.constituency import CRFCon...
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2021-01-06 16:12 from typing import List from elit.common.dataset import SortingSamplerBuilder from elit.common.transform import NormalizeToken from elit.components.mtl.multi_task_learning import MultiTaskLearning from elit.components.mtl.tasks.constituency import CRFCon...
# load modules from requests_api import request from ..entity import SearchResponse # const SERVER = 'https://beatsaver.com/api' # definition async def search_maps( # Options are a little weird, I may add another enum field in future to make this clearer. # true = both, false = only ai, null = no ai au...
# load modules from requests_api import request from ..entity import SearchResponse # const SERVER = 'https://beatsaver.com/api' # definition async def search_maps( # Options are a little weird, I may add another enum field in future to make this clearer. # true = both, false = only ai, null = no ai au...
""" This module sets up all the post endpoints Author: Dave """ from flask import request, jsonify, make_response, Blueprint, session from app.api.v1.utils.posts_validator import PostValidator from app.api.v1.models.posts import Post, AuthenticationRequired from app.api.v1.models.users import User, AuthenticationRequ...
""" This module sets up all the post endpoints Author: Dave """ from flask import request, jsonify, make_response, Blueprint, session from app.api.v1.utils.posts_validator import PostValidator from app.api.v1.models.posts import Post, AuthenticationRequired from app.api.v1.models.users import User, AuthenticationRequ...
"""UniFi switch platform tests.""" from copy import deepcopy from unittest.mock import patch from aiounifi.controller import MESSAGE_CLIENT_REMOVED, MESSAGE_EVENT from homeassistant import config_entries, core from homeassistant.components.device_tracker import DOMAIN as TRACKER_DOMAIN from homeassistant.components.s...
"""UniFi switch platform tests.""" from copy import deepcopy from unittest.mock import patch from aiounifi.controller import MESSAGE_CLIENT_REMOVED, MESSAGE_EVENT from homeassistant import config_entries, core from homeassistant.components.device_tracker import DOMAIN as TRACKER_DOMAIN from homeassistant.components.s...
import pathlib import tensorflow as tf import tensorflow_datasets as tfds from dataduit.log.dataduit_logging import config_logger from dataduit.dataset.io.read.location.local.records.parse import return_parse_feature def read_tf_from_dir(config_dict): logger = config_logger(config_dict["meta"]["logging"], "downl...
import pathlib import tensorflow as tf import tensorflow_datasets as tfds from dataduit.log.dataduit_logging import config_logger from dataduit.dataset.io.read.location.local.records.parse import return_parse_feature def read_tf_from_dir(config_dict): logger = config_logger(config_dict["meta"]["logging"], "downl...
import logging from datetime import datetime, timezone from flask import Blueprint from flask import current_app as app from flask import flash, redirect, render_template, request, url_for from flask_login import login_required from flask_paginate import Pagination from iso8601 import parse_date from structlog import ...
import logging from datetime import datetime, timezone from flask import Blueprint from flask import current_app as app from flask import flash, redirect, render_template, request, url_for from flask_login import login_required from flask_paginate import Pagination from iso8601 import parse_date from structlog import ...
import RaceRandom as random from collections import defaultdict, deque import logging import time from enum import unique, Flag from typing import DefaultDict, Dict, List from BaseClasses import RegionType, Region, Door, DoorType, Direction, Sector, CrystalBarrier, DungeonInfo, dungeon_keys from Doors import reset_por...
import RaceRandom as random from collections import defaultdict, deque import logging import time from enum import unique, Flag from typing import DefaultDict, Dict, List from BaseClasses import RegionType, Region, Door, DoorType, Direction, Sector, CrystalBarrier, DungeonInfo, dungeon_keys from Doors import reset_por...
""" Export forces to sto """ from pathlib import Path import matplotlib.pyplot as plt import numpy as np import yaml from pyosim import Conf from pyosim import Analogs3dOsim aws_conf = yaml.safe_load(open("../conf.yml")) local_or_distant = "distant" if aws_conf["distant_id"]["enable"] else "local" conf = Conf(project...
""" Export forces to sto """ from pathlib import Path import matplotlib.pyplot as plt import numpy as np import yaml from pyosim import Conf from pyosim import Analogs3dOsim aws_conf = yaml.safe_load(open("../conf.yml")) local_or_distant = "distant" if aws_conf["distant_id"]["enable"] else "local" conf = Conf(project...
# Copyright 2020-2021 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 agre...
# Copyright 2020-2021 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 agre...
from typing import Optional import time from datetime import datetime, timedelta from wpwatcher import log from wpwatcher.core import WPWatcher from wpwatcher.config import Config from wpwatcher.report import ScanReport from wpwatcher.site import Site from filelock import FileLock, Timeout # Date format used everyw...
from typing import Optional import time from datetime import datetime, timedelta from wpwatcher import log from wpwatcher.core import WPWatcher from wpwatcher.config import Config from wpwatcher.report import ScanReport from wpwatcher.site import Site from filelock import FileLock, Timeout # Date format used everyw...
artilharia = list() while True: jogador = dict() print("-"*30) jogador['nome'] = str(input('Nome do Jogador: ')) gols = list() total = 0 partidas = int(input(f"Quantas partidas {jogador["nome"]} jogou? ")) for i in range(partidas): valor = int(input(f'Quantos gols na partida {i+1}...
artilharia = list() while True: jogador = dict() print("-"*30) jogador['nome'] = str(input('Nome do Jogador: ')) gols = list() total = 0 partidas = int(input(f"Quantas partidas {jogador['nome']} jogou? ")) for i in range(partidas): valor = int(input(f'Quantos gols na partida {i+1}...
# -*- coding: utf-8 -*- # Owner(s): ["module: tests"] import torch import torch.utils.data import numpy as np import contextlib import gc import io import inspect import itertools import math import random import re import copy import os import tempfile import unittest import warnings import types import pickle impor...
# -*- coding: utf-8 -*- # Owner(s): ["module: tests"] import torch import torch.utils.data import numpy as np import contextlib import gc import io import inspect import itertools import math import random import re import copy import os import tempfile import unittest import warnings import types import pickle impor...
import argparse import os from pathlib import Path import cv2 from codenames.preprocessing import Split, ExtractCards, Rotate, get_all_images_in def preprocess() -> None: preprocessors = { 'split': Split(), 'extract_cards': ExtractCards(), 'rotate': Rotate() } parser = argparse....
import argparse import os from pathlib import Path import cv2 from codenames.preprocessing import Split, ExtractCards, Rotate, get_all_images_in def preprocess() -> None: preprocessors = { 'split': Split(), 'extract_cards': ExtractCards(), 'rotate': Rotate() } parser = argparse....
import os from queue import Queue import time import threading from pyvips import Image, Error import shared.config as config import shared.logger as logger import shared.graphql_utility as gql import shared.aws_utility as aws_utility import shared.uri_utility as uri_utility import shared.google_utility as google_utili...
import os from queue import Queue import time import threading from pyvips import Image, Error import shared.config as config import shared.logger as logger import shared.graphql_utility as gql import shared.aws_utility as aws_utility import shared.uri_utility as uri_utility import shared.google_utility as google_utili...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals if __name__ == '__main__': import argparse, textwrap import script_utils # Append mripy to Python path from mripy import dicom_report, utils parser = argparse.ArgumentParse...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals if __name__ == '__main__': import argparse, textwrap import script_utils # Append mripy to Python path from mripy import dicom_report, utils parser = argparse.ArgumentParse...
"""Support for AirVisual air quality sensors.""" from homeassistant.components.sensor import SensorEntity from homeassistant.const import ( ATTR_LATITUDE, ATTR_LONGITUDE, ATTR_STATE, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_PARTS_PER_BILLION, CONCENTRATION_PARTS_PER_MILLION, C...
"""Support for AirVisual air quality sensors.""" from homeassistant.components.sensor import SensorEntity from homeassistant.const import ( ATTR_LATITUDE, ATTR_LONGITUDE, ATTR_STATE, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_PARTS_PER_BILLION, CONCENTRATION_PARTS_PER_MILLION, C...
import logging from typing import List, NoReturn, OrderedDict, Union from django.db import transaction from hexbytes import HexBytes from gnosis.eth import EthereumClient, EthereumClientProvider from ..models import (EthereumBlock, EthereumTx, InternalTxDecoded, MultisigConfirmation, MultisigT...
import logging from typing import List, NoReturn, OrderedDict, Union from django.db import transaction from hexbytes import HexBytes from gnosis.eth import EthereumClient, EthereumClientProvider from ..models import (EthereumBlock, EthereumTx, InternalTxDecoded, MultisigConfirmation, MultisigT...
import os import json from pathlib import Path from jinja2 import Environment, FileSystemLoader from aids.app.settings import BASE_DIR class toHtml: def __init__(self): self.env = Environment(loader=FileSystemLoader(BASE_DIR / 'templates')) self.out_path = Path().cwd() self....
import os import json from pathlib import Path from jinja2 import Environment, FileSystemLoader from aids.app.settings import BASE_DIR class toHtml: def __init__(self): self.env = Environment(loader=FileSystemLoader(BASE_DIR / 'templates')) self.out_path = Path().cwd() self....
""" 提目:输入两个递增排序的链表,合并这两个链表并使新链表中的结点仍然是按照递增排序的。 例如输入图3.11中的链表1和链表2,则合并之后的升序链表如链表3所示。 总结:需要注意最后节点为 None 的情况,避免链表断裂(另可用递归的思想,代码更加整洁) """ import unittest class ListNode(object): def __init__(self, x): self.val = x self.next = None def __repr__(self): return f'<ListNode object val: {self.v...
""" 提目:输入两个递增排序的链表,合并这两个链表并使新链表中的结点仍然是按照递增排序的。 例如输入图3.11中的链表1和链表2,则合并之后的升序链表如链表3所示。 总结:需要注意最后节点为 None 的情况,避免链表断裂(另可用递归的思想,代码更加整洁) """ import unittest class ListNode(object): def __init__(self, x): self.val = x self.next = None def __repr__(self): return f'<ListNode object val: {self.v...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Unit tests for AWS Security Token Service (AWS STS) usage functions. """ import json import unittest.mock import pytest import requests import boto3 from botocore.exceptions import ClientError import assume...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Unit tests for AWS Security Token Service (AWS STS) usage functions. """ import json import unittest.mock import pytest import requests import boto3 from botocore.exceptions import ClientError import assume...
import torch from terminaltables import AsciiTable from copy import deepcopy import numpy as np import torch.nn.functional as F def get_sr_flag(epoch, sr): # return epoch >= 5 and sr return sr def parse_module_defs(module_defs): CBL_idx = [] Conv_idx = [] ignore_idx = set() ...
import torch from terminaltables import AsciiTable from copy import deepcopy import numpy as np import torch.nn.functional as F def get_sr_flag(epoch, sr): # return epoch >= 5 and sr return sr def parse_module_defs(module_defs): CBL_idx = [] Conv_idx = [] ignore_idx = set() ...
import json from collections import defaultdict from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponseRedirect from django.urls import reverse from django.utils.http import urlencode from django.views.generic import FormView, TemplateView, CreateView from database.models.sched...
import json from collections import defaultdict from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponseRedirect from django.urls import reverse from django.utils.http import urlencode from django.views.generic import FormView, TemplateView, CreateView from database.models.sched...
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import pandas as pd import clean.clean_03 as southtrac import process.constants as c from matplotlib import gridspec from datetime import datetime import winsound duration = 1000 # milliseconds freq = 440 # Hz import plotly.io as pio impor...
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import pandas as pd import clean.clean_03 as southtrac import process.constants as c from matplotlib import gridspec from datetime import datetime import winsound duration = 1000 # milliseconds freq = 440 # Hz import plotly.io as pio impor...
import logging from typing import List, Dict, Text, Optional, Any, Set, TYPE_CHECKING, Union from tqdm import tqdm import numpy as np import json from rasa.shared.constants import DOCS_URL_RULES import rasa.shared.utils.io from rasa.shared.core.events import FormValidation, UserUttered, ActionExecuted from rasa.core....
import logging from typing import List, Dict, Text, Optional, Any, Set, TYPE_CHECKING, Union from tqdm import tqdm import numpy as np import json from rasa.shared.constants import DOCS_URL_RULES import rasa.shared.utils.io from rasa.shared.core.events import FormValidation, UserUttered, ActionExecuted from rasa.core....
# Copyright © 2021 CloudBlue. All rights reserved. import json import os import sys import inspect import importlib import tempfile import shutil from cookiecutter import generate from cookiecutter.main import cookiecutter from cookiecutter.config import get_user_config from cookiecutter.exceptions import OutputDirE...
# Copyright © 2021 CloudBlue. All rights reserved. import json import os import sys import inspect import importlib import tempfile import shutil from cookiecutter import generate from cookiecutter.main import cookiecutter from cookiecutter.config import get_user_config from cookiecutter.exceptions import OutputDirE...
# This file is part of sner4 project governed by MIT license, see the LICENSE.txt file. """ parsers to import from agent outputs to storage """ import json import re import sys from datetime import datetime from pathlib import Path from pprint import pprint from time import time from zipfile import ZipFile import lib...
# This file is part of sner4 project governed by MIT license, see the LICENSE.txt file. """ parsers to import from agent outputs to storage """ import json import re import sys from datetime import datetime from pathlib import Path from pprint import pprint from time import time from zipfile import ZipFile import lib...
import re from typing import List, \ Union, \ Set from common.file_reader import FileReader def _find_bags_colors(color: str, in_bag: Union[str, None], rules: dict, path: List[str] = []) -> Union[int, Set]: if in_bag is None: total = set() for bag_option in set(rules): path_ne...
import re from typing import List, \ Union, \ Set from common.file_reader import FileReader def _find_bags_colors(color: str, in_bag: Union[str, None], rules: dict, path: List[str] = []) -> Union[int, Set]: if in_bag is None: total = set() for bag_option in set(rules): path_ne...
# A python class for the Delcom USBLMP 904x multi-color visual signal indicator. This # has been tested with the 904007-SB but should work with most of the other # indicators. # # Requires the Signal 11 HIDAPI and cython-hidapi. # # Copyright (c) 2019 Aaron Linville <aaron@linville.org> import hid vendor_id = 0x0FC5 ...
# A python class for the Delcom USBLMP 904x multi-color visual signal indicator. This # has been tested with the 904007-SB but should work with most of the other # indicators. # # Requires the Signal 11 HIDAPI and cython-hidapi. # # Copyright (c) 2019 Aaron Linville <aaron@linville.org> import hid vendor_id = 0x0FC5 ...
""" This script directly applies our method to video, finding dense correspondences across time in an input video. This works by applying GANgealing per-frame without using any temporal information. """ import torch import numpy as np import math from datasets import img_dataloader from prepare_data import nchw_center_...
""" This script directly applies our method to video, finding dense correspondences across time in an input video. This works by applying GANgealing per-frame without using any temporal information. """ import torch import numpy as np import math from datasets import img_dataloader from prepare_data import nchw_center_...
from abc import ( ABCMeta, ) from concurrent.futures.thread import ( ThreadPoolExecutor, ) from contextlib import ( contextmanager, ) import csv import gzip from io import ( BytesIO, TextIOWrapper, ) from itertools import ( chain, ) import json import logging import os import random import re im...
from abc import ( ABCMeta, ) from concurrent.futures.thread import ( ThreadPoolExecutor, ) from contextlib import ( contextmanager, ) import csv import gzip from io import ( BytesIO, TextIOWrapper, ) from itertools import ( chain, ) import json import logging import os import random import re im...
import datetime import json import math import random import re import time import threading from datetime import date from deepdiff import DeepDiff from membase.api.exception import CBQError from membase.api.rest_client import RestConnection from remote.remote_util import RemoteMachineShellConnection from collection....
import datetime import json import math import random import re import time import threading from datetime import date from deepdiff import DeepDiff from membase.api.exception import CBQError from membase.api.rest_client import RestConnection from remote.remote_util import RemoteMachineShellConnection from collection....
from __future__ import annotations import random from typing import Match import aiosqlite from bot.config import Config from bot.data import command from bot.data import esc from bot.data import format_msg from bot.permissions import is_moderator from bot.permissions import is_subscriber async def ensure_giveaway...
from __future__ import annotations import random from typing import Match import aiosqlite from bot.config import Config from bot.data import command from bot.data import esc from bot.data import format_msg from bot.permissions import is_moderator from bot.permissions import is_subscriber async def ensure_giveaway...