code: def _get_outpath(inpath, output_dir=None, rel_dir=None):
      if output_dir is None:
          return inpath
  
      if rel_dir is not None:
          rel_dir = fos.normalize_path(rel_dir)
          filename = os.path.relpath(inpath, rel_dir)
      else:
          filename = os.path.basename(inpath)
  
      return os.path.join(fos.normalize_path(output_dir), filename)
  
imports: import itertools
  import json
  import logging
  import os
  import eta.core.frameutils
  import eta.core.image
  import eta.core.numutils
  import eta.core.utils
  import eta.core.video
  import fiftyone
  import fiftyone.core.metadata
  import fiftyone.core.storage
  import fiftyone.core.utils
  import fiftyone.core.validation
label_desc: Use image node_id 14 for calling a global function with example usage: _get_outpath(inpath, output_dir, rel_dir) and returns: os, inpath