edited_code
stringlengths
17
978k
original_code
stringlengths
17
978k
# stdlib from typing import Any from typing import Callable as CallableT import warnings # third party from google.protobuf.reflection import GeneratedProtocolMessageType # syft absolute import syft # relative from ....util import aggressive_set_attr from .deserialize import CAPNP_REGISTRY module_type = type(syft) ...
# stdlib from typing import Any from typing import Callable as CallableT import warnings # third party from google.protobuf.reflection import GeneratedProtocolMessageType # syft absolute import syft # relative from ....util import aggressive_set_attr from .deserialize import CAPNP_REGISTRY module_type = type(syft) ...
#!/usr/bin/env python # Licensed to Elasticsearch B.V under one or more agreements. # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information import json import tempfile import collections import black from click.testing import CliRunn...
#!/usr/bin/env python # Licensed to Elasticsearch B.V under one or more agreements. # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information import json import tempfile import collections import black from click.testing import CliRunn...
from decimal import Decimal import eth_abi import pytest from vyper.exceptions import ( ArgumentException, EventDeclarationException, InvalidType, NamespaceCollision, TypeMismatch, UndeclaredDefinition, ) from vyper.utils import keccak256 pytestmark = pytest.mark.usefixtures("memory_mocker") ...
from decimal import Decimal import eth_abi import pytest from vyper.exceptions import ( ArgumentException, EventDeclarationException, InvalidType, NamespaceCollision, TypeMismatch, UndeclaredDefinition, ) from vyper.utils import keccak256 pytestmark = pytest.mark.usefixtures("memory_mocker") ...
# Copyright 2020 ByteDance 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 writin...
# Copyright 2020 ByteDance 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 writin...
from discord.ext import commands from pyourls3 import Yourls from utils.permissions import level class Links(commands.Cog): """A cog for link shortening and statistics.""" def __init__(self, bot: commands.Bot): self.bot = bot config = bot.cfg.module("links") self.api = Yourls(addr=co...
from discord.ext import commands from pyourls3 import Yourls from utils.permissions import level class Links(commands.Cog): """A cog for link shortening and statistics.""" def __init__(self, bot: commands.Bot): self.bot = bot config = bot.cfg.module("links") self.api = Yourls(addr=co...
#!/usr/bin/python3 """Alta3 Research - Exploring OpenAPIs with requests""" # documentation for this API is at # https://anapioficeandfire.com/Documentation import requests AOIF_BOOKS = "https://www.anapioficeandfire.com/api/books" def main(): ## Send HTTPS GET to the API of ICE and Fire gotresp = requests.ge...
#!/usr/bin/python3 """Alta3 Research - Exploring OpenAPIs with requests""" # documentation for this API is at # https://anapioficeandfire.com/Documentation import requests AOIF_BOOKS = "https://www.anapioficeandfire.com/api/books" def main(): ## Send HTTPS GET to the API of ICE and Fire gotresp = requests.ge...
import builtins import importlib import inspect import io import linecache import os.path import types from contextlib import contextmanager from pathlib import Path from typing import cast, Any, BinaryIO, Callable, Dict, List, Optional, Union from weakref import WeakValueDictionary import torch from torch.serializati...
import builtins import importlib import inspect import io import linecache import os.path import types from contextlib import contextmanager from pathlib import Path from typing import cast, Any, BinaryIO, Callable, Dict, List, Optional, Union from weakref import WeakValueDictionary import torch from torch.serializati...
from talon import Context, Module, actions, imgui, registry ctx = Context() mod = Module() mod.list("code_libraries", desc="List of libraries for active language") mod.tag( "code_libraries_gui_showing", desc="Active when the library picker GUI is showing" ) # global library_list = [] @mod.capture(rule="{user.c...
from talon import Context, Module, actions, imgui, registry ctx = Context() mod = Module() mod.list("code_libraries", desc="List of libraries for active language") mod.tag( "code_libraries_gui_showing", desc="Active when the library picker GUI is showing" ) # global library_list = [] @mod.capture(rule="{user.c...
import importlib from collections import defaultdict import torch.nn as nn import torch.optim as optim class TrainerMaker: def __init__(self, args, model, data): print("[Make Trainer]") if args.mode == 'train': criterion = self.__set_criterion(args.criterion) optimizer = se...
import importlib from collections import defaultdict import torch.nn as nn import torch.optim as optim class TrainerMaker: def __init__(self, args, model, data): print("[Make Trainer]") if args.mode == 'train': criterion = self.__set_criterion(args.criterion) optimizer = se...
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. import os import json from torchvision import datasets, transforms from torchvision.datasets.folder import ImageFolder, default_loader from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.data import create_transform ...
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. import os import json from torchvision import datasets, transforms from torchvision.datasets.folder import ImageFolder, default_loader from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.data import create_transform ...
SPECIAL_DEVICES={ "chuangmi.plug.212a01":{ "device_type": ['switch','sensor'], "mapping": {"switch": {"switch_status": {"siid": 2, "piid": 1}, "temperature": {"siid": 2, "piid": 6}, "working_time": {"siid": 2, "piid": 7}}, "power_consumption": {"power_consumption": {"siid": 5, "piid": 1}, "electric_...
SPECIAL_DEVICES={ "chuangmi.plug.212a01":{ "device_type": ['switch','sensor'], "mapping": {"switch": {"switch_status": {"siid": 2, "piid": 1}, "temperature": {"siid": 2, "piid": 6}, "working_time": {"siid": 2, "piid": 7}}, "power_consumption": {"power_consumption": {"siid": 5, "piid": 1}, "electric_...
from flask import Blueprint, request, render_template, session, redirect, url_for from flask.wrappers import Response from loguru import logger from src.utils.common.data_helper import load_data from src.utils.common.plotly_helper import PlotlyHelper from src.utils.common.project_report_helper import ProjectReports imp...
from flask import Blueprint, request, render_template, session, redirect, url_for from flask.wrappers import Response from loguru import logger from src.utils.common.data_helper import load_data from src.utils.common.plotly_helper import PlotlyHelper from src.utils.common.project_report_helper import ProjectReports imp...
''' This module is used to download the data from several feeds in the public KoDa API. Supported companies: - dintur - Västernorrlands län: Only GTFSStatic - dt - Dalatrafik - klt - Kalmar länstrafik - krono - Kronobergs Länstrafik: Only GTFSStatic - otraf - Östgötatrafiken - sj - SJ + Snälltåget + Tågab: Only GTFSSt...
''' This module is used to download the data from several feeds in the public KoDa API. Supported companies: - dintur - Västernorrlands län: Only GTFSStatic - dt - Dalatrafik - klt - Kalmar länstrafik - krono - Kronobergs Länstrafik: Only GTFSStatic - otraf - Östgötatrafiken - sj - SJ + Snälltåget + Tågab: Only GTFSSt...
#!/usr/bin/env python # Copyright The PyTorch Lightning team. # # 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...
#!/usr/bin/env python # Copyright The PyTorch Lightning team. # # 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 pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity import pathlib import logging from copy import copy import numpy as np class Geomatch: def __init__(self, standard_db=False, # порядок колонок им...
import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity import pathlib import logging from copy import copy import numpy as np class Geomatch: def __init__(self, standard_db=False, # порядок колонок им...
import unittest import requests_mock from response_operations_social_ui import create_app from response_operations_social_ui.common import uaa class TestUaa(unittest.TestCase): def setUp(self): self.app = create_app('TestingConfig') def test_get_uaa_public_key_with_config_set(self): with s...
import unittest import requests_mock from response_operations_social_ui import create_app from response_operations_social_ui.common import uaa class TestUaa(unittest.TestCase): def setUp(self): self.app = create_app('TestingConfig') def test_get_uaa_public_key_with_config_set(self): with s...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.codegen.protobuf.target_types import ( ProtobufDependenciesField, ProtobufGrpcToggleField, ) from pants.backend.codegen.utils import find_python_runtime_library...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.codegen.protobuf.target_types import ( ProtobufDependenciesField, ProtobufGrpcToggleField, ) from pants.backend.codegen.utils import find_python_runtime_library...
import numpy as np import pytest from eelbrain import Dataset, Factor from eelbrain._design import permute, random_factor, complement def test_random_factor(): """Test the design module for creating an experiemnt design""" ds = permute(( ('A', '123456'), ('Bin', '01'), ...
import numpy as np import pytest from eelbrain import Dataset, Factor from eelbrain._design import permute, random_factor, complement def test_random_factor(): """Test the design module for creating an experiemnt design""" ds = permute(( ('A', '123456'), ('Bin', '01'), ...
import datetime import numpy as np import modin.pandas as pd import pytest from sklearn.exceptions import NotFittedError from sklearn.metrics import mean_absolute_error from sklearn.metrics import mean_squared_error from testfixtures import LogCapture import greykite.common.constants as cst from greykite.algo.forecas...
import datetime import numpy as np import modin.pandas as pd import pytest from sklearn.exceptions import NotFittedError from sklearn.metrics import mean_absolute_error from sklearn.metrics import mean_squared_error from testfixtures import LogCapture import greykite.common.constants as cst from greykite.algo.forecas...
#!/usr/bin/env python # coding: utf-8 # # 🏁 Wrap-up quiz # # **This quiz requires some programming to be answered.** # # Open the dataset `house_prices.csv` with the following command: # In[2]: import pandas as pd ames_housing = pd.read_csv("../datasets/house_prices.csv", na_values="?") target_name = "SalePrice...
#!/usr/bin/env python # coding: utf-8 # # 🏁 Wrap-up quiz # # **This quiz requires some programming to be answered.** # # Open the dataset `house_prices.csv` with the following command: # In[2]: import pandas as pd ames_housing = pd.read_csv("../datasets/house_prices.csv", na_values="?") target_name = "SalePrice...
from Bio import SeqIO from Bio import AlignIO import sys import argparse parser = argparse.ArgumentParser(description='Clean up coding consensus.') parser.add_argument("--alignment_with_ref", action="store", type=str, dest="alignment") parser.add_argument("--output_seq", action="store", type=str, dest="output_seq") pa...
from Bio import SeqIO from Bio import AlignIO import sys import argparse parser = argparse.ArgumentParser(description='Clean up coding consensus.') parser.add_argument("--alignment_with_ref", action="store", type=str, dest="alignment") parser.add_argument("--output_seq", action="store", type=str, dest="output_seq") pa...
import datetime import html import textwrap import bs4 import jikanpy import requests from innexiaBot import DEV_USERS, OWNER_ID, DRAGONS, dispatcher from innexiaBot.modules.disable import DisableAbleCommandHandler from telegram import (InlineKeyboardButton, InlineKeyboardMarkup, ParseMode, Updat...
import datetime import html import textwrap import bs4 import jikanpy import requests from innexiaBot import DEV_USERS, OWNER_ID, DRAGONS, dispatcher from innexiaBot.modules.disable import DisableAbleCommandHandler from telegram import (InlineKeyboardButton, InlineKeyboardMarkup, ParseMode, Updat...
import os, sys import unittest import tempfile from openmmforcefields.utils import get_data_filename from openmmforcefields.generators import GAFFTemplateGenerator from openmmforcefields.generators import SMIRNOFFTemplateGenerator import logging _logger = logging.getLogger("openmmforcefields.tests.test_template_gene...
import os, sys import unittest import tempfile from openmmforcefields.utils import get_data_filename from openmmforcefields.generators import GAFFTemplateGenerator from openmmforcefields.generators import SMIRNOFFTemplateGenerator import logging _logger = logging.getLogger("openmmforcefields.tests.test_template_gene...
import logging import os from functools import wraps from discord_webhook import DiscordEmbed from rcon.recorded_commands import RecordedRcon from rcon.player_history import ( save_player, save_start_player_session, save_end_player_session, safe_save_player_action, get_player, _get_set_player,...
import logging import os from functools import wraps from discord_webhook import DiscordEmbed from rcon.recorded_commands import RecordedRcon from rcon.player_history import ( save_player, save_start_player_session, save_end_player_session, safe_save_player_action, get_player, _get_set_player,...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # https://github.com/FerryYoungFan/SimpleTextMontage # 之前我不知道 Montage 是什么 # 其实用反向 Alpha-blend 也可以,不过我不想这么做,因为懒,而且我是没大阅读 doc… from PIL import Image from PIL import ImageDraw, ImageFont from argparse import ArgumentParser, FileType from math import ceil from sys import std...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # https://github.com/FerryYoungFan/SimpleTextMontage # 之前我不知道 Montage 是什么 # 其实用反向 Alpha-blend 也可以,不过我不想这么做,因为懒,而且我是没大阅读 doc… from PIL import Image from PIL import ImageDraw, ImageFont from argparse import ArgumentParser, FileType from math import ceil from sys import std...
from collections import OrderedDict import h5py import json from datetime import datetime import hashlib import urllib import base64 import logging from pathlib import Path import re from typing import List import numpy as np import requests # for HTTP requests from .docstream import MappedH5Generator from .model im...
from collections import OrderedDict import h5py import json from datetime import datetime import hashlib import urllib import base64 import logging from pathlib import Path import re from typing import List import numpy as np import requests # for HTTP requests from .docstream import MappedH5Generator from .model im...
import subprocess from collections import defaultdict from util import database, toolchain, bitdiff, progress with database.transact() as db: for device_name, device in db.items(): progress(device_name) package, pinout = next(iter(device['pins'].items())) goe_names = [name for name in d...
import subprocess from collections import defaultdict from util import database, toolchain, bitdiff, progress with database.transact() as db: for device_name, device in db.items(): progress(device_name) package, pinout = next(iter(device['pins'].items())) goe_names = [name for name in d...
# -*- coding: utf-8 -*- # # Copyright (C) 2021 CESNET. # # OARepo-Communities is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. """OArepo module that adds support for communities""" import click import sqlalchemy from flask.cli import w...
# -*- coding: utf-8 -*- # # Copyright (C) 2021 CESNET. # # OARepo-Communities is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. """OArepo module that adds support for communities""" import click import sqlalchemy from flask.cli import w...
#! /usr/bin/env pipenv run -- python3 import click @click.command() @click.option('--version', '-v', flag_value=True, help="Show Viper version") @click.argument('args', nargs=-1) def app(version, args): if version: click.echo('Viper 0.0.1') elif args: click.echo(f"I know I'm supposed to compi...
#! /usr/bin/env pipenv run -- python3 import click @click.command() @click.option('--version', '-v', flag_value=True, help="Show Viper version") @click.argument('args', nargs=-1) def app(version, args): if version: click.echo('Viper 0.0.1') elif args: click.echo(f"I know I'm supposed to compi...
import csv import math from pathlib import Path from typing import List, Dict, Tuple import xmltodict from celery import current_app as current_celery_app from celery import shared_task from fiftyone import Dataset, Sample, Polyline, Polylines from fiftyone.core.metadata import ImageMetadata from app.models.schemas i...
import csv import math from pathlib import Path from typing import List, Dict, Tuple import xmltodict from celery import current_app as current_celery_app from celery import shared_task from fiftyone import Dataset, Sample, Polyline, Polylines from fiftyone.core.metadata import ImageMetadata from app.models.schemas i...
import json import hashlib import os import time import requests import binascii from web3 import Web3 import offlineOpen import offlineClose providerAddr = 'https://http-mainnet-node.huobichain.com' w3 = Web3(Web3.HTTPProvider(providerAddr)) FPABIFILE = "./abi/FuturePerpetual.json" FPADDR = '0x917e091cc000012bbd58af...
import json import hashlib import os import time import requests import binascii from web3 import Web3 import offlineOpen import offlineClose providerAddr = 'https://http-mainnet-node.huobichain.com' w3 = Web3(Web3.HTTPProvider(providerAddr)) FPABIFILE = "./abi/FuturePerpetual.json" FPADDR = '0x917e091cc000012bbd58af...
#!/usr/bin/env python import syslog import signal import bme680 import sys from paho.mqtt import client as mqtt_client from time import sleep from threading import Event sensor = bme680.BME680(bme680.I2C_ADDR_PRIMARY) exit = Event() # These oversampling settings can be tweaked to # change the balance between accuracy...
#!/usr/bin/env python import syslog import signal import bme680 import sys from paho.mqtt import client as mqtt_client from time import sleep from threading import Event sensor = bme680.BME680(bme680.I2C_ADDR_PRIMARY) exit = Event() # These oversampling settings can be tweaked to # change the balance between accuracy...
from crawl import main as crawl from util import get_params from util.elastic import Elastic import os import wget BASICS = 'https://datasets.imdbws.com/title.basics.tsv.gz' RATINGS = 'https://datasets.imdbws.com/title.ratings.tsv.gz' EPISODES = 'https://datasets.imdbws.com/title.episode.tsv.gz' def main(): elas...
from crawl import main as crawl from util import get_params from util.elastic import Elastic import os import wget BASICS = 'https://datasets.imdbws.com/title.basics.tsv.gz' RATINGS = 'https://datasets.imdbws.com/title.ratings.tsv.gz' EPISODES = 'https://datasets.imdbws.com/title.episode.tsv.gz' def main(): elas...
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pathlib import Path from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest class MypyIntegrationTest(PantsRunIntegrationTest): cmdline = ["--backend-pac...
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pathlib import Path from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest class MypyIntegrationTest(PantsRunIntegrationTest): cmdline = ["--backend-pac...
import torchvision from fastai.vision import * from fastai.callbacks import SaveModelCallback import librosa import h5py # ***************************************************************************************** just_test = True # skip training and use a saved model sample_length = 5 # time window length in secon...
import torchvision from fastai.vision import * from fastai.callbacks import SaveModelCallback import librosa import h5py # ***************************************************************************************** just_test = True # skip training and use a saved model sample_length = 5 # time window length in secon...
import sys import os import tempfile import pandas as pd import craft.config as config def finemap(data_dfs, index_df, file_dir, n_causal_snps): """ Runs Finemap and LDStore on each SNP locus. Finemap(v1.3.1) was created by Christian Brenner (http://www.christianbenner.com/) and uses summary statistics for ...
import sys import os import tempfile import pandas as pd import craft.config as config def finemap(data_dfs, index_df, file_dir, n_causal_snps): """ Runs Finemap and LDStore on each SNP locus. Finemap(v1.3.1) was created by Christian Brenner (http://www.christianbenner.com/) and uses summary statistics for ...
from discord import File, Member from discord.ext import commands from leveling.utils import get_user_data, get_rank from easy_pil import Editor, Canvas, load_image_async, Font class Level(commands.Cog): def __init__(self, bot) -> None: self.bot = bot @commands.command() async def rank(self, ctx,...
from discord import File, Member from discord.ext import commands from leveling.utils import get_user_data, get_rank from easy_pil import Editor, Canvas, load_image_async, Font class Level(commands.Cog): def __init__(self, bot) -> None: self.bot = bot @commands.command() async def rank(self, ctx,...
#!/usr/bin/env python3 # # installation.py r""" .. extensions:: sphinx_toolbox.installation Configuration -------------- .. confval:: conda_channels :type: :class:`~typing.List`\[:class:`str`\] :required: False :default: ``[]`` The conda channels required to install the library from Anaconda. An alternative ...
#!/usr/bin/env python3 # # installation.py r""" .. extensions:: sphinx_toolbox.installation Configuration -------------- .. confval:: conda_channels :type: :class:`~typing.List`\[:class:`str`\] :required: False :default: ``[]`` The conda channels required to install the library from Anaconda. An alternative ...
""" Saturn-specific override of ``dask.distributed.deploy.SpecCluster`` See https://distributed.dask.org/en/latest/_modules/distributed/deploy/spec.html for details on the parent class. """ import os import json import logging import warnings import weakref from distutils.version import LooseVersion from typing impor...
""" Saturn-specific override of ``dask.distributed.deploy.SpecCluster`` See https://distributed.dask.org/en/latest/_modules/distributed/deploy/spec.html for details on the parent class. """ import os import json import logging import warnings import weakref from distutils.version import LooseVersion from typing impor...
"""Blueprint models.""" from __future__ import annotations import asyncio import logging import pathlib import shutil from typing import Any from awesomeversion import AwesomeVersion import voluptuous as vol from voluptuous.humanize import humanize_error from homeassistant import loader from homeassistant.const impo...
"""Blueprint models.""" from __future__ import annotations import asyncio import logging import pathlib import shutil from typing import Any from awesomeversion import AwesomeVersion import voluptuous as vol from voluptuous.humanize import humanize_error from homeassistant import loader from homeassistant.const impo...
#!/usr/local/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test custom integrators. """ #=============================================...
#!/usr/local/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test custom integrators. """ #=============================================...
# MIT License # # Copyright (c) 2018-2020 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 # in the Software without restriction, including without limitation the rights # to use, copy, modify, ...
# MIT License # # Copyright (c) 2018-2020 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 # in the Software without restriction, including without limitation the rights # to use, copy, modify, ...
import dataclasses import docker import logging import os import shutil import homepose.libs.enviroment import homepose.libs.utils class DNSMasqInstallError(Exception): default_message = 'DNSMasq installation failed!' def __init__(self, msg=default_message, *args, **kwargs): super().__init__(msg, *a...
import dataclasses import docker import logging import os import shutil import homepose.libs.enviroment import homepose.libs.utils class DNSMasqInstallError(Exception): default_message = 'DNSMasq installation failed!' def __init__(self, msg=default_message, *args, **kwargs): super().__init__(msg, *a...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2020 James Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, co...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2020 James Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, co...
from django.contrib.contenttypes.models import ContentType from django.db.models import Prefetch from django.db.models.expressions import RawSQL from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from circuits.models import Provider from circuits.tables import ProviderTabl...
from django.contrib.contenttypes.models import ContentType from django.db.models import Prefetch from django.db.models.expressions import RawSQL from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from circuits.models import Provider from circuits.tables import ProviderTabl...
import collections from datetime import timedelta import functools import gc import json import operator import pickle import re from textwrap import dedent from typing import ( TYPE_CHECKING, Any, Callable, Dict, FrozenSet, Hashable, List, Mapping, Optional, Sequence, Set, ...
import collections from datetime import timedelta import functools import gc import json import operator import pickle import re from textwrap import dedent from typing import ( TYPE_CHECKING, Any, Callable, Dict, FrozenSet, Hashable, List, Mapping, Optional, Sequence, Set, ...
from prettyprinter import pformat import inspect from functools import cached_property class PickleableState: def __init__(self, kwds): self.attrs = list(kwds.keys()) self.filename: str = kwds['format_filename'] self.frame: PickleableFrame = kwds['frame'] self.event: str = kwds['event'] self.arg: ...
from prettyprinter import pformat import inspect from functools import cached_property class PickleableState: def __init__(self, kwds): self.attrs = list(kwds.keys()) self.filename: str = kwds['format_filename'] self.frame: PickleableFrame = kwds['frame'] self.event: str = kwds['event'] self.arg: ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # "Testing Configurations" - a chapter of "The Fuzzing Book" # Web site: https://www.fuzzingbook.org/html/ConfigurationFuzzer.html # Last change: 2021-06-04 14:57:19+02:00 # # Copyright (c) 2021 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saa...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # "Testing Configurations" - a chapter of "The Fuzzing Book" # Web site: https://www.fuzzingbook.org/html/ConfigurationFuzzer.html # Last change: 2021-06-04 14:57:19+02:00 # # Copyright (c) 2021 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saa...
import socket import threading from sys import exit server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.connect(("127.0.0.1", 55556)) nickname = input('Pls Enter a nickname') def recive(): while True: try: message = server.recv(1024).decode("ascii") if message == "N...
import socket import threading from sys import exit server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.connect(("127.0.0.1", 55556)) nickname = input('Pls Enter a nickname') def recive(): while True: try: message = server.recv(1024).decode("ascii") if message == "N...
import json import os import platform import sys import threading import time from concurrent.futures import ThreadPoolExecutor import requests from pixivpy3 import * from altfe.interface.root import interRoot @interRoot.bind("biu", "LIB_CORE") class core_module_biu(interRoot): def __init__(self): self....
import json import os import platform import sys import threading import time from concurrent.futures import ThreadPoolExecutor import requests from pixivpy3 import * from altfe.interface.root import interRoot @interRoot.bind("biu", "LIB_CORE") class core_module_biu(interRoot): def __init__(self): self....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of CbM (https://github.com/ec-jrc/cbm). # Author : Guido Lemoine, Konstantinos Anastasakis # Credits : GTCAP Team # Copyright : 2021 European Commission, Joint Research Centre # License : 3-Clause BSD import os import os.path import requests fr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of CbM (https://github.com/ec-jrc/cbm). # Author : Guido Lemoine, Konstantinos Anastasakis # Credits : GTCAP Team # Copyright : 2021 European Commission, Joint Research Centre # License : 3-Clause BSD import os import os.path import requests fr...
import os import sys import glob import json import requests import time import ipaddress import socket import shutil import random import hashlib import base64 import re import copy from ast import literal_eval from pathlib import Path from itertools import chain import inspect import uuid from bs4 import BeautifulSou...
import os import sys import glob import json import requests import time import ipaddress import socket import shutil import random import hashlib import base64 import re import copy from ast import literal_eval from pathlib import Path from itertools import chain import inspect import uuid from bs4 import BeautifulSou...
from aiohttp import request from discord import Embed from discord.ext.commands import Cog, BucketType from discord.ext.commands import command, has_permissions, cooldown from discord.ext.commands.errors import MissingPermissions from random import choice, randint import logging class Fun(Cog): def __init__(self, ...
from aiohttp import request from discord import Embed from discord.ext.commands import Cog, BucketType from discord.ext.commands import command, has_permissions, cooldown from discord.ext.commands.errors import MissingPermissions from random import choice, randint import logging class Fun(Cog): def __init__(self, ...
#!/usr/bin/env python3 """ Contains the logic to create an instance of the server See also https://github.com/best-bet/thumbs-up-api """ import os from flask import Flask, g, jsonify, request from flask_cors import CORS from .api import projects, items, options from .database import connect_db def create_app(): ...
#!/usr/bin/env python3 """ Contains the logic to create an instance of the server See also https://github.com/best-bet/thumbs-up-api """ import os from flask import Flask, g, jsonify, request from flask_cors import CORS from .api import projects, items, options from .database import connect_db def create_app(): ...
#-- toolbar building blocks ------------------------------------------------- tool_nav = ( '<tool type="nav"/>' ) tool_insert = ( '<tool type="img" name="insert" tip="Insert row (Ctrl+Insert)" ' 'shortcut="ctrl,Insert" action="' '&lt;req_insert_row/&gt;' '"/>' ) tool_delete = ( ...
#-- toolbar building blocks ------------------------------------------------- tool_nav = ( '<tool type="nav"/>' ) tool_insert = ( '<tool type="img" name="insert" tip="Insert row (Ctrl+Insert)" ' 'shortcut="ctrl,Insert" action="' '&lt;req_insert_row/&gt;' '"/>' ) tool_delete = ( ...
from pathlib import Path from shutil import ExecError from typing import Any, Callable, Dict, List, Tuple, Union from experiment_server._participant_ordering import construct_participant_condition, ORDERING_BEHAVIOUR from experiment_server.utils import ExperimentServerConfigurationExcetion from loguru import logger fro...
from pathlib import Path from shutil import ExecError from typing import Any, Callable, Dict, List, Tuple, Union from experiment_server._participant_ordering import construct_participant_condition, ORDERING_BEHAVIOUR from experiment_server.utils import ExperimentServerConfigurationExcetion from loguru import logger fro...
"""Support for the Netatmo cameras.""" import logging import aiohttp import pyatmo import voluptuous as vol from homeassistant.components.camera import SUPPORT_STREAM, Camera from homeassistant.core import callback from homeassistant.exceptions import PlatformNotReady from homeassistant.helpers import config_validati...
"""Support for the Netatmo cameras.""" import logging import aiohttp import pyatmo import voluptuous as vol from homeassistant.components.camera import SUPPORT_STREAM, Camera from homeassistant.core import callback from homeassistant.exceptions import PlatformNotReady from homeassistant.helpers import config_validati...
import traceback from typing import Optional import aiosqlite import discord from discord.ext import commands import time import discordSuperUtils from discordSuperUtils import MusicManager from tools.database_tool import DataBaseTool import datetime from bot import MyBot from py_cord_components import ( ...
import traceback from typing import Optional import aiosqlite import discord from discord.ext import commands import time import discordSuperUtils from discordSuperUtils import MusicManager from tools.database_tool import DataBaseTool import datetime from bot import MyBot from py_cord_components import ( ...
from django.db import models from django.contrib.auth.models import User import uuid class DevProfile(models.Model): """ DevProfile model for developers """ user = models.OneToOneField(User, on_delete=models.CASCADE) first_name = models.CharField(max_length=50) last_name = models.CharField(max...
from django.db import models from django.contrib.auth.models import User import uuid class DevProfile(models.Model): """ DevProfile model for developers """ user = models.OneToOneField(User, on_delete=models.CASCADE) first_name = models.CharField(max_length=50) last_name = models.CharField(max...
import os from typing import List, Dict, Generator, Tuple import pandas as pd import numpy as np from argparse import ArgumentParser from tqdm import tqdm from evaluate import evaluate, Metrics, match_arguments from common import Question, Role, QUESTION_FIELDS, Argument from decode_encode_answers import NO_RANGE, d...
import os from typing import List, Dict, Generator, Tuple import pandas as pd import numpy as np from argparse import ArgumentParser from tqdm import tqdm from evaluate import evaluate, Metrics, match_arguments from common import Question, Role, QUESTION_FIELDS, Argument from decode_encode_answers import NO_RANGE, d...
from plotly.subplots import make_subplots import plotly.graph_objs as go class WellLog: """Well log wrapper. Args: n_tracks (int): number of vertical tracks. shared_yaxes (bool): shared Y axes for all tracks? Other keyword arguments will be passed to plotly.make_subplots() Attribute...
from plotly.subplots import make_subplots import plotly.graph_objs as go class WellLog: """Well log wrapper. Args: n_tracks (int): number of vertical tracks. shared_yaxes (bool): shared Y axes for all tracks? Other keyword arguments will be passed to plotly.make_subplots() Attribute...
import json import boto3 from datetime import datetime as dt lambd = boto3.client('lambda') def lambda_handler(event, context): today = dt.fromtimestamp(event['timestamp']) prefix = event['prefix'] event['report']['img']['files'] = [] for query in event['queries']: if...
import json import boto3 from datetime import datetime as dt lambd = boto3.client('lambda') def lambda_handler(event, context): today = dt.fromtimestamp(event['timestamp']) prefix = event['prefix'] event['report']['img']['files'] = [] for query in event['queries']: if...
from typing import Iterator, Optional, Any, Dict, Callable, Iterable from typing import Union, Tuple, List, Set, Pattern, Sequence from typing import NoReturn, TYPE_CHECKING, TypeVar, cast, overload from dataclasses import dataclass import random import itertools import functools from contextlib import contextmanager ...
from typing import Iterator, Optional, Any, Dict, Callable, Iterable from typing import Union, Tuple, List, Set, Pattern, Sequence from typing import NoReturn, TYPE_CHECKING, TypeVar, cast, overload from dataclasses import dataclass import random import itertools import functools from contextlib import contextmanager ...
from __future__ import annotations __copyright__ = "Copyright (C) 2021 Kaushik Kulkarni" __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without l...
from __future__ import annotations __copyright__ = "Copyright (C) 2021 Kaushik Kulkarni" __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without l...
from typing import Union, Tuple, Callable, Any import torch import copy import numpy as np class Point(torch.Tensor): """ A point has a variable number of coordinates specified in the constructor. Each point is immutable. """ __values: Union[Tuple[float, ...], Tuple[int, ...]] __is_float: bool...
from typing import Union, Tuple, Callable, Any import torch import copy import numpy as np class Point(torch.Tensor): """ A point has a variable number of coordinates specified in the constructor. Each point is immutable. """ __values: Union[Tuple[float, ...], Tuple[int, ...]] __is_float: bool...
import gspread import json import re import string import pandas as pd import datetime from spacectl.command.execute import _check_api_permissions, _get_service_and_resource, _get_client,_call_api, \ _parse_parameter from spacectl.conf.my_conf import get_config, get_endpoint, get_template from spacectl.lib.apply.t...
import gspread import json import re import string import pandas as pd import datetime from spacectl.command.execute import _check_api_permissions, _get_service_and_resource, _get_client,_call_api, \ _parse_parameter from spacectl.conf.my_conf import get_config, get_endpoint, get_template from spacectl.lib.apply.t...
class ActionBatchSwitch(object): def __init__(self): super(ActionBatchSwitch, self).__init__() def cycleDeviceSwitchPorts(self, serial: str, ports: list): """ **Cycle a set of switch ports** https://developer.cisco.com/meraki/api-v1/#!cycle-device-switch-ports - serial (string): (required) - ports (ar...
class ActionBatchSwitch(object): def __init__(self): super(ActionBatchSwitch, self).__init__() def cycleDeviceSwitchPorts(self, serial: str, ports: list): """ **Cycle a set of switch ports** https://developer.cisco.com/meraki/api-v1/#!cycle-device-switch-ports - serial (string): (required) - ports (ar...
import configparser import logging import sys from pymongo import MongoClient config_path = 'config/settings.conf' config = configparser.ConfigParser() config.read(config_path) logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class TradeAnalyzer: def __init__(self): self.mo...
import configparser import logging import sys from pymongo import MongoClient config_path = 'config/settings.conf' config = configparser.ConfigParser() config.read(config_path) logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class TradeAnalyzer: def __init__(self): self.mo...
"""Definition of Snoop Task System. This is a simple set of wrappers around Celery functions to afford them stability, reproductability and result storage. Even while Celery has support for using "result backends" to store the task results, we didn't enjoy the fact that a power failure or unexpected server restart wou...
"""Definition of Snoop Task System. This is a simple set of wrappers around Celery functions to afford them stability, reproductability and result storage. Even while Celery has support for using "result backends" to store the task results, we didn't enjoy the fact that a power failure or unexpected server restart wou...
#AUTOGENERATED! DO NOT EDIT! File to edit: dev/13_learner.ipynb (unless otherwise specified). __all__ = ['CancelFitException', 'CancelEpochException', 'CancelTrainException', 'CancelValidException', 'CancelBatchException', 'Callback', 'TrainEvalCallback', 'GatherPredsCallback', 'event', 'replacing_yield', ...
#AUTOGENERATED! DO NOT EDIT! File to edit: dev/13_learner.ipynb (unless otherwise specified). __all__ = ['CancelFitException', 'CancelEpochException', 'CancelTrainException', 'CancelValidException', 'CancelBatchException', 'Callback', 'TrainEvalCallback', 'GatherPredsCallback', 'event', 'replacing_yield', ...
from brownie import DeepFreezeFactory, Contract from scripts.helpful_scripts import get_account from web3 import Web3 from sys import exit import json HINT = "Hello" ETH = Web3.toWei(0.1, "Ether") def createFreezer(): if len(DeepFreezeFactory) == 0: print("You need to deploy the contract first") ...
from brownie import DeepFreezeFactory, Contract from scripts.helpful_scripts import get_account from web3 import Web3 from sys import exit import json HINT = "Hello" ETH = Web3.toWei(0.1, "Ether") def createFreezer(): if len(DeepFreezeFactory) == 0: print("You need to deploy the contract first") ...
#!/usr/bin/env python3 # SPDX-License-Identifier: MIT import sys, pathlib sys.path.append(str(pathlib.Path(__file__).resolve().parents[1])) from m1n1.setup import * from m1n1 import asm code_len = 12 * 16 * 8 + 4 data_len = 8 * 16 * 8 if u.mrs(SPRR_CONFIG_EL1): u.msr(GXF_CONFIG_EL12, 0) u.msr(SPRR_CONFIG_EL1...
#!/usr/bin/env python3 # SPDX-License-Identifier: MIT import sys, pathlib sys.path.append(str(pathlib.Path(__file__).resolve().parents[1])) from m1n1.setup import * from m1n1 import asm code_len = 12 * 16 * 8 + 4 data_len = 8 * 16 * 8 if u.mrs(SPRR_CONFIG_EL1): u.msr(GXF_CONFIG_EL12, 0) u.msr(SPRR_CONFIG_EL1...
"""Service calling related helpers.""" from __future__ import annotations import asyncio import dataclasses from functools import partial, wraps import logging from typing import ( TYPE_CHECKING, Any, Awaitable, Callable, Dict, Iterable, List, Optional, Set, Tuple, TypedDict...
"""Service calling related helpers.""" from __future__ import annotations import asyncio import dataclasses from functools import partial, wraps import logging from typing import ( TYPE_CHECKING, Any, Awaitable, Callable, Dict, Iterable, List, Optional, Set, Tuple, TypedDict...
import json import pathlib import re import time import bs4 import os import data_models import requests from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as ec GOOGLE_CHROME_PATH ...
import json import pathlib import re import time import bs4 import os import data_models import requests from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as ec GOOGLE_CHROME_PATH ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @trojanzhex import re import pyrogram from pyrogram import ( filters, Client ) from pyrogram.types import ( InlineKeyboardButton, InlineKeyboardMarkup, Message, CallbackQuery ) from bot import Bot from script import script from database.mdb...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @trojanzhex import re import pyrogram from pyrogram import ( filters, Client ) from pyrogram.types import ( InlineKeyboardButton, InlineKeyboardMarkup, Message, CallbackQuery ) from bot import Bot from script import script from database.mdb...
from textwrap import dedent class VkErr(Exception): """ Errors from response from vk """ lp_faileds = { 1: "The event history went out of date or was partially lost", 2: "The key’s active period expired", 3: "Information was lost", 4: "Invalid version number was passed"...
from textwrap import dedent class VkErr(Exception): """ Errors from response from vk """ lp_faileds = { 1: "The event history went out of date or was partially lost", 2: "The key’s active period expired", 3: "Information was lost", 4: "Invalid version number was passed"...
import psycopg2 import os import logging import requests import json import redis from requests.exceptions import HTTPError from dotenv import load_dotenv load_dotenv() logFormatter = '%(asctime)s - %(levelname)s - %(message)s' logging.basicConfig(format=logFormatter, level=logging.INFO) logger = logging.getLogger(__n...
import psycopg2 import os import logging import requests import json import redis from requests.exceptions import HTTPError from dotenv import load_dotenv load_dotenv() logFormatter = '%(asctime)s - %(levelname)s - %(message)s' logging.basicConfig(format=logFormatter, level=logging.INFO) logger = logging.getLogger(__n...
# -*- coding: utf-8 -*- # pylint: disable=line-too-long,missing-docstring,reimported,unused-import,unused-variable import orjson import pytest from pydantic.error_wrappers import ValidationError import turvallisuusneuvonta.csaf.document as document from tests import conftest def _subs(count: int) -> str: """DRY....
# -*- coding: utf-8 -*- # pylint: disable=line-too-long,missing-docstring,reimported,unused-import,unused-variable import orjson import pytest from pydantic.error_wrappers import ValidationError import turvallisuusneuvonta.csaf.document as document from tests import conftest def _subs(count: int) -> str: """DRY....
""" Module holding transformer functions. Transformer functions take an input data structure, make a change, and return an output of the same type. They are commonly used to perform operations on cytoscape graph elements. """ import copy import datetime as dt import uuid from collections import defaultdict, deque fro...
""" Module holding transformer functions. Transformer functions take an input data structure, make a change, and return an output of the same type. They are commonly used to perform operations on cytoscape graph elements. """ import copy import datetime as dt import uuid from collections import defaultdict, deque fro...
#!/usr/bin/env python3 # # Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import zlib from collections import OrderedDict, defaultdict import asyncio import os import time from typing imp...
#!/usr/bin/env python3 # # Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import zlib from collections import OrderedDict, defaultdict import asyncio import os import time from typing imp...
import itertools import sys import torch from torch import nn import unittest from sklearn.datasets import make_classification from sklearn.model_selection import train_test_split from torch.nn import CrossEntropyLoss from torch.optim import SGD from torch.optim.lr_scheduler import MultiStepLR, ReduceLROnPlateau from...
import itertools import sys import torch from torch import nn import unittest from sklearn.datasets import make_classification from sklearn.model_selection import train_test_split from torch.nn import CrossEntropyLoss from torch.optim import SGD from torch.optim.lr_scheduler import MultiStepLR, ReduceLROnPlateau from...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05_data.transforms.ipynb (unless otherwise specified). __all__ = ['get_files', 'FileGetter', 'image_extensions', 'get_image_files', 'ImageGetter', 'get_text_files', 'RandomSplitter', 'IndexSplitter', 'GrandparentSplitter', 'FuncSplitter', 'MaskSplitter', 'File...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05_data.transforms.ipynb (unless otherwise specified). __all__ = ['get_files', 'FileGetter', 'image_extensions', 'get_image_files', 'ImageGetter', 'get_text_files', 'RandomSplitter', 'IndexSplitter', 'GrandparentSplitter', 'FuncSplitter', 'MaskSplitter', 'File...
import math import os from enum import IntEnum from typing import Dict, Union, Callable, List, Optional from cereal import log, car import cereal.messaging as messaging from common.conversions import Conversions as CV from common.realtime import DT_CTRL from selfdrive.locationd.calibrationd import MIN_SPEED_FILTER fro...
import math import os from enum import IntEnum from typing import Dict, Union, Callable, List, Optional from cereal import log, car import cereal.messaging as messaging from common.conversions import Conversions as CV from common.realtime import DT_CTRL from selfdrive.locationd.calibrationd import MIN_SPEED_FILTER fro...
# Copyright (c) MONAI Consortium # 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, so...
# Copyright (c) MONAI Consortium # 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, so...
import json import os import pandas as pd from dagster_dbt import dbt_cli_resource from dagster_dbt.asset_defs import load_assets_from_dbt_manifest from hacker_news_assets.resources.snowflake_io_manager import ( SHARED_SNOWFLAKE_CONF, connect_snowflake, ) from dagster import MetadataValue from dagster.utils i...
import json import os import pandas as pd from dagster_dbt import dbt_cli_resource from dagster_dbt.asset_defs import load_assets_from_dbt_manifest from hacker_news_assets.resources.snowflake_io_manager import ( SHARED_SNOWFLAKE_CONF, connect_snowflake, ) from dagster import MetadataValue from dagster.utils i...
import logging import os from pathlib import Path from shutil import copyfile from fashiondatasets.deepfashion1.DeepFashion1 import DeepFashion1Dataset from fashiondatasets.deepfashion2.DeepFashion2Quadruplets import DeepFashion2Quadruplets from fashiondatasets.deepfashion2.helper.pairs.deep_fashion_2_pairs_generator ...
import logging import os from pathlib import Path from shutil import copyfile from fashiondatasets.deepfashion1.DeepFashion1 import DeepFashion1Dataset from fashiondatasets.deepfashion2.DeepFashion2Quadruplets import DeepFashion2Quadruplets from fashiondatasets.deepfashion2.helper.pairs.deep_fashion_2_pairs_generator ...
from InquirerPy import prompt, inquirer from InquirerPy.separator import Separator from ...flair_management.skin_manager.skin_manager import Skin_Manager from .weapon_config_prompts import Prompts class Randomizer_Editor: ''' this flows through 4 stages weapon type -> weapon -> skins -> skin preferences ...
from InquirerPy import prompt, inquirer from InquirerPy.separator import Separator from ...flair_management.skin_manager.skin_manager import Skin_Manager from .weapon_config_prompts import Prompts class Randomizer_Editor: ''' this flows through 4 stages weapon type -> weapon -> skins -> skin preferences ...
""" Core dataset implementation. BaseCore may be inherhit to create a new DatasetCore """ import os from abc import ABC, abstractmethod import cv2 import numpy as np import torch from scipy import io from experimenting.utils import Skeleton from ..utils import get_file_paths from .base import BaseCore class DHP19...
""" Core dataset implementation. BaseCore may be inherhit to create a new DatasetCore """ import os from abc import ABC, abstractmethod import cv2 import numpy as np import torch from scipy import io from experimenting.utils import Skeleton from ..utils import get_file_paths from .base import BaseCore class DHP19...
import sys from datetime import datetime import kfp import kfp.dsl as dsl from kfp.components import create_component_from_func import requests # (1) import the user-defined Python function from # download_file.py # ignore linting; separated from other imports for clarity from download_file import download # no...
import sys from datetime import datetime import kfp import kfp.dsl as dsl from kfp.components import create_component_from_func import requests # (1) import the user-defined Python function from # download_file.py # ignore linting; separated from other imports for clarity from download_file import download # no...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import configparser import json import os import re import sys if os.name != "nt": from blessings import Terminal OS_IS_NT = False TERM = Terminal() else: OS_IS_NT = True from instabot_py import InstaBot python_version_test = f"If yo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import configparser import json import os import re import sys if os.name != "nt": from blessings import Terminal OS_IS_NT = False TERM = Terminal() else: OS_IS_NT = True from instabot_py import InstaBot python_version_test = f"If yo...
# # SymbiYosys (sby) -- Front-end for Yosys-based formal verification flows # # Copyright (C) 2016 Claire Xenia Wolf <claire@yosyshq.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this per...
# # SymbiYosys (sby) -- Front-end for Yosys-based formal verification flows # # Copyright (C) 2016 Claire Xenia Wolf <claire@yosyshq.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this per...
from typing import Any, Iterable from types_extensions import const, void, list_type, tuple_type class ExceptionLevels: RAISE: const(int) = 1 WARN: const(int) = 2 SILENT: const(int) = 3 class InvalidArgumentException(Exception): def __init__(self, given_argument: Any, allowed_arguments: Iterable[...
from typing import Any, Iterable from types_extensions import const, void, list_type, tuple_type class ExceptionLevels: RAISE: const(int) = 1 WARN: const(int) = 2 SILENT: const(int) = 3 class InvalidArgumentException(Exception): def __init__(self, given_argument: Any, allowed_arguments: Iterable[...
#!/bin/python3 import requests import json from time import sleep import zipfile import io from datetime import * from dateutil import tz import sys import os from .dryrun import _make_fake_fetchers BASE_URL="https://ca1.qualtrics.com/API" TIMEZONE = "America/Los_Angeles" TZ = tz.gettz(TIMEZONE) def progress(t): ...
#!/bin/python3 import requests import json from time import sleep import zipfile import io from datetime import * from dateutil import tz import sys import os from .dryrun import _make_fake_fetchers BASE_URL="https://ca1.qualtrics.com/API" TIMEZONE = "America/Los_Angeles" TZ = tz.gettz(TIMEZONE) def progress(t): ...
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, 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 Lice...
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, 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 Lice...
""" Module for formatting output data in HTML. """ from textwrap import dedent from typing import ( Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, cast, ) from pandas._config import get_option from pandas._libs import lib from pandas import ( MultiIndex, opti...
""" Module for formatting output data in HTML. """ from textwrap import dedent from typing import ( Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, cast, ) from pandas._config import get_option from pandas._libs import lib from pandas import ( MultiIndex, opti...
__all__ = ('ShowTestDescription', ) from .consoleHelper import * import unittest from typing import Callable, Any class ShowTestDescription(unittest.TestCase): def setUp(self) -> None: # print(self.__doc__) # class doc # print(self._testMethodName) # function name print_tex...
__all__ = ('ShowTestDescription', ) from .consoleHelper import * import unittest from typing import Callable, Any class ShowTestDescription(unittest.TestCase): def setUp(self) -> None: # print(self.__doc__) # class doc # print(self._testMethodName) # function name print_tex...
import ast import base64 import csv import json import logging import os import random import time from binascii import b2a_base64 from datetime import datetime from functools import wraps from io import StringIO from math import isnan from numbers import Number import requests from flask import Blueprint, Flask from ...
import ast import base64 import csv import json import logging import os import random import time from binascii import b2a_base64 from datetime import datetime from functools import wraps from io import StringIO from math import isnan from numbers import Number import requests from flask import Blueprint, Flask from ...
""" HTTP REquest introspection """ import sys import logging import click import requests import pyld try: import orjson as json except ModuleNotFoundError: import json import opersist.rdfutils # import igsn_lib.link_requests LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, "WARNING"...
""" HTTP REquest introspection """ import sys import logging import click import requests import pyld try: import orjson as json except ModuleNotFoundError: import json import opersist.rdfutils # import igsn_lib.link_requests LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, "WARNING"...
import os import random from core.dm import csc, Pr, PTurn from core.reminder import REMINDER CODEWORD = os.environ.get('CODEWORD') or str(random.random()) @csc.add_handler(priority=Pr.STRONG_INTENT, regexp='.*выслать напоминание.*') def ask_for_reminders(turn: PTurn): turn.response_text = 'Чтобы разослать нап...
import os import random from core.dm import csc, Pr, PTurn from core.reminder import REMINDER CODEWORD = os.environ.get('CODEWORD') or str(random.random()) @csc.add_handler(priority=Pr.STRONG_INTENT, regexp='.*выслать напоминание.*') def ask_for_reminders(turn: PTurn): turn.response_text = 'Чтобы разослать нап...
import importlib import torch from collections import Counter from copy import deepcopy from os import path as osp from torch import distributed as dist from tqdm import tqdm from basicsr.models.sr_model import SRModel from basicsr.utils import get_root_logger, imwrite, tensor2img from basicsr.utils.dist_util import g...
import importlib import torch from collections import Counter from copy import deepcopy from os import path as osp from torch import distributed as dist from tqdm import tqdm from basicsr.models.sr_model import SRModel from basicsr.utils import get_root_logger, imwrite, tensor2img from basicsr.utils.dist_util import g...