def do_read(self, arg):
        '''Read mail by uid.'''
        try:
            args = docopt.docopt(u'\n'.join([
                u'Usage: read [options] <mail_uid> [<save_directory>]',
                u'',
                u'Options:',
                u'    -b, --browser     Open mail in browser',
            ]), arg)
        except __HOLE__:
            return

        fetched_mail = fetch.read(self.imap_account, args['<mail_uid>'],
                                  save_directory=args['<save_directory>'])
        if fetched_mail is None:
            log.error("Mail was not fetched, an error occured")

        if args['--browser'] is True:
            temp_file = tempfile.NamedTemporaryFile(delete=False)
            temp_file.write(fetch.display(fetched_mail,
                                          browser=True).encode('utf-8'))

            webbrowser.open_new_tab(temp_file.name)

            temp_file.close()
        else:
            sys.stdout.write(fetch.display(fetched_mail))
dataset/ETHPy150Open Gentux/imap-cli/imap_cli/scripts/imap_shell.py/ImapShell.do_read