def _is_problematic(  # pylint: disable=too-many-arguments
        starts, ends, block_index, first, max_res_block, min_gap_block):
    """
    Return True is the sub-exon block is problematic.

    In particular, a sub-exon block is problematic if it has <= max_res_block
    and it is separeated from the rest of the sub-exon by a gap block
    => min_gap_block.

    >>> _is_problematic([0, 3, 6, 7], [3, 6, 7, 10], 0, True, 2, 2)
    False
    >>> _is_problematic([0, 3, 6, 7], [3, 6, 7, 10], 2, False, 2, 2)
    True
    """
    subexon_len = ends[block_index] - starts[block_index]
    if first:
        gaps_len = ends[block_index + 1] - starts[block_index + 1]
    else:
        gaps_len = ends[block_index - 1] - starts[block_index - 1]
    return (subexon_len <= max_res_block) and (gaps_len >= min_gap_block)