code: def from_str(cls, s: str):
      if isinstance(s, cls):
          return s
      for t in cls:
          if t.value == s:
              return t
      raise ValueError(f"{s} not in {cls}")
  
file_path: FATE/python/fate/arch/federation/_builder.py
imports: import typing
  from enum import Enum
  from fate.arch.federation.api import PartyMeta
  from fate.arch.config import cfg
label_desc: Use image node_id 1 for calling the FederationMode obj's underlying member method code with example usage: obj.from_str(cls, s) and returns: s, t