code: def _create_obj_in(atom, root):
      """Find / create object defined in `atom` in dict-like given by `root`
  
      Returns corresponding value if there is already a key matching
      `atom.obj_id` in `root`.
  
      Otherwise, create new object with ``atom.obj_type`, insert into dictionary,
      and return new object.
  
      Can therefore modify `root` in place.
      """
      name = atom.obj_id
      obj = root.get(name, NoValue)
      if obj is not NoValue:
          return obj
      obj = atom.obj_type()
      root[name] = obj
      return obj
  
file_path: nibabel/nibabel/nicom/ascconv.py
imports: import ast
  import re
  from collections import OrderedDict
label_desc: Use image node_id 2 for calling a global function with example usage: _create_obj_in(atom, root) and returns: obj, obj