code: def print_status(self, roles=None, state_filter="running"):
      
      if not roles:
        for instance in self._get_instances(self._get_cluster_group_name(),
                                            state_filter):
          self._print_instance("", instance)
      else:
        for role in roles:
          for instance in self._get_instances(self._group_name_for_role(role),
                                              state_filter):
            self._print_instance(role, instance)
docs: Print the status of instances in the given roles, filtered by state.