code: def _add_history(attrs):
      """Add 'history' attribute to dictionary."""
      _history_create = "Created by pytroll/satpy on {}".format(
          datetime.datetime.utcnow()
      )
      if "history" in attrs:
          if isinstance(attrs["history"], list):
              attrs["history"] = "".join(attrs["history"])
          attrs["history"] += "\n" + _history_create
      else:
          attrs["history"] = _history_create
      return attrs
  
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 13 for calling a global function with example usage: _add_history(attrs) and returns: attrs