code: def _create_struct_metadata_cmg(ftype: str) -> str:
      # Case of a MOD09 file
      if ftype == "MOD09":
          gridline = 'GridName="MOD09CMG"\n'
          upleft = (
              "UpperLeftPointMtrs=(-180000000.000000,90000000.000000)\n"
          )
          upright = (
              "LowerRightMtrs=(180000000.000000,-90000000.000000)\n"
          )
      # Case of a MCD43 file
      else:
          gridline = 'GridName="MCD_CMG_BRDF_0.05Deg"\n'
          upleft = "UpperLeftPointMtrs=(-180.000000,90.000000)\n"
          upright = "LowerRightMtrs=(180.000000,-90.000000)\n"
  
      struct_metadata_header = (
          "GROUP=SwathStructure\n"
          "END_GROUP=SwathStructure\n"
          "GROUP=GridStructure\n"
          "GROUP=GRID_1\n"
          f"{gridline}\n"
          "XDim=7200\n"
          "YDim=3600\n"
          f"{upleft}\n"
          f"{upright}\n"
          "END_GROUP=GRID_1\n"
          "END_GROUP=GridStructure\nEND"
      )
      return struct_metadata_header
  
imports: from __future__ import annotations
  from datetime import datetime, timedelta
  from typing import Optional
  import numpy
  import pytest
  from pyhdf.SD import SD, SDC
label_desc: Use image node_id 17 for calling a global function with example usage: _create_struct_metadata_cmg(ftype) and returns: struct_metadata_header