edited_code
stringlengths
17
978k
original_code
stringlengths
17
978k
#!/usr/bin/python3 """Widget that simplifies defining questionnaires.""" import os import pickle from tkinter import BooleanVar from tkinter import DoubleVar from tkinter import IntVar from tkinter import StringVar from tkinter import TclError from tkinter.ttk import Checkbutton from tkinter.ttk import Combobox from ...
#!/usr/bin/python3 """Widget that simplifies defining questionnaires.""" import os import pickle from tkinter import BooleanVar from tkinter import DoubleVar from tkinter import IntVar from tkinter import StringVar from tkinter import TclError from tkinter.ttk import Checkbutton from tkinter.ttk import Combobox from ...
""" File to house a replyer service """ from service_framework import get_logger LOG = get_logger() def setup_config(config): """ Setup ~~ all the things ~~ """ config['response_text'] = config.get('response_text', 'DEFAULT') return config def on_new_request(args, to_send, config): """ ...
""" File to house a replyer service """ from service_framework import get_logger LOG = get_logger() def setup_config(config): """ Setup ~~ all the things ~~ """ config['response_text'] = config.get('response_text', 'DEFAULT') return config def on_new_request(args, to_send, config): """ ...
#!/usr/bin/env python3 # Copyright (c) 2020 Teradici Corporation # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import base64 import importlib import os import site import subprocess import sys import textwrap import json f...
#!/usr/bin/env python3 # Copyright (c) 2020 Teradici Corporation # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import base64 import importlib import os import site import subprocess import sys import textwrap import json f...
import math from django.core.management.base import BaseCommand from django.conf import settings from django.utils import timezone from twitterbot.bot import TwitterBot from visitors.models import Visitor, Statistic, Institution, VisitorScrapeProgress class Command(BaseCommand): help = 'computes the total numbe...
import math from django.core.management.base import BaseCommand from django.conf import settings from django.utils import timezone from twitterbot.bot import TwitterBot from visitors.models import Visitor, Statistic, Institution, VisitorScrapeProgress class Command(BaseCommand): help = 'computes the total numbe...
import asyncio import datetime import importlib import itertools import os import random import re import subprocess import sys import discord import psutil from src import const from src.algorithms import levenshtein_distance from src.api.bot_instance import BotInstance from src.backend.discord.embed import DiscordE...
import asyncio import datetime import importlib import itertools import os import random import re import subprocess import sys import discord import psutil from src import const from src.algorithms import levenshtein_distance from src.api.bot_instance import BotInstance from src.backend.discord.embed import DiscordE...
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- from argparse import ArgumentParser import curses import json import time from datetime import datetime from pathlib import Path from striptease import StripConnection, append_to_run_log args = None cur_json_procedure = [] DEFAULT_WAIT_TIME_S = 0.5 warnings = [] d...
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- from argparse import ArgumentParser import curses import json import time from datetime import datetime from pathlib import Path from striptease import StripConnection, append_to_run_log args = None cur_json_procedure = [] DEFAULT_WAIT_TIME_S = 0.5 warnings = [] d...
import asyncio from akinator.async_aki import Akinator as Akinator_ import discord from discord.ext import commands class Options: YES = "✅" NO = "❌" IDK = "🤷" PY = "🤔" PN = "😔" STOP = "⏹️" class Akinator: def __init__(self): self.player = None self.win_at = None ...
import asyncio from akinator.async_aki import Akinator as Akinator_ import discord from discord.ext import commands class Options: YES = "✅" NO = "❌" IDK = "🤷" PY = "🤔" PN = "😔" STOP = "⏹️" class Akinator: def __init__(self): self.player = None self.win_at = None ...
"""Test setup for ASGI spec tests Mock application used for testing ASGI standard compliance. """ from enum import Enum from functools import partial from sys import version_info as PY_VER # noqa import pytest class AppState(Enum): PREINIT = 0 INIT = 1 READY = 2 SHUTDOWN = 3 class BaseMockApp(obj...
"""Test setup for ASGI spec tests Mock application used for testing ASGI standard compliance. """ from enum import Enum from functools import partial from sys import version_info as PY_VER # noqa import pytest class AppState(Enum): PREINIT = 0 INIT = 1 READY = 2 SHUTDOWN = 3 class BaseMockApp(obj...
import logging import requests import jimi ######### --------- API --------- ######### if jimi.api.webServer: if not jimi.api.webServer.got_first_request: if jimi.api.webServer.name == "jimi_core": @jimi.api.webServer.route(jimi.api.base+"admin/clearCache/", methods=["GET"]) @jimi.a...
import logging import requests import jimi ######### --------- API --------- ######### if jimi.api.webServer: if not jimi.api.webServer.got_first_request: if jimi.api.webServer.name == "jimi_core": @jimi.api.webServer.route(jimi.api.base+"admin/clearCache/", methods=["GET"]) @jimi.a...
#!/usr/bin/env python from __future__ import unicode_literals import openpyxl import youtube_dl START_COL = 'N' START_ROW = 10 def get_youtube_links(workbook_name, start_row, start_col): base_col = openpyxl.utils.column_index_from_string(start_col) workbook = openpyxl.load_workbook(workbook_name) worksh...
#!/usr/bin/env python from __future__ import unicode_literals import openpyxl import youtube_dl START_COL = 'N' START_ROW = 10 def get_youtube_links(workbook_name, start_row, start_col): base_col = openpyxl.utils.column_index_from_string(start_col) workbook = openpyxl.load_workbook(workbook_name) worksh...
from typing import Tuple import numpy from matchms.typing import SpectrumType from .BaseSimilarity import BaseSimilarity from .spectrum_similarity_functions import collect_peak_pairs from .spectrum_similarity_functions import score_best_matches class CosineGreedy(BaseSimilarity): """Calculate 'cosine similarity s...
from typing import Tuple import numpy from matchms.typing import SpectrumType from .BaseSimilarity import BaseSimilarity from .spectrum_similarity_functions import collect_peak_pairs from .spectrum_similarity_functions import score_best_matches class CosineGreedy(BaseSimilarity): """Calculate 'cosine similarity s...
"""Metric data needed for notifications.""" class MetricNotificationData: # pylint: disable=too-few-public-methods """Handle metric data needed for notifications.""" def __init__(self, metric, data_model, reason: str) -> None: """Initialise the Notification with metric data.""" self.metric_n...
"""Metric data needed for notifications.""" class MetricNotificationData: # pylint: disable=too-few-public-methods """Handle metric data needed for notifications.""" def __init__(self, metric, data_model, reason: str) -> None: """Initialise the Notification with metric data.""" self.metric_n...
# Copyright 2020 ChainLab # # 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 writi...
# Copyright 2020 ChainLab # # 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 writi...
# Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from enum import Enum from functools import wraps from pathlib import...
# Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from enum import Enum from functools import wraps from pathlib import...
#!/usr/bin/env python3 # Copyright (c) 2020-2021 Rugged Bytes IT-Services GmbH # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import json import os import click import elementstx # noqa: F401 from bitcointx import select_chain...
#!/usr/bin/env python3 # Copyright (c) 2020-2021 Rugged Bytes IT-Services GmbH # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import json import os import click import elementstx # noqa: F401 from bitcointx import select_chain...
"""Validate router configuration variables.""" # Standard Library import os import re from typing import Any, Dict, List, Union, Optional from pathlib import Path from ipaddress import IPv4Address, IPv6Address # Third Party from pydantic import StrictInt, StrictStr, StrictBool, validator, root_validator # Project fr...
"""Validate router configuration variables.""" # Standard Library import os import re from typing import Any, Dict, List, Union, Optional from pathlib import Path from ipaddress import IPv4Address, IPv6Address # Third Party from pydantic import StrictInt, StrictStr, StrictBool, validator, root_validator # Project fr...
from __future__ import annotations import inspect import sys from contextlib import contextmanager from typing import TYPE_CHECKING, Any from magicgui._type_wrapper import resolve_forward_refs from magicgui.application import use_app from magicgui.events import Signal from magicgui.widgets import _protocols BUILDING...
from __future__ import annotations import inspect import sys from contextlib import contextmanager from typing import TYPE_CHECKING, Any from magicgui._type_wrapper import resolve_forward_refs from magicgui.application import use_app from magicgui.events import Signal from magicgui.widgets import _protocols BUILDING...
"""Light for Shelly.""" from typing import Optional, Tuple from aioshelly import Block from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_WHITE_VALUE, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_WHITE_VALUE, LightEn...
"""Light for Shelly.""" from typing import Optional, Tuple from aioshelly import Block from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_WHITE_VALUE, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_WHITE_VALUE, LightEn...
def arithmetic_arranger(problems, answer=False): top = [] bottom = [] lines = [] answers = [] if len(problems) > 5: return "Error: Too many problems." for prob in problems: a, sign, b = prob.split() if sign not in ['+', '-']: return "Error: Operator must be '+...
def arithmetic_arranger(problems, answer=False): top = [] bottom = [] lines = [] answers = [] if len(problems) > 5: return "Error: Too many problems." for prob in problems: a, sign, b = prob.split() if sign not in ['+', '-']: return "Error: Operator must be '+...
def main(request, response): def fmt(x): return f'"{x.decode('utf-8')}"' if x is not None else "undefined" purpose = request.headers.get("Purpose", b"").decode("utf-8") sec_purpose = request.headers.get("Sec-Purpose", b"").decode("utf-8") headers = [(b"Content-Type", b"text/html"), (b'WWW-Authenticate', ...
def main(request, response): def fmt(x): return f'"{x.decode("utf-8")}"' if x is not None else "undefined" purpose = request.headers.get("Purpose", b"").decode("utf-8") sec_purpose = request.headers.get("Sec-Purpose", b"").decode("utf-8") headers = [(b"Content-Type", b"text/html"), (b'WWW-Authenticate', ...
# Copyright 2021 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2021 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
""" VIAME Fish format deserializer """ import csv import datetime import io import json import re from typing import Any, Dict, Generator, List, Tuple, Union from dive_utils.models import Feature, Track, interpolate def format_timestamp(fps: int, frame: int) -> str: return str(datetime.datetime.utcfromtimestamp(...
""" VIAME Fish format deserializer """ import csv import datetime import io import json import re from typing import Any, Dict, Generator, List, Tuple, Union from dive_utils.models import Feature, Track, interpolate def format_timestamp(fps: int, frame: int) -> str: return str(datetime.datetime.utcfromtimestamp(...
import base64 import json filter_keys = ['id', 'name', 'abv', 'ibu', 'target_fg', 'target_og', 'ebc', 'srm', 'ph'] def lambda_handler(event, context): output = [] print (f"Evento: {event}") print (f"Leitura dos registros: {len(event["records"])}") for record in event['records']: print(f"ID: ...
import base64 import json filter_keys = ['id', 'name', 'abv', 'ibu', 'target_fg', 'target_og', 'ebc', 'srm', 'ph'] def lambda_handler(event, context): output = [] print (f"Evento: {event}") print (f"Leitura dos registros: {len(event['records'])}") for record in event['records']: print(f"ID: ...
#!/usr/bin/python3 ''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import argparse import base64 import hashlib import io import logging import os import subprocess import sys import time import zipfile import simplejson as json from keylime.requests_client import R...
#!/usr/bin/python3 ''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import argparse import base64 import hashlib import io import logging import os import subprocess import sys import time import zipfile import simplejson as json from keylime.requests_client import R...
""" Tests for the course search form. """ from unittest import mock from django.http.request import QueryDict from django.test import TestCase from richie.apps.core.defaults import ALL_LANGUAGES_DICT from richie.apps.search.forms import ItemSearchForm @mock.patch.dict(ALL_LANGUAGES_DICT, {"fr": "French", "en": "Eng...
""" Tests for the course search form. """ from unittest import mock from django.http.request import QueryDict from django.test import TestCase from richie.apps.core.defaults import ALL_LANGUAGES_DICT from richie.apps.search.forms import ItemSearchForm @mock.patch.dict(ALL_LANGUAGES_DICT, {"fr": "French", "en": "Eng...
#!/usr/bin/env python3 # Copyright 2011 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """emcc - compiler helper script =============...
#!/usr/bin/env python3 # Copyright 2011 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """emcc - compiler helper script =============...
#!/usr/bin/env python # coding: utf-8 import json import os import pathlib from dotenv import load_dotenv from requests_oauthlib import OAuth1Session class FailedToGetResponse(Exception): """TwitterAPIからのレスポンスが正常ではないことを知らせる例外クラス""" pass class TwitterUtils(): def __init__(self) -> None: root_pa...
#!/usr/bin/env python # coding: utf-8 import json import os import pathlib from dotenv import load_dotenv from requests_oauthlib import OAuth1Session class FailedToGetResponse(Exception): """TwitterAPIからのレスポンスが正常ではないことを知らせる例外クラス""" pass class TwitterUtils(): def __init__(self) -> None: root_pa...
__all__ = ["GoogleAPI", "Resource", "Method"] import re import os import warnings from urllib.parse import urlencode, quote from functools import wraps from typing import List, Generic, TypeVar from .excs import ValidationError from .utils import _safe_getitem from .models import MediaDownload, MediaUpload, Resumable...
__all__ = ["GoogleAPI", "Resource", "Method"] import re import os import warnings from urllib.parse import urlencode, quote from functools import wraps from typing import List, Generic, TypeVar from .excs import ValidationError from .utils import _safe_getitem from .models import MediaDownload, MediaUpload, Resumable...
import copy import re import typing import uritemplate from django.core import exceptions as django_exceptions from django.core import validators from django.db import models from django.utils.translation import gettext_lazy as _ from rest_framework import permissions, renderers, serializers from rest_framework.fields...
import copy import re import typing import uritemplate from django.core import exceptions as django_exceptions from django.core import validators from django.db import models from django.utils.translation import gettext_lazy as _ from rest_framework import permissions, renderers, serializers from rest_framework.fields...
import csv import io import json import logging import sys from datetime import date, datetime, timedelta import hug from peewee import fn, DatabaseError from api import api from access_control.access_control import UserRoles, get_or_create_auto_user from config import config from db import directives from db.migrati...
import csv import io import json import logging import sys from datetime import date, datetime, timedelta import hug from peewee import fn, DatabaseError from api import api from access_control.access_control import UserRoles, get_or_create_auto_user from config import config from db import directives from db.migrati...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 5 10:49:55 2020 @author: nmei """ import pandas as pd import numpy as np from glob import glob from tqdm import tqdm import os from scipy import stats import statsmodels.api as sm from statsmodels.formula.api import ols from statsmodels.stats.ano...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 5 10:49:55 2020 @author: nmei """ import pandas as pd import numpy as np from glob import glob from tqdm import tqdm import os from scipy import stats import statsmodels.api as sm from statsmodels.formula.api import ols from statsmodels.stats.ano...
import discord from discord.ext import commands# import json from func import options class Recipe(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() async def recipe(self, ctx, *, n=None): if n is None: await ctx.send(f'{ctx.author.mention} invalid sy...
import discord from discord.ext import commands# import json from func import options class Recipe(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() async def recipe(self, ctx, *, n=None): if n is None: await ctx.send(f'{ctx.author.mention} invalid sy...
#!/usr/bin/env python3 """ Combine individual metadata files into datapackage.json """ import fnmatch import hashlib import json import logging import os import sys from os import path import yaml LOGGER = logging.getLogger(__name__) def get_source_dict(filename): with open(filename, 'r', encoding='utf8') as f: ...
#!/usr/bin/env python3 """ Combine individual metadata files into datapackage.json """ import fnmatch import hashlib import json import logging import os import sys from os import path import yaml LOGGER = logging.getLogger(__name__) def get_source_dict(filename): with open(filename, 'r', encoding='utf8') as f: ...
""" Functions to download and transform the parquet files to numpy files """ import os from itertools import repeat from multiprocessing import Pool from typing import Tuple from tqdm import tqdm as tq from autofaiss.datasets.readers.remote_iterators import read_filenames from autofaiss.utils.os_tools import run_com...
""" Functions to download and transform the parquet files to numpy files """ import os from itertools import repeat from multiprocessing import Pool from typing import Tuple from tqdm import tqdm as tq from autofaiss.datasets.readers.remote_iterators import read_filenames from autofaiss.utils.os_tools import run_com...
#!/usr/bin/env python import csv import requests import base64 from os import environ from logging import basicConfig, getLogger from time import sleep from pathlib import Path url = "http://www.vpngate.net/api/iphone/" basicConfig(format='[%(asctime)s - %(levelname)s] %(message)s', datefmt="%H:%M:%S") ...
#!/usr/bin/env python import csv import requests import base64 from os import environ from logging import basicConfig, getLogger from time import sleep from pathlib import Path url = "http://www.vpngate.net/api/iphone/" basicConfig(format='[%(asctime)s - %(levelname)s] %(message)s', datefmt="%H:%M:%S") ...
import calendar import copy import datetime import functools import hashlib import itertools import json import math import os.path import random import re import sys import threading import time import traceback from .common import InfoExtractor, SearchInfoExtractor from ..compat import ( compat_chr, compat_H...
import calendar import copy import datetime import functools import hashlib import itertools import json import math import os.path import random import re import sys import threading import time import traceback from .common import InfoExtractor, SearchInfoExtractor from ..compat import ( compat_chr, compat_H...
from numbers import Number from time import time from typing import Iterable, Hashable from diskcache import Index from .helper import hash class CacheSet: """ A Set-like Cache that wraps :class:`diskcache.Index` """ def __init__(self, iterable=(), directory=None): self.index = Index(direct...
from numbers import Number from time import time from typing import Iterable, Hashable from diskcache import Index from .helper import hash class CacheSet: """ A Set-like Cache that wraps :class:`diskcache.Index` """ def __init__(self, iterable=(), directory=None): self.index = Index(direct...
import contextlib import datetime import json class Meta: Title = 'title' Artist = 'artist' Year = 'year' Comment = 'comment' class WeSing: def __init__(self, src): self._src = src self._data = None def get_meta(self): meta = {} try: data = self._...
import contextlib import datetime import json class Meta: Title = 'title' Artist = 'artist' Year = 'year' Comment = 'comment' class WeSing: def __init__(self, src): self._src = src self._data = None def get_meta(self): meta = {} try: data = self._...
# Copyright 2020 Cortex Labs, 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 wri...
# Copyright 2020 Cortex Labs, 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 wri...
import matplotlib.image as mpimg import matplotlib.style as style import matplotlib.pyplot as plt from matplotlib import rcParams from simtk.openmm.app import * from simtk.openmm import * from simtk.unit import * from sys import stdout import seaborn as sns from math import exp import pandas as pd import mdtraj as md i...
import matplotlib.image as mpimg import matplotlib.style as style import matplotlib.pyplot as plt from matplotlib import rcParams from simtk.openmm.app import * from simtk.openmm import * from simtk.unit import * from sys import stdout import seaborn as sns from math import exp import pandas as pd import mdtraj as md i...
import asyncio import datetime import logging from copy import copy from io import BytesIO from typing import Dict, List, Literal, Optional, Tuple, Union, cast import aiohttp import discord from redbot import VersionInfo, version_info from redbot.core import Config, checks, commands from redbot.core.bot import Red fro...
import asyncio import datetime import logging from copy import copy from io import BytesIO from typing import Dict, List, Literal, Optional, Tuple, Union, cast import aiohttp import discord from redbot import VersionInfo, version_info from redbot.core import Config, checks, commands from redbot.core.bot import Red fro...
import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_table as dt import fire import pandas as pd from dash.dependencies import Input, Output from codecarbon.viz.components import Components from codecarbon.viz.data import Data def render_app(df: pd.DataFrame): app = ...
import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_table as dt import fire import pandas as pd from dash.dependencies import Input, Output from codecarbon.viz.components import Components from codecarbon.viz.data import Data def render_app(df: pd.DataFrame): app = ...
from collections import namedtuple from datetime import datetime import numbers import sys from ..time import Resolution, Frequency from .base import Series from .timeseries import TimeseriesList, Timeseries, Value class Period(namedtuple("Period", ("begin", "end", "value"))): """ A period for a period-based...
from collections import namedtuple from datetime import datetime import numbers import sys from ..time import Resolution, Frequency from .base import Series from .timeseries import TimeseriesList, Timeseries, Value class Period(namedtuple("Period", ("begin", "end", "value"))): """ A period for a period-based...
#!/usr/bin/env python3 """ Extract audio from vinput_fne and convert to correct format. """ import asyncio import websockets import sys import json import hashlib import os import argparse from common.tools import compute_digest def parse_options(argv): parser = argparse.ArgumentParser( description='E...
#!/usr/bin/env python3 """ Extract audio from vinput_fne and convert to correct format. """ import asyncio import websockets import sys import json import hashlib import os import argparse from common.tools import compute_digest def parse_options(argv): parser = argparse.ArgumentParser( description='E...
import json import os import unittest import warnings import yaml from checkov.terraform import checks from checkov.common.checks_infra.checks_parser import NXGraphCheckParser from checkov.common.checks_infra.registry import Registry from checkov.common.models.enums import CheckResult from typing import List from path...
import json import os import unittest import warnings import yaml from checkov.terraform import checks from checkov.common.checks_infra.checks_parser import NXGraphCheckParser from checkov.common.checks_infra.registry import Registry from checkov.common.models.enums import CheckResult from typing import List from path...
import os, re, copy, json, subprocess from random import randrange, randint, choice from threading import Thread from couchbase_helper.cluster import Cluster from membase.helper.rebalance_helper import RebalanceHelper from couchbase_helper.documentgenerator import BlobGenerator, DocumentGenerator from ent_backup_resto...
import os, re, copy, json, subprocess from random import randrange, randint, choice from threading import Thread from couchbase_helper.cluster import Cluster from membase.helper.rebalance_helper import RebalanceHelper from couchbase_helper.documentgenerator import BlobGenerator, DocumentGenerator from ent_backup_resto...
""" Utilities for working with the local dataset cache. """ import weakref from contextlib import contextmanager import glob import io import os import logging import tempfile import json from abc import ABC from collections import defaultdict from dataclasses import dataclass, asdict from datetime import timedelta fro...
""" Utilities for working with the local dataset cache. """ import weakref from contextlib import contextmanager import glob import io import os import logging import tempfile import json from abc import ABC from collections import defaultdict from dataclasses import dataclass, asdict from datetime import timedelta fro...
import datetime import json import logging import os import urllib.parse from typing import Optional, Dict, Any import aws_embedded_metrics import boto3 import botocore.client from aws_embedded_metrics.logger.metrics_logger import MetricsLogger STATIC_HEADERS = { "Content-Type": "text/plain; charset=utf-8", "...
import datetime import json import logging import os import urllib.parse from typing import Optional, Dict, Any import aws_embedded_metrics import boto3 import botocore.client from aws_embedded_metrics.logger.metrics_logger import MetricsLogger STATIC_HEADERS = { "Content-Type": "text/plain; charset=utf-8", "...
import os import pytest import sys import random import tempfile import requests from pathlib import Path import ray from ray.test_utils import (run_string_as_driver, run_string_as_driver_nonblocking) from ray._private.utils import (get_wheel_filename, get_master_wheel_url, ...
import os import pytest import sys import random import tempfile import requests from pathlib import Path import ray from ray.test_utils import (run_string_as_driver, run_string_as_driver_nonblocking) from ray._private.utils import (get_wheel_filename, get_master_wheel_url, ...
from __future__ import (absolute_import, division, print_function, unicode_literals) import arrow import backtrader as bt import importlib import time import backtrader.indicators as btind # {'startDay': 283968000, 'endDay': 2524579200, 'kline': 'kline_day', 'myStocks': ['SH.603922'], 'market': 'SH', 'maxTimeBuffer'...
from __future__ import (absolute_import, division, print_function, unicode_literals) import arrow import backtrader as bt import importlib import time import backtrader.indicators as btind # {'startDay': 283968000, 'endDay': 2524579200, 'kline': 'kline_day', 'myStocks': ['SH.603922'], 'market': 'SH', 'maxTimeBuffer'...
# -*- coding: utf-8 -*- import asyncio import base64 import json import ssl import time import typing import urllib.parse from asyncio import TimeoutError from tornado.httpclient import AsyncHTTPClient, HTTPResponse from . import AppConfig from .AppConfig import Expose from .Exceptions import K8sError from .constants...
# -*- coding: utf-8 -*- import asyncio import base64 import json import ssl import time import typing import urllib.parse from asyncio import TimeoutError from tornado.httpclient import AsyncHTTPClient, HTTPResponse from . import AppConfig from .AppConfig import Expose from .Exceptions import K8sError from .constants...
import discord from discord.ext import commands from traceback import format_exception import io import textwrap import contextlib from discord.ext.buttons import Paginator import os class Pag(Paginator): async def teardown(self): try: await self.page.clear_reactions() except discord.HT...
import discord from discord.ext import commands from traceback import format_exception import io import textwrap import contextlib from discord.ext.buttons import Paginator import os class Pag(Paginator): async def teardown(self): try: await self.page.clear_reactions() except discord.HT...
"""Implementation of the wired WebComponents""" import ast import datetime import json from typing import Optional import param from awesome_panel.express.components.material import MWC_ICONS from awesome_panel.express.pane.web_component import WebComponent # @Philippfr. Should we load the full bundle or in...
"""Implementation of the wired WebComponents""" import ast import datetime import json from typing import Optional import param from awesome_panel.express.components.material import MWC_ICONS from awesome_panel.express.pane.web_component import WebComponent # @Philippfr. Should we load the full bundle or in...
"""Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # Sylvain Marie # License: BSD 3 clause from functools import wraps import warnings import numbers import ope...
"""Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # Sylvain Marie # License: BSD 3 clause from functools import wraps import warnings import numbers import ope...
# -*- coding: utf-8 -*- """ Entrance of the subscription module. """ import json import logging import os from datetime import datetime from src.utils_v1.did.eladid import ffi, lib from src import hive_setting from src.utils_v1.constants import APP_INSTANCE_DID, DID_INFO_NONCE_EXPIRED from src.utils_v1.did.entity im...
# -*- coding: utf-8 -*- """ Entrance of the subscription module. """ import json import logging import os from datetime import datetime from src.utils_v1.did.eladid import ffi, lib from src import hive_setting from src.utils_v1.constants import APP_INSTANCE_DID, DID_INFO_NONCE_EXPIRED from src.utils_v1.did.entity im...
from typing import Any, Dict, List from .utils import get_json def fetch_markets(market_type: str) -> List[Dict[str, Any]]: '''Fetch all trading markets from a crypto exchage.''' if market_type == 'spot': return _fetch_spot_markets() elif market_type == 'swap': return _fetch_swap_markets(...
from typing import Any, Dict, List from .utils import get_json def fetch_markets(market_type: str) -> List[Dict[str, Any]]: '''Fetch all trading markets from a crypto exchage.''' if market_type == 'spot': return _fetch_spot_markets() elif market_type == 'swap': return _fetch_swap_markets(...
""" Training or finetuning a LSR model on DocRED dataset. """ import argparse import csv import json import logging import os import numpy as np import torch from sklearn import metrics from torch.utils.data.dataloader import DataLoader, default_collate from transformers import set_seed from .config import LsrConfig ...
""" Training or finetuning a LSR model on DocRED dataset. """ import argparse import csv import json import logging import os import numpy as np import torch from sklearn import metrics from torch.utils.data.dataloader import DataLoader, default_collate from transformers import set_seed from .config import LsrConfig ...
from fastapi import APIRouter from fastapi.param_functions import Depends from starlette.requests import Request from starlette.responses import RedirectResponse from dependencies import get_user import math router = APIRouter() def convert_size(size_bytes): if size_bytes == 0: return "0MB" size_name = ("...
from fastapi import APIRouter from fastapi.param_functions import Depends from starlette.requests import Request from starlette.responses import RedirectResponse from dependencies import get_user import math router = APIRouter() def convert_size(size_bytes): if size_bytes == 0: return "0MB" size_name = ("...
#!/usr/bin/env python3 from env import env from run_common import AWSCli from run_common import print_message from run_common import print_session from run_terminate_codebuild_common import run_terminate_vpc_project from run_terminate_codebuild_common import terminate_all_iam_role_and_policy from run_terminate_codebuil...
#!/usr/bin/env python3 from env import env from run_common import AWSCli from run_common import print_message from run_common import print_session from run_terminate_codebuild_common import run_terminate_vpc_project from run_terminate_codebuild_common import terminate_all_iam_role_and_policy from run_terminate_codebuil...
import discord import time import os import psutil import datetime from datetime import datetime from discord.ext import commands from utils import default, repo class Information(commands.Cog): def __init__(self, bot): self.bot = bot self.process = psutil.Process(os.getpid()) ...
import discord import time import os import psutil import datetime from datetime import datetime from discord.ext import commands from utils import default, repo class Information(commands.Cog): def __init__(self, bot): self.bot = bot self.process = psutil.Process(os.getpid()) ...
import json import os import unittest import warnings import yaml from checkov.terraform import checks from checkov.common.checks_infra.checks_parser import NXGraphCheckParser from checkov.common.checks_infra.registry import Registry from checkov.common.models.enums import CheckResult from typing import List from path...
import json import os import unittest import warnings import yaml from checkov.terraform import checks from checkov.common.checks_infra.checks_parser import NXGraphCheckParser from checkov.common.checks_infra.registry import Registry from checkov.common.models.enums import CheckResult from typing import List from path...
# --- # Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
# --- # Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
from datetime import timedelta, date, datetime from django.utils.text import slugify from django.db import models from django.urls import reverse from django.conf import settings from django.contrib.auth.models import AbstractUser from django.utils.translation import gettext as _ from django.db.models import Q from dja...
from datetime import timedelta, date, datetime from django.utils.text import slugify from django.db import models from django.urls import reverse from django.conf import settings from django.contrib.auth.models import AbstractUser from django.utils.translation import gettext as _ from django.db.models import Q from dja...
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
"""Performs an SRE checkpoint. The checks are defined in https://gitlab.cee.redhat.com/app-sre/contract/-/blob/master/content/process/sre_checkpoints.md """ import logging import re from functools import partial, lru_cache from http import HTTPStatus from pathlib import Path from typing import Any, Callable, Dict, It...
"""Performs an SRE checkpoint. The checks are defined in https://gitlab.cee.redhat.com/app-sre/contract/-/blob/master/content/process/sre_checkpoints.md """ import logging import re from functools import partial, lru_cache from http import HTTPStatus from pathlib import Path from typing import Any, Callable, Dict, It...
""" # Validation loop The lightning validation loop handles everything except the actual computations of your model. To decide what will happen in your validation loop, define the `validation_step` function. Below are all the things lightning automates for you in the validation loop. .. note:: Lightning will run 5 st...
""" # Validation loop The lightning validation loop handles everything except the actual computations of your model. To decide what will happen in your validation loop, define the `validation_step` function. Below are all the things lightning automates for you in the validation loop. .. note:: Lightning will run 5 st...
import logging import os from itertools import permutations from typing import Dict, List, Set, Tuple, Union import pysbd from rich import print from sumeval.metrics.rouge import RougeCalculator from factsumm.utils.module_entity import load_ie, load_ner, load_rel from factsumm.utils.module_question import load_qa, lo...
import logging import os from itertools import permutations from typing import Dict, List, Set, Tuple, Union import pysbd from rich import print from sumeval.metrics.rouge import RougeCalculator from factsumm.utils.module_entity import load_ie, load_ner, load_rel from factsumm.utils.module_question import load_qa, lo...
import logging from google.protobuf.json_format import MessageToDict from spaceone.core import pygrpc from spaceone.core.connector import BaseConnector from spaceone.core.utils import parse_endpoint from spaceone.identity.error.error_authentication import * _LOGGER = logging.getLogger(__name__) class AuthPluginCon...
import logging from google.protobuf.json_format import MessageToDict from spaceone.core import pygrpc from spaceone.core.connector import BaseConnector from spaceone.core.utils import parse_endpoint from spaceone.identity.error.error_authentication import * _LOGGER = logging.getLogger(__name__) class AuthPluginCon...
# Copyright 2021 Raven Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright 2021 Raven Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
import kopf import yaml import kubernetes import time from jinja2 import Environment, FileSystemLoader def wait_until_job_end(jobname): api = kubernetes.client.BatchV1Api() job_finished = False jobs = api.list_namespaced_job('default') while (not job_finished) and \ any(job.metadata.name =...
import kopf import yaml import kubernetes import time from jinja2 import Environment, FileSystemLoader def wait_until_job_end(jobname): api = kubernetes.client.BatchV1Api() job_finished = False jobs = api.list_namespaced_job('default') while (not job_finished) and \ any(job.metadata.name =...
import enum import json import pytest from dagster import ( ConfigMapping, DagsterInstance, Enum, Field, In, InputDefinition, Nothing, Out, Permissive, Shape, graph, logger, op, resource, success_hook, ) from dagster.check import CheckError from dagster.core....
import enum import json import pytest from dagster import ( ConfigMapping, DagsterInstance, Enum, Field, In, InputDefinition, Nothing, Out, Permissive, Shape, graph, logger, op, resource, success_hook, ) from dagster.check import CheckError from dagster.core....
import pytest from text_providers.Nestle1904LowfatProvider import Nestle1904LowfatProvider from typing import Callable from unittest.mock import MagicMock from AnoixoError import ProbableBugError, ServerOverwhelmedError from TextQuery import TextQuery @pytest.fixture def basex_session_mock(mocker): basex_session_...
import pytest from text_providers.Nestle1904LowfatProvider import Nestle1904LowfatProvider from typing import Callable from unittest.mock import MagicMock from AnoixoError import ProbableBugError, ServerOverwhelmedError from TextQuery import TextQuery @pytest.fixture def basex_session_mock(mocker): basex_session_...
import asyncio import datetime from typing import Optional import discord from ElevatorBot.database.database import lookupDiscordID from ElevatorBot.events.backgroundTasks import UpdateActivityDB from ElevatorBot.events.baseEvent import BaseEvent from ElevatorBot.backendNetworking.destinyPlayer import DestinyPlayer f...
import asyncio import datetime from typing import Optional import discord from ElevatorBot.database.database import lookupDiscordID from ElevatorBot.events.backgroundTasks import UpdateActivityDB from ElevatorBot.events.baseEvent import BaseEvent from ElevatorBot.backendNetworking.destinyPlayer import DestinyPlayer f...
""" Credit: m3hrdadfi https://huggingface.co/m3hrdadfi/wav2vec2-large-xlsr-persian-v2 """ import re import string import hazm _normalizer = hazm.Normalizer() chars_to_ignore = [ ",", "?", ".", "!", "-", ";", ":", '""', "%", "'", '"', "�", "#", "!", "؟", ...
""" Credit: m3hrdadfi https://huggingface.co/m3hrdadfi/wav2vec2-large-xlsr-persian-v2 """ import re import string import hazm _normalizer = hazm.Normalizer() chars_to_ignore = [ ",", "?", ".", "!", "-", ";", ":", '""', "%", "'", '"', "�", "#", "!", "؟", ...
import discord from discord.ext import commands from discord import utils import asyncio import json class Suggest(): def __init__(self, bot): self.bot = bot @commands.command(name="suggest") @commands.guild_only() async def suggest(self, ctx): """Test""" ...
import discord from discord.ext import commands from discord import utils import asyncio import json class Suggest(): def __init__(self, bot): self.bot = bot @commands.command(name="suggest") @commands.guild_only() async def suggest(self, ctx): """Test""" ...
import copy import os import warnings from collections import OrderedDict import numpy as np import pandas as pd import woodwork as ww from joblib import Parallel, delayed from sklearn.exceptions import NotFittedError from sklearn.inspection import partial_dependence as sk_partial_dependence from sklearn.inspection im...
import copy import os import warnings from collections import OrderedDict import numpy as np import pandas as pd import woodwork as ww from joblib import Parallel, delayed from sklearn.exceptions import NotFittedError from sklearn.inspection import partial_dependence as sk_partial_dependence from sklearn.inspection im...
import xarray from matplotlib.pyplot import figure def timeprofile(iono: xarray.Dataset): fig = figure(figsize=(16, 12)) axs = fig.subplots(3, 1, sharex=True).ravel() fig.suptitle( f"{str(iono.time[0].values)[:-13]} to " f"{str(iono.time[-1].values)[:-13]}\n" f"Glat, Glon: {iono....
import xarray from matplotlib.pyplot import figure def timeprofile(iono: xarray.Dataset): fig = figure(figsize=(16, 12)) axs = fig.subplots(3, 1, sharex=True).ravel() fig.suptitle( f"{str(iono.time[0].values)[:-13]} to " f"{str(iono.time[-1].values)[:-13]}\n" f"Glat, Glon: {iono....
# %% import time import datetime from scipy.stats import uniform import statsmodels.api as sm from statsmodels.stats.outliers_influence import variance_inflation_factor from sklearn.pipeline import Pipeline from sklearn.model_selection import RandomizedSearchCV, train_test_split # Moldeling Libraries from sklearn.lin...
# %% import time import datetime from scipy.stats import uniform import statsmodels.api as sm from statsmodels.stats.outliers_influence import variance_inflation_factor from sklearn.pipeline import Pipeline from sklearn.model_selection import RandomizedSearchCV, train_test_split # Moldeling Libraries from sklearn.lin...
import traceback import json import os import asyncio import concurrent.futures import datetime import aiohttp from aiohttp import web import uvloop import jinja2 import humanize import aiohttp_jinja2 from gidgethub import aiohttp as gh_aiohttp, routing as gh_routing, sansio as gh_sansio import batch from .log import ...
import traceback import json import os import asyncio import concurrent.futures import datetime import aiohttp from aiohttp import web import uvloop import jinja2 import humanize import aiohttp_jinja2 from gidgethub import aiohttp as gh_aiohttp, routing as gh_routing, sansio as gh_sansio import batch from .log import ...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import textwrap from dataclasses import dataclass from typing import Generic, Optional, Sequence, Type, get_type_hints from pants.engine.console import Console from pants.engine.goal impo...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import textwrap from dataclasses import dataclass from typing import Generic, Optional, Sequence, Type, get_type_hints from pants.engine.console import Console from pants.engine.goal impo...
import tensorflow as tf import os import numpy as np from data.preprocess import load_image from models.encoder import CNN_Encoder from models.decoder import RNN_Decoder import pickle from train import embedding_dim, units, vocab_size, img_name_train, img_name_val, max_length, cap_val import matplotlib.pyplot as plt fr...
import tensorflow as tf import os import numpy as np from data.preprocess import load_image from models.encoder import CNN_Encoder from models.decoder import RNN_Decoder import pickle from train import embedding_dim, units, vocab_size, img_name_train, img_name_val, max_length, cap_val import matplotlib.pyplot as plt fr...
from collections import OrderedDict from entities.person import Person class PersonTracker(): def __init__(self): self.persons = OrderedDict() self.persons_activities = [] def register(self, name, entry_time): self.persons[name] = Person(name, entry_time, 0) def mark_person_disapp...
from collections import OrderedDict from entities.person import Person class PersonTracker(): def __init__(self): self.persons = OrderedDict() self.persons_activities = [] def register(self, name, entry_time): self.persons[name] = Person(name, entry_time, 0) def mark_person_disapp...
import multiprocessing import queue import random import threading import unittest import requests import time from dateutil.parser import parse from .fixtures import APITestCase class ContainerTestCase(APITestCase): def test_list(self): r = requests.get(self.uri("/containers/json"), timeout=5) ...
import multiprocessing import queue import random import threading import unittest import requests import time from dateutil.parser import parse from .fixtures import APITestCase class ContainerTestCase(APITestCase): def test_list(self): r = requests.get(self.uri("/containers/json"), timeout=5) ...
import argparse import spotipy import secrets as user_secrets from spotipy.oauth2 import SpotifyOAuth PERMISSIONS_SCOPE = 'user-library-read playlist-modify-public' FILTERS_AND_ARGS = None # Track stats FILTERED, ADDED, SKIPPED = 0, 0, 0 def get_args(): parser = argparse.ArgumentParser(descript...
import argparse import spotipy import secrets as user_secrets from spotipy.oauth2 import SpotifyOAuth PERMISSIONS_SCOPE = 'user-library-read playlist-modify-public' FILTERS_AND_ARGS = None # Track stats FILTERED, ADDED, SKIPPED = 0, 0, 0 def get_args(): parser = argparse.ArgumentParser(descript...
import sys sys.path.append("../shared") sys.path.append("") import logging import numpy as np import df_utils import file_utils import time import pandas as pd from plotly.subplots import make_subplots from plotly.offline import plot import plotly.graph_objects as go from sklearn.linear_model import LinearRegression fr...
import sys sys.path.append("../shared") sys.path.append("") import logging import numpy as np import df_utils import file_utils import time import pandas as pd from plotly.subplots import make_subplots from plotly.offline import plot import plotly.graph_objects as go from sklearn.linear_model import LinearRegression fr...
import json import os import time import datetime import pytz from xml.sax.saxutils import escape from wsgiref.handlers import format_date_time import cachetools.func import diskcache import requests import podgen from flask import abort from flask import render_template from flask import make_response from flask imp...
import json import os import time import datetime import pytz from xml.sax.saxutils import escape from wsgiref.handlers import format_date_time import cachetools.func import diskcache import requests import podgen from flask import abort from flask import render_template from flask import make_response from flask imp...
import json import logging import math import os import random import warnings from multiprocessing import cpu_count from pathlib import Path import numpy as np from tqdm.auto import tqdm, trange import pandas as pd import torch from simpletransformers.config.global_args import global_args from simpletransformers.seq...
import json import logging import math import os import random import warnings from multiprocessing import cpu_count from pathlib import Path import numpy as np from tqdm.auto import tqdm, trange import pandas as pd import torch from simpletransformers.config.global_args import global_args from simpletransformers.seq...
# Copyright 2018 Google LLC # # 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, s...
# Copyright 2018 Google LLC # # 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, s...
from django.shortcuts import render from django.core.exceptions import ObjectDoesNotExist from django.contrib.contenttypes.models import ContentType from django.http import HttpResponse, JsonResponse, Http404 from django.shortcuts import render, get_object_or_404 from django.utils.text import slugify from django.urls i...
from django.shortcuts import render from django.core.exceptions import ObjectDoesNotExist from django.contrib.contenttypes.models import ContentType from django.http import HttpResponse, JsonResponse, Http404 from django.shortcuts import render, get_object_or_404 from django.utils.text import slugify from django.urls i...
#!/usr/bin/env python3 __version__ = '0.1.0' __author__ = 'https://md.land/md' import datetime import math import os import re import sys import typing import json # Entity class Day: def __init__(self, date: datetime.date, entry_list: typing.List['Entry']): self.date: datetime.date = date self...
#!/usr/bin/env python3 __version__ = '0.1.0' __author__ = 'https://md.land/md' import datetime import math import os import re import sys import typing import json # Entity class Day: def __init__(self, date: datetime.date, entry_list: typing.List['Entry']): self.date: datetime.date = date self...
import os import tests.testdata as test_data from mkqa_eval import ( compute_mkqa_scores_for_language, MKQAAnnotation, MKQAPrediction, read_predictions, read_annotations, evaluate, ) package_path = list(test_data.__path__)[0] def test_compute_mkqa_scores(): test_cases = [ # Test ...
import os import tests.testdata as test_data from mkqa_eval import ( compute_mkqa_scores_for_language, MKQAAnnotation, MKQAPrediction, read_predictions, read_annotations, evaluate, ) package_path = list(test_data.__path__)[0] def test_compute_mkqa_scores(): test_cases = [ # Test ...
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 from http import HTTPStatus from jira import JIRA, JIRAError, Issue, User as JiraUser from typing import Any, List from flask import current_app as app from amundsen_application.api.metadata.v0 import USER_ENDPOINT from amundsen_...
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 from http import HTTPStatus from jira import JIRA, JIRAError, Issue, User as JiraUser from typing import Any, List from flask import current_app as app from amundsen_application.api.metadata.v0 import USER_ENDPOINT from amundsen_...
""" This sets variables for a matrix of QT versions to test downloading against with Azure Pipelines """ import collections import json from itertools import product class BuildJob: def __init__(self, qt_version, host, target, arch, archdir, module=None): self.qt_version = qt_version self.host = h...
""" This sets variables for a matrix of QT versions to test downloading against with Azure Pipelines """ import collections import json from itertools import product class BuildJob: def __init__(self, qt_version, host, target, arch, archdir, module=None): self.qt_version = qt_version self.host = h...
#!/usr/bin/env python3 import argparse import glob import html import json import os import random import re import shutil import subprocess import sys import traceback from datetime import datetime from distutils.version import StrictVersion from functools import partial from multiprocessing import Pool from typing i...
#!/usr/bin/env python3 import argparse import glob import html import json import os import random import re import shutil import subprocess import sys import traceback from datetime import datetime from distutils.version import StrictVersion from functools import partial from multiprocessing import Pool from typing i...
""" Interval datatypes """ import logging import math import sys import tempfile from urllib.parse import quote_plus from bx.intervals.io import ( GenomicIntervalReader, ParseError, ) from galaxy import util from galaxy.datatypes import metadata from galaxy.datatypes.data import DatatypeValidation from galaxy...
""" Interval datatypes """ import logging import math import sys import tempfile from urllib.parse import quote_plus from bx.intervals.io import ( GenomicIntervalReader, ParseError, ) from galaxy import util from galaxy.datatypes import metadata from galaxy.datatypes.data import DatatypeValidation from galaxy...
from __future__ import annotations from pre_commit_hooks.check_yaml import yaml def test_readme_contains_all_hooks(): with open('README.md', encoding='UTF-8') as f: readme_contents = f.read() with open('.pre-commit-hooks.yaml', encoding='UTF-8') as f: hooks = yaml.load(f) for hook in hook...
from __future__ import annotations from pre_commit_hooks.check_yaml import yaml def test_readme_contains_all_hooks(): with open('README.md', encoding='UTF-8') as f: readme_contents = f.read() with open('.pre-commit-hooks.yaml', encoding='UTF-8') as f: hooks = yaml.load(f) for hook in hook...
from fpdf import FPDF import os from datetime import datetime width, height = 595, 842 topic_size = 32 subtopic_size = 24 normal_size = 16 padding = 10 next_topic = "next topic" next_subtopic = "next subtopic" image_trigger = "insert screenshot" def getImportantWord(line): words = line.split(" ") ind = wor...
from fpdf import FPDF import os from datetime import datetime width, height = 595, 842 topic_size = 32 subtopic_size = 24 normal_size = 16 padding = 10 next_topic = "next topic" next_subtopic = "next subtopic" image_trigger = "insert screenshot" def getImportantWord(line): words = line.split(" ") ind = wor...
from psychopy import core from bcipy.display.rsvp.mode.calibration import CalibrationDisplay from bcipy.tasks.task import Task from bcipy.helpers.triggers import _write_triggers_from_sequence_calibration from bcipy.helpers.stimuli import random_rsvp_calibration_seq_gen, get_task_info from bcipy.helpers.task import (...
from psychopy import core from bcipy.display.rsvp.mode.calibration import CalibrationDisplay from bcipy.tasks.task import Task from bcipy.helpers.triggers import _write_triggers_from_sequence_calibration from bcipy.helpers.stimuli import random_rsvp_calibration_seq_gen, get_task_info from bcipy.helpers.task import (...
""" @author: Gabriele Girelli @contact: gigi.ga90@gmail.com """ import argparse from collections import defaultdict from czifile import CziFile # type: ignore import logging from logging import Logger, getLogger from nd2reader import ND2Reader # type: ignore from nd2reader.parser import Parser as ND2Parser # type: ...
""" @author: Gabriele Girelli @contact: gigi.ga90@gmail.com """ import argparse from collections import defaultdict from czifile import CziFile # type: ignore import logging from logging import Logger, getLogger from nd2reader import ND2Reader # type: ignore from nd2reader.parser import Parser as ND2Parser # type: ...
import datetime from src import const from src.commands import BaseCmd from src.config import bc from src.message import Msg from src.reminder import Reminder from src.utils import Util class ReminderCommands(BaseCmd): def bind(self): bc.commands.register_command(__name__, self.get_classname(), "addremin...
import datetime from src import const from src.commands import BaseCmd from src.config import bc from src.message import Msg from src.reminder import Reminder from src.utils import Util class ReminderCommands(BaseCmd): def bind(self): bc.commands.register_command(__name__, self.get_classname(), "addremin...