parameters: (self, mailbox='INBOX', readonly=False)
return_statement: return typ, self.untagged_responses.get('EXISTS', [None])
docstring: Select a mailbox.
  
          Flush all untagged responses.
  
          (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)
  
          'data' is count of messages in mailbox ('EXISTS' response).
  
          Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
          other responses should be obtained via <instance>.response('FLAGS') etc.
docstring_summary: Select a mailbox.
docstring_tokens: Select a mailbox .
function: def select(self, mailbox='INBOX', readonly=False):
          """Select a mailbox.
  
          Flush all untagged responses.
  
          (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)
  
          'data' is count of messages in mailbox ('EXISTS' response).
  
          Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
          other responses should be obtained via <instance>.response('FLAGS') etc.
          """
          self.untagged_responses = {}    # Flush old responses.
          self.is_readonly = readonly
          if readonly:
              name = 'EXAMINE'
          else:
              name = 'SELECT'
          typ, dat = self._simple_command(name, mailbox)
          if typ != 'OK':
              self.state = 'AUTH'     # Might have been 'SELECTED'
              return typ, dat
          self.state = 'SELECTED'
          if 'READ-ONLY' in self.untagged_responses \
                  and not readonly:
              if __debug__:
                  if self.debug >= 1:
                      self._dump_ur(self.untagged_responses)
              raise self.readonly('%s is not writable' % mailbox)
          return typ, self.untagged_responses.get('EXISTS', [None])
function_tokens: def select ( self , mailbox = 'INBOX' , readonly = False ) : self . untagged_responses = { } # Flush old responses. self . is_readonly = readonly if readonly : name = 'EXAMINE' else : name = 'SELECT' typ , dat = self . _simple_command ( name , mailbox ) if typ != 'OK' : self . state = 'AUTH' # Might have been 'SELECTED' return typ , dat self . state = 'SELECTED' if 'READ-ONLY' in self . untagged_responses and not readonly : if __debug__ : if self . debug >= 1 : self . _dump_ur ( self . untagged_responses ) raise self . readonly ( '%s is not writable' % mailbox ) return typ , self . untagged_responses . get ( 'EXISTS' , [ None ] )