def METHOD_NAME(self, directly_logout = False):
    Shared.wait_for_element(self.browser, 'id', 'user')
    # must click this icon options first
    if directly_logout == False:
        try:
            ele = self.browser.find_element_by_xpath("//div[@id='user-options' and @style='display: block;']")
            if ele is None:
                ele1 = self.browser.find_element_by_xpath("//div[@id='user' and @class='button']/div[@class='icon options']/div[@class='icon arrow']").click()
        except NoSuchElementException as err:
            ele1 = self.browser.find_element_by_xpath("//div[@id='user' and @class='button']/div[@class='icon options']/div[@class='icon arrow']").click()
    time.sleep(1)
    ele2 = self.browser.find_element_by_xpath("//div[@id='user' and @class='button']/div[@id='user-options']/a[1]").click()
    Shared.wait_for_element(self.browser, 'class_name', 'login')