code: def format_flag(val, truncate_floats=False, shorten_paths=False):
      encoded = encode_flag_val(val)
      if truncate_floats and isinstance(val, float):
          trunc_len = _trunc_len(truncate_floats)
          encoded = _truncate_formatted_float(encoded, trunc_len)
      if shorten_paths and _is_path(val):
          path_len = _path_len(shorten_paths)
          encoded = util.shorten_path(val, path_len)
      return _quote_encoded(encoded, val)
  
imports: import logging
  import os
  import re
  import yaml
  from guild import util
  from guild import yaml_util
label_desc: Use image node_id 36 for calling a global function with example usage: format_flag(val, truncate_floats, shorten_paths) and returns: _quote_encoded