code: def join_splittable_flag_vals(vals, split_spec=None):
      encoded_vals = [encode_flag_val(val) for val in vals]
      if split_spec in (None, True, "shlex"):
          return " ".join([util.shlex_quote(x) for x in encoded_vals])
      if isinstance(split_spec, str):
          return split_spec.join(encoded_vals)
      raise ValueError(
          f"split_spec must be None, True, or a string: {split_spec!r}"
      )
  
imports: import logging
  import os
  import re
  import yaml
  from guild import util
  from guild import yaml_util
label_desc: Use image node_id 47 for calling a global function with example usage: join_splittable_flag_vals(vals, split_spec) and returns: str, split_spec