parameters: (self, f)
return_statement: return result
docstring: Consolidate _mgr -- if the blocks have changed, then clear the
          cache
docstring_summary: Consolidate _mgr -- if the blocks have changed, then clear the
          cache
docstring_tokens: Consolidate _mgr -- if the blocks have changed then clear the cache
function: def _protect_consolidate(self, f):
          """
          Consolidate _mgr -- if the blocks have changed, then clear the
          cache
          """
          if isinstance(self._mgr, (ArrayManager, SingleArrayManager)):
              return f()
          blocks_before = len(self._mgr.blocks)
          result = f()
          if len(self._mgr.blocks) != blocks_before:
              self._clear_item_cache()
          return result
function_tokens: def _protect_consolidate ( self , f ) : if isinstance ( self . _mgr , ( ArrayManager , SingleArrayManager ) ) : return f ( ) blocks_before = len ( self . _mgr . blocks ) result = f ( ) if len ( self . _mgr . blocks ) != blocks_before : self . _clear_item_cache ( ) return result