code: def parse_sentinel_state(item):
      result = pairs_to_dict_typed(item, SENTINEL_STATE_TYPES)
      flags = set(result["flags"].split(","))
      for name, flag in (
          ("is_master", "master"),
          ("is_slave", "slave"),
          ("is_sdown", "s_down"),
          ("is_odown", "o_down"),
          ("is_sentinel", "sentinel"),
          ("is_disconnected", "disconnected"),
          ("is_master_down", "master_down"),
      ):
          result[name] = flag in flags
      return result
  
imports: import datetime
  from redis.utils import str_if_bytes
label_desc: Use image node_id 5 for calling a global function with example usage: parse_sentinel_state(item) and returns: result