<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prt_tsv_sections(prt, tsv_data, **kws):
 """Write tsv file containing section names followed by lines of namedtuple data."""

    prt_hdr_min = 10  # Print hdr on the 1st section and for any following 'large' sections
    num_items = 0
    if tsv_data:
        # Basic data checks
        assert len(tsv_data[0]) == 2, "wr_tsv_sections EXPECTED: [(section, nts), ..."
        assert tsv_data[0][1], \
            "wr_tsv_sections EXPECTED SECTION({S}) LIST TO HAVE DATA".format(S=tsv_data[0][0])
        hdrs_wrote = False
        sep = "\t" if 'sep' not in kws else kws['sep']
        prt_flds = kws['prt_flds'] if 'prt_flds' in kws else tsv_data[0]._fields
        fill = sep*(len(prt_flds) - 1)
        # Write data
        for section_text, data_nts in tsv_data:
            prt.write("{SEC}{FILL}\n".format(SEC=section_text, FILL=fill))
            if hdrs_wrote is False or len(data_nts) > prt_hdr_min:
                prt_tsv_hdr(prt, data_nts, **kws)
                hdrs_wrote = True
            num_items += prt_tsv_dat(prt, data_nts, **kws)
        return num_items
    else:
        return 0