def METHOD_NAME(username=None):
    password = None
    if username:
        password = click.prompt("Enter password for user %s" % username,
                                hide_input=True)
    options = webdriver.ChromeOptions()
    options.add_argument("--headless")
    driver = webdriver.Chrome(options=options,
                              executable_path=r'/usr/local/bin/chromedriver')
    driver.set_window_size(1120, 550)
    driver.get('https://www.hepdata.net/search/')
    wait = WebDriverWait(driver, 10)
    wait.until(EC.visibility_of_element_located(
        (By.CSS_SELECTOR, ".cc_btn_accept_all")
    ))
    time.sleep(1)
    cookie_accept_btn = driver.find_element(By.CSS_SELECTOR, ".cc_btn_accept_all")
    cookie_accept_btn.click()
    if username and password:
        click.echo("Logging in...")
        driver.get('https://www.hepdata.net/login/')
        login_form = driver.find_element(By.NAME, 'login_user_form')
        login_form.find_element(By.NAME, 'email').send_keys(username)
        login_form.find_element(By.NAME, 'password').send_keys(password)
        login_form.submit()
    return driver