code: def resolve_file_path_list(pathlist, workdir, prefix='',
                             randomize=False):
      
      files = []
      with open(pathlist, 'r') as f:
          files = [line.strip() for line in f]
  
      newfiles = []
      for f in files:
          f = os.path.expandvars(f)
          if os.path.isfile(f):
              newfiles += [f]
          else:
              newfiles += [os.path.join(workdir, f)]
  
      if randomize:
          _, tmppath = tempfile.mkstemp(prefix=prefix, dir=workdir)
      else:
          tmppath = os.path.join(workdir, prefix)
  
      tmppath += '.txt'
  
      with open(tmppath, 'w') as tmpfile:
          tmpfile.write("\n".join(newfiles))
      return tmppath
docs: Resolve the path of each file name in the file ``pathlist`` and
      write the updated paths to a new file.