<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def merge_source_tables(src_tab, tab, all_sources=False, prefix="", suffix="", roi_idx=None):
 """Append the sources in a table into another table. Parameters src_tab : `~astropy.table.Table` Master source table that will be appended with the sources in ``tab``. tab : `~astropy.table.Table` Table to be merged into ``src_tab``. all_sources : bool If true, then all the sources get added to the table. if false, then only the sources that start with 'PS' get added prefix : str Prepended to all source names suffix : str Appended to all source names Returns ------- tab : `~astropy.table.Table` """

    if roi_idx is not None and 'roi' not in tab.columns:
        tab.add_column(Column(name='roi', data=len(tab) * [roi_idx]))

    remove_rows = []
    for i, row in enumerate(tab):

        if not all_sources and row['name'].find("PS") != 0:
            remove_rows += [i]
            continue
        sname = "%s%s%s" % (prefix, row['name'], suffix)
        row['name'] = sname

    tab.remove_rows(remove_rows)

    if src_tab is None:
        src_tab = tab
    else:
        src_tab = vstack([src_tab, tab], join_type='outer')

    return src_tab