code: def collect(self, target):
          
          statusobjects = set()
          callables = set()
          objs_from_this_obj = getattr(self, '_give_%s' % target)()
  
          if not is_iterable(objs_from_this_obj):
              objs_from_this_obj = [objs_from_this_obj]
  
          if is_iterable(objs_from_this_obj):
              for i in (self.name_to_system_object(j) for j in objs_from_this_obj):
                  if isinstance(i, AbstractStatusObject):
                      statusobjects.add(i)
                  elif isinstance(i, AbstractCallable):
                      callables.add(i)
  
          for i in (self.name_to_system_object(j) for j in deep_iterate(callables)):
              if isinstance(i, AbstractCallable):
                  statusobjects.update(getattr(i, target))
  
          return statusobjects
docs: Recursively collect all potential triggers/targets in this node and its children.
          Define targets and triggers of this particular callable in :meth:`_give_triggers`
          and :meth:`_give_targets`.
  
          :param str target: valid values: ``'targets'`` and ``'triggers'``