code: def collect_from_bundles(self, bundles: List[Bundle]) -> Dict[str, Any]:
          
          all_objects = {}  # all discovered objects
          key_bundles = {}  # lookup of which bundle a key came from
          object_keys = set()  # keys in all_objects, used to ensure uniqueness
          for bundle in bundles:
              from_bundle = self.collect_from_bundle(bundle)
              if isinstance(bundle, AppBundle):
                  all_objects.update(from_bundle)
                  break  # app_bundle is last, no need to update keys
  
              from_bundle_keys = set(from_bundle.keys())
              conflicts = object_keys.intersection(from_bundle_keys)
              if conflicts:
                  msg = [f'{self.name} from {bundle.name} conflict with '
                         f'previously registered {self.name}:']
                  for key in conflicts:
                      msg.append(f'{key} from {key_bundles[key].name}')
                  raise NameCollisionError('\n'.join(msg))
  
              all_objects.update(from_bundle)
              object_keys = object_keys.union(from_bundle_keys)
              key_bundles.update({k: bundle for k in from_bundle_keys})
  
          return all_objects
docs: Collect objects where :meth:`type_check` returns ``True`` from bundles.
          Names (keys) are expected to be unique across bundles, except for the
          app bundle, which can override anything from other bundles.