from typing import Union
from typing import List
import gzip


def basic_gzip_load(file_path: str, max_lines: Union[int, None] = 100_000) -> List[str]:
    """
    Load sentences from specified gzipped text file.
    It is expected that archived file is going to large, thus maximum
    amount of lines to load may be specified (100_000 by default).
    :param file_path: path to gzip archive
    :param max_lines: stop loading if this number is reached
    :return: list of loaded sentences
    """
    result = []
    with gzip.open(file_path) as file:
        for index, line in enumerate(file):
            result.append(line.decode('utf-8').strip('\n'))
            if max_lines and index >= max_lines - 1:
                break
    return result