def is_active(self):
    """This plugin is active if 2 conditions hold.

    1. The scalars plugin is registered and active.
    2. There is a custom layout for the dashboard.

    Returns: A boolean. Whether the plugin is active.
    """
    if not self._multiplexer:
      return False

    scalars_plugin_instance = self._get_scalars_plugin()
    if not (scalars_plugin_instance and
            scalars_plugin_instance.is_active()):
      return False

    # This plugin is active if any run has a layout.
    return bool(self._multiplexer.PluginRunToTagToContent(metadata.PLUGIN_NAME))
This plugin is active if 2 conditions hold.

    1. The scalars plugin is registered and active.
    2. There is a custom layout for the dashboard.

    Returns: A boolean. Whether the plugin is active.