import collections
from typing import List


def make_list_layer_band(imagery_layers: collections.OrderedDict, count: int) -> List:
    """
    Makes list of all output bands and their respective provenance.

    :param imagery_layers: All imagery_layers included in output file and attributes
    :param count: The count of all bands in output file
    :return: A list output bands and their provenance
    """
    out_list: List[List] = []
    band_order: List[int] = []
    layer_names: List[str] = []

    for layer in imagery_layers:
        layer_names += [layer] * imagery_layers[layer]["bands_count"]
        band_order += list(range(1, imagery_layers[layer]["bands_count"] + 1))

    for band_number in range(1, count + 1):
        layer_name = layer_names[band_number - 1]
        layer_band = band_order[band_number - 1]
        out_list += [[band_number, layer_name, layer_band]]
    return out_list