code: def load_pipeline(test_case, encoded_data):
      """Load a pipeline from base-64 encoded data
  
      test_case - an instance of unittest.TestCase
      encoded_data - a pipeline encoded using base-64
      The magic incantation to do the above is the following:
      import base64
      fd = open('my_PIPE.mat','rb')
      bindata = fd.read()
      fd.close()
      b64data = base64.b64encode(bindata)
      """
      import cellprofiler_core.pipeline
  
      (matfd, matpath) = tempfile.mkstemp(".mat")
      matfh = os.fdopen(matfd, "wb")
      try:
          data = base64.b64decode(encoded_data)
          matfh.write(data)
          matfh.flush()
          pipeline = cellprofiler_core.pipeline.Pipeline()
          handles = scipy.io.matlab.mio.loadmat(
              matpath, struct_as_record=True
          )
      finally:
          matfh.close()
  
      def blowup(pipeline, event):
          if isinstance(
              event,
              (
                  cellprofiler_core.pipeline.event.RunException,
                  cellprofiler_core.pipeline.event.LoadException,
              ),
          ):
              if test_case is not None:
                  test_case.assertFalse(event.error.message)
              else:
                  assert not event.error.message
  
      pipeline.add_listener(blowup)
      pipeline.create_from_handles(handles)
      return pipeline
  
imports: import logging
  import base64
  import hashlib
  import numpy
  import os
  import unittest
  import tempfile
  import functools
  import scipy.io.matlab.mio
  import numpy
  import skimage.io
  from urllib.request import URLopener
  import cellprofiler_core.utilities.legacy
  from cellprofiler_core.pipeline import ImageFile
  import tests.frontend
label_desc: Use image node_id 7 for calling a global function with example usage: load_pipeline(test_case, encoded_data) and returns: pipeline