code: def _sanitize_params(prefix, suffix, dir):
      
      output_type = _infer_return_type(prefix, suffix, dir)
      if suffix is None:
          suffix = output_type()
      if prefix is None:
          if output_type is str:
              prefix = "tmp"
          else:
              prefix = os.fsencode("tmp")
      if dir is None:
          if output_type is str:
              dir = gettempdir()
          else:
              dir = fs_encode(gettempdir())
      return prefix, suffix, dir, output_type
docs: Common parameter processing for most APIs in this module.