class_docstr: This class helps collect `MetaflowCardComponent`s during runtime execution
  
  ### Usage with `current`
  `current.card` is of type `CardComponentCollector`
  
  ### Main Usage TLDR
  - [x] `current.card.append` customizes the default editable card.
  - [x] Only one card can be default editable in a step.
  - [x] The card class must have `ALLOW_USER_COMPONENTS=True` to be considered default editable.
      - [x] Classes with `ALLOW_USER_COMPONENTS=False` are never default editable.
  - [x] The user can specify an `id` argument to a card, in which case the card is editable through `current.card[id].append`.
      - [x] A card with an id can be also default editable, if there are no other cards that are eligible to be default editable.
  - [x] If multiple default-editable cards exist but only one card doesn't have an id, the card without an id is considered to be default editable.
  - [x] If we can't resolve a single default editable card through the above rules, `current.card`.append calls show a warning but the call doesn't fail.
  - [x] A card that is not default editable can be still edited through:
      - [x] its `current.card['myid']`
      - [x] by looking it up by its type, e.g. `current.card.get(type='pytorch')`.
class_docstr_tok: ["This","class","helps","collect","`","MetaflowCardComponent","`","s","during","runtime","execution","#","#","#","Usage","with","`","current","`","`","current.card","`","is","of","type","`","CardComponentCollector","`","#","#","#","Main","Usage","TLDR","-","[","x","]","`","current.card.append","`","customizes","the","default","editable","card",".","-","[","x","]","Only","one","card","can","be","default","editable","in","a","step",".","-","[","x","]","The","card","class","must","have","`","ALLOW_USER_COMPONENTS=True","`","to","be","considered","default","editable",".","-","[","x","]","Classes","with","`","ALLOW_USER_COMPONENTS=False","`","are","never","default","editable",".","-","[","x","]","The","user","can","specify","an","`","id","`","argument","to","a","card",",","in","which","case","the","card","is","editable","through","`","current.card","[","id","]",".append","`",".","-","[","x","]","A","card","with","an","id","can","be","also","default","editable",",","if","there","are","no","other","cards","that","are","eligible","to","be","default","editable",".","-","[","x","]","If","multiple","default-editable","cards","exist","but","only","one","card","does","n't","have","an","id",",","the","card","without","an","id","is","considered","to","be","default","editable",".","-","[","x","]","If","we","ca","n't","resolve","a","single","default","editable","card","through","the","above","rules",",","`","current.card","`",".append","calls","show","a","warning","but","the","call","does","n't","fail",".","-","[","x","]","A","card","that","is","not","default","editable","can","be","still","edited","through",":","-","[","x","]","its","`","current.card","[","'myid","'","]","`","-","[","x","]","by","looking","it","up","by","its","type",",","e.g",".","`","current.card.get","(","type='pytorch","'",")","`","."]
docstr: This function helps collect cards from all the card decorators.
  As `current.card` is a singleton this function is called by all @card decorators over a @step to add editable cards.
  
  ## Parameters
  
      - `card_type` (str) : value of the associated `MetaflowCard.type`
      - `card_id` (str) : `id` argument provided at top of decorator
      - `editable` (bool) : this corresponds to the value of `MetaflowCard.ALLOW_USER_COMPONENTS` for that `card_type`
      - `customize` (bool) : This argument is reserved for a single @card decorator per @step.
          - An `editable` card with `customize=True` gets precedence to be set as default editable card.
          - A default editable card is the card which can be access via the `append` and `extend` methods.
docstr_tok: ["This","function","helps","collect","cards","from","all","the","card","decorators",".","As","`","current.card","`","is","a","singleton","this","function","is","called","by","all","@","card","decorators","over","a","@","step","to","add","editable","cards",".","#","#","Parameters","-","`","card_type","`","(","str",")",":","value","of","the","associated","`","MetaflowCard.type","`","-","`","card_id","`","(","str",")",":","`","id","`","argument","provided","at","top","of","decorator","-","`","editable","`","(","bool",")",":","this","corresponds","to","the","value","of","`","MetaflowCard.ALLOW_USER_COMPONENTS","`","for","that","`","card_type","`","-","`","customize","`","(","bool",")",":","This","argument","is","reserved","for","a","single","@","card","decorator","per","@","step",".","-","An","`","editable","`","card","with","`","customize=True","`","gets","precedence","to","be","set","as","default","editable","card",".","-","A","default","editable","card","is","the","card","which","can","be","access","via","the","`","append","`","and","`","extend","`","methods","."]
code: def _add_card(
      self,
      card_type,
      card_id,
      decorator_attributes,
      card_options,
      editable=False,
      customize=False,
      suppress_warnings=False,
      runtime_card=False,
      refresh_interval=5,
  ):
      """
      This function helps collect cards from all the card decorators.
      As `current.card` is a singleton this function is called by all @card decorators over a @step to add editable cards.
  
      ## Parameters
  
          - `card_type` (str) : value of the associated `MetaflowCard.type`
          - `card_id` (str) : `id` argument provided at top of decorator
          - `editable` (bool) : this corresponds to the value of `MetaflowCard.ALLOW_USER_COMPONENTS` for that `card_type`
          - `customize` (bool) : This argument is reserved for a single @card decorator per @step.
              - An `editable` card with `customize=True` gets precedence to be set as default editable card.
              - A default editable card is the card which can be access via the `append` and `extend` methods.
      """
      card_uuid = self.create_uuid()
      card_metadata = dict(
          type=card_type,
          uuid=card_uuid,
          card_id=card_id,
          editable=editable,
          customize=customize,
          suppress_warnings=suppress_warnings,
          runtime_card=runtime_card,
          decorator_attributes=decorator_attributes,
          card_options=card_options,
          refresh_interval=refresh_interval,
      )
      self._cards_meta[card_uuid] = card_metadata
      self._card_component_store[card_uuid] = CardComponentManager(
          card_uuid,
          decorator_attributes,
          self._card_creator,
          components=None,
          logger=self._logger,
          no_warnings=self._no_warnings,
          user_set_card_id=card_id,
          runtime_card=runtime_card,
          card_options=card_options,
          refresh_interval=refresh_interval,
      )
      return card_metadata
  
imports: from .card_modules import MetaflowCardComponent
  from .card_modules.basic import ErrorComponent, SectionComponent
  from .card_modules.components import UserComponent, create_component_id, StubComponent
  from .exception import ComponentOverwriteNotSupportedException
  from metaflow.metaflow_config import RUNTIME_CARD_RENDER_INTERVAL
  import uuid
  import json
  import platform
  from collections import OrderedDict
  import time
label_desc: Use image node_id 4 for calling the CardComponentCollector obj's underlying member method code with example usage: obj._add_card(card_type, card_id, decorator_attributes, card_options, editable, customize, suppress_warnings, runtime_card, refresh_interval) and returns: card_metadata