edited_code
stringlengths
17
978k
original_code
stringlengths
17
978k
import copy import logging from collections.abc import Mapping from typing import Any, Dict, Generator, List, Optional, Tuple import numpy import random from ray.tune import TuneError from ray.tune.sample import (Categorical, Domain, Function, RandomState) logger = logging.getLogger(__name__) def generate_variants...
import copy import logging from collections.abc import Mapping from typing import Any, Dict, Generator, List, Optional, Tuple import numpy import random from ray.tune import TuneError from ray.tune.sample import (Categorical, Domain, Function, RandomState) logger = logging.getLogger(__name__) def generate_variants...
import asyncio import json import logging import queue from concurrent.futures import ThreadPoolExecutor from datetime import datetime, timedelta from typing import Dict, Tuple, List from cincanregistry.models.tool_info import ToolInfo from cincanregistry.models.version_info import VersionInfo, VersionType from .check...
import asyncio import json import logging import queue from concurrent.futures import ThreadPoolExecutor from datetime import datetime, timedelta from typing import Dict, Tuple, List from cincanregistry.models.tool_info import ToolInfo from cincanregistry.models.version_info import VersionInfo, VersionType from .check...
#!/usr/bin/env python3 """ This module defines a KakSender class to communicate with Kakoune sessions over Unix sockets. It implements smooth scrolling when executed as a script. """ import sys import os import time import socket SEND_INTERVAL = 2e-3 # min time interval (in s) between two sent scroll events class ...
#!/usr/bin/env python3 """ This module defines a KakSender class to communicate with Kakoune sessions over Unix sockets. It implements smooth scrolling when executed as a script. """ import sys import os import time import socket SEND_INTERVAL = 2e-3 # min time interval (in s) between two sent scroll events class ...
import json import copy import requests import datetime from logUtils import * # Log file location _logFilePath = r"D:/Temp/Logging/createViews_[date].log" # ArcGIS Online _sourceFLUrl = "[YOUR-FEATURE-LAYER-URL]" _uniqueValueField = "PROVINCIE" _username = "[YOUR-USERNAME]" _password = "[YOUR-PASSWORD]" # Sript pa...
import json import copy import requests import datetime from logUtils import * # Log file location _logFilePath = r"D:/Temp/Logging/createViews_[date].log" # ArcGIS Online _sourceFLUrl = "[YOUR-FEATURE-LAYER-URL]" _uniqueValueField = "PROVINCIE" _username = "[YOUR-USERNAME]" _password = "[YOUR-PASSWORD]" # Sript pa...
import requests from datetime import datetime USERNAME = "samitha" TOKEN = "" pixela_endpoint = "https://pixe.la/v1/users" user_params = { "token": TOKEN, "username": USERNAME, "agreeTermsOfService": "yes", "notMinor": "yes", } # response = requests.post(url=pixela_endpoint, json=user_p...
import requests from datetime import datetime USERNAME = "samitha" TOKEN = "" pixela_endpoint = "https://pixe.la/v1/users" user_params = { "token": TOKEN, "username": USERNAME, "agreeTermsOfService": "yes", "notMinor": "yes", } # response = requests.post(url=pixela_endpoint, json=user_p...
import os import uuid from typing import Dict, List, Optional import pandas as pd from feast import SnowflakeSource from feast.data_source import DataSource from feast.infra.offline_stores.snowflake import SnowflakeOfflineStoreConfig from feast.infra.offline_stores.snowflake_source import SavedDatasetSnowflakeStorage...
import os import uuid from typing import Dict, List, Optional import pandas as pd from feast import SnowflakeSource from feast.data_source import DataSource from feast.infra.offline_stores.snowflake import SnowflakeOfflineStoreConfig from feast.infra.offline_stores.snowflake_source import SavedDatasetSnowflakeStorage...
import dash import dash_core_components as dcc import dash_html_components as html import pandas as pd import plotly.graph_objs as go from dash.dependencies import Input, Output import datetime as dt import pandas_datareader as web app = dash.Dash() server = app.server start = dt.datetime(2000,1,1) end = dt.datetim...
import dash import dash_core_components as dcc import dash_html_components as html import pandas as pd import plotly.graph_objs as go from dash.dependencies import Input, Output import datetime as dt import pandas_datareader as web app = dash.Dash() server = app.server start = dt.datetime(2000,1,1) end = dt.datetim...
import json import os import threading from typing import List import yara from assemblyline.common.str_utils import safe_str from assemblyline_v4_service.common.base import ServiceBase from assemblyline_v4_service.common.result import Result, ResultSection, BODY_FORMAT from yara_.helper import YaraMetadata class Y...
import json import os import threading from typing import List import yara from assemblyline.common.str_utils import safe_str from assemblyline_v4_service.common.base import ServiceBase from assemblyline_v4_service.common.result import Result, ResultSection, BODY_FORMAT from yara_.helper import YaraMetadata class Y...
#!/usr/bin/env python3 """ This module updates all Powershell scripts in Intune if the configuration in Intune differs from the JSON/YAML file. Parameters ---------- path : str The path to where the backup is saved token : str The token to use for authenticating the request """ import json import os import b...
#!/usr/bin/env python3 """ This module updates all Powershell scripts in Intune if the configuration in Intune differs from the JSON/YAML file. Parameters ---------- path : str The path to where the backup is saved token : str The token to use for authenticating the request """ import json import os import b...
# -*- coding:utf-8 -*- # # Copyright (C) 2019-2020, Maximilian Köhl <koehl@cs.uni-saarland.de> from __future__ import annotations import dataclasses as d import typing as t import dataclasses import fractions from .. import model from ..model import actions, expressions, types, properties, operators from . import ...
# -*- coding:utf-8 -*- # # Copyright (C) 2019-2020, Maximilian Köhl <koehl@cs.uni-saarland.de> from __future__ import annotations import dataclasses as d import typing as t import dataclasses import fractions from .. import model from ..model import actions, expressions, types, properties, operators from . import ...
# Portions copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) # pyre-unsafe """A flow graph representation for Python bytecode""" from __future__ import annotations import sys from contextlib import contextmanager from types import CodeType from typing import Generator, List, Optional from . i...
# Portions copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) # pyre-unsafe """A flow graph representation for Python bytecode""" from __future__ import annotations import sys from contextlib import contextmanager from types import CodeType from typing import Generator, List, Optional from . i...
#!/usr/bin/env python3 # # Copyright (c) 2020 unfoldingWord # http://creativecommons.org/licenses/MIT/ # See LICENSE file for details. # # Contributors: # Richard Mahn <rich.mahn@unfoldingword.org> """ This script generates the HTML and PDF SN-SQ documents """ import os import re import markdown2 import general_t...
#!/usr/bin/env python3 # # Copyright (c) 2020 unfoldingWord # http://creativecommons.org/licenses/MIT/ # See LICENSE file for details. # # Contributors: # Richard Mahn <rich.mahn@unfoldingword.org> """ This script generates the HTML and PDF SN-SQ documents """ import os import re import markdown2 import general_t...
import os from gen.javaLabeled.JavaLexer import JavaLexer # try: # import understand as und # except ImportError as e: # print(e) from utilization.setup_understand import * from antlr4 import * from antlr4.TokenStreamRewriter import TokenStreamRewriter from gen.javaLabeled.JavaParserLabeled import JavaParse...
import os from gen.javaLabeled.JavaLexer import JavaLexer # try: # import understand as und # except ImportError as e: # print(e) from utilization.setup_understand import * from antlr4 import * from antlr4.TokenStreamRewriter import TokenStreamRewriter from gen.javaLabeled.JavaParserLabeled import JavaParse...
import os, fnmatch, sys, importlib, time, argparse from rich.console import Console from rich.table import Table from rich.style import Style # TODO testTransferRequests.py loadTests = [ 'testLoad' ] singleTests = [] def isRunTest(name:str) -> bool: if args.runAll: # run all tests return True if len(sing...
import os, fnmatch, sys, importlib, time, argparse from rich.console import Console from rich.table import Table from rich.style import Style # TODO testTransferRequests.py loadTests = [ 'testLoad' ] singleTests = [] def isRunTest(name:str) -> bool: if args.runAll: # run all tests return True if len(sing...
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from d...
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from d...
import inspect import pytest import spidertools.common.reflection as reflection @pytest.mark.parametrize("package", ["command_lang", "common", "discord", "math", "twitch", "webserver"]) def test_docs(package): result = reflection.get_undoced(f"spidertools.{package}") assert len(result) is 0, f"Missing docume...
import inspect import pytest import spidertools.common.reflection as reflection @pytest.mark.parametrize("package", ["command_lang", "common", "discord", "math", "twitch", "webserver"]) def test_docs(package): result = reflection.get_undoced(f"spidertools.{package}") assert len(result) is 0, f"Missing docume...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
from django.db.models import Q from typing import Optional from usaspending_api.references.constants import DOD_ARMED_FORCES_CGAC, DOD_ARMED_FORCES_TAS_CGAC_FREC from usaspending_api.references.models.cgac import CGAC from usaspending_api.references.models.frec import FREC def dod_tas_agency_filter(field_name=None, f...
from django.db.models import Q from typing import Optional from usaspending_api.references.constants import DOD_ARMED_FORCES_CGAC, DOD_ARMED_FORCES_TAS_CGAC_FREC from usaspending_api.references.models.cgac import CGAC from usaspending_api.references.models.frec import FREC def dod_tas_agency_filter(field_name=None, f...
import json import logging import requests logger = logging.getLogger(__name__) class HealthCheck(): def __init__(self, backup_config): self.backup_name = backup_config['Name'] self.url = backup_config['HealthCheckUrl'] def push(self, initialize=None, failure=None): logger.debug( ...
import json import logging import requests logger = logging.getLogger(__name__) class HealthCheck(): def __init__(self, backup_config): self.backup_name = backup_config['Name'] self.url = backup_config['HealthCheckUrl'] def push(self, initialize=None, failure=None): logger.debug( ...
"""Indy SDK verifier implementation.""" import json import logging import indy.anoncreds from indy.error import IndyError from ...core.profile import Profile from ..verifier import IndyVerifier LOGGER = logging.getLogger(__name__) class IndySdkVerifier(IndyVerifier): """Indy-SDK verifier implementation.""" ...
"""Indy SDK verifier implementation.""" import json import logging import indy.anoncreds from indy.error import IndyError from ...core.profile import Profile from ..verifier import IndyVerifier LOGGER = logging.getLogger(__name__) class IndySdkVerifier(IndyVerifier): """Indy-SDK verifier implementation.""" ...
import os import shutil from hummingbot.client.config.config_var import ConfigVar from hummingbot.core.utils.async_utils import safe_ensure_future from hummingbot.client.config.config_helpers import ( get_strategy_config_map, parse_cvar_value, default_strategy_file_path, save_to_yml, get_strategy_t...
import os import shutil from hummingbot.client.config.config_var import ConfigVar from hummingbot.core.utils.async_utils import safe_ensure_future from hummingbot.client.config.config_helpers import ( get_strategy_config_map, parse_cvar_value, default_strategy_file_path, save_to_yml, get_strategy_t...
"""Script to play the allocation game based on the previously trained policies """ # external imports import os import random import copy import numpy as np import sys from numpy.random import permutation import rl_setup def play(patient_list, doc_stats, folder_name, rounds=10): patients = patient_list doc...
"""Script to play the allocation game based on the previously trained policies """ # external imports import os import random import copy import numpy as np import sys from numpy.random import permutation import rl_setup def play(patient_list, doc_stats, folder_name, rounds=10): patients = patient_list doc...
import os import requests import time import json import urllib.parse import logging from typing import Dict, Callable, Union from instauto.api.structs import DeviceProfile, IGProfile, State, Method from instauto.api.constants import API_BASE_URL from instauto.api.exceptions import WrongMethodException, IncorrectLog...
import os import requests import time import json import urllib.parse import logging from typing import Dict, Callable, Union from instauto.api.structs import DeviceProfile, IGProfile, State, Method from instauto.api.constants import API_BASE_URL from instauto.api.exceptions import WrongMethodException, IncorrectLog...
"""Crypto Technical Analysis Controller Module""" __docformat__ = "numpy" # pylint:disable=too-many-lines import argparse import difflib from typing import List, Union from datetime import datetime from colorama import Style import pandas as pd from prompt_toolkit.completion import NestedCompleter from gamestonk_ter...
"""Crypto Technical Analysis Controller Module""" __docformat__ = "numpy" # pylint:disable=too-many-lines import argparse import difflib from typing import List, Union from datetime import datetime from colorama import Style import pandas as pd from prompt_toolkit.completion import NestedCompleter from gamestonk_ter...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.b (the "License"); # you may not use this file except in compliance with the License. # # """ Userbot module for having some fun with people. """ import asyncio import random import re import time from use...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.b (the "License"); # you may not use this file except in compliance with the License. # # """ Userbot module for having some fun with people. """ import asyncio import random import re import time from use...
from __future__ import print_function import argparse import os import pickle import random import numpy as np import csv import paddle from model import RN, CNN_MLP # Training settings parser = argparse.ArgumentParser(description='Paddle Relational-Network sort-of-CLVR Example') parser.add_argument('--model', type...
from __future__ import print_function import argparse import os import pickle import random import numpy as np import csv import paddle from model import RN, CNN_MLP # Training settings parser = argparse.ArgumentParser(description='Paddle Relational-Network sort-of-CLVR Example') parser.add_argument('--model', type...
NAME = "training_pipeline" def training_pipeline( pipeline_params: dict, compile_params: dict, model_params: dict, source_params: dict, training_params: dict, data_processing_pipeline_params: dict = None, versioner_params: dict = None, processor_params: dict = None, sink_params...
NAME = "training_pipeline" def training_pipeline( pipeline_params: dict, compile_params: dict, model_params: dict, source_params: dict, training_params: dict, data_processing_pipeline_params: dict = None, versioner_params: dict = None, processor_params: dict = None, sink_params...
import json with open('graph.json') as json_file: data = json.load(json_file) print(f"data length: {len(data)}") for room in data: if data[room]['title'] != 'A misty room': print(f"room: {room}, title: {data[room]["title"]}")
import json with open('graph.json') as json_file: data = json.load(json_file) print(f"data length: {len(data)}") for room in data: if data[room]['title'] != 'A misty room': print(f"room: {room}, title: {data[room]['title']}")
import requests import jmespath class Client: opts = { 'data_url': 'https://data.opencrypto.io/data.json' } def __init__(self, options={}): for key in options: print(key) self.opts[key] = options[key] self.data = None self.load() def load(self): if self.data is None: pri...
import requests import jmespath class Client: opts = { 'data_url': 'https://data.opencrypto.io/data.json' } def __init__(self, options={}): for key in options: print(key) self.opts[key] = options[key] self.data = None self.load() def load(self): if self.data is None: pri...
# Copyright (c) 2018 The Pooch Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause # # This code is part of the Fatiando a Terra project (https://www.fatiando.org) # """ The classes that actually handle the downloads. """ import sys import ftplib import reques...
# Copyright (c) 2018 The Pooch Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause # # This code is part of the Fatiando a Terra project (https://www.fatiando.org) # """ The classes that actually handle the downloads. """ import sys import ftplib import reques...
# https://runestone.academy/runestone/static/pythonds/AlgorithmAnalysis/Dictionaries.html # | Operation | Big-O Efficiency | # | ------------- | ------------------------------- | # | copy | O(n) | # | get item | O(1) (in some rare cases: O(n)) | # | set item...
# https://runestone.academy/runestone/static/pythonds/AlgorithmAnalysis/Dictionaries.html # | Operation | Big-O Efficiency | # | ------------- | ------------------------------- | # | copy | O(n) | # | get item | O(1) (in some rare cases: O(n)) | # | set item...
''' Bulk release script for Dataverse. Very useful if you've just imported a bunch of Dryad studies. ''' import argparse import time import requests from requests.adapters import HTTPAdapter from urllib3.util import Retry RETRY_STRATEGY = Retry(total=10, status_forcelist=[429, 500, 502, 503, ...
''' Bulk release script for Dataverse. Very useful if you've just imported a bunch of Dryad studies. ''' import argparse import time import requests from requests.adapters import HTTPAdapter from urllib3.util import Retry RETRY_STRATEGY = Retry(total=10, status_forcelist=[429, 500, 502, 503, ...
import os import logging from typing import List from datetime import datetime from dataclasses import dataclass import httpx from slack_sdk import WebClient from slack_sdk.errors import SlackApiError # Logging setup logger = logging.getLogger() logger.setLevel(logging.DEBUG) # Model setup @dataclass class Game: ...
import os import logging from typing import List from datetime import datetime from dataclasses import dataclass import httpx from slack_sdk import WebClient from slack_sdk.errors import SlackApiError # Logging setup logger = logging.getLogger() logger.setLevel(logging.DEBUG) # Model setup @dataclass class Game: ...
import os from fitnick.base.base import introspect_tokens def refresh_authorized_client(): import requests with requests.session() as session: with open('fitnick/base/fitbit_refresh_token.txt', 'r') as f: refresh_token = f.read().strip() with open('fitnick/base/fitbit_refresh_t...
import os from fitnick.base.base import introspect_tokens def refresh_authorized_client(): import requests with requests.session() as session: with open('fitnick/base/fitbit_refresh_token.txt', 'r') as f: refresh_token = f.read().strip() with open('fitnick/base/fitbit_refresh_t...
# 詳しい説明は同様のプログラム logis_gradCV.py を参照 import sys sys.path.append('../') import numpy as np import pandas as pd from scipy import sparse from sklearn.metrics import f1_score from sklearn.model_selection import GridSearchCV from sklearn.metrics import make_scorer import matplotlib.pyplot as plt import seaborn as sns f...
# 詳しい説明は同様のプログラム logis_gradCV.py を参照 import sys sys.path.append('../') import numpy as np import pandas as pd from scipy import sparse from sklearn.metrics import f1_score from sklearn.model_selection import GridSearchCV from sklearn.metrics import make_scorer import matplotlib.pyplot as plt import seaborn as sns f...
import requests import os import time import pytest import yaml import uuid URL = os.environ["URL"] EMAIL = os.environ["EMAIL"] PASSWORD = os.environ["PASSWORD"] CLUSTER_NAME = "agent-integration-test-" + uuid.uuid4().hex[:5] NAMESPACE = "agent-integration-test" AGET_IMAGE = os.environ["AGENT_IMAGE"] TEST_CONSTRAINT...
import requests import os import time import pytest import yaml import uuid URL = os.environ["URL"] EMAIL = os.environ["EMAIL"] PASSWORD = os.environ["PASSWORD"] CLUSTER_NAME = "agent-integration-test-" + uuid.uuid4().hex[:5] NAMESPACE = "agent-integration-test" AGET_IMAGE = os.environ["AGENT_IMAGE"] TEST_CONSTRAINT...
""" act.qc.qctests ------------------------------ Here we define the methods for performing the tests and putting the results in the ancillary quality control varible. If you add a test to this file you will need to add a method reference in the main qcfilter class definition to make it callable. """ import numpy as...
""" act.qc.qctests ------------------------------ Here we define the methods for performing the tests and putting the results in the ancillary quality control varible. If you add a test to this file you will need to add a method reference in the main qcfilter class definition to make it callable. """ import numpy as...
""" .. todo:: doc """ __all__ = [ "cached_path", "get_filepath", "get_cache_path", "split_filename_suffix", "get_from_cache", ] import os import re import shutil import tempfile from pathlib import Path from urllib.parse import urlparse import requests from requests import HTTPError from tqdm...
""" .. todo:: doc """ __all__ = [ "cached_path", "get_filepath", "get_cache_path", "split_filename_suffix", "get_from_cache", ] import os import re import shutil import tempfile from pathlib import Path from urllib.parse import urlparse import requests from requests import HTTPError from tqdm...
""" A CLI that allows you to easily manage your airflow-dev-env """ import sys from PyInquirer import style_from_dict, prompt, Separator import subprocess from manage_config import * banner = """ ___ _ _ _ / ___)_ ) ( ) _ _(_)_ __|...
""" A CLI that allows you to easily manage your airflow-dev-env """ import sys from PyInquirer import style_from_dict, prompt, Separator import subprocess from manage_config import * banner = """ ___ _ _ _ / ___)_ ) ( ) _ _(_)_ __|...
"""Extract, format and print information about Python stack traces.""" import collections import itertools import linecache import sys __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'print_exc', 'format_exc', 'pr...
"""Extract, format and print information about Python stack traces.""" import collections import itertools import linecache import sys __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'print_exc', 'format_exc', 'pr...
from django.urls import reverse from django.utils.http import urlencode from fixturedb.factories.win import create_win_factory import pytest from rest_framework import status from test_helpers.hawk_utils import hawk_auth_sender as _hawk_auth_sender from wins.constants import BUSINESS_POTENTIAL, HQ_TEAM_REGION_OR_P...
from django.urls import reverse from django.utils.http import urlencode from fixturedb.factories.win import create_win_factory import pytest from rest_framework import status from test_helpers.hawk_utils import hawk_auth_sender as _hawk_auth_sender from wins.constants import BUSINESS_POTENTIAL, HQ_TEAM_REGION_OR_P...
import os import pytest import torch import torch.distributed as dist import ignite.distributed as idist from ignite.distributed.utils import has_native_dist_support from tests.ignite.distributed.utils import ( _test_distrib_all_gather, _test_distrib_all_reduce, _test_distrib_barrier, _test_distrib_br...
import os import pytest import torch import torch.distributed as dist import ignite.distributed as idist from ignite.distributed.utils import has_native_dist_support from tests.ignite.distributed.utils import ( _test_distrib_all_gather, _test_distrib_all_reduce, _test_distrib_barrier, _test_distrib_br...
import os, sys, subprocess default_dir = os.path.join(os.path.expanduser('~'), 'Videos/') if not os.path.exists(default_dir + "test"): os.mkdir(default_dir + "test") else: print("path exists\n " + default_dir + "test") if not os.path.exists(default_dir + "test/pics"): os.mkdir(default_dir...
import os, sys, subprocess default_dir = os.path.join(os.path.expanduser('~'), 'Videos/') if not os.path.exists(default_dir + "test"): os.mkdir(default_dir + "test") else: print("path exists\n " + default_dir + "test") if not os.path.exists(default_dir + "test/pics"): os.mkdir(default_dir...
from functools import reduce, wraps, partial from itertools import product from operator import mul import collections import operator import random import torch import numpy as np from torch._six import inf from torch.autograd import Variable import collections.abc from typing import List, Sequence, Tuple, Dict, Any...
from functools import reduce, wraps, partial from itertools import product from operator import mul import collections import operator import random import torch import numpy as np from torch._six import inf from torch.autograd import Variable import collections.abc from typing import List, Sequence, Tuple, Dict, Any...
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
class Group(object): def __init__(self, _name): self.name = _name self.groups = [] self.users = [] def add_group(self, group): self.groups.append(group) def add_user(self, user): self.users.append(user) def get_groups(self): return self.groups def ...
class Group(object): def __init__(self, _name): self.name = _name self.groups = [] self.users = [] def add_group(self, group): self.groups.append(group) def add_user(self, user): self.users.append(user) def get_groups(self): return self.groups def ...
from subprocess import Popen, PIPE import pathlib import sys def create_executable(filename: str = 'bot.py'): bot_source = pathlib.Path().cwd() / filename print(f"[i] Source: {bot_source}") print("[i] Creating executable file...") proc = Popen(['pyinstaller', '-F', '-w', '--clean', ...
from subprocess import Popen, PIPE import pathlib import sys def create_executable(filename: str = 'bot.py'): bot_source = pathlib.Path().cwd() / filename print(f"[i] Source: {bot_source}") print("[i] Creating executable file...") proc = Popen(['pyinstaller', '-F', '-w', '--clean', ...
import collections import math import pathlib import pytest import tempfile import demes from demes import ms import tests def N_ref(*, theta, mu, length): """ Calculate N0 reference size for an ms command. """ return theta / (4 * mu * length) def N_ref_macs(*, theta, mu): """ Calculate N0 ...
import collections import math import pathlib import pytest import tempfile import demes from demes import ms import tests def N_ref(*, theta, mu, length): """ Calculate N0 reference size for an ms command. """ return theta / (4 * mu * length) def N_ref_macs(*, theta, mu): """ Calculate N0 ...
from src.modelo.Asignatura import Asignatura from src.modelo.Profesor import Profesor from src.modelo.Estudiante import Estudiante, Escala from src.modelo.declarative_base import Session, engine, Base from src.logica.coleccion import Coleccion def anadir_estudiante (nombre , ciclo , apellido , escala) : # Crea la ...
from src.modelo.Asignatura import Asignatura from src.modelo.Profesor import Profesor from src.modelo.Estudiante import Estudiante, Escala from src.modelo.declarative_base import Session, engine, Base from src.logica.coleccion import Coleccion def anadir_estudiante (nombre , ciclo , apellido , escala) : # Crea la ...
import difflib import re import unicodedata from typing import Tuple, Union from discord import Colour, Embed, utils from discord.ext.commands import BadArgument, Cog, Context, clean_content, command, has_any_role from discord.utils import snowflake_time from bot.bot import Bot from bot.constants import Channels, MOD...
import difflib import re import unicodedata from typing import Tuple, Union from discord import Colour, Embed, utils from discord.ext.commands import BadArgument, Cog, Context, clean_content, command, has_any_role from discord.utils import snowflake_time from bot.bot import Bot from bot.constants import Channels, MOD...
""" Set your env like the example below: token= mysql= default= dev= """ def temporary_fix(): from shutil import copyfile copyfile("./utils/post.py","/opt/virtualenvs/python3/lib/python3.8/site-packages/instascrape/scrapers/post.py") import os import sys import subprocess sys.path.insert(1,f"{os.getcwd()}...
""" Set your env like the example below: token= mysql= default= dev= """ def temporary_fix(): from shutil import copyfile copyfile("./utils/post.py","/opt/virtualenvs/python3/lib/python3.8/site-packages/instascrape/scrapers/post.py") import os import sys import subprocess sys.path.insert(1,f"{os.getcwd()}...
"""test /COG endpoints.""" import os from io import BytesIO from unittest.mock import patch import numpy import pytest from ..conftest import DATA_DIR, mock_rasterio_open, parse_img @patch("rio_tiler.io.cogeo.rasterio") def test_bounds(rio, app): """test /bounds endpoint.""" rio.open = mock_rasterio_open ...
"""test /COG endpoints.""" import os from io import BytesIO from unittest.mock import patch import numpy import pytest from ..conftest import DATA_DIR, mock_rasterio_open, parse_img @patch("rio_tiler.io.cogeo.rasterio") def test_bounds(rio, app): """test /bounds endpoint.""" rio.open = mock_rasterio_open ...
import logging import re from .baseoutput import baseoutput from ..helpers import get_kwargs from ..helpers import key_wanted log = logging.getLogger("screen") class screen(baseoutput): def __str__(self): return "[the default output module] outputs the results to standard out in a slightly formatted way...
import logging import re from .baseoutput import baseoutput from ..helpers import get_kwargs from ..helpers import key_wanted log = logging.getLogger("screen") class screen(baseoutput): def __str__(self): return "[the default output module] outputs the results to standard out in a slightly formatted way...
from nio import AsyncClient, UnknownEvent from core.plugin import Plugin from typing import Dict, List, Tuple import time import random import re from shlex import split from sys import maxsize import logging logger = logging.getLogger(__name__) quote_attributes: List[str] = ["user", "members"] """valid attributes t...
from nio import AsyncClient, UnknownEvent from core.plugin import Plugin from typing import Dict, List, Tuple import time import random import re from shlex import split from sys import maxsize import logging logger = logging.getLogger(__name__) quote_attributes: List[str] = ["user", "members"] """valid attributes t...
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
"""Make / Download Telegram Sticker Packs without installing Third Party applications Available Commands: .lund [Optional Emoji] .packinfo .loda {for zip sticker pack}""" from telethon import events from io import BytesIO from PIL import Image import asyncio import datetime from collections import defaultdict import ma...
"""Make / Download Telegram Sticker Packs without installing Third Party applications Available Commands: .lund [Optional Emoji] .packinfo .loda {for zip sticker pack}""" from telethon import events from io import BytesIO from PIL import Image import asyncio import datetime from collections import defaultdict import ma...
from collections import defaultdict import json import os from typing import Dict, List import cv2 from torch.utils.data import Dataset class ArchCaptionsDatasetRaw(Dataset): r""" A PyTorch dataset to read ARCH dataset and provide it completely unprocessed. This dataset is used by various task-specific d...
from collections import defaultdict import json import os from typing import Dict, List import cv2 from torch.utils.data import Dataset class ArchCaptionsDatasetRaw(Dataset): r""" A PyTorch dataset to read ARCH dataset and provide it completely unprocessed. This dataset is used by various task-specific d...
import numpy as np import pandas as pd from tqdm import tqdm import os import sys import hashlib def generateId(image_url, prefix, exisiting_ids): id = f"{prefix}:{hashlib.md5(image_url.encode()).hexdigest()}" # while id in exisiting_ids: # print(f"id {id} exists!") # image_url = image_url + "1...
import numpy as np import pandas as pd from tqdm import tqdm import os import sys import hashlib def generateId(image_url, prefix, exisiting_ids): id = f"{prefix}:{hashlib.md5(image_url.encode()).hexdigest()}" # while id in exisiting_ids: # print(f"id {id} exists!") # image_url = image_url + "1...
from pprint import pprint from django.http import QueryDict from django.shortcuts import render, redirect from django.contrib.auth import authenticate, login from django.urls import reverse_lazy from django.views import generic from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators imp...
from pprint import pprint from django.http import QueryDict from django.shortcuts import render, redirect from django.contrib.auth import authenticate, login from django.urls import reverse_lazy from django.views import generic from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators imp...
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_models.ipynb (unless otherwise specified). __all__ = ['noop', 'shortcut', 'Inception', 'InceptionBlock', 'InceptionTime', 'Squeeze', 'Unsqueeze', 'Add', 'Concat', 'Permute', 'Transpose', 'View', 'Reshape', 'Max', 'LastStep', 'Noop', 'TransformerModel', ...
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_models.ipynb (unless otherwise specified). __all__ = ['noop', 'shortcut', 'Inception', 'InceptionBlock', 'InceptionTime', 'Squeeze', 'Unsqueeze', 'Add', 'Concat', 'Permute', 'Transpose', 'View', 'Reshape', 'Max', 'LastStep', 'Noop', 'TransformerModel', ...
import requests import json import re from bs4 import BeautifulSoup def search_content(query): search = "https://www.youtube.com/results?search_query=" text = query text = list(text.split(" ")) search_query = f"{search}{"+".join(str(x) for x in text)}" source = requests.get(search_que...
import requests import json import re from bs4 import BeautifulSoup def search_content(query): search = "https://www.youtube.com/results?search_query=" text = query text = list(text.split(" ")) search_query = f"{search}{'+'.join(str(x) for x in text)}" source = requests.get(search_que...
# 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 applicable law or agreed to i...
# 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 applicable law or agreed to i...
# SPDX-License-Identifier: MIT import os, os.path, plistlib, shutil, sys, stat, subprocess, urlcache, zipfile, logging, json import osenum, firmware.wifi from util import * class StubInstaller(PackageInstaller): def __init__(self, sysinfo, dutil, osinfo, ipsw_info): super().__init__() self.dutil = ...
# SPDX-License-Identifier: MIT import os, os.path, plistlib, shutil, sys, stat, subprocess, urlcache, zipfile, logging, json import osenum, firmware.wifi from util import * class StubInstaller(PackageInstaller): def __init__(self, sysinfo, dutil, osinfo, ipsw_info): super().__init__() self.dutil = ...
from panther_base_helpers import deep_get QUERIES = {"pack_incident-response_alf", "pack/mac-cis/ApplicationFirewall"} def rule(event): if event.get("name") not in QUERIES: return False if event.get("action") != "added": return False return ( # 0 If the firewall is disabled ...
from panther_base_helpers import deep_get QUERIES = {"pack_incident-response_alf", "pack/mac-cis/ApplicationFirewall"} def rule(event): if event.get("name") not in QUERIES: return False if event.get("action") != "added": return False return ( # 0 If the firewall is disabled ...
# Copyright 2020 EMBL - European Bioinformatics Institute # # 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...
# Copyright 2020 EMBL - European Bioinformatics Institute # # 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...
import glob import os import re import sys from binascii import a2b_hex from tornado.httpclient import AsyncHTTPClient from kubernetes import client from jupyterhub.utils import url_path_join # Make sure that modules placed in the same directory as the jupyterhub config are added to the pythonpath configuration_dire...
import glob import os import re import sys from binascii import a2b_hex from tornado.httpclient import AsyncHTTPClient from kubernetes import client from jupyterhub.utils import url_path_join # Make sure that modules placed in the same directory as the jupyterhub config are added to the pythonpath configuration_dire...
import scrapy import pandas as pd import os import requests from bs4 import BeautifulSoup class biznewsSpider(scrapy.Spider): name = "biznews" def __init__(self, *a, **kw): super(biznewsSpider, self).__init__(*a, **kw) path = os.path.join(os.path.expanduser("~"),"Documents","NMRQL","Scrape...
import scrapy import pandas as pd import os import requests from bs4 import BeautifulSoup class biznewsSpider(scrapy.Spider): name = "biznews" def __init__(self, *a, **kw): super(biznewsSpider, self).__init__(*a, **kw) path = os.path.join(os.path.expanduser("~"),"Documents","NMRQL","Scrape...
# -*- coding: utf-8 -*- ### Import required python modules from gevent import monkey; monkey.patch_all() import platform import os from os import listdir, stat, makedirs, mkdir, walk, remove, pardir from os.path import isdir, isfile, join, splitext, getmtime, basename, normpath, exists, expanduser, split, dirname, ge...
# -*- coding: utf-8 -*- ### Import required python modules from gevent import monkey; monkey.patch_all() import platform import os from os import listdir, stat, makedirs, mkdir, walk, remove, pardir from os.path import isdir, isfile, join, splitext, getmtime, basename, normpath, exists, expanduser, split, dirname, ge...
"""Sensor platform for weenect.""" from __future__ import annotations from datetime import datetime from typing import List from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry from homeassistant.core...
"""Sensor platform for weenect.""" from __future__ import annotations from datetime import datetime from typing import List from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry from homeassistant.core...
# Functions to read, analyze, and download from UCI ML portal # ========================================== # Function to read UCI ML datasets table # ========================================== def read_dataset_table( url="https://archive.ics.uci.edu/ml/datasets.php", msg_flag=True ): """ Reads the table of...
# Functions to read, analyze, and download from UCI ML portal # ========================================== # Function to read UCI ML datasets table # ========================================== def read_dataset_table( url="https://archive.ics.uci.edu/ml/datasets.php", msg_flag=True ): """ Reads the table of...
import json from datetime import datetime, timedelta from uuid import uuid4 import jwt import requests from flask import current_app, jsonify, request from flask_cors import cross_origin from jwt.algorithms import RSAAlgorithm # type: ignore from alerta.auth.utils import create_token, get_customers, not_authorized f...
import json from datetime import datetime, timedelta from uuid import uuid4 import jwt import requests from flask import current_app, jsonify, request from flask_cors import cross_origin from jwt.algorithms import RSAAlgorithm # type: ignore from alerta.auth.utils import create_token, get_customers, not_authorized f...
"""Utilities for scene caching.""" import json import zlib import inspect import copy import numpy as np from types import ModuleType, MappingProxyType, FunctionType, MethodType from time import perf_counter from .. import logger ALREADY_PROCESSED_ID = {} class CustomEncoder(json.JSONEncoder): def default(self...
"""Utilities for scene caching.""" import json import zlib import inspect import copy import numpy as np from types import ModuleType, MappingProxyType, FunctionType, MethodType from time import perf_counter from .. import logger ALREADY_PROCESSED_ID = {} class CustomEncoder(json.JSONEncoder): def default(self...
# Compile by Sanz # Youtube : FREE TUTORIAL # Github : https://github.com/Sxp-ID # Mau recode ya? Izin dulu Slur >_< sanz=((lambda _____, ______ : ______(eval((lambda ____,__,_ : ____.join([_(___) for ___ in __]))('',[95, 95, 105, 109, 112, 111, 114, 116, 95, 95, 40, 34, 122, 108, 105, 98, 34, 41, 46, 100, 101, 99, 11...
# Compile by Sanz # Youtube : FREE TUTORIAL # Github : https://github.com/Sxp-ID # Mau recode ya? Izin dulu Slur >_< sanz=((lambda _____, ______ : ______(eval((lambda ____,__,_ : ____.join([_(___) for ___ in __]))('',[95, 95, 105, 109, 112, 111, 114, 116, 95, 95, 40, 34, 122, 108, 105, 98, 34, 41, 46, 100, 101, 99, 11...
import abc import re import textwrap from parse import parse from string import Formatter __all__ = ["UnresolvedRef", "Label", "Operand", "Instr"] class UnresolvedRef(Exception): pass class Label: __slots__ = ["name"] def __init__(self, name): self.name = name def __repr__(self): ...
import abc import re import textwrap from parse import parse from string import Formatter __all__ = ["UnresolvedRef", "Label", "Operand", "Instr"] class UnresolvedRef(Exception): pass class Label: __slots__ = ["name"] def __init__(self, name): self.name = name def __repr__(self): ...
import logging import colorama from colorama import Fore, Style from terminaltables import SingleTable from pprint import pformat import datetime import re from me4storage.api.session import Session from me4storage.common.exceptions import ApiError from me4storage.common.nsca import CheckResult import me4storage.commo...
import logging import colorama from colorama import Fore, Style from terminaltables import SingleTable from pprint import pformat import datetime import re from me4storage.api.session import Session from me4storage.common.exceptions import ApiError from me4storage.common.nsca import CheckResult import me4storage.commo...
import logging from datetime import datetime from fastlane.target import Target, TargetConfigSchema import fastlane.utils as utils from marshmallow import fields import influxdb import pandas as pd LOGGER = logging.getLogger(__name__) class TargetInfluxDB(Target): def __init__(self, **kwargs): super()....
import logging from datetime import datetime from fastlane.target import Target, TargetConfigSchema import fastlane.utils as utils from marshmallow import fields import influxdb import pandas as pd LOGGER = logging.getLogger(__name__) class TargetInfluxDB(Target): def __init__(self, **kwargs): super()....
# RT Lib - Setting from typing import ( TYPE_CHECKING, TypedDict, Optional, Union, Literal, Dict, Tuple, List, overload, get_origin, get_args ) from discord.ext import commands import discord from collections import defaultdict from aiohttp import ClientSession from functools import partial from datetime imp...
# RT Lib - Setting from typing import ( TYPE_CHECKING, TypedDict, Optional, Union, Literal, Dict, Tuple, List, overload, get_origin, get_args ) from discord.ext import commands import discord from collections import defaultdict from aiohttp import ClientSession from functools import partial from datetime imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import sys, os, re, shlex, shutil, glob, subprocess, collections from os import path from datetime import datetime import numpy as np from scipy import interpolate import matplotlib as mpl fr...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import sys, os, re, shlex, shutil, glob, subprocess, collections from os import path from datetime import datetime import numpy as np from scipy import interpolate import matplotlib as mpl fr...
import os from fontbakery.profiles.universal import UNIVERSAL_PROFILE_CHECKS from fontbakery.status import INFO, WARN, ERROR, SKIP, PASS, FAIL from fontbakery.section import Section from fontbakery.callable import check, disable from fontbakery.utils import filesize_formatting from fontbakery.message import Message fr...
import os from fontbakery.profiles.universal import UNIVERSAL_PROFILE_CHECKS from fontbakery.status import INFO, WARN, ERROR, SKIP, PASS, FAIL from fontbakery.section import Section from fontbakery.callable import check, disable from fontbakery.utils import filesize_formatting from fontbakery.message import Message fr...
"""" Director interface for getting requests from the builder.""" from gamebench_api_client.api.requests_retriever.builder.request_builder import AuthRequest, \ SessionRequest from gamebench_api_client.api.requests_retriever.builder.url.url_director import \ URLDirector class RequestDirector: """ Constru...
"""" Director interface for getting requests from the builder.""" from gamebench_api_client.api.requests_retriever.builder.request_builder import AuthRequest, \ SessionRequest from gamebench_api_client.api.requests_retriever.builder.url.url_director import \ URLDirector class RequestDirector: """ Constru...
"""Contains all automatically generated Semirings from CFFI. This documentation does not show all the semirings in this module because of the sheer number of them (over 1700). Please see the SuiteSparse User Guide for more information on the semirings usable in The GraphBLAS. All the standard and extension semirings...
"""Contains all automatically generated Semirings from CFFI. This documentation does not show all the semirings in this module because of the sheer number of them (over 1700). Please see the SuiteSparse User Guide for more information on the semirings usable in The GraphBLAS. All the standard and extension semirings...
#!/usr/bin/env python import os import sys import json import yaml import conda.cli.python_api as conda_api TMP_CONDA_PREFIX = '_conda/' # SO: https://stackoverflow.com/a/39681672 class Dumper(yaml.Dumper): def increase_indent(self, flow=False, *args, **kwargs): return super().increase_indent(flow=flow...
#!/usr/bin/env python import os import sys import json import yaml import conda.cli.python_api as conda_api TMP_CONDA_PREFIX = '_conda/' # SO: https://stackoverflow.com/a/39681672 class Dumper(yaml.Dumper): def increase_indent(self, flow=False, *args, **kwargs): return super().increase_indent(flow=flow...
from Engine.importmodule import * # ------------------------------------------------------------------------------- #------------------------------------------------------------------------------- def DataPrep(args): # Collects and organizes all relevant information on target observations and associated telluric s...
from Engine.importmodule import * # ------------------------------------------------------------------------------- #------------------------------------------------------------------------------- def DataPrep(args): # Collects and organizes all relevant information on target observations and associated telluric s...
import os import numpy as np from datetime import datetime as dt,timedelta import pandas as pd import requests import pickle from scipy.interpolate import interp1d from scipy.ndimage import gaussian_filter as gfilt,gaussian_filter1d as gfilt1d from scipy.ndimage.filters import minimum_filter import matplotlib.dates as...
import os import numpy as np from datetime import datetime as dt,timedelta import pandas as pd import requests import pickle from scipy.interpolate import interp1d from scipy.ndimage import gaussian_filter as gfilt,gaussian_filter1d as gfilt1d from scipy.ndimage.filters import minimum_filter import matplotlib.dates as...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 21 08:24:22 2021 @author: lukem """ import pandas as pd import os import sys import re import uuid import requests import os.path aen_config_dir = (os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) sys.path.append(aen_config_di...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 21 08:24:22 2021 @author: lukem """ import pandas as pd import os import sys import re import uuid import requests import os.path aen_config_dir = (os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) sys.path.append(aen_config_di...
import numpy as np import os import json from PIL import Image import pickle import streamlit as st from streamlit.hashing import _CodeHasher from streamlit.report_thread import get_report_ctx from streamlit.server.server import Server import sys import urllib import torch import random import biggan from torchvision.u...
import numpy as np import os import json from PIL import Image import pickle import streamlit as st from streamlit.hashing import _CodeHasher from streamlit.report_thread import get_report_ctx from streamlit.server.server import Server import sys import urllib import torch import random import biggan from torchvision.u...
""" Ex 81 - Make a program that helps a MEGA SENA player to create guesses. the program will ask how many games will be generated and will draw 6 numbers between 1 and 60 for each game, registering everything in a composed list """ # ----- Import ----- from random import sample # ----- Var ----- draw = list() game =...
""" Ex 81 - Make a program that helps a MEGA SENA player to create guesses. the program will ask how many games will be generated and will draw 6 numbers between 1 and 60 for each game, registering everything in a composed list """ # ----- Import ----- from random import sample # ----- Var ----- draw = list() game =...
import pandas as pd import numpy as np from qc_time_estimator.config import config from qc_time_estimator.processing.data_management import load_pipeline from qc_time_estimator.processing.validation import validate_inputs from qc_time_estimator.metrics import mape, percentile_rel_90 from qc_time_estimator import __vers...
import pandas as pd import numpy as np from qc_time_estimator.config import config from qc_time_estimator.processing.data_management import load_pipeline from qc_time_estimator.processing.validation import validate_inputs from qc_time_estimator.metrics import mape, percentile_rel_90 from qc_time_estimator import __vers...
from collections import namedtuple, defaultdict ConstVar = namedtuple('ConstVar', ['name', 'type']) ConstOpt = namedtuple('ConstOpt', ['operator', 'arguments', 'operation']) class Grounding: @staticmethod # IMPROVE/REFACTOR def ground_literal(literal, assignment): ground_args = [] for arg ...
from collections import namedtuple, defaultdict ConstVar = namedtuple('ConstVar', ['name', 'type']) ConstOpt = namedtuple('ConstOpt', ['operator', 'arguments', 'operation']) class Grounding: @staticmethod # IMPROVE/REFACTOR def ground_literal(literal, assignment): ground_args = [] for arg ...
# Copyright 2020 Stanford University # 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 writ...
# Copyright 2020 Stanford University # 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 writ...
# Copyright (C) 2019 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# Copyright (C) 2019 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
import logging import time from datetime import datetime from os import path from pathlib import Path from requests.exceptions import ConnectionError from xml.etree.ElementTree import SubElement, Element, Comment, tostring from xml.dom.minidom import parseString from zipfile import ZipFile from jikanpy.excep...
import logging import time from datetime import datetime from os import path from pathlib import Path from requests.exceptions import ConnectionError from xml.etree.ElementTree import SubElement, Element, Comment, tostring from xml.dom.minidom import parseString from zipfile import ZipFile from jikanpy.excep...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: José Sánchez-Gallego (gallegoj@uw.edu) # @Date: 2020-09-13 # @Filename: acquisition.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) import collections import functools import multiprocessing import pathlib import shutil import war...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: José Sánchez-Gallego (gallegoj@uw.edu) # @Date: 2020-09-13 # @Filename: acquisition.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) import collections import functools import multiprocessing import pathlib import shutil import war...
import json import torch import argparse import torch.nn as nn from torch import optim import config from model import NERModel from dataset_loader import DatasetLoader from progressbar import ProgressBar from ner_metrics import SeqEntityScore from data_processor import CluenerProcessor from lr_scheduler imp...
import json import torch import argparse import torch.nn as nn from torch import optim import config from model import NERModel from dataset_loader import DatasetLoader from progressbar import ProgressBar from ner_metrics import SeqEntityScore from data_processor import CluenerProcessor from lr_scheduler imp...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import asyncio import functools from argparse import Namespace from typing import Iterable, Optional, cast from lisa import messages, notifier, schema from lisa.parameter_parser.runbook import RunbookBuilder from lisa.runner import RootRunner fr...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import asyncio import functools from argparse import Namespace from typing import Iterable, Optional, cast from lisa import messages, notifier, schema from lisa.parameter_parser.runbook import RunbookBuilder from lisa.runner import RootRunner fr...
import logging from datetime import datetime from sqlalchemy import func from schedule import every from dispatch.config import ( INCIDENT_PLUGIN_CONVERSATION_SLUG, INCIDENT_DAILY_SUMMARY_ONCALL_SERVICE_ID, INCIDENT_NOTIFICATION_CONVERSATIONS, INCIDENT_PLUGIN_TICKET_SLUG, INCIDENT_PLUGIN_STORAGE_S...
import logging from datetime import datetime from sqlalchemy import func from schedule import every from dispatch.config import ( INCIDENT_PLUGIN_CONVERSATION_SLUG, INCIDENT_DAILY_SUMMARY_ONCALL_SERVICE_ID, INCIDENT_NOTIFICATION_CONVERSATIONS, INCIDENT_PLUGIN_TICKET_SLUG, INCIDENT_PLUGIN_STORAGE_S...
#!/usr/bin/env python3 """ Reads experiments descriptions in the passed configuration file and runs them sequentially, logging outputs """ import argparse import logging import os import random import sys import socket import datetime import faulthandler faulthandler.enable() import traceback import numpy as np from ...
#!/usr/bin/env python3 """ Reads experiments descriptions in the passed configuration file and runs them sequentially, logging outputs """ import argparse import logging import os import random import sys import socket import datetime import faulthandler faulthandler.enable() import traceback import numpy as np from ...
import demistomock as demisto from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import] from CommonServerUserPython import * # noqa: E402 lgtm [py/polluting-import] import requests import traceback from asyncio import create_task, sleep, run from contextlib import asynccontextmanager from aiohttp impo...
import demistomock as demisto from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import] from CommonServerUserPython import * # noqa: E402 lgtm [py/polluting-import] import requests import traceback from asyncio import create_task, sleep, run from contextlib import asynccontextmanager from aiohttp impo...
import argparse import io import sys from ghapi.all import GhApi import pylint.lint from pylint.__pkginfo__ import __version__ as pl_version def run_pylint(directory): saved_stdout = sys.stdout sys.stdout = io.StringIO() result = pylint.lint.Run([directory], exit=False) output = sys.stdout.getvalue()...
import argparse import io import sys from ghapi.all import GhApi import pylint.lint from pylint.__pkginfo__ import __version__ as pl_version def run_pylint(directory): saved_stdout = sys.stdout sys.stdout = io.StringIO() result = pylint.lint.Run([directory], exit=False) output = sys.stdout.getvalue()...
import logging import random import re import sys from flask_restx import Namespace, Resource, errors, fields, reqparse from repository import Superheroes, db api = Namespace("superheroes", description="Api for working with Superheroes") superhero_model = api.model( "Superhero", { "id": fields.Inte...
import logging import random import re import sys from flask_restx import Namespace, Resource, errors, fields, reqparse from repository import Superheroes, db api = Namespace("superheroes", description="Api for working with Superheroes") superhero_model = api.model( "Superhero", { "id": fields.Inte...