code: def _validate_subclass_init_signature(cls: Type["ModelComponent"]):
      """Raises SyntaxError if the __init__ method is not formatted correctly.
  
      Expects arguments: ['self', 'models', Optional['config']]
  
      Parameters
      ----------
      cls
          class to perform the analysis on
  
      Raises
      ------
      SyntaxError
          If parameters are not specified correctly.
  
      """
      params = inspect.signature(cls.__init__).parameters
      if len(params) > 3:
          raise SyntaxError(
              "__init__ can only have 1 or 2 parameters. Must conform to "
              "specification: (`'self', 'model', Optional['config']`)"
          )
      for idx, param in enumerate(params.keys()):
          if (idx == 1) and (param != "model"):
              raise SyntaxError(
                  f"__init__ must set 'model' as first param, not `{param}`"
              )
          if (idx == 2) and (param != "config"):
              raise SyntaxError(
                  f"__init__ can only set 'config' as second param, not `{param}`"
              )
  
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 2 for calling a global function with example usage: _validate_subclass_init_signature(cls) without return types