# Path: asynctnt/utils.py
# def get_running_loop(loop_arg: Optional[asyncio.AbstractEventLoop] = None):
#     if loop_arg is not None:
#         warnings.warn(
#             'loop argument is deprecated and is dropped',
#             DeprecationWarning,
#             stacklevel=3
#         )
# 
#     return __get_running_loop()


import abc
import asyncio
import asyncio.subprocess
import functools
import logging
import math
import os
import random
import re
import select
import shutil
import socket
import string
import subprocess
import time
import yaml
from typing import Optional
from threading import Thread
from asynctnt.utils import get_running_loop
            return None
        res = res[0]
        m = VERSION_STRING_REGEX.match(res)
        if m is not None:
            ver = m.group(1)
            return tuple(map(int, ver.split('.')))

    def command(self, cmd, print_greeting=True):
        s = TcpSocket(self._console_host, self._console_port)
        try:
            s.connect()
            greeting = s.read(128).decode()
            if print_greeting:
                self._logger.info(greeting)

            if isinstance(cmd, str):
                cmd = cmd.encode('utf-8')

            s.write(cmd + b'\n')

            data = s.read_until(b'...\n').decode()
            data = yaml.full_load(data)
            return data
        finally:
            s.close()


class TarantoolAsyncInstance(TarantoolInstance):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

# Path: asynctnt/utils.py
# def get_running_loop(loop_arg: Optional[asyncio.AbstractEventLoop] = None):
#     if loop_arg is not None:
#         warnings.warn(
#             'loop argument is deprecated and is dropped',
#             DeprecationWarning,
#             stacklevel=3
#         )
# 
#     return __get_running_loop()


# Path: asynctnt/instance.py
import abc
import asyncio
import asyncio.subprocess
import functools
import logging
import math
import os
import random
import re
import select
import shutil
import socket
import string
import subprocess
import time
import yaml
from typing import Optional
from threading import Thread
from asynctnt.utils import get_running_loop

            return None
        res = res[0]
        m = VERSION_STRING_REGEX.match(res)
        if m is not None:
            ver = m.group(1)
            return tuple(map(int, ver.split('.')))

    def command(self, cmd, print_greeting=True):
        s = TcpSocket(self._console_host, self._console_port)
        try:
            s.connect()
            greeting = s.read(128).decode()
            if print_greeting:
                self._logger.info(greeting)

            if isinstance(cmd, str):
                cmd = cmd.encode('utf-8')

            s.write(cmd + b'\n')

            data = s.read_until(b'...\n').decode()
            data = yaml.full_load(data)
            return data
        finally:
            s.close()


class TarantoolAsyncInstance(TarantoolInstance):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        self._loop = get_running_loop(kwargs.pop('loop', None))