<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_gather(flist):
 """ Gather all the HDUs from a list of files"""

    hlist = []
    nskip = 3
    for fname in flist:
        fin = fits.open(fname)
        if len(hlist) == 0:
            if fin[1].name == 'SKYMAP':
                nskip = 4
            start = 0
        else:
            start = nskip
        for h in fin[start:]:
            hlist.append(h)
    hdulistout = fits.HDUList(hlist)
    return hdulistout