def _get_context_name(self, app=None):
        """Generate the name of the context variable for this component & app.

        Because we store the ``context`` in a Local so the component
        can be used across multiple apps, we cannot store the context on the
        instance itself. This function will generate a unique and predictable
        key in which to store the context.

        Returns:
            str: The name of the context variable to set and get the context
                from.
        """
        elements = [
            self.__class__.__name__,
            'context',
            text_type(id(self)),
        ]

        if app:
            elements.append(text_type(id(app)))
        else:
            try:
                elements.append(text_type(id(self.app)))
            except RuntimeError:
                pass

        return '_'.join(elements)
Generate the name of the context variable for this component & app.

        Because we store the ``context`` in a Local so the component
        can be used across multiple apps, we cannot store the context on the
        instance itself. This function will generate a unique and predictable
        key in which to store the context.

        Returns:
            str: The name of the context variable to set and get the context
                from.