parameters: (self, folder_alias, query=None)
return_statement: return cache[cache_key]
docstring: Get a Folder object for this account.
docstring_summary: Get a Folder object for this account.
docstring_tokens: Get a Folder object for this account .
function: def get_folder(self, folder_alias, query=None):
          '''
          Get a Folder object for this account.
          '''
  
          folder_name = folder_alias
          if folder_alias in self.settings['folders']:
              folder_name = self.settings['folders'][folder_alias]
  
          prefix = self.settings['folders'].get('prefix')
          if prefix and folder_alias != 'inbox':
              folder_name = f'{prefix}{folder_name}'
  
          # Is this a temporary query-based folder?
          cache = self.query_folders if query else self.folders
          cache_key = ''.join((folder_name, query)) if query else folder_name
  
          if cache_key not in cache:
              cache[cache_key] = Folder(
                  folder_name, folder_alias,
                  account=self,
                  query=query,
              )
  
          return cache[cache_key]
function_tokens: def get_folder ( self , folder_alias , query = None ) : folder_name = folder_alias if folder_alias in self . settings [ 'folders' ] : folder_name = self . settings [ 'folders' ] [ folder_alias ] prefix = self . settings [ 'folders' ] . get ( 'prefix' ) if prefix and folder_alias != 'inbox' : folder_name = f'{prefix}{folder_name}' # Is this a temporary query-based folder? cache = self . query_folders if query else self . folders cache_key = '' . join ( ( folder_name , query ) ) if query else folder_name if cache_key not in cache : cache [ cache_key ] = Folder ( folder_name , folder_alias , account = self , query = query , ) return cache [ cache_key ]