docstr: Remove duplicate variables in `vs` referring to `created`.
  
  Parameters
  ----------
  vs
      The container that needs to be pruned.
  created
      The container as the duplication reference.
  
  Returns
  -------
  vs
      The container after removing duplicate variables.
  keychain_mappings
      Dict storing those keys and ids being removed.
docstr_tok: ["Remove","duplicate","variables","in","`","vs","`","referring","to","`","created","`",".","Parameters","--","--","--","--","--","vs","The","container","that","needs","to","be","pruned",".","created","The","container","as","the","duplication","reference",".","Returns","--","--","--","-","vs","The","container","after","removing","duplicate","variables",".","keychain_mappings","Dict","storing","those","keys","and","ids","being","removed","."]
code: def _remove_duplicate_variables(vs, created, /):
      """Remove duplicate variables in `vs` referring to `created`.
  
      Parameters
      ----------
      vs
          The container that needs to be pruned.
      created
          The container as the duplication reference.
  
      Returns
      -------
      vs
          The container after removing duplicate variables.
      keychain_mappings
          Dict storing those keys and ids being removed.
      """
      created_ids = created.cont_map(lambda x, kc: id(x))
      vs_ids = vs.cont_map(lambda x, kc: id(x))
      ids = {}
      duplicate_keychains = []
      keychain_mappings = {}
  
      def unique_callback(x, kc):
          ids[x] = kc
  
      def found_dup_callback(x, kc):
          if ids[x] == kc:
              return
          duplicate_keychains.append(kc)
          keychain_mappings[kc] = ids[x]
  
      created_ids.cont_map(lambda x, kc: unique_callback(x, kc))
      vs_ids.cont_map(
          lambda x, kc: (
              unique_callback(x, kc)
              if x not in ids
              else found_dup_callback(x, kc)
          )
      )
      for dup_kc in duplicate_keychains:
          vs = vs.cont_prune_key_chain(dup_kc)
      return vs, keychain_mappings
  
file_path: ivy/ivy/stateful/helpers.py
imports: import functools
  import logging
  import ivy
  from ivy.data_classes.container import Container
  from ivy.func_wrapper import _get_first_array
label_desc: Use image node_id 5 for calling the ModuleHelpers obj's underlying member method code with example usage: obj._remove_duplicate_variables() and returns: vs,  keychain_mappings