edited_code
stringlengths
17
978k
original_code
stringlengths
17
978k
#!/usr/bin/env python from pdb import set_trace as bp import json import os import re import sys import glob import pandas as pd import typer from typing import Optional from sqlalchemy import create_engine import psycopg2 debug = False verbose = True use_pandas = False if use_pandas: print("WARNING: under deve...
#!/usr/bin/env python from pdb import set_trace as bp import json import os import re import sys import glob import pandas as pd import typer from typing import Optional from sqlalchemy import create_engine import psycopg2 debug = False verbose = True use_pandas = False if use_pandas: print("WARNING: under deve...
# Copyright 2015-2016 The Meson development 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 agree...
# Copyright 2015-2016 The Meson development 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 agree...
#!/usr/bin/python3 # ######################################################################## # Copyright (c) 2021 Advanced Micro Devices, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Softw...
#!/usr/bin/python3 # ######################################################################## # Copyright (c) 2021 Advanced Micro Devices, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Softw...
import scrape import mongo import datetime import argparse def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--dbhost', help='hostname to connect a mongodb') parser.add_argument('--port', help='port number to connect a mongodb', type=in...
import scrape import mongo import datetime import argparse def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--dbhost', help='hostname to connect a mongodb') parser.add_argument('--port', help='port number to connect a mongodb', type=in...
# Copyright (c) 2017-2019, Stefan Grönke # Copyright (c) 2014-2018, iocage # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted providing that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # ...
# Copyright (c) 2017-2019, Stefan Grönke # Copyright (c) 2014-2018, iocage # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted providing that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # ...
# Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT """ Data layer on top of PSQL using sqlalch """ import enum import logging import os from contextlib import contextmanager from datetime import datetime, timedelta from typing import ( Dict, Iterable, List, Optional, TYP...
# Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT """ Data layer on top of PSQL using sqlalch """ import enum import logging import os from contextlib import contextmanager from datetime import datetime, timedelta from typing import ( Dict, Iterable, List, Optional, TYP...
from django.test import TestCase from rest_framework.test import APITestCase from coodesh_app.models import SFNArticles, SFNArticlesLaunches import json from datetime import datetime from coodesh_app.management.commands.load_api_data import DATETIME_FORMAT # Create your tests here. class SFNArticlesCreateTestCase(AP...
from django.test import TestCase from rest_framework.test import APITestCase from coodesh_app.models import SFNArticles, SFNArticlesLaunches import json from datetime import datetime from coodesh_app.management.commands.load_api_data import DATETIME_FORMAT # Create your tests here. class SFNArticlesCreateTestCase(AP...
# Copyright 2021 Google Research. # # 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 2021 Google Research. # # 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...
# # This source file is part of the EdgeDB open source project. # # Copyright 2019-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
# # This source file is part of the EdgeDB open source project. # # Copyright 2019-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
""" This file (test_admin.py) contains the functional tests for the `admin` blueprint. These tests use GETs and POSTs to different endpoints to check for the proper behavior of the `admin` blueprint. """ import os import json import pytest from flask import request from flask import url_for from modules.box__default.a...
""" This file (test_admin.py) contains the functional tests for the `admin` blueprint. These tests use GETs and POSTs to different endpoints to check for the proper behavior of the `admin` blueprint. """ import os import json import pytest from flask import request from flask import url_for from modules.box__default.a...
import re import pytest from invoke.context import Context from test.test_utils import LOGGER, ec2, get_framework_and_version_from_tag def test_stray_files(image): """ Test to ensure that unnecessary build artifacts are not present in any easily visible or tmp directories :param image: ECR image URI ...
import re import pytest from invoke.context import Context from test.test_utils import LOGGER, ec2, get_framework_and_version_from_tag def test_stray_files(image): """ Test to ensure that unnecessary build artifacts are not present in any easily visible or tmp directories :param image: ECR image URI ...
""" Функции команд бота. """ import logging import random import re from typing import List, Dict import pkg_resources import requests from sqlalchemy.orm import selectinload from telegram import Update, ParseMode, InlineKeyboardMarkup, InlineKeyboardButton, ChatAction from telegram.ext import CallbackContext from po...
""" Функции команд бота. """ import logging import random import re from typing import List, Dict import pkg_resources import requests from sqlalchemy.orm import selectinload from telegram import Update, ParseMode, InlineKeyboardMarkup, InlineKeyboardButton, ChatAction from telegram.ext import CallbackContext from po...
""" The MIT License (MIT) Copyright (c) 2021 - Oxy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge...
""" The MIT License (MIT) Copyright (c) 2021 - Oxy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge...
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. import os import json from torchvision import datasets, transforms from torchvision.datasets.folder import ImageFolder, default_loader from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.data import create_transform ...
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. import os import json from torchvision import datasets, transforms from torchvision.datasets.folder import ImageFolder, default_loader from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.data import create_transform ...
#!/usr/bin/env python3 import subprocess import logging import copy import os import time from schema import VMDescriptionSchema, VMNameSchema from expose import ExposedClass, exposed, transformational from exception import VMRunningError, VMNotRunningError from threading import RLock from tap_device import TAPDevice...
#!/usr/bin/env python3 import subprocess import logging import copy import os import time from schema import VMDescriptionSchema, VMNameSchema from expose import ExposedClass, exposed, transformational from exception import VMRunningError, VMNotRunningError from threading import RLock from tap_device import TAPDevice...
#!python3 """ Main Meshtastic """ import argparse import platform import logging import sys import time import yaml from pubsub import pub import pyqrcode import pkg_resources import meshtastic.util import meshtastic.test from . import remote_hardware from . import portnums_pb2, channel_pb2, radioconfig_pb2 from .glob...
#!python3 """ Main Meshtastic """ import argparse import platform import logging import sys import time import yaml from pubsub import pub import pyqrcode import pkg_resources import meshtastic.util import meshtastic.test from . import remote_hardware from . import portnums_pb2, channel_pb2, radioconfig_pb2 from .glob...
# -*- coding: utf-8 -*- ''' Module to interact with Junos devices. ''' from __future__ import absolute_import # Import python libraries import logging import json import os try: from lxml import etree except ImportError: from salt._compat import ElementTree as etree # Juniper interface libraries # https://gi...
# -*- coding: utf-8 -*- ''' Module to interact with Junos devices. ''' from __future__ import absolute_import # Import python libraries import logging import json import os try: from lxml import etree except ImportError: from salt._compat import ElementTree as etree # Juniper interface libraries # https://gi...
import tensorflow as tf from tensorflow.python import debug as tf_debug from collections import namedtuple from .estimator import get_estimator from .input import gen_input_fn from .args import * # Make TF be quiet import os os.environ["TF_CPP_MIN_LOG_LEVEL"]="2" import logging logger = logging.getLogger(__name__) ...
import tensorflow as tf from tensorflow.python import debug as tf_debug from collections import namedtuple from .estimator import get_estimator from .input import gen_input_fn from .args import * # Make TF be quiet import os os.environ["TF_CPP_MIN_LOG_LEVEL"]="2" import logging logger = logging.getLogger(__name__) ...
""" Represents a collection of trip stays and home stays. """ import csv, datetime from datetime import date, timedelta from svg_chart import SVGChart class StaysCollection: MERGE_RANGE_DAYS = 1 # Max days between trips to merge them PRINT_DATE_FORMAT = '%a %d %b %Y' def __init__(self, data_csv_pat...
""" Represents a collection of trip stays and home stays. """ import csv, datetime from datetime import date, timedelta from svg_chart import SVGChart class StaysCollection: MERGE_RANGE_DAYS = 1 # Max days between trips to merge them PRINT_DATE_FORMAT = '%a %d %b %Y' def __init__(self, data_csv_pat...
from Modules import functions, data from time import time last_check_time = 0 # check_punishments unfinished async def check_punishments(guild): # iterate through each punishment, ignore if no expiration for user in functions.get_data("SELECT * FROM punishments", ()): user_id = user[0] ...
from Modules import functions, data from time import time last_check_time = 0 # check_punishments unfinished async def check_punishments(guild): # iterate through each punishment, ignore if no expiration for user in functions.get_data("SELECT * FROM punishments", ()): user_id = user[0] ...
import torch.nn as nn from wilds.common.metrics.loss import ElementwiseLoss, Loss, MultiTaskLoss from wilds.common.metrics.all_metrics import MSE def initialize_loss(config, d_out): if config.get('loss_function') == 'cross_entropy': return ElementwiseLoss(loss_fn=nn.CrossEntropyLoss(reduction='none')...
import torch.nn as nn from wilds.common.metrics.loss import ElementwiseLoss, Loss, MultiTaskLoss from wilds.common.metrics.all_metrics import MSE def initialize_loss(config, d_out): if config.get('loss_function') == 'cross_entropy': return ElementwiseLoss(loss_fn=nn.CrossEntropyLoss(reduction='none')...
# coding=utf-8 # Copyright 2021 Google Research and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
# coding=utf-8 # Copyright 2021 Google Research and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
import yaml import sys import os def get_or(d, k, e): if k in d: d[k] else: e def print_args(c): if 'args' in c: print() print(f"**Arguments**") args = c['args'] print(""" |Name|Switch|Kind|Multiple|Description| |----|------|----|--------|-----------|""") ...
import yaml import sys import os def get_or(d, k, e): if k in d: d[k] else: e def print_args(c): if 'args' in c: print() print(f"**Arguments**") args = c['args'] print(""" |Name|Switch|Kind|Multiple|Description| |----|------|----|--------|-----------|""") ...
def get_create_database_query(db_name: str): return f'CREATE or REPLACE database {db_name}' def get_drop_database_query(db_name: str): return f'DROP DATABASE {db_name}' def get_create_constraint_query(label: str, property_name: str, constraint_name: str = ''): """ Build query to create a constraint ...
def get_create_database_query(db_name: str): return f'CREATE or REPLACE database {db_name}' def get_drop_database_query(db_name: str): return f'DROP DATABASE {db_name}' def get_create_constraint_query(label: str, property_name: str, constraint_name: str = ''): """ Build query to create a constraint ...
""" MTGJSON Set Builder """ import json import logging import pathlib import re import unicodedata import uuid from typing import Any, Dict, List, Optional, Set, Tuple from . import consts from .classes import ( MtgjsonCardObject, MtgjsonForeignDataObject, MtgjsonGameFormatsObject, MtgjsonLeadershipSki...
""" MTGJSON Set Builder """ import json import logging import pathlib import re import unicodedata import uuid from typing import Any, Dict, List, Optional, Set, Tuple from . import consts from .classes import ( MtgjsonCardObject, MtgjsonForeignDataObject, MtgjsonGameFormatsObject, MtgjsonLeadershipSki...
from tkinter import filedialog from tkinter import * import copy import shutil import sys import os import locg import comicvine import comicutil import archiveutil import imageutil import config import comixology import comicdb from comicapi import comicinfoxml, filenameparser SETTINGS = config.get_config() REMOVE_S...
from tkinter import filedialog from tkinter import * import copy import shutil import sys import os import locg import comicvine import comicutil import archiveutil import imageutil import config import comixology import comicdb from comicapi import comicinfoxml, filenameparser SETTINGS = config.get_config() REMOVE_S...
import base64 import json import urllib.request, urllib.parse, urllib.error from urllib3._collections import HTTPHeaderDict from . import httplib2 import logger import traceback import socket import time import re import uuid from copy import deepcopy from threading import Thread from TestInput import TestInputSinglet...
import base64 import json import urllib.request, urllib.parse, urllib.error from urllib3._collections import HTTPHeaderDict from . import httplib2 import logger import traceback import socket import time import re import uuid from copy import deepcopy from threading import Thread from TestInput import TestInputSinglet...
# # Enumeration of various types of sony camera, options (maximum all mode, list of features in that model of camera) and cp_enumeration (number assigned to the feature in the API and GUI) # import enum import re # --------------- each camera has a set of enumerations for each functionality and its available option...
# # Enumeration of various types of sony camera, options (maximum all mode, list of features in that model of camera) and cp_enumeration (number assigned to the feature in the API and GUI) # import enum import re # --------------- each camera has a set of enumerations for each functionality and its available option...
import traceback import discord, datetime, json, random from discord.ext import commands import aiohttp, io from random import randint from yarl import URL import fast_colorthief start_time = datetime.datetime.utcnow() class General(commands.Cog): def __init__(self, bot): self.bot = bot @commands.co...
import traceback import discord, datetime, json, random from discord.ext import commands import aiohttp, io from random import randint from yarl import URL import fast_colorthief start_time = datetime.datetime.utcnow() class General(commands.Cog): def __init__(self, bot): self.bot = bot @commands.co...
from typing import TYPE_CHECKING, Dict, List from ray.tune.checkpoint_manager import Checkpoint if TYPE_CHECKING: from ray.tune.trial import Trial class Callback: """Tune base callback that can be extended and passed to a ``TrialRunner`` Tune callbacks are called from within the ``TrialRunner`` class. ...
from typing import TYPE_CHECKING, Dict, List from ray.tune.checkpoint_manager import Checkpoint if TYPE_CHECKING: from ray.tune.trial import Trial class Callback: """Tune base callback that can be extended and passed to a ``TrialRunner`` Tune callbacks are called from within the ``TrialRunner`` class. ...
import pandas as pd import os import numpy as np paths = { 'Data' : os.path.join(os.getcwd(), 'Data') } def json_reader(file): df = pd.read_json(os.path.join(paths['Data'], file),encoding='utf-8', dtype=int) df.set_index('Lesson-Code') return df def DataFrame_appender(df : pd.DataFrame , ld : pd.Dat...
import pandas as pd import os import numpy as np paths = { 'Data' : os.path.join(os.getcwd(), 'Data') } def json_reader(file): df = pd.read_json(os.path.join(paths['Data'], file),encoding='utf-8', dtype=int) df.set_index('Lesson-Code') return df def DataFrame_appender(df : pd.DataFrame , ld : pd.Dat...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * ''' IMPORTS ''' import json import requests import base64 import email import hashlib from typing import List from dateutil.parser import parse from typing import Dict, Tuple, Any, Optional, Union # Disable insecure wa...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * ''' IMPORTS ''' import json import requests import base64 import email import hashlib from typing import List from dateutil.parser import parse from typing import Dict, Tuple, Any, Optional, Union # Disable insecure wa...
from flask import Flask, request as flaskRequest, jsonify, render_template import requests import json import time from datetime import datetime, timedelta import sqlite3 import sys import ccxt import os from threading import Thread from pathlib import Path import logging #setup the logging module for file output log...
from flask import Flask, request as flaskRequest, jsonify, render_template import requests import json import time from datetime import datetime, timedelta import sqlite3 import sys import ccxt import os from threading import Thread from pathlib import Path import logging #setup the logging module for file output log...
# -*- coding: utf-8 -*- """ Configuration parsing and resolving =================================== """ import copy import getpass import hashlib import logging import os import git import yaml from numpy import inf as infinity import orion import orion.core from orion.core.io.orion_cmdline_parser import OrionCmdlin...
# -*- coding: utf-8 -*- """ Configuration parsing and resolving =================================== """ import copy import getpass import hashlib import logging import os import git import yaml from numpy import inf as infinity import orion import orion.core from orion.core.io.orion_cmdline_parser import OrionCmdlin...
import copy import json import os import random import ssl import sys from binascii import b2a_hex from datetime import datetime from json import JSONDecodeError import click import requests from apscheduler.schedulers.blocking import BlockingScheduler from cryptography.hazmat.backends import default_backend from cryp...
import copy import json import os import random import ssl import sys from binascii import b2a_hex from datetime import datetime from json import JSONDecodeError import click import requests from apscheduler.schedulers.blocking import BlockingScheduler from cryptography.hazmat.backends import default_backend from cryp...
#!/usr/bin/env python import argparse import os import sqlite3 def main(): parser = argparse.ArgumentParser(description='Extract mol blocks of specified mol ids into SDF file and extract ' 'their docking scores.') parser.add_argument('-i', '--input', metavar='...
#!/usr/bin/env python import argparse import os import sqlite3 def main(): parser = argparse.ArgumentParser(description='Extract mol blocks of specified mol ids into SDF file and extract ' 'their docking scores.') parser.add_argument('-i', '--input', metavar='...
# coding: utf-8 """Plotting library.""" from copy import deepcopy from io import BytesIO from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np from .basic import Booster, _log_warning from .compat import GRAPHVIZ_INSTALLED, MATPLOTLIB_INSTALLED from .sklearn import LGBMModel def _check_not_t...
# coding: utf-8 """Plotting library.""" from copy import deepcopy from io import BytesIO from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np from .basic import Booster, _log_warning from .compat import GRAPHVIZ_INSTALLED, MATPLOTLIB_INSTALLED from .sklearn import LGBMModel def _check_not_t...
#!/usr/bin/env python3 # @Author : Yang Liu # @FileName : meth_stats_tool.py # @Software : NANOME project # @Organization : JAX Li Lab # @Website : https://github.com/TheJacksonLaboratory/nanome """ Tool for pre-processing results """ import argparse import glob import gzip import sys from collections import defaul...
#!/usr/bin/env python3 # @Author : Yang Liu # @FileName : meth_stats_tool.py # @Software : NANOME project # @Organization : JAX Li Lab # @Website : https://github.com/TheJacksonLaboratory/nanome """ Tool for pre-processing results """ import argparse import glob import gzip import sys from collections import defaul...
import logging from aiohttp import web from ledfx.api import RestEndpoint from ledfx.config import save_config from ledfx.events import Event _LOGGER = logging.getLogger(__name__) class QLCEndpoint(RestEndpoint): """REST end-point for querying and managing a QLC integration""" ENDPOINT_PATH = "/api/integr...
import logging from aiohttp import web from ledfx.api import RestEndpoint from ledfx.config import save_config from ledfx.events import Event _LOGGER = logging.getLogger(__name__) class QLCEndpoint(RestEndpoint): """REST end-point for querying and managing a QLC integration""" ENDPOINT_PATH = "/api/integr...
import json import logging import re from datetime import datetime from random import random from typing import List, NamedTuple, Optional from urllib.parse import urlparse import requests from streamlink.exceptions import NoStreamsError, PluginError from streamlink.plugin import Plugin, PluginArgument, PluginArgumen...
import json import logging import re from datetime import datetime from random import random from typing import List, NamedTuple, Optional from urllib.parse import urlparse import requests from streamlink.exceptions import NoStreamsError, PluginError from streamlink.plugin import Plugin, PluginArgument, PluginArgumen...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Retrievers for RAG. """ from abc import ABC, abstractmethod import copy import csv import gzip import numpy as np impo...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Retrievers for RAG. """ from abc import ABC, abstractmethod import copy import csv import gzip import numpy as np impo...
import copy import os import sys import argparse import traceback import gc parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("-i", "--ip", help="Set IP address for sending tracking data", default="127.0.0.1") parser.add_argument("-p", "--port", type=int, help...
import copy import os import sys import argparse import traceback import gc parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("-i", "--ip", help="Set IP address for sending tracking data", default="127.0.0.1") parser.add_argument("-p", "--port", type=int, help...
import json import logging import os import time from datetime import datetime from discord.ext import commands from pretty_help import PrettyHelp with open('token.secret')as fp: TOKEN = fp.read().strip() fp.close() with open('config.json') as file: config = json.load(file) DESCRIPTION = config["DESC...
import json import logging import os import time from datetime import datetime from discord.ext import commands from pretty_help import PrettyHelp with open('token.secret')as fp: TOKEN = fp.read().strip() fp.close() with open('config.json') as file: config = json.load(file) DESCRIPTION = config["DESC...
"""Module for dealing with the toolbar. """ import os import ee import ipyevents import ipyleaflet import ipywidgets as widgets from ipyfilechooser import FileChooser from IPython.core.display import display from .common import * from .timelapse import * def tool_template(m=None): widget_width = "250px" pa...
"""Module for dealing with the toolbar. """ import os import ee import ipyevents import ipyleaflet import ipywidgets as widgets from ipyfilechooser import FileChooser from IPython.core.display import display from .common import * from .timelapse import * def tool_template(m=None): widget_width = "250px" pa...
"""Process fictitious N2 cross sections from LxCAT. """ from nepc.curate.curate import CurateLxCAT, curate_client from nepc.util import config NEPC_HOME = config.nepc_home() datadir = NEPC_HOME + "/tests/data" states = { 'X1': 'N2(X1Sigmag+)', 'B3': 'N2(B3Pig)', 'W3': 'N2(W3Deltau)', 'B\'3': 'N2(Bp3S...
"""Process fictitious N2 cross sections from LxCAT. """ from nepc.curate.curate import CurateLxCAT, curate_client from nepc.util import config NEPC_HOME = config.nepc_home() datadir = NEPC_HOME + "/tests/data" states = { 'X1': 'N2(X1Sigmag+)', 'B3': 'N2(B3Pig)', 'W3': 'N2(W3Deltau)', 'B\'3': 'N2(Bp3S...
import abc import collections import dataclasses import logging import os import subprocess import tempfile import traceback import typing import version import yaml from github3.exceptions import ( ConnectionError, NotFoundError, ) import gci.componentmodel as cm import ci.util from ci.util import ( ex...
import abc import collections import dataclasses import logging import os import subprocess import tempfile import traceback import typing import version import yaml from github3.exceptions import ( ConnectionError, NotFoundError, ) import gci.componentmodel as cm import ci.util from ci.util import ( ex...
import math import os import sys import tempfile from datetime import date, datetime, time, timedelta from decimal import Decimal from enum import Enum, IntEnum from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network from pathlib import Path from typing import ( Any, ...
import math import os import sys import tempfile from datetime import date, datetime, time, timedelta from decimal import Decimal from enum import Enum, IntEnum from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network from pathlib import Path from typing import ( Any, ...
""" Wolfram|Alpha Adapter is an adapter which is used to fetch results from the Wolfram ALpha server MARKS LICENSE AND ATTRIBUTION"Wolfram|Alpha Marks" means the trade names, trademarks, service marks, logos, domain names and other distinctive marks of Wolfram|Alpha. Wolfram|Alpha grants You a non-exclusive license to...
""" Wolfram|Alpha Adapter is an adapter which is used to fetch results from the Wolfram ALpha server MARKS LICENSE AND ATTRIBUTION"Wolfram|Alpha Marks" means the trade names, trademarks, service marks, logos, domain names and other distinctive marks of Wolfram|Alpha. Wolfram|Alpha grants You a non-exclusive license to...
#!/usr/bin/env python """ Wrapper classes for providing a minimal consistent interface to cheminformatics toolkits Currently supported toolkits: * The `OpenEye Toolkit <https://docs.eyesopen.com/toolkits/python/quickstart-python/index.html>`_ * The `RDKit <http://www.rdkit.org/>`_ * `AmberTools <http://ambermd.org/Am...
#!/usr/bin/env python """ Wrapper classes for providing a minimal consistent interface to cheminformatics toolkits Currently supported toolkits: * The `OpenEye Toolkit <https://docs.eyesopen.com/toolkits/python/quickstart-python/index.html>`_ * The `RDKit <http://www.rdkit.org/>`_ * `AmberTools <http://ambermd.org/Am...
import sys, mood_db import matplotlib.pyplot as plt import mplcursors from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QIcon from pathlib import Path from datetime import datetime cur_dir = Path.cwd() class Canva...
import sys, mood_db import matplotlib.pyplot as plt import mplcursors from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QIcon from pathlib import Path from datetime import datetime cur_dir = Path.cwd() class Canva...
# Copyright 2020- Robot Framework Foundation # # 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 ag...
# Copyright 2020- Robot Framework Foundation # # 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 ag...
#!/usr/bin/env python3 import templates import cgi import secret import os # import json # Print environment as json # print("Content-Type: application/json") # print() # print(json.dumps(dict(os.environ), indent=2)) # Print query parameter data in html # print("Content-Type: text/html") # print() # print(f"<p>QUERY_...
#!/usr/bin/env python3 import templates import cgi import secret import os # import json # Print environment as json # print("Content-Type: application/json") # print() # print(json.dumps(dict(os.environ), indent=2)) # Print query parameter data in html # print("Content-Type: text/html") # print() # print(f"<p>QUERY_...
from threading import Thread, Event, Lock from typing import Union from mongoengine.errors import NotUniqueError from web3.datastructures import AttributeDict from src.contracts.ethereum.event_listener import EthEventListener from src.contracts.ethereum.multisig_wallet import MultisigWallet from src.contracts.secret....
from threading import Thread, Event, Lock from typing import Union from mongoengine.errors import NotUniqueError from web3.datastructures import AttributeDict from src.contracts.ethereum.event_listener import EthEventListener from src.contracts.ethereum.multisig_wallet import MultisigWallet from src.contracts.secret....
# Copyright 2020-2021 Huawei Technologies Co., Ltd.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 ...
# Copyright 2020-2021 Huawei Technologies Co., Ltd.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 ...
import indicators.rsi.rsi_settings as rsi_settings from indicators.rsi.rsi_obj import RSI import ochlv_db.db_settings as db_settings import sqlite3 import pandas as pd from tqdm import tqdm import time from datetime import datetime stop_streaming = False def rsi_fn(n = '-------rsi_idle-------'): kwargs = { ...
import indicators.rsi.rsi_settings as rsi_settings from indicators.rsi.rsi_obj import RSI import ochlv_db.db_settings as db_settings import sqlite3 import pandas as pd from tqdm import tqdm import time from datetime import datetime stop_streaming = False def rsi_fn(n = '-------rsi_idle-------'): kwargs = { ...
# -*- coding: utf-8 -*- #https://www.pythoncentral.io/series/python-sqlalchemy-database-tutorial/ import os import sys if not (os.path.dirname(os.path.dirname(__file__)) in sys.path): sys.path.append(os.path.dirname(os.path.dirname(__file__))) if not (os.path.dirname(__file__) in sys.path): sys.path.append(os.path.dirn...
# -*- coding: utf-8 -*- #https://www.pythoncentral.io/series/python-sqlalchemy-database-tutorial/ import os import sys if not (os.path.dirname(os.path.dirname(__file__)) in sys.path): sys.path.append(os.path.dirname(os.path.dirname(__file__))) if not (os.path.dirname(__file__) in sys.path): sys.path.append(os.path.dirn...
labels = [] labels.append(open(f"Labels_swe/Adina_labels.txt", "r",encoding="utf-8").readlines()) labels.append(open(f"Labels_swe/Christian_labels.txt", "r",encoding="utf-8").readlines()) labels.append(open(f"Labels_swe/Liza_labels.txt", "r",encoding="utf-8").readlines()) labels.append(open(f"Labels_swe/Sofia_label...
labels = [] labels.append(open(f"Labels_swe/Adina_labels.txt", "r",encoding="utf-8").readlines()) labels.append(open(f"Labels_swe/Christian_labels.txt", "r",encoding="utf-8").readlines()) labels.append(open(f"Labels_swe/Liza_labels.txt", "r",encoding="utf-8").readlines()) labels.append(open(f"Labels_swe/Sofia_label...
from collections import deque from datetime import datetime from enum import Enum from itertools import product from typing import Dict, List, Optional, Tuple, Union import pytest from typing_extensions import Literal from pydantic import BaseModel, ConfigError, Extra, Field, ValidationError, errors, validator from p...
from collections import deque from datetime import datetime from enum import Enum from itertools import product from typing import Dict, List, Optional, Tuple, Union import pytest from typing_extensions import Literal from pydantic import BaseModel, ConfigError, Extra, Field, ValidationError, errors, validator from p...
""" model the end-to-end Subaru-SCExAO optics system Here, we will add the basic functionality of the Subaru+SCExAO Telescope, including the primary, secondary, and AO188. The SCExAO system sits behind the AO188 instrument of Subaru, which is a 188-element AO system located at the Nasmyth focus (IR) of the telescope. ...
""" model the end-to-end Subaru-SCExAO optics system Here, we will add the basic functionality of the Subaru+SCExAO Telescope, including the primary, secondary, and AO188. The SCExAO system sits behind the AO188 instrument of Subaru, which is a 188-element AO system located at the Nasmyth focus (IR) of the telescope. ...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
import time import logging import os import sys import json from martypy import Marty jointNames = [ 'left hip', 'left twist', 'left knee', 'right hip', 'right twist', 'right knee', 'left arm', 'right arm', 'eyes' ] def betweenCommands(): time.sleep(3) def testBoolCmd(cmdS...
import time import logging import os import sys import json from martypy import Marty jointNames = [ 'left hip', 'left twist', 'left knee', 'right hip', 'right twist', 'right knee', 'left arm', 'right arm', 'eyes' ] def betweenCommands(): time.sleep(3) def testBoolCmd(cmdS...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function from .sql_updates import check_and_insert_user_agent from .sql_updates import get_username_random, get_username_to_unfollow_random from .sql_updates import ( get_usernames_first, get_usernames, get_username_row_count, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function from .sql_updates import check_and_insert_user_agent from .sql_updates import get_username_random, get_username_to_unfollow_random from .sql_updates import ( get_usernames_first, get_usernames, get_username_row_count, ...
import json import logging import os import re import subprocess import tempfile from datetime import datetime from pathlib import Path import requests from fastapi import FastAPI from fastapi_utils.tasks import repeat_every from grayskull.__main__ import create_python_recipe from grayskull.cli import CLIConfig from g...
import json import logging import os import re import subprocess import tempfile from datetime import datetime from pathlib import Path import requests from fastapi import FastAPI from fastapi_utils.tasks import repeat_every from grayskull.__main__ import create_python_recipe from grayskull.cli import CLIConfig from g...
# Copyright (c) 2018-2019 Patricio Cubillos and contributors. # bibmanager is open-source software under the MIT license (see LICENSE). __all__ = [ 'manager', 'search', 'display', 'add_bibtex', 'update', 'key_update', ] import os import re import json import urllib import textwrap import pickl...
# Copyright (c) 2018-2019 Patricio Cubillos and contributors. # bibmanager is open-source software under the MIT license (see LICENSE). __all__ = [ 'manager', 'search', 'display', 'add_bibtex', 'update', 'key_update', ] import os import re import json import urllib import textwrap import pickl...
# (c) 2012-2019, Ansible by Red Hat # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) any later version. # ...
# (c) 2012-2019, Ansible by Red Hat # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) any later version. # ...
class pipe(object): def __init__(self): self.buf = [] self.last_output = 0 def next(self): element = self.buf[0] self.buf = self.buf[1:] return element def peek(self): if len(self.buf) == 0: return None return self.buf[0] def write(self...
class pipe(object): def __init__(self): self.buf = [] self.last_output = 0 def next(self): element = self.buf[0] self.buf = self.buf[1:] return element def peek(self): if len(self.buf) == 0: return None return self.buf[0] def write(self...
# -*- coding: utf-8 -*- from ..interpreter import model, NodeContext # Python models for autorally_gazebo # Derived from: https://github.com/AutoRally/autorally/tree/melodic-devel/autorally_gazebo/nodes @model('autorally_gazebo', 'autorally_controller.py') def autorally_controller(c: NodeContext) -> None: c.rea...
# -*- coding: utf-8 -*- from ..interpreter import model, NodeContext # Python models for autorally_gazebo # Derived from: https://github.com/AutoRally/autorally/tree/melodic-devel/autorally_gazebo/nodes @model('autorally_gazebo', 'autorally_controller.py') def autorally_controller(c: NodeContext) -> None: c.rea...
""" MIT License Copyright (c) 2021 MShawon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
""" MIT License Copyright (c) 2021 MShawon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function from .sql_updates import check_and_insert_user_agent from .sql_updates import get_username_random, get_username_to_unfollow_random from .sql_updates import ( get_usernames_first, get_usernames, get_username_row_count, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function from .sql_updates import check_and_insert_user_agent from .sql_updates import get_username_random, get_username_to_unfollow_random from .sql_updates import ( get_usernames_first, get_usernames, get_username_row_count, ...
import discord from discord.ext import commands from discord.ext.commands.core import has_permissions from Tools.utils import getConfig, updateConfig class AntiSpamCog(commands.Cog, name="Anti Spamming"): """ Enable or Disable Anti-Spam Property of Garuda. When enabled, Garuda will warn or kick member i...
import discord from discord.ext import commands from discord.ext.commands.core import has_permissions from Tools.utils import getConfig, updateConfig class AntiSpamCog(commands.Cog, name="Anti Spamming"): """ Enable or Disable Anti-Spam Property of Garuda. When enabled, Garuda will warn or kick member i...
from dataclasses import asdict, dataclass import asyncio import base64 import binascii import chevron import hashlib import json import logging import re from aiohttp import ClientConnectionError, ClientSession, ClientTimeout from arq import Retry, cron from arq.utils import to_unix_ms from arq.worker import run_worke...
from dataclasses import asdict, dataclass import asyncio import base64 import binascii import chevron import hashlib import json import logging import re from aiohttp import ClientConnectionError, ClientSession, ClientTimeout from arq import Retry, cron from arq.utils import to_unix_ms from arq.worker import run_worke...
"""Support for non-delivered packages recorded in AfterShip.""" from __future__ import annotations import logging from typing import Any, Final from pyaftership.tracker import Tracking import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA as BASE_PLATFORM_SCHEMA, SensorEntity...
"""Support for non-delivered packages recorded in AfterShip.""" from __future__ import annotations import logging from typing import Any, Final from pyaftership.tracker import Tracking import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA as BASE_PLATFORM_SCHEMA, SensorEntity...
"""" Modified by Harrison McCarty - Autonomous Robotics Club of Purdue Copyright © Krypton 2021 - https://github.com/kkrypt0nn Description: """ import json import os import platform import random import sys import discord from discord.ext import commands, tasks from discord.ext.commands import Bot if not os.path.isf...
"""" Modified by Harrison McCarty - Autonomous Robotics Club of Purdue Copyright © Krypton 2021 - https://github.com/kkrypt0nn Description: """ import json import os import platform import random import sys import discord from discord.ext import commands, tasks from discord.ext.commands import Bot if not os.path.isf...
# This is an automatically generated file. # DO NOT EDIT or your changes may be overwritten import base64 from typing import List, Optional from xdrlib import Packer, Unpacker from .claim_predicate_type import ClaimPredicateType from .int64 import Int64 from ..exceptions import ValueError __all__ = ["ClaimPredicate"]...
# This is an automatically generated file. # DO NOT EDIT or your changes may be overwritten import base64 from typing import List, Optional from xdrlib import Packer, Unpacker from .claim_predicate_type import ClaimPredicateType from .int64 import Int64 from ..exceptions import ValueError __all__ = ["ClaimPredicate"]...
from pathlib import Path import tarfile import requests from rich import print as rprint from bg_atlasapi import utils, config, core, descriptors COMPRESSED_FILENAME = "atlas.tar.gz" def _version_tuple_from_str(version_str): return tuple([int(n) for n in version_str.split(".")]) def _version_str_from_tuple(...
from pathlib import Path import tarfile import requests from rich import print as rprint from bg_atlasapi import utils, config, core, descriptors COMPRESSED_FILENAME = "atlas.tar.gz" def _version_tuple_from_str(version_str): return tuple([int(n) for n in version_str.split(".")]) def _version_str_from_tuple(...
""" A submodel that uses Dynamic Flux Balance Analysis (dFBA) to model a set of reactions :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu> :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu> :Date: 2020-07-29 :Copyright: 2016-2020, Karr Lab :License: MIT """ import collections import conv_opt import copy import enum im...
""" A submodel that uses Dynamic Flux Balance Analysis (dFBA) to model a set of reactions :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu> :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu> :Date: 2020-07-29 :Copyright: 2016-2020, Karr Lab :License: MIT """ import collections import conv_opt import copy import enum im...
from ipdb import set_trace as st import os import time import random import numpy as np from loguru import logger import torch def set_seed(seed): random.seed(seed) np.random.seed(seed) os.environ["PYTHONHASHSEED"] = str(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) # type: ignore ...
from ipdb import set_trace as st import os import time import random import numpy as np from loguru import logger import torch def set_seed(seed): random.seed(seed) np.random.seed(seed) os.environ["PYTHONHASHSEED"] = str(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) # type: ignore ...
class Verdict: def __init__(self, reconciled: bool=None, verdict: str=None): self.reconciled = reconciled self.verdicts = [] if verdict: self.verdicts.append(verdict) def __str__(self): return f'<Verdict / {'reconciled' if self.reconciled else 'non-reconciled'} ({...
class Verdict: def __init__(self, reconciled: bool=None, verdict: str=None): self.reconciled = reconciled self.verdicts = [] if verdict: self.verdicts.append(verdict) def __str__(self): return f'<Verdict / {"reconciled" if self.reconciled else "non-reconciled"} ({...
"""scrapli.factory""" import importlib from copy import deepcopy from io import BytesIO from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, cast from scrapli.driver import AsyncGenericDriver, AsyncNetworkDriver, GenericDriver, NetworkDriver from scrapli.driver.core import ( AsyncEOSDriver, ...
"""scrapli.factory""" import importlib from copy import deepcopy from io import BytesIO from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, cast from scrapli.driver import AsyncGenericDriver, AsyncNetworkDriver, GenericDriver, NetworkDriver from scrapli.driver.core import ( AsyncEOSDriver, ...
from contextlib import contextmanager from logging import getLogger, Logger from typing import Iterator, Tuple, ClassVar from sqlalchemy import create_engine from sqlalchemy.orm import Session as sqlaSession, sessionmaker from sqlalchemy.pool import StaticPool from .base import Base class Database: """ A simpli...
from contextlib import contextmanager from logging import getLogger, Logger from typing import Iterator, Tuple, ClassVar from sqlalchemy import create_engine from sqlalchemy.orm import Session as sqlaSession, sessionmaker from sqlalchemy.pool import StaticPool from .base import Base class Database: """ A simpli...
#!/usr/bin/env python # SPDX-License-Identifier: Apache-2.0 import os import io from onnx import defs, load, AttributeProto from onnx.backend.test.case import collect_snippets from onnx.backend.test.runner import Runner from onnx.backend.test.loader import load_model_tests from typing import Any, IO, Sequence, Dict,...
#!/usr/bin/env python # SPDX-License-Identifier: Apache-2.0 import os import io from onnx import defs, load, AttributeProto from onnx.backend.test.case import collect_snippets from onnx.backend.test.runner import Runner from onnx.backend.test.loader import load_model_tests from typing import Any, IO, Sequence, Dict,...
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
import bson import re import logging from datetime import datetime from functools import reduce from mongoengine import EmbeddedDocumentField, EmbeddedDocument, Document, QuerySet, register_connection from pymongo import ReadPreference from mongoengine.errors import * from spaceone.core import config from spaceone.core...
import bson import re import logging from datetime import datetime from functools import reduce from mongoengine import EmbeddedDocumentField, EmbeddedDocument, Document, QuerySet, register_connection from pymongo import ReadPreference from mongoengine.errors import * from spaceone.core import config from spaceone.core...
from dataclasses import dataclass from typing import Dict, List, Optional, Tuple import aiosqlite from beer.consensus.block_record import BlockRecord from beer.types.blockchain_format.sized_bytes import bytes32 from beer.types.blockchain_format.sub_epoch_summary import SubEpochSummary from beer.types.coin_spend impor...
from dataclasses import dataclass from typing import Dict, List, Optional, Tuple import aiosqlite from beer.consensus.block_record import BlockRecord from beer.types.blockchain_format.sized_bytes import bytes32 from beer.types.blockchain_format.sub_epoch_summary import SubEpochSummary from beer.types.coin_spend impor...
import json import logging from abc import ABC import slack_actions from ws_sdk.web import WS import slack_format class Report(ABC): def __init__(self, ws_conn_details: dict, config: dict, ws_connector: WS): self.ws_conn_details = ws_conn_details ...
import json import logging from abc import ABC import slack_actions from ws_sdk.web import WS import slack_format class Report(ABC): def __init__(self, ws_conn_details: dict, config: dict, ws_connector: WS): self.ws_conn_details = ws_conn_details ...
import _thread import argparse import logging import os import time import webbrowser from threading import Thread from cryptography.hazmat.backends import default_backend as crypto_default_backend from cryptography.hazmat.primitives import serialization as crypto_serialization from cryptography.hazmat.primitives.asym...
import _thread import argparse import logging import os import time import webbrowser from threading import Thread from cryptography.hazmat.backends import default_backend as crypto_default_backend from cryptography.hazmat.primitives import serialization as crypto_serialization from cryptography.hazmat.primitives.asym...
# Copyright (c) 2021 elParaguayo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
# Copyright (c) 2021 elParaguayo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
import json import os from typing import TYPE_CHECKING from funcy import reraise from dvc.exceptions import DvcException from dvc.render.base import Renderer from dvc.render.utils import get_files from dvc.utils import relpath if TYPE_CHECKING: from dvc.types import StrPath class ImageRenderer(Renderer): T...
import json import os from typing import TYPE_CHECKING from funcy import reraise from dvc.exceptions import DvcException from dvc.render.base import Renderer from dvc.render.utils import get_files from dvc.utils import relpath if TYPE_CHECKING: from dvc.types import StrPath class ImageRenderer(Renderer): T...
# # Copyright 2018-2021 Elyra Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# # Copyright 2018-2021 Elyra Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
try: import importlib.resources as resources except ModuleNotFoundError: import importlib_resources as resources from itertools import takewhile import os from pathlib import Path import shutil import subprocess as sp import sys from typing import Dict, Iterable, Optional, Tuple with resources.path('pyscreener...
try: import importlib.resources as resources except ModuleNotFoundError: import importlib_resources as resources from itertools import takewhile import os from pathlib import Path import shutil import subprocess as sp import sys from typing import Dict, Iterable, Optional, Tuple with resources.path('pyscreener...
import os import logging import csv import pandas as pd from collections import OrderedDict from bs4 import BeautifulSoup DUMMY_ANTECEDENT = None ##################### # GLOBAL PARAMETERS ##################### # Path "./data/*" assumes you are running from root folder, i.e. (python /src/baseline.py) # Use path "../d...
import os import logging import csv import pandas as pd from collections import OrderedDict from bs4 import BeautifulSoup DUMMY_ANTECEDENT = None ##################### # GLOBAL PARAMETERS ##################### # Path "./data/*" assumes you are running from root folder, i.e. (python /src/baseline.py) # Use path "../d...
from skt.vault_utils import get_secrets def get_hive_conn(): from pyhive import hive hiveserver2 = get_secrets(path="ye/hiveserver2") host = hiveserver2["ip"] port = hiveserver2["port"] user = hiveserver2["user"] conn = hive.connect(host, port=port, username=user) return conn def get_hd...
from skt.vault_utils import get_secrets def get_hive_conn(): from pyhive import hive hiveserver2 = get_secrets(path="ye/hiveserver2") host = hiveserver2["ip"] port = hiveserver2["port"] user = hiveserver2["user"] conn = hive.connect(host, port=port, username=user) return conn def get_hd...
# Copyright (c) 2018 getcarrier.io # # 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 (c) 2018 getcarrier.io # # 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...
"""Support for Huawei LTE routers.""" from __future__ import annotations from collections import defaultdict from collections.abc import Callable from contextlib import suppress from dataclasses import dataclass, field from datetime import timedelta import logging import time from typing import Any, NamedTuple, cast ...
"""Support for Huawei LTE routers.""" from __future__ import annotations from collections import defaultdict from collections.abc import Callable from contextlib import suppress from dataclasses import dataclass, field from datetime import timedelta import logging import time from typing import Any, NamedTuple, cast ...
# Copyright 2020 The XLS Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright 2020 The XLS Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
#!/usr/bin/env python3 # Copyright (C) 2017-2020 The btclib developers # # This file is part of btclib. It is subject to the license terms in the # LICENSE file found in the top-level directory of this distribution. # # No part of btclib including this file, may be copied, modified, propagated, # or distributed except...
#!/usr/bin/env python3 # Copyright (C) 2017-2020 The btclib developers # # This file is part of btclib. It is subject to the license terms in the # LICENSE file found in the top-level directory of this distribution. # # No part of btclib including this file, may be copied, modified, propagated, # or distributed except...
import argparse, time, re, asyncio, functools, base64, random, urllib.parse, socket from . import proto from .__doc__ import * SOCKET_TIMEOUT = 300 PACKET_SIZE = 65536 UDP_LIMIT = 30 DUMMY = lambda s: s asyncio.StreamReader.read_ = lambda self: self.read(PACKET_SIZE) asyncio.StreamReader.read_n = lambda self, n: asyn...
import argparse, time, re, asyncio, functools, base64, random, urllib.parse, socket from . import proto from .__doc__ import * SOCKET_TIMEOUT = 300 PACKET_SIZE = 65536 UDP_LIMIT = 30 DUMMY = lambda s: s asyncio.StreamReader.read_ = lambda self: self.read(PACKET_SIZE) asyncio.StreamReader.read_n = lambda self, n: asyn...
import argparse import logging import math import os import random import time from copy import deepcopy from pathlib import Path from threading import Thread import numpy as np import torch.distributed as dist import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.optim.lr_sche...
import argparse import logging import math import os import random import time from copy import deepcopy from pathlib import Path from threading import Thread import numpy as np import torch.distributed as dist import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.optim.lr_sche...
import concurrent.futures import secrets from enum import Enum from ipaddress import ip_address from typing import Tuple, Set, Dict, Callable from urllib import parse import pytz import urllib3 from CommonServerUserPython import * # noqa from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-impo...
import concurrent.futures import secrets from enum import Enum from ipaddress import ip_address from typing import Tuple, Set, Dict, Callable from urllib import parse import pytz import urllib3 from CommonServerUserPython import * # noqa from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-impo...
import petscii import bisect from util import to_word, to_bytes # fmt: off basic_tokens = ( "END", "FOR", "NEXT", "DATA", "INPUT#", "INPUT", "DIM", "READ", "LET", "GOTO", "RUN", "IF", "RESTORE", "GOSUB", "RETURN", "REM", "STOP", "ON", "WAIT", "LOAD", "SAVE", "VERIFY", "DEF", "POKE", "PRINT#", "PRINT", ...
import petscii import bisect from util import to_word, to_bytes # fmt: off basic_tokens = ( "END", "FOR", "NEXT", "DATA", "INPUT#", "INPUT", "DIM", "READ", "LET", "GOTO", "RUN", "IF", "RESTORE", "GOSUB", "RETURN", "REM", "STOP", "ON", "WAIT", "LOAD", "SAVE", "VERIFY", "DEF", "POKE", "PRINT#", "PRINT", ...