code: def _list_cards(self, step, task=None, card_type=None):
      with NamedTemporaryFile(dir=".") as f:
          pathspec = "%s/%s" % (self.run_id, step)
          if task is not None:
              pathspec = "%s/%s/%s" % (self.run_id, step, task)
          cmd = [
              "--quiet",
              "card",
              "list",
              pathspec,
              "--as-json",
              "--file",
              f.name,
          ]
          if card_type is not None:
              cmd.extend(["--type", card_type])
  
          self.run_cli(cmd)
          with open(f.name, "r") as jsf:
              return json.load(jsf)
  
imports: import sys
  import subprocess
  import json
  from collections import namedtuple
  from tempfile import NamedTemporaryFile
  from metaflow.includefile import IncludedFile
  from metaflow.util import is_stringish
  from .None import MetaflowCheck, AssertArtifactFailed, AssertLogFailed, truncate, AssertCardFailed
label_desc: Use image node_id 8 for calling the CliCheck obj's underlying member method code with example usage: obj._list_cards(step, task, card_type) and returns: json