code: def _check_metadata(
      data_arr: xr.DataArray, test_data: xr.Dataset, platform_name: str
  ) -> None:
      var_name = data_arr.attrs["name"]
      if var_name not in ["latitude", "longitude"]:
          _check_area(data_arr)
      assert "_FillValue" not in data_arr.attrs
      _check_attrs(data_arr, platform_name)
  
      input_fake_data = (
          test_data["BT"]
          if "btemp" in var_name
          else test_data[var_name]
      )
      if "valid_range" in input_fake_data.attrs:
          valid_range = input_fake_data.attrs["valid_range"]
          _check_valid_range(data_arr, valid_range)
      if "_FillValue" in input_fake_data.attrs:
          fill_value = input_fake_data.attrs["_FillValue"]
          _check_fill_value(data_arr, fill_value)
  
      assert data_arr.attrs["units"] == DEFAULT_UNITS[var_name]
  
imports: from __future__ import annotations
  import os
  from datetime import datetime
  from unittest import mock
  import numpy
  import pytest
  import xarray
  from satpy._config import config_search_paths
  from satpy.dataset import DataID
  from satpy.readers import load_reader
  from satpy.readers.yaml_reader import FileYAMLReader
label_desc: Use image node_id 9 for calling a global function with example usage: _check_metadata(data_arr, test_data, platform_name) without return types