(item: T.Any, flatten: bool = True)
return result
Returns a list with all args embedded in a list if they are not a list.
    This function preserves order.
    @flatten: Convert lists of lists to a flat list
Returns a list with all args embedded in a list if they are not a list.
    This function preserves order.
Returns a list with all args embedded in a list if they are not a list . This function preserves order .
def listify(item: T.Any, flatten: bool = True) -> T.List[T.Any]:
    '''
    Returns a list with all args embedded in a list if they are not a list.
    This function preserves order.
    @flatten: Convert lists of lists to a flat list
    '''
    if not isinstance(item, list):
        return [item]
    result = []  # type: T.List[T.Any]
    for i in item:
        if flatten and isinstance(i, list):
            result += listify(i, flatten=True)
        else:
            result.append(i)
    return result
def listify ( item : T . Any , flatten : bool = True ) -> T . List [ T . Any ] : if not isinstance ( item , list ) : return [ item ] result = [ ] # type: T.List[T.Any] for i in item : if flatten and isinstance ( i , list ) : result += listify ( i , flatten = True ) else : result . append ( i ) return result