def get_folder(self, *, folder_id=None, folder_name=None):
if folder_id and folder_name:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>if not folder_id and not folder_name:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>if folder_id:<EOL><INDENT>url = self.build_url(<EOL>self._endpoints.get('<STR_LIT>').format(id=folder_id))<EOL>params = None<EOL><DEDENT>else:<EOL><INDENT>if self.root:<EOL><INDENT>url = self.build_url(self._endpoints.get('<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>url = self.build_url(<EOL>self._endpoints.get('<STR_LIT>').format(<EOL>id=self.folder_id))<EOL><DEDENT>params = {'<STR_LIT>': "<STR_LIT>".format(self._cc('<STR_LIT>'),<EOL>folder_name), '<STR_LIT>': <NUM_LIT:1>}<EOL><DEDENT>response = self.con.get(url, params=params)<EOL>if not response:<EOL><INDENT>return None<EOL><DEDENT>if folder_id:<EOL><INDENT>folder = response.json()<EOL><DEDENT>else:<EOL><INDENT>folder = response.json().get('<STR_LIT:value>')<EOL>folder = folder[<NUM_LIT:0>] if folder else None<EOL>if folder is None:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>self_class = getattr(self, '<STR_LIT>', type(self))<EOL>return self_class(con=self.con, protocol=self.protocol,<EOL>main_resource=self.main_resource,<EOL>**{self._cloud_data_key: folder})<EOL>
Get a folder by it's id or name

        :param str folder_id: the folder_id to be retrieved.
         Can be any folder Id (child or not)
        :param str folder_name: the folder name to be retrieved.
         Must be a child of this folder.
        :return: a single folder
        :rtype: mailbox.Folder or None