<commit_before>import logging
from time import sleep
from datetime import timedelta
from hashlib import md5
from os import path
from io import BytesIO

# Import some externalized utilities to work with the Telegram types and more
from . import helpers as utils
from .errors import (
    RPCError, FloodWaitError, FileMigrateError, TypeNotFoundError
)
from .network import authenticator, MtProtoSender, Connection, ConnectionMode
from .utils import get_appropriated_part_size
from .crypto import rsa, CdnDecrypter

# For sending and receiving requests
from .tl import TLObject, Session
from .tl.all_tlobjects import layer
from .tl.functions import (
    InitConnectionRequest, InvokeWithLayerRequest, PingRequest
)

# Initial request
from .tl.functions.help import GetConfigRequest
from .tl.functions.auth import (
    ImportAuthorizationRequest, ExportAuthorizationRequest
)

# Easier access for working with media
from .tl.functions.upload import (
    GetFileRequest, GetCdnFileRequest, ReuploadCdnFileRequest,
    SaveBigFilePartRequest, SaveFilePartRequest
)

from .tl.functions.help import GetCdnConfigRequest

# All the types we need to work with
from .tl.types import InputFile, InputFileBig
from .tl.types.upload import FileCdnRedirect, CdnFileReuploadNeeded


class TelegramBareClient:
    """Bare Telegram Client with just the minimum -

       The reason to distinguish between a MtProtoSender and a
       TelegramClient itself is because the sender is just that,
       a sender, which should know nothing about Telegram but
       rather how to handle this specific connection.

       The TelegramClient itself should know how to initialize
       a proper connection to the servers, as well as other basic
       methods such as disconnection and reconnection.

       This distinction between a bare client and a full client
       makes it possible to create clones of the bare version
       (by using the same session, IP address and port) to be
       able to execute queries on either, without the additional
       cost that would involve having the methods for signing in,
       logging out, and such.
    """

    # Current TelegramClient version
    __version__ = '0.12.2'

    # region Initialization

    def __init__(self, session, api_id, api_hash,
                 connection_mode=ConnectionMode.TCP_FULL,
                 proxy=None, timeout=timedelta(seconds=5)):
        """Initializes the Telegram client with the specified API ID and Hash.
           Session must always be a Session instance, and an optional proxy
           can also be specified to be used on the connection.
        """
        self.session = session<commit_msg>Update to v0.13<commit_after>import logging
from time import sleep
from datetime import timedelta
from hashlib import md5
from os import path
from io import BytesIO

# Import some externalized utilities to work with the Telegram types and more
from . import helpers as utils
from .errors import (
    RPCError, FloodWaitError, FileMigrateError, TypeNotFoundError
)
from .network import authenticator, MtProtoSender, Connection, ConnectionMode
from .utils import get_appropriated_part_size
from .crypto import rsa, CdnDecrypter

# For sending and receiving requests
from .tl import TLObject, Session
from .tl.all_tlobjects import layer
from .tl.functions import (
    InitConnectionRequest, InvokeWithLayerRequest, PingRequest
)

# Initial request
from .tl.functions.help import GetConfigRequest
from .tl.functions.auth import (
    ImportAuthorizationRequest, ExportAuthorizationRequest
)

# Easier access for working with media
from .tl.functions.upload import (
    GetFileRequest, GetCdnFileRequest, ReuploadCdnFileRequest,
    SaveBigFilePartRequest, SaveFilePartRequest
)

from .tl.functions.help import GetCdnConfigRequest

# All the types we need to work with
from .tl.types import InputFile, InputFileBig
from .tl.types.upload import FileCdnRedirect, CdnFileReuploadNeeded


class TelegramBareClient:
    """Bare Telegram Client with just the minimum -

       The reason to distinguish between a MtProtoSender and a
       TelegramClient itself is because the sender is just that,
       a sender, which should know nothing about Telegram but
       rather how to handle this specific connection.

       The TelegramClient itself should know how to initialize
       a proper connection to the servers, as well as other basic
       methods such as disconnection and reconnection.

       This distinction between a bare client and a full client
       makes it possible to create clones of the bare version
       (by using the same session, IP address and port) to be
       able to execute queries on either, without the additional
       cost that would involve having the methods for signing in,
       logging out, and such.
    """

    # Current TelegramClient version
    __version__ = '0.13'

    # region Initialization

    def __init__(self, session, api_id, api_hash,
                 connection_mode=ConnectionMode.TCP_FULL,
                 proxy=None, timeout=timedelta(seconds=5)):
        """Initializes the Telegram client with the specified API ID and Hash.
           Session must always be a Session instance, and an optional proxy
           can also be specified to be used on the connection.
        """
        self.session = session
{'fraction_non_alphanumeric': 0.04269662921348315, 'fraction_numerical': 0.0026217228464419477, 'mean_word_length': 3.545531914893617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1763489', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1313, 'n_words': 601}