def get_active_nodes(self):
<EOL>stats_response = self.send_command("<STR_LIT>")<EOL>if not stats_response:<EOL><INDENT>return []<EOL><DEDENT>lines = stats_response.split("<STR_LIT:\n>")<EOL>fields = lines.pop(<NUM_LIT:0>).split("<STR_LIT:U+002C>")<EOL>fields.pop(<NUM_LIT:0>)<EOL>active_nodes = collections.defaultdict(list)<EOL>for line in lines:<EOL><INDENT>values = line.split("<STR_LIT:U+002C>")<EOL>service_name = values.pop(<NUM_LIT:0>)<EOL>active_nodes[service_name].append(<EOL>dict(<EOL>(fields[i], values[i])<EOL>for i in range(len(fields))<EOL>)<EOL>)<EOL><DEDENT>return active_nodes<EOL>
Returns a dictionary of lists, where the key is the name of a service
and the list includes all active nodes associated with that service.