human
I wrote the below code

    from pandas.core.series import Series
    def _convert_listlike(arg, format):
        if isinstance(arg, (list, tuple)):
            arg = np.array(arg, dtype='O')
        elif (getattr(arg, 'ndim', 1) > 1):
            raise TypeError('arg    must    be    a    string,    datetime,    list,    tuple,    1-d    array,    or    Series')
        arg = _ensure_object(arg)
        if (infer_time_format and (format is None)):
            format = _guess_time_format_for_array(arg)
        times = []
        if (format is not None):
            for element in arg:
                try:
                    times.append(datetime.strptime(element, format).time())
                except (ValueError, TypeError):
                    if (errors == 'raise'):
                        raise ValueError(('Cannot    convert    %s    to    a    time    with    given    format    %s' % (element, format)))
                    elif (errors == 'ignore'):
                        return arg
                    else:
                        times.append(None)
        else:
            formats = _time_formats[:]
            format_found = False
            for element in arg:
                time_object = None
                for time_format in formats:
                    try:
                        time_object = datetime.strptime(element, time_format).time()
                        if (not format_found):
                            fmt = formats.pop(formats.index(time_format))
                            formats.insert(0, fmt)
                            format_found = True
                        break
                    except (ValueError, TypeError):
                        continue
                if (time_object is not None):
                    times.append(time_object)
                elif (errors == 'raise'):
                    raise ValueError('Cannot    convert    arg    {arg}    to    a    time'.format(arg=arg))
                elif (errors == 'ignore'):
                    return arg
                else:
             ...

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def to_time(arg, format=None, infer_time_format=False, errors='raise'):