def _merge_common_bands(rasters):
    # type: (List[_Raster]) -> List[_Raster]
    """Combine the common bands.

    """
    # Compute band order
    all_bands = IndexedSet([rs.band_names[0] for rs in rasters])

    def key(rs):
        return all_bands.index(rs.band_names[0])

    rasters_final = []  # type: List[_Raster]
    for band_name, rasters_group in groupby(sorted(rasters, key=key), key=key):
        rasters_final.append(reduce(_fill_pixels, rasters_group))

    return rasters_final
def _merge_common_bands ( rasters ) : all_bands = IndexedSet ( [ rs . band_names [ 0 ] for rs in rasters ] ) def key ( rs ) : return all_bands . index ( rs . band_names [ 0 ] ) rasters_final = [ ] for band_name , rasters_group in groupby ( sorted ( rasters , key = key ) , key = key ) : rasters_final . append ( reduce ( _fill_pixels , rasters_group ) ) return rasters_final
Combine the common bands.