def METHOD_NAME(
    requests: Requests,
    info_resource_list: List[tuple],
    registration_enabled: bool,
    search_enabled: bool,
    repeater_id: str,
) -> List[tuple]:
    info_resource_list_to_send = []
    for info, resource in info_resource_list:
        if resource['resourceType'] != 'Patient':
            info_resource_list_to_send.append((info, resource))
            continue
        if info.extra_fields['external_id']:
            # Patient is already registered
            info_resource_list_to_send.append((info, resource))
            continue
        if search_enabled:
            patient = find_patient(requests, resource)  # Raises DuplicateWarning
        else:
            patient = None
        if patient:
            _set_external_id(info, patient['id'], repeater_id)
            info_resource_list_to_send.append((info, resource))
        elif registration_enabled:
            patient = register_patient(requests, resource)
            _set_external_id(info, patient['id'], repeater_id)
            # Don't append `resource` to `info_resource_list_to_send`
            # because the remote service has all its data now.
    return info_resource_list_to_send