docstr: Register a CustomComponent.
  
  Parameters
  ----------
  component : CustomComponent
      The component to register.
docstr_tok: ["Register","a","CustomComponent",".","Parameters","--","--","--","--","--","component",":","CustomComponent","The","component","to","register","."]
code: def register_component(self, component: CustomComponent) -> None:
      """Register a CustomComponent.
  
      Parameters
      ----------
      component : CustomComponent
          The component to register.
      """
  
      # Validate the component's path
      abspath = component.abspath
      if abspath is not None and not os.path.isdir(abspath):
          raise StreamlitAPIException(
              f"No such component directory: '{abspath}'"
          )
  
      with self._lock:
          existing = self._components.get(component.name)
          self._components[component.name] = component
  
      if existing is not None and component != existing:
          LOGGER.warning(
              "%s overriding previously-registered %s",
              component,
              existing,
          )
  
      LOGGER.debug("Registered component %s", component)
  
imports: import inspect
  import json
  import os
  import threading
  from typing import Any, Dict, Optional, Type, Union
  import streamlit
  from streamlit import type_util, util
  from streamlit.elements.form import current_form_id
  from streamlit.errors import StreamlitAPIException
  from streamlit.logger import get_logger
  from streamlit.proto.Components_pb2 import ArrowTable
  from streamlit.proto.Components_pb2 import SpecialArg
  from streamlit.proto.Element_pb2 import Element
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner import get_script_run_ctx
  from streamlit.runtime.state import NoValue, register_widget
  from streamlit.runtime.state.common import compute_widget_id
  from streamlit.type_util import to_bytes
label_desc: Use image node_id 4 for calling the ComponentRegistry obj's underlying member method code with example usage: obj.register_component(component) without return types