class_docstr: We keep a mapping of externally used names to classes.
code: def __new__(cls, name, bases, namespace):
      # create new instance of cls in order to apply any @expose class decorations.
      _tmp_cls = super().__new__(cls, name, bases, namespace)
  
      # determine which methods have been exposed.
      ex_meths = valfilter(
          lambda x: hasattr(x, "flashserve_meta"), _tmp_cls.__dict__
      )
      if _tmp_cls.__name__ != "ModelComponent":
          if len(ex_meths) != 1:
              raise SyntaxError(
                  f"`@expose` decorator must be applied to one (and only one) method in a "
                  f"class class=`{_tmp_cls.__name__}` detected n=`{len(ex_meths)}` "
                  f"decorations on method_names=`{list(ex_meths.keys())}`"
              )
  
          # alter namespace to insert flash serve info as bound components of class.
          exposed = first(ex_meths.values())
          namespace["_flashserve_meta_"] = exposed.flashserve_meta
          namespace["__call__"] = wraps(exposed)(
              exposed,
          )
  
      new_cls = super().__new__(cls, name, bases, namespace)
      if new_cls.__name__ != "ModelComponent":
          # If user defined class, validate.
          _validate_subclass_init_signature(new_cls)
          if set(_FLASH_SERVE_RESERVED_NAMES).intersection(namespace):
              raise TypeError(
                  f"Subclasses of {bases[-1]} are not allowed to define bound methods/"
                  f"attrs named: `{set(_FLASH_SERVE_RESERVED_NAMES).intersection(namespace)}`"
              )
      return new_cls
  
file_path: lightning-flash/src/flash/core/serve/component.py
imports: import inspect
  from dataclasses import replace
  from functools import wraps
  from typing import Dict, List, Optional, Tuple, Type, Union
  from torch import nn
  from flash.core.serve.core import ParameterContainer, Servable
  from flash.core.serve.decorators import BoundMeta, UnboundMeta
  from flash.core.utilities.imports import _CYTOOLZ_AVAILABLE, _TOPIC_SERVE_AVAILABLE, requires
label_desc: Use image node_id 1 for calling the FlashServeMeta obj's underlying member method code with example usage: obj.__new__(cls, name, bases, namespace) and returns: new_cls