code: def _load_external_cards():
      # Load external card packages
      card_packages = _get_external_card_packages()
      if not card_packages:
          return []
      external_cards = {}
      card_arr = []
      # Load cards from all external packages.
      for package in card_packages:
          try:
              cards = package.CARDS
              # Ensure that types match.
              if not type(cards) == list:
                  continue
          except AttributeError as e:
              _ext_debug("Card import failed with error : %s" % str(e))
              continue
          else:
              for c in cards:
                  if not isinstance(c, type) or not issubclass(
                      c, MetaflowCard
                  ):
                      # every card should only be inheriting a MetaflowCard
                      continue
                  if not getattr(c, "type", None):
                      # todo Warn user of nonexistent `type` in MetaflowCard
                      continue
                  if c.type in external_cards:
                      # todo Warn user of duplicate card
                      continue
                  # external_cards[c.type] = c
                  _ext_debug("Adding card of type: %s" % str(c.type))
                  card_arr.append(c)
      return card_arr
  
imports: import os
  import traceback
  from .card import MetaflowCard, MetaflowCardComponent
  from metaflow.extension_support import get_modules, EXT_PKG, _ext_debug
label_desc: Use image node_id 3 for calling a global function with example usage: _load_external_cards() and returns: card_arr, list