def _getcomponents(self, clsname=None):
    """Get components dictionary.

    Parameters
    ----------
    clsname : str or None
        Class name for which components dict should be returned.
        If `None` then instance level components dict is returned.
    """
    components_attr = '__components'
    if clsname:
        components_attr = '_'+clsname+components_attr
    return getattr(self, components_attr)