code: def searchForMaxIteration(folder, with_dot=False):
      if with_dot:
          saved_iters = [
              int(fname.split("_")[-1].split(".")[0])
              for fname in os.listdir(folder)
              if ".pth" in fname
          ]
      else:
          saved_iters = [
              int(fname.split("_")[-1]) for fname in os.listdir(folder)
          ]
      return max(saved_iters)
  
imports: from errno import EEXIST
  from os import makedirs, path
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: searchForMaxIteration(folder, with_dot) and returns: max