code: def get_cards(
      task: Union[str, "Task"],
      id: Optional[str] = None,
      type: Optional[str] = None,
      follow_resumed: bool = True,
  ) -> CardContainer:
      """
      Get cards related to a `Task`.
  
      Note that `get_cards` resolves the cards contained by the task, but it doesn't actually
      retrieve them from the datastore. Actual card contents are retrieved lazily either when
      the card is rendered in a notebook to when you call `Card.get`. This means that
      `get_cards` is a fast call even when individual cards contain a lot of data.
  
      Parameters
      ----------
      task : str or `Task`
          A `Task` object or pathspec `{flow_name}/{run_id}/{step_name}/{task_id}` that
          uniquely identifies a task.
      id : str, optional
          The ID of card to retrieve if multiple cards are present.
      type : str, optional
          The type of card to retrieve if multiple cards are present.
      follow_resumed : bool, default: True
          If the task has been resumed, then setting this flag will resolve the card for
          the origin task.
  
      Returns
      -------
      CardContainer
          A list-like object that holds `Card` objects.
      """
      from metaflow.client import Task
      from metaflow import namespace
  
      card_id = id
      if isinstance(task, str):
          task_str = task
          if len(task_str.split("/")) != 4:
              # Exception that pathspec is not of correct form
              raise IncorrectPathspecException(task_str)
          # set namespace as None so that we don't face namespace mismatch error.
          namespace(None)
          task = Task(task_str)
      elif not isinstance(task, Task):
          # Exception that the task argument should be of form `Task` or `str`
          raise IncorrectArgumentException(_TYPE(task))
  
      origin_taskpathspec = None
      if follow_resumed:
          origin_taskpathspec = resumed_info(task)
          if origin_taskpathspec:
              task = Task(origin_taskpathspec)
  
      card_paths, card_ds = resolve_paths_from_task(
          _get_flow_datastore(task),
          pathspec=task.pathspec,
          type=type,
          card_id=card_id,
      )
      return CardContainer(
          card_paths,
          card_ds,
          origin_pathspec=origin_taskpathspec,
      )
  
imports: from typing import Optional, Union, TYPE_CHECKING
  from metaflow.datastore import FlowDataStore
  from metaflow.metaflow_config import CARD_SUFFIX
  from .card_resolver import resolve_paths_from_task, resumed_info
  from .card_datastore import CardDatastore, CardNameSuffix
  from .exception import UnresolvableDatastoreException, IncorrectArgumentException, IncorrectPathspecException
  import os
  import tempfile
  import uuid
label_desc: Use image node_id 1 for calling a global function with example usage: get_cards(task, id, type, follow_resumed) and returns: CardContainer