original_docstring: 
          Checks if our cached UID validity matches the server.
          
docstring: Checks if our cached UID validity matches the server.
docstring_tokens: Checks if our cached UID validity matches the server .
code: def check_cache_validity(self):
          '''
          Checks if our cached UID validity matches the server.
          '''
  
          # Note we don't use self.get_connection because we don't want to actually
          # *select* the folder.
          with self.account.get_imap_connection() as connection:
              status = connection.folder_status(self.name, [b'UIDVALIDITY'])
  
          uid_validity = status[b'UIDVALIDITY']
          cache_validity = self.cache.get_uid_validity()
  
          if uid_validity != cache_validity:
              if cache_validity:
                  self.log('warning', (
                      'Found invalid UIDVALIDITY '
                      f'(local={cache_validity}, remote={uid_validity})',
                  ))
                  self.cache.bust()
              self.cache.set_uid_validity(uid_validity)
              return False
          return True
code_tokens: def check_cache_validity ( self ) : with self . account . get_imap_connection ( ) as connection : status = connection . folder_status ( self . name , [ b'UIDVALIDITY' ] ) uid_validity = status [ b'UIDVALIDITY' ] cache_validity = self . cache . get_uid_validity ( ) if uid_validity != cache_validity : if cache_validity : self . log ( 'warning' , ( 'Found invalid UIDVALIDITY ' f'(local={cache_validity}, remote={uid_validity})' , ) ) self . cache . bust ( ) self . cache . set_uid_validity ( uid_validity ) return False return True
short_docstring: Checks if our cached UID validity matches the server.
short_docstring_tokens: Checks if our cached UID validity matches the server .
comment: '''
          Checks if our cached UID validity matches the server.
          '''$SEP$# Note we don't use self.get_connection because we don't want to actually$SEP$# *select* the folder.