code: def _cmd_flag_as_data(cmd_flag):
      data = {}
      if cmd_flag.arg_name:
          data["arg-name"] = cmd_flag.arg_name
      if cmd_flag.arg_skip:
          data["arg-skip"] = cmd_flag.arg_skip
      if cmd_flag.arg_switch:
          data["arg-switch"] = cmd_flag.arg_switch
      if cmd_flag.arg_split is not None:
          data["arg-split"] = cmd_flag.arg_split
      if cmd_flag.env_name:
          data["env-name"] = cmd_flag.env_name
      if cmd_flag.arg_encoding:
          data["arg-encoding"] = cmd_flag.arg_encoding
      if cmd_flag.env_encoding:
          data["env-encoding"] = cmd_flag.env_encoding
      return data
  
imports: import logging
  import pprint
  from guild import flag_util
  from guild import util
  from guild import yaml_util
label_desc: Use image node_id 30 for calling a global function with example usage: _cmd_flag_as_data(cmd_flag) and returns: data