def get_squeeze_axes(squeeze_mask, rank):
    """
    Utility function to get the squeeze_axes from squeeze_mask.
    i.e., returns a list of indices ``i`` where ``squeeze_mask[i] == True``.
    For instance, given ``squeeze_mask = [True, False, True]``,
    this utility returns ``[0, 2]``
    """
    if squeeze_mask is None:
        squeeze_mask = [False] * rank
    squeeze_axes = []
    for idx, mask in enumerate(squeeze_mask):
        if mask:
            squeeze_axes.append(idx)
    return squeeze_axes

    Utility function to get the squeeze_axes from squeeze_mask.
    i.e., returns a list of indices ``i`` where ``squeeze_mask[i] == True``.
    For instance, given ``squeeze_mask = [True, False, True]``,
    this utility returns ``[0, 2]``
    
coremltools/converters/mil/mil/ops/defs/_utils.py