code: def test_metaclass_raises_uses_restricted_method_name():
      # Restricted Name: `inputs`
      with pytest.raises(TypeError, match="bound methods/attrs named"):
  
          class FailedMethod_Inputs(ModelComponent):
              def __init__(self, model):
                  pass
  
              @expose(
                  inputs={"param": Number()}, outputs={"foo": Number()}
              )
              @staticmethod
              def predict(param):
                  return param
  
              def inputs(self):
                  pass
  
      # Restricted Name: `inputs`
      with pytest.raises(TypeError, match="bound methods/attrs named"):
  
          class FailedMethod_Outputs(ModelComponent):
              def __init__(self, model):
                  pass
  
              @expose(
                  inputs={"param": Number()}, outputs={"foo": Number()}
              )
              @staticmethod
              def predict(param):
                  return param
  
              def outputs(self):
                  pass
  
      # Restricted Name: `inputs`
      with pytest.raises(TypeError, match="bound methods/attrs named"):
  
          class FailedMethod_Name(ModelComponent):
              def __init__(self, model):
                  pass
  
              @expose(
                  inputs={"param": Number()}, outputs={"foo": Number()}
              )
              @staticmethod
              def predict(param):
                  return param
  
              @property
              def uid(self):
                  return f"{self.uid}_SHOULD_NOT_RETURN"
  
      # Ensure that if we add more restricted names in the future,
      # there is a test for them as well.
      from flash.core.serve.component import _FLASH_SERVE_RESERVED_NAMES
  
      assert (
          set(_FLASH_SERVE_RESERVED_NAMES).difference(
              {"inputs", "outputs", "uid"}
          )
          == set()
      )
  
file_path: lightning-flash/tests/core/serve/test_gridbase_validations.py
imports: import pytest
  from flash.core.serve import ModelComponent, expose
  from flash.core.serve.types import Number
  from flash.core.utilities.imports import _CYTOOLZ_AVAILABLE, _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 6 for calling a global function with example usage: test_metaclass_raises_uses_restricted_method_name() and returns: param, param, param, self, str