code: def _update_structure(structure, kvs, path, command):
      from pyrsistent._pmap import pmap
  
      e = structure.evolver()
      if not path and command is discard:
          # Do this in reverse to avoid index problems with vectors. See #92.
          for k, v in reversed(kvs):
              discard(e, k)
      else:
          for k, v in kvs:
              is_empty = False
              if v is _EMPTY_SENTINEL:
                  # Allow expansion of structure but make sure to cover the case
                  # when an empty pmap is added as leaf node. See #154.
                  is_empty = True
                  v = pmap()
  
              result = _do_to_path(v, path, command)
              if result is not v or is_empty:
                  e[k] = result
  
      return e.persistent()
  
file_path: catboost/contrib/python/pyrsistent/py2/pyrsistent/_transformations.py
imports: import re
  import six
label_desc: Use image node_id 12 for calling a global function with example usage: _update_structure(structure, kvs, path, command) and returns: e