code: def list_cards(self, step, task, card_type=None):
      from metaflow.plugins.cards.exception import (
          CardNotPresentException,
      )
  
      try:
          card_iter = self.get_card(step, task, card_type)
      except CardNotPresentException:
          card_iter = None
  
      if card_iter is None:
          return
      pathspec = self.run[step][task].pathspec
      list_data = dict(pathspec=pathspec, cards=[])
      if len(card_iter) > 0:
          list_data["cards"] = [
              dict(
                  hash=card.hash,
                  id=card.id,
                  type=card.type,
                  filename=card.path.split("/")[-1],
              )
              for card in card_iter
          ]
      return list_data
  
imports: import json
  import os
  from metaflow.util import is_stringish
  from .None import MetaflowCheck, AssertArtifactFailed, AssertCardFailed, AssertLogFailed, assert_equals, assert_exception, truncate
label_desc: Use image node_id 8 for calling the MetadataCheck obj's underlying member method code with example usage: obj.list_cards(step, task, card_type) and returns: list_data