def __contains__(self, func):
        """
        Returns whether the function is stored anywhere in the middleware chain.

        This runs recursively though any subchains.

        Args:
            func (callable): A function which may be present in the chain

        Returns:
            bool: True if func is a function contained anywhere in the chain.
        """
        return any((func is mw.func) or (mw.is_subchain and func in mw.func)
                   for mw in self.mw_list)
def __contains__ ( self , func ) : return any ( ( func is mw . func ) or ( mw . is_subchain and func in mw . func ) for mw in self . mw_list )
Returns whether the function is stored anywhere in the middleware chain.

        This runs recursively though any subchains.

        Args:
            func (callable): A function which may be present in the chain

        Returns:
            bool: True if func is a function contained anywhere in the chain.