def get_output_names(outputs) -> Optional[List[str]]:
    """
    :param: list[ct.TensorType/ct.ImageType]
    :return: list[str] or None
    """
    # Avoid circular import
    from coremltools.converters.mil.input_types import InputType

    output_names = None
    if outputs is not None:
        assert all(isinstance(t, InputType) for t in outputs), \
            "outputs must be a list of ct.ImageType or ct.TensorType"
        output_names = [t.name for t in outputs]
        if all(name is None for name in output_names):
            output_names = None
    return output_names

    :param: list[ct.TensorType/ct.ImageType]
    :return: list[str] or None
    
coremltools/converters/mil/frontend/_utils.py