code: def _create_core_metadata(file_shortname: str) -> str:
      beginning_date = datetime.now()
      ending_date = beginning_date + timedelta(minutes=5)
      core_metadata_header = (
          "GROUP = INVENTORYMETADATA\nGROUPTYPE = MASTERGROUP\n\n"
          'GROUP = RANGEDATETIME\n\nOBJECT = RANGEBEGINNINGDATE\nNUM_VAL = 1\nVALUE = "{}"\n'
          "END_OBJECT = RANGEBEGINNINGDATE\n\nOBJECT = RANGEBEGINNINGTIME\n"
          'NUM_VAL = 1\nVALUE = "{}"\n'
          "END_OBJECT = RANGEBEGINNINGTIME\n\nOBJECT = RANGEENDINGDATE\n"
          'NUM_VAL = 1\nVALUE = "{}"\n'
          'END_OBJECT = RANGEENDINGDATE\n\nOBJECT = RANGEENDINGTIME\nNUM_VAL = 1\nVALUE = "{}"\n'
          "END_OBJECT = RANGEENDINGTIME\nEND_GROUP = RANGEDATETIME"
      )
      core_metadata_header = core_metadata_header.format(
          beginning_date.strftime("%Y-%m-%d"),
          beginning_date.strftime("%H:%M:%S.%f"),
          ending_date.strftime("%Y-%m-%d"),
          ending_date.strftime("%H:%M:%S.%f"),
      )
      inst_metadata = (
          "GROUP = ASSOCIATEDPLATFORMINSTRUMENTSENSOR\n\n"
          'OBJECT = ASSOCIATEDPLATFORMINSTRUMENTSENSORCONTAINER\nCLASS = "1"\n\n'
          'OBJECT = ASSOCIATEDSENSORSHORTNAME\nCLASS = "1"\nNUM_VAL = 1\n'
          'VALUE = "MODIS"\nEND_OBJECT = ASSOCIATEDSENSORSHORTNAME\n\n'
          'OBJECT = ASSOCIATEDPLATFORMSHORTNAME\nCLASS = "1"\nNUM_VAL = 1\n'
          'VALUE = "Terra"\nEND_OBJECT = ASSOCIATEDPLATFORMSHORTNAME\n\n'
          'OBJECT = ASSOCIATEDINSTRUMENTSHORTNAME\nCLASS = "1"\nNUM_VAL = 1\n'
          'VALUE = "MODIS"\nEND_OBJECT = ASSOCIATEDINSTRUMENTSHORTNAME\n\n'
          "END_OBJECT = ASSOCIATEDPLATFORMINSTRUMENTSENSORCONTAINER\n\n"
          "END_GROUP              = ASSOCIATEDPLATFORMINSTRUMENTSENSOR\n\n"
      )
      collection_metadata = (
          "GROUP = COLLECTIONDESCRIPTIONCLASS\n\nOBJECT = SHORTNAME\nNUM_VAL = 1\n"
          f"VALUE = {file_shortname!r}\nEND_OBJECT = SHORTNAME\n\n"
          "OBJECT = VERSIONID\nNUM_VAL = 1\nVALUE = 6\nEND_OBJECT = VERSIONID\n\n"
          "END_GROUP = COLLECTIONDESCRIPTIONCLASS\n\n"
      )
      core_metadata_header += (
          "\n\n" + inst_metadata + collection_metadata
      )
      return core_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 15 for calling a global function with example usage: _create_core_metadata(file_shortname) and returns: core_metadata_header