parameters: (revision: Optional[str])
docstring: Defines the revision -> model mapping
docstring_summary: Defines the revision -> model mapping
docstring_tokens: Defines the revision - > model mapping
function: def _model_from_revision(revision: Optional[str]) -> str:
          """Defines the revision -> model mapping"""
          if not revision or "v" not in revision:
              log.error(f"bad revision: {revision}")
              return "magneticModuleV1"
          try:
              revision_num = float(revision.split("v")[-1])
          except (ValueError, TypeError):
              log.exception("bad revision: {revision}")
              return "magneticModuleV1"
          if revision_num < MagDeck.FIRST_GEN2_REVISION:
              return "magneticModuleV1"
          else:
              return "magneticModuleV2"
function_tokens: def _model_from_revision ( revision : Optional [ str ] ) -> str : if not revision or "v" not in revision : log . error ( f"bad revision: {revision}" ) return "magneticModuleV1" try : revision_num = float ( revision . split ( "v" ) [ - 1 ] ) except ( ValueError , TypeError ) : log . exception ( "bad revision: {revision}" ) return "magneticModuleV1" if revision_num < MagDeck . FIRST_GEN2_REVISION : return "magneticModuleV1" else : return "magneticModuleV2"