<commit_before># import pyximport; pyximport.install()

import asyncio
# import uvloop; asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
import logging
import os
import sys

from asynctnt import Iterator
from asynctnt.exceptions import TarantoolConnectionLostError
from asynctnt.instance import TarantoolInstance

logging.basicConfig(format='%(created)f [%(module)s:%(funcName)s:%(lineno)d] %(levelname)s: %(message)s',
                    level=logging.DEBUG, stream=sys.stdout)

import datetime

import asynctnt

CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))


def read_applua():
    path = os.path.join(CURRENT_DIR, os.pardir, 'tests', 'files', 'app.lua')
    with open(path, 'r') as f:
        return f.read()


async def main(loop):
    tnt = TarantoolInstance(
        applua=read_applua(),
        cleanup=True,
        host='unix/',
        port='/tmp/_mytnt.sock',
        console_host='127.0.0.1',
        loop=loop
    )

    await tnt.start()
    conn = None
    try:
        coro = asyncio.ensure_future(
            asynctnt.connect(host=tnt.host, port=tnt.port,
                             username='t1', password='t1',
                             fetch_schema=True,
                             auto_refetch_schema=True,
                             reconnect_timeout=1, request_timeout=20,
                             encoding='utf-8',
                             loop=loop),
            loop=loop
        )
        # await asyncio.sleep(1, loop=loop)
        # await tnt.start()
        conn = await coro

        print('connected')
        # print(conn._protocol.schema)
        # print(conn._protocol._con_state)
        #
        # res = await conn.call16('long', [3])
        # res = await conn.auth('tt', 'ttp')d

        # await tnt.stop()
        # await tnt.start()
        # print('RESTARTED TNT')
        # await asyncio.sleep(1, loop=loop)

        # print(res.body2yaml())
        # res = await conn.select('tester')
        # print(res.body)
        res = await conn.eval('return box.cfg')
        print(res.body)
        return
        # res = await conn.call('test', timeout=0)
        res = await conn.call('long', [5])
        print(res)
        print(res.body)
        print(res.schema_id)

        res = await conn.call('long', [2])
        print(res)
        if res is not None:
            print(res.body)
            print(res.schema_id)

        res = await conn.call('long', [5])
        print(res)
        if res is not None:
            print(res.body)
            print(res.schema_id)
        # res = await conn.refetch_schema()
        # res = await conn.insert('tester', (2, 'hello', 3))<commit_msg>Increased code coverage<commit_after># import pyximport; pyximport.install()

import asyncio
# import uvloop; asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
import logging
import os
import sys

from asynctnt import Iterator
from asynctnt.exceptions import TarantoolConnectionLostError
from asynctnt.instance import TarantoolInstance

logging.basicConfig(format='%(created)f [%(module)s:%(funcName)s:%(lineno)d] %(levelname)s: %(message)s',
                    level=logging.DEBUG, stream=sys.stdout)

import datetime

import asynctnt

CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))


def read_applua():
    path = os.path.join(CURRENT_DIR, os.pardir, 'tests', 'files', 'app.lua')
    with open(path, 'r') as f:
        return f.read()


async def main(loop):
    tnt = TarantoolInstance(
        applua=read_applua(),
        cleanup=True,
        host='unix/',
        port='/tmp/_mytnt.sock',
        console_host='127.0.0.1',
        loop=loop
    )

    # await tnt.start()
    conn = None
    try:
        coro = asyncio.ensure_future(
            asynctnt.connect(host='127.0.0.1', port=3303,
                             username='t1', password='t1',
                             fetch_schema=True,
                             auto_refetch_schema=True,
                             reconnect_timeout=1, request_timeout=20,
                             encoding='utf-8',
                             loop=loop),
            loop=loop
        )
        # await asyncio.sleep(1, loop=loop)
        # await tnt.start()
        conn = await coro

        print('connected')
        # print(conn._protocol.schema)
        # print(conn._protocol._con_state)
        #
        # res = await conn.call16('long', [3])
        # res = await conn.auth('tt', 'ttp')d

        # await tnt.stop()
        # await tnt.start()
        # print('RESTARTED TNT')
        # await asyncio.sleep(1, loop=loop)

        # print(res.body2yaml())
        # res = await conn.select('tester')
        # print(res.body)
        # res = await conn.call('test', timeout=0)
        res = await conn.call('long', [10])
        print(res)
        print(res.body)
        print(res.schema_id)
        return

        res = await conn.call('long', [2])
        print(res)
        if res is not None:
            print(res.body)
            print(res.schema_id)

        res = await conn.call('long', [5])
        print(res)
        if res is not None:
            print(res.body)
            print(res.schema_id)
        # res = await conn.refetch_schema()
        # res = await conn.insert('tester', (2, 'hello', 3))
{'fraction_non_alphanumeric': 0.1269901440485216, 'fraction_numerical': 0.011182714177407127, 'mean_word_length': 1.9712837837837838, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5574907', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1640, 'n_words': 328}