code: def _set_duplicates(xs, duplicate_index_chains):
      """Set the duplicates in the nested structure to have the same
      reference."""
      originals = list(
          map(
              lambda key_chains: [key_chains[0]]
              * (len(key_chains) - 1),
              duplicate_index_chains,
          )
      )
      originals = ivy.multi_index_nest(
          xs, list(itertools.chain(*originals))
      )
      duplicates = list(
          map(
              lambda index_chains: list(index_chains[1:]),
              duplicate_index_chains,
          )
      )
      nullifying_index_chains = (
          list(
              map(
                  lambda index_chain: index_chain.split("/"),
                  list(itertools.chain(*duplicates)),
              )
          )
          if isinstance(xs, ivy.Container)
          else list(itertools.chain(*duplicates))
      )
      ivy.set_nest_at_indices(xs, nullifying_index_chains, originals)
      return xs
  
imports: from typing import Sequence, Union, Optional, Tuple, Callable
  import numpy
  import itertools
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, inputs_to_ivy_arrays, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 6 for calling a global function with example usage: _set_duplicates(xs, duplicate_index_chains) and returns: xs