(index_arr, label_size=None, check_arr=True)
return decomposed_data
Falt the multilabel_index to one-dimensional.

    Parameters
    ----------
    index_arr: list or np.ndarray
        index array.
          
    label_size: int
        the inferred label size.   

    check_arr: bool
        if True,check the index_arr is a legal multilabel_index.
        
    Returns
    -------
    decomposed_data: list
        the decomposed data after falting.
Falt the multilabel_index to one-dimensional.
Falt the multilabel_index to one - dimensional .
def flattern_multilabel_index(index_arr, label_size=None, check_arr=True):
    """
    Falt the multilabel_index to one-dimensional.

    Parameters
    ----------
    index_arr: list or np.ndarray
        index array.
          
    label_size: int
        the inferred label size.   

    check_arr: bool
        if True,check the index_arr is a legal multilabel_index.
        
    Returns
    -------
    decomposed_data: list
        the decomposed data after falting.
    """
    if check_arr:
        index_arr = check_index_multilabel(index_arr)
    if label_size is None:
        label_size = infer_label_size_multilabel(index_arr)
    else:
        assert (label_size > 0)
    decomposed_data = []
    for item in index_arr:
        if len(item) == 1:
            for i in range(label_size):
                decomposed_data.append((item[0], i))
        else:
            if isinstance(item[1], collections.Iterable):
                label_ind = [i for i in item[1] if 0 <= i < label_size]
            else:
                assert (0 <= item[1] < label_size)
                label_ind = [item[1]]
            for j in range(len(label_ind)):
                decomposed_data.append((item[0], label_ind[j]))
    return decomposed_data
def flattern_multilabel_index ( index_arr , label_size = None , check_arr = True ) : if check_arr : index_arr = check_index_multilabel ( index_arr ) if label_size is None : label_size = infer_label_size_multilabel ( index_arr ) else : assert ( label_size > 0 ) decomposed_data = [ ] for item in index_arr : if len ( item ) == 1 : for i in range ( label_size ) : decomposed_data . append ( ( item [ 0 ] , i ) ) else : if isinstance ( item [ 1 ] , collections . Iterable ) : label_ind = [ i for i in item [ 1 ] if 0 <= i < label_size ] else : assert ( 0 <= item [ 1 ] < label_size ) label_ind = [ item [ 1 ] ] for j in range ( len ( label_ind ) ) : decomposed_data . append ( ( item [ 0 ] , label_ind [ j ] ) ) return decomposed_data