code: def _epoch_doy_offset_from_sgs_time(
      sgs_time_array: ArrayLike,
  ) -> timedelta:
      doy1 = sgs_time_array["doy1"].astype(np.int64)
      doy_hours = sgs_time_array["doy_hours"].astype(np.int64)
      hours_mins = sgs_time_array["hours_mins"].astype(np.int64)
      mins_secs = sgs_time_array["mins_secs"].astype(np.int64)
      secs_msecs = sgs_time_array["secs_msecs"].astype(np.int64)
      msecs = sgs_time_array["msecs"].astype(np.int64)
  
      doy = (doy1 >> 4) * 100 + (doy1 & 15) * 10 + (doy_hours >> 4)
      hours = (doy_hours & 15) * 10 + (hours_mins >> 4)
      mins = (hours_mins & 15) * 10 + (mins_secs >> 4)
      secs = (mins_secs & 15) * 10 + (secs_msecs >> 4)
      msecs = (secs_msecs & 15) * 100 + (msecs >> 4) * 10 + (msecs & 15)
      return timedelta(
          days=int(doy - 1),
          hours=int(hours),
          minutes=int(mins),
          seconds=int(secs),
          milliseconds=int(msecs),
      )
  
imports: import logging
  from datetime import datetime, timedelta
  import dask.array
  import numpy
  import xarray
  from satpy._compat import ArrayLike
  from satpy.readers._geos_area import get_area_definition, get_area_extent, get_geos_area_naming
  from satpy.readers.eum_base import recarray2dict, time_cds_short
  from satpy.readers.hrit_base import HRITFileHandler, ancillary_text, annotation_header, base_hdr_map, image_data_function
label_desc: Use image node_id 3 for calling a global function with example usage: _epoch_doy_offset_from_sgs_time(sgs_time_array) and returns: timedelta