code: def _resolve_filepath(filemask):
      import socket
      import sys
  
      pid = os.getpid()
      hostname = socket.gethostname()
      executable_filename = os.path.basename(sys.executable)
  
      return (
          filemask.replace("%p", str(pid))
          .replace("%h", hostname)
          .replace("%e", executable_filename)
      )
  
imports: import collections
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: _resolve_filepath(filemask) and returns: filemask