Format lists to return, depending on whether we want to return also masks and coordinates or not.
format_output()