<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def parse_clusters(out_file, clust_file, seq_db=None, db_path=None, seq_dict=None, return_just_seq_ids=False):
    '''
    Parses CD-HIT output.

    Args:

        out_file (str): Path to the CD-HIT output file. Required.

        clust_file (str): Path to the CD-HIT cluster file. Required.

        seq_db (sqlite.Connection): SQLite3 `Connection` object. Default is `None`. If not provided and
            `return_just_seq_ids` is False, the returned `Cluster` objects will not contain any sequence
            information beyond the sequence ID.

        db_path (str): Path to a SQLite3 database file. Default is `None`. Must be provided if
            `seq_db` is also provided.

        seq_dict (dict): A `dict` mapping sequence IDs to `abutils.core.sequence.Sequence` objects. Default
            is `None`. Typically used when a relatively small number of sequences are being clustered and
            creating a `sqlite3` database would be overkill.

        temp_dir (str): Path to the temporary directory. If not provided, `'/tmp'` is used.

        make_db (bool): Whether to build a SQlite database of sequence information. Required
            if you want to calculate consensus/centroid sequences for the resulting
            clusters or if you need to access the clustered sequences (not just sequence IDs)
            Default is `True`.
        
        quiet (bool): If `True`, surpresses printing of output/progress info. Default is `False`.

        threads (int): Number of threads (CPU cores) to be used for clustering. Default is `0`,
            which results in all available cores being used.
        
        return_just_seq_ids (bool): If `True`, will return a 2D list of sequence IDs
            (a list containing a list of sequence IDs for each cluster) rather than returning a
            list of `Cluster` objects.

        max_memory (int): Max memory (in MB) for CD-HIT. Will be passed directly to CD-HIT through
            the `-M` runtime option. Default is `800`.

        debug (bool): If `True`, print standard output and standard error from CD-HIT. Default is `False`.

    Returns:

        A CDHITResult object, or a 2D list of sequence IDs, if `return_just_seq_ids` is `True`.
    '''
    raw_clusters = [c.split('\n') for c in open(clust_file, 'r').read().split('\n>')]
    if return_just_seq_ids:
        ids = []
        for rc in raw_clusters:
            _ids = []
            for c in rc[1:]:
                if c:
                    _ids.append(c.split()[2][1:-3])
            ids.append(_ids)
        os.unlink(out_file)
        os.unlink(clust_file)
        return ids
    os.unlink(out_file)
    os.unlink(clust_file)
    clusters = [Cluster(rc, seq_db, db_path, seq_dict) for rc in raw_clusters]
    return CDHITResult(clusters, seq_db=seq_db, db_path=db_path, seq_dict=seq_dict)