human
I wrote the below code

    if isinstance(fname, string_types):
        fhd = StataReader(open(fname, 'rb'), missing_values=False, encoding=encoding)
    elif (not hasattr(fname, 'read')):
        raise TypeError(('The    input    should    be    a    string    or    a    filehandle.    (got    %s    instead)' % type(fname)))
    else:
        fhd = StataReader(fname, missing_values=False, encoding=encoding)
    header = fhd.file_headers()
    types = header['dtyplist']
    nobs = header['nobs']
    numvars = header['nvar']
    varnames = header['varlist']
    fmtlist = header['fmtlist']
    dataname = header['data_label']
    labels = header['vlblist']
    data = np.zeros((nobs, numvars))
    stata_dta = fhd.dataset()
    dt = np.dtype(lzip(varnames, types))
    data = np.zeros(nobs, dtype=dt)
    for (rownum, line) in enumerate(stata_dta):
        if (None in line):
            for (i, val) in enumerate(line):
                if (val is None):
                    line[i] = missing_flt
        data[rownum] = tuple(line)
    if pandas:
        from pandas import DataFrame
        data = DataFrame.from_records(data)
        if convert_dates:
            cols = np.where(lmap((lambda x: (x in _date_formats)), fmtlist))[0]
            for col in cols:
                i = col
                col = data.columns[col]
                data[col] = data[col].apply(_stata_elapsed_date_to_datetime, args=(fmtlist[i],))
    elif convert_dates:
        cols = np.where(lmap((lambda x: (x in _date_formats)), fmtlist))[0]
        dtype = data.dtype.descr
        dtype = [((dt[0], object) if (i in cols) else dt) for (i, dt) in enumerate(dtype)]
        data = data.astype(dtype)
        for col in cols:
            def convert(x):
                return _stata_elapsed_date_to_datetime(x, fmtlist[col])
            data[data.dtype.names[col]] = lmap(convert, data[data.dtype.names[col]])
    return data

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

def genfromdta(fname, missing_flt=(-999.0), encoding=None, pandas=False, convert_dates=True):