code: def load_measurements(
      filename, dest_file=None, run_name=None, image_numbers=None
  ):
      """Load measurements from an HDF5 file
  
      filename - path to file containing the measurements or file-like object
                 if .mat
  
      dest_file - path to file to be created. This file is used as the backing
                  store for the measurements.
  
      run_name - name of the run (an HDF file can contain measurements
                 from multiple runs). By default, takes the last.
  
      returns a Measurements object
      """
      from ..measurement import Measurements
  
      HDF5_HEADER = (
          chr(137)
          + chr(72)
          + chr(68)
          + chr(70)
          + chr(13)
          + chr(10)
          + chr(26)
          + chr(10)
      )
      if hasattr(filename, "seek"):
          filename.seek(0)
          header = filename.read(len(HDF5_HEADER))
          filename.seek(0)
      else:
          fd = open(filename, "rb")
          header = fd.read(len(HDF5_HEADER))
          fd.close()
  
      if header.decode("unicode_escape") == HDF5_HEADER:
          f, top_level = get_top_level_group(filename)
          try:
              if VERSION in list(f.keys()):
                  if run_name is not None:
                      top_level = top_level[run_name]
                  else:
                      # Assume that the user wants the last one
                      last_key = sorted(top_level.keys())[-1]
                      top_level = top_level[last_key]
              m = Measurements(
                  filename=dest_file,
                  copy=top_level,
                  image_numbers=image_numbers,
              )
              return m
          finally:
              f.close()
      else:
          # FIXME - add clearer exception
          raise ValueError("Received HDF5 file header was invalid")
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/utilities/measurement.py
imports: import os
  import re
  import sys
  import tempfile
  from .hdf5_dict import get_top_level_group
  from .hdf5_dict import VERSION
label_desc: Use image node_id 3 for calling a global function with example usage: load_measurements(filename, dest_file, run_name, image_numbers) and returns: m