code: def map_structure_with_atom_order(
      in_list: list, first_call: bool = True
  ) -> list:
      # Maps strings in a nested list structure to their corresponding index in atom_order
      if first_call:
          in_list = copy.deepcopy(in_list)
      for i in range(len(in_list)):
          if isinstance(in_list[i], list):
              in_list[i] = map_structure_with_atom_order(
                  in_list[i], first_call=False
              )
          elif isinstance(in_list[i], str):
              in_list[i] = atom_order[in_list[i]]
          else:
              raise ValueError(
                  "Unexpected type when mapping nested lists!"
              )
      return in_list
  
file_path: transformers/src/transformers/models/esm/openfold_utils/residue_constants.py
imports: import collections
  import copy
  import functools
  from importlib import resources
  from typing import Dict, List, Mapping, Sequence, Tuple
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: map_structure_with_atom_order(in_list, first_call) and returns: in_list