def max_chunk_count_generator(chunk_count, file_data):
    """
    Generate chunks by defining a maximum number of chunks

    :param chunk_count: Max number of chunks
    :param file_data: bytes data
    :return:
    """
    try:
        # bytes data
        chunk_size = len(file_data) // chunk_count
    except TypeError:
        # file like object
        file_len = get_file_size(file_data)
        chunk_size = file_len // chunk_count

    return chunk_generator(chunk_count, chunk_size, file_data)

    Generate chunks by defining a maximum number of chunks

    :param chunk_count: Max number of chunks
    :param file_data: bytes data
    :return:
    
instagram_private_api/utils.py