def _getcomponent(self, component, clsname=None):
    """Get single component by name.

    Parameters
    ----------
    component : str
        Component name.
    clsname : str or None
        Optional name of the class for component lookup.
        If `None` then instance level components are searched.
    """
    components = self._getcomponents(clsname)
    try:
        return components[component]
    except KeyError:
        if not clsname:
            clsname = self.__class__.__name__
        raise AttributeError(f"'{clsname}' does not have '{component}' component")