class_docstr: A predicate that compares an ifd against a metadata key and value
class_docstr_tok: ["A","predicate","that","compares","an","ifd","against","a","metadata","key","and","value"]
code: def test_valid(self, pipeline, *args):
      print(
          "Testing validity of a metadata predicate using a fake image plane"
      )
  
      class FakeModpathResolver(object):
          """Resolve one modpath to one ipd"""
  
          def __init__(self, modpath, ipd):
              self.modpath = modpath
              self.ipd = ipd
  
          def get_image_plane_details(self, modpath):
              assert len(modpath) == len(self.modpath)
              assert all(
                  [m1 == m2 for m1, m2 in zip(self.modpath, modpath)]
              )
              return self.ipd
  
      modpath = ["imaging", "image.png"]
      plane = ImagePlane(
          ImageFile("/imaging/image.png"), None, None, None
      )
      self(
          (
              FileCollectionDisplay.NODE_IMAGE_PLANE,
              modpath,
              FakeModpathResolver(modpath, plane),
          ),
          *args,
      )
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/setting/filter/_metadata_predicate.py
imports: from ._does_not_predicate import DoesNotPredicate
  from ._does_predicate import DoesPredicate
  from ._filter import LITERAL_PREDICATE
  from ._filter_predicate import FilterPredicate
  from .._file_collection_display import FileCollectionDisplay
  from ...pipeline import ImageFile
  from ...pipeline import ImagePlane
label_desc: Use image node_id 4 for calling the MetadataPredicate obj's underlying member method code with example usage: obj.test_valid(pipeline) and returns: self