<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _validate_plan_base( new_plan, base_plan, is_partition_subset=True, allow_rf_change=False, ):
 """Validate if given plan is valid comparing with given base-plan. Validate following assertions: - Partition-check: New partition-set should be subset of base-partition set - Replica-count check: Replication-factor for each partition remains same - Broker-check: New broker-set should be subset of base broker-set """


    # Verify that partitions in plan are subset of base plan.
    new_partitions = set([
        (p_data['topic'], p_data['partition'])
        for p_data in new_plan['partitions']
    ])
    base_partitions = set([
        (p_data['topic'], p_data['partition'])
        for p_data in base_plan['partitions']
    ])
    if is_partition_subset:
        invalid_partitions = list(new_partitions - base_partitions)
    else:
        # partition set should be equal
        invalid_partitions = list(
            new_partitions.union(base_partitions) -
            new_partitions.intersection(base_partitions),
        )
    if invalid_partitions:
        _log.error(
            'Invalid partition(s) found: {p_list}'.format(
                p_list=invalid_partitions,
            )
        )
        return False

    # Verify replication-factor remains consistent
    base_partition_replicas = {
        (p_data['topic'], p_data['partition']): p_data['replicas']
        for p_data in base_plan['partitions']
    }
    new_partition_replicas = {
        (p_data['topic'], p_data['partition']): p_data['replicas']
        for p_data in new_plan['partitions']
    }
    if not allow_rf_change:
        invalid_replication_factor = False
        for new_partition, replicas in six.iteritems(new_partition_replicas):
            base_replica_cnt = len(base_partition_replicas[new_partition])
            if len(replicas) != base_replica_cnt:
                invalid_replication_factor = True
                _log.error(
                    'Replication-factor Mismatch: Partition: {partition}: '
                    'Base-replicas: {expected}, Proposed-replicas: {actual}'
                    .format(
                        partition=new_partition,
                        expected=base_partition_replicas[new_partition],
                        actual=replicas,
                    ),
                )
        if invalid_replication_factor:
            return False

    # Validation successful
    return True