def touch_object(self, objects: Set[Object]) -> Set[Object]:
        """
        Returns all objects that touch the given set of objects.
        """
        objects_per_box = self._separate_objects_by_boxes(objects)
        return_set = set()
        for box, box_objects in objects_per_box.items():
            candidate_objects = box.objects
            for object_ in box_objects:
                for candidate_object in candidate_objects:
                    if self._objects_touch_each_other(object_, candidate_object):
                        return_set.add(candidate_object)
        return return_set
def touch_object ( self , objects : Set [ Object ] ) -> Set [ Object ] : objects_per_box = self . _separate_objects_by_boxes ( objects ) return_set = set ( ) for box , box_objects in objects_per_box . items ( ) : candidate_objects = box . objects for object_ in box_objects : for candidate_object in candidate_objects : if self . _objects_touch_each_other ( object_ , candidate_object ) : return_set . add ( candidate_object ) return return_set
Returns all objects that touch the given set of objects.