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: Specify components of the chosen card.
  
  Instead of adding components to a card individually with `current.card[ID].append(component)`,
  use this method to assign a list of components to a card, replacing the existing components:
  ```
  current.card[ID] = [FirstComponent, SecondComponent]
  ```
  
  Parameters
  ----------
  key: str
      Card ID.
  
  value: List[MetaflowCardComponent]
      List of card components to assign to this card.
docstr_tok: ["Specify","components","of","the","chosen","card",".","Instead","of","adding","components","to","a","card","individually","with","`","current.card","[","ID","]",".append","(","component",")","`",",","use","this","method","to","assign","a","list","of","components","to","a","card",",","replacing","the","existing","components",":","``","`","current.card","[","ID","]","=","[","FirstComponent",",","SecondComponent","]","``","`","Parameters","--","--","--","--","--","key",":","str","Card","ID",".","value",":","List","[","MetaflowCardComponent","]","List","of","card","components","to","assign","to","this","card","."]
code: def __setitem__(self, key, value):
      """
      Specify components of the chosen card.
  
      Instead of adding components to a card individually with `current.card[ID].append(component)`,
      use this method to assign a list of components to a card, replacing the existing components:
      ```
      current.card[ID] = [FirstComponent, SecondComponent]
      ```
  
      Parameters
      ----------
      key: str
          Card ID.
  
      value: List[MetaflowCardComponent]
          List of card components to assign to this card.
      """
      if key in self._card_id_map:
          card_uuid = self._card_id_map[key]
          if not isinstance(value, list):
              _warning_msg = (
                  "`current.card['%s']` not set. `current.card['%s']` should be a `list` of `MetaflowCardComponent`."
                  % (key, key)
              )
              self._warning(_warning_msg)
              return
          self._card_component_store[card_uuid] = CardComponentManager(
              card_uuid,
              self._cards_meta[card_uuid]["decorator_attributes"],
              self._card_creator,
              components=value,
              logger=self._logger,
              no_warnings=self._no_warnings,
              user_set_card_id=key,
              card_options=self._cards_meta[card_uuid]["card_options"],
              runtime_card=self._cards_meta[card_uuid]["runtime_card"],
              refresh_interval=self._cards_meta[card_uuid][
                  "refresh_interval"
              ],
          )
          return
  
      self._warning(
          "`current.card['%s']` is not present. Please set the `id` argument in @card to '%s' to access `current.card['%s']`. "
          % (key, key, key)
      )
  
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 10 for calling the CardComponentCollector obj's underlying member method code with example usage: obj.__setitem__(key, value) without return types