import copy


def MergeConditionalData(registration_requests, conditional_datas):
  """Returns copy of registration_requests with merged conditional datas."""
  cond_data_map = {str(cond['fccId']) + str(cond['cbsdSerialNumber']): cond
                   for cond in conditional_datas}
  reg_requests = copy.deepcopy(registration_requests)
  for reg_request in reg_requests:
    unique_id = str(reg_request['fccId']) + str(reg_request['cbsdSerialNumber'])
    if unique_id in cond_data_map:
      reg_request.update(cond_data_map[unique_id])
  return reg_requests