code: def _load_ancillary_variables(self, datasets):
          
          all_av_ids = set()
          for dataset in datasets.values():
              ancillary_variables = dataset.attrs.get('ancillary_variables', [])
              if not isinstance(ancillary_variables, (list, tuple, set)):
                  ancillary_variables = ancillary_variables.split(' ')
              av_ids = []
              for key in ancillary_variables:
                  try:
                      av_ids.append(self.get_dataset_key(key))
                  except KeyError:
                      logger.warning("Can't load ancillary dataset %s", str(key))
  
              all_av_ids |= set(av_ids)
              dataset.attrs['ancillary_variables'] = av_ids
          loadable_av_ids = [av_id for av_id in all_av_ids if av_id not in datasets]
          if not all_av_ids:
              return
          if loadable_av_ids:
              self.load(loadable_av_ids, previous_datasets=datasets)
  
          for dataset in datasets.values():
              new_vars = []
              for av_id in dataset.attrs.get('ancillary_variables', []):
                  if isinstance(av_id, DatasetID):
                      new_vars.append(datasets[av_id])
                  else:
                      new_vars.append(av_id)
              dataset.attrs['ancillary_variables'] = new_vars
docs: Load the ancillary variables of `datasets`.