code: def _add_ancillary_variables_attrs(data_arr: xr.DataArray) -> None:
      """Replace ancillary_variables DataArray with a list of their name."""
      list_ancillary_variable_names = [
          da_ancillary.attrs["name"]
          for da_ancillary in data_arr.attrs.get(
              "ancillary_variables", []
          )
      ]
      if list_ancillary_variable_names:
          data_arr.attrs["ancillary_variables"] = " ".join(
              list_ancillary_variable_names
          )
      else:
          data_arr.attrs.pop("ancillary_variables", None)
  
imports: from __future__ import annotations
  import datetime
  import json
  import logging
  from collections import OrderedDict
  import numpy
  import xarray
  from satpy.writers.utils import flatten_dict
label_desc: Use image node_id 11 for calling a global function with example usage: _add_ancillary_variables_attrs(data_arr) without return types