class_docstr: See module's docstring.
  
  Args:
      class_: the class that Canals should use as a component.
      serializable: whether to check, at init time, if the component can be saved with
      `save_pipelines()`.
  
  Returns:
      A class that can be recognized as a component.
  
  Raises:
      ComponentError: if the class provided has no `run()` method or otherwise doesn't respect the component contract.
class_docstr_tok: ["See","module","'s","docstring",".","Args",":","class_",":","the","class","that","Canals","should","use","as","a","component",".","serializable",":","whether","to","check",",","at","init","time",",","if","the","component","can","be","saved","with","`","save_pipelines","(",")","`",".","Returns",":","A","class","that","can","be","recognized","as","a","component",".","Raises",":","ComponentError",":","if","the","class","provided","has","no","`","run","(",")","`","method","or","otherwise","does","n't","respect","the","component","contract","."]
docstr: Add a single input socket to the component instance.
  
  :param instance: Component instance where the input type will be added.
  :param name: name of the input socket.
  :param type: type of the input socket.
  :param default: default value of the input socket, defaults to _empty
docstr_tok: ["Add","a","single","input","socket","to","the","component","instance",".",":","param","instance",":","Component","instance","where","the","input","type","will","be","added",".",":","param","name",":","name","of","the","input","socket",".",":","param","type",":","type","of","the","input","socket",".",":","param","default",":","default","value","of","the","input","socket",",","defaults","to","_empty"]
code: def set_input_type(
      self, instance, name: str, type: Any, default: Any = _empty
  ):
      """
      Add a single input socket to the component instance.
  
      :param instance: Component instance where the input type will be added.
      :param name: name of the input socket.
      :param type: type of the input socket.
      :param default: default value of the input socket, defaults to _empty
      """
      if not hasattr(instance, "__canals_input__"):
          instance.__canals_input__ = {}
      instance.__canals_input__[name] = InputSocket(
          name=name, type=type, default_value=default
      )
  
imports: import logging
  import inspect
  from typing import Protocol, runtime_checkable, Any
  from types import new_class
  from copy import deepcopy
  from haystack.core.component.sockets import InputSocket, OutputSocket, _empty
  from haystack.core.errors import ComponentError
label_desc: Use image node_id 2 for calling the _Component obj's underlying member method code with example usage: obj.set_input_type(instance, name, type, default) without return types