# Buggy code
def load_config(self, commands, commit=False, replace=False):
    """Loads the config commands onto the remote device"""
    use_session = os.getenv("ANSIBLE_EOS_USE_SESSIONS", True)
    try:
        use_session = int(use_session)
    except ValueError:
        pass

    if not all((bool(use_session), self.supports_sessions)):
        if commit:
            return self.configure(self, commands)
        else:
            self._module.warn("EOS can not check config without config session")
            result = {"changed": True}
            return result

    conn = self._get_connection()
    session = "ansible_%s" % int(time.time())
    result = {"session": session}

    out = conn.get("configure session %s" % session)

    if replace:
        out = conn.get("rollback clean-config")

    try:
        self.send_config(commands)
    except ConnectionError as exc:
        self.close_session(session)
        message = getattr(exc, "err", exc)
        self._module.fail_json(
            msg="Error on executing commands %s" % commands,
            data=to_text(message, errors="surrogate_then_replace"),
        )

    out = conn.get("show session-config diffs")
    if out:
        result["diff"] = to_text(out, errors="surrogate_then_replace").strip()

    if commit:
        conn.get("commit")
    else:
        self.close_session(session)

    return result


# Traceback (TypeError)
TASK [eos : replace configuration from file] ***********************************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: configure() takes exactly 2 arguments (3 given)
fatal: [TL1MCSW01]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_S_CQ4R/ansible_module_eos_config.py\", line 467, in <module>\n    main()\n  File \"/tmp/ansible_S_CQ4R/ansible_module_eos_config.py\", line 394, in main\n    response = load_config(module, commands, replace=replace, commit=commit)\n  File \"/tmp/ansible_S_CQ4R/ansible_modlib.zip/ansible/module_utils/eos.py\", line 476, in load_config\n  File \"/tmp/ansible_S_CQ4R/ansible_modlib.zip/ansible/module_utils/eos.py\", line 406, in load_config\nTypeError: configure() takes exactly 2 arguments (3 given)\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

# Fixed code
def load_config(self, commands, commit=False, replace=False):
    """Loads the config commands onto the remote device"""
    use_session = os.getenv("ANSIBLE_EOS_USE_SESSIONS", True)
    try:
        use_session = int(use_session)
    except ValueError:
        pass

    if not all((bool(use_session), self.supports_sessions)):
        if commit:
            return self.configure(commands)
        else:
            self._module.warn("EOS can not check config without config session")
            result = {"changed": True}
            return result

    conn = self._get_connection()
    session = "ansible_%s" % int(time.time())
    result = {"session": session}

    out = conn.get("configure session %s" % session)

    if replace:
        out = conn.get("rollback clean-config")

    try:
        self.send_config(commands)
    except ConnectionError as exc:
        self.close_session(session)
        message = getattr(exc, "err", exc)
        self._module.fail_json(
            msg="Error on executing commands %s" % commands,
            data=to_text(message, errors="surrogate_then_replace"),
        )

    out = conn.get("show session-config diffs")
    if out:
        result["diff"] = to_text(out, errors="surrogate_then_replace").strip()

    if commit:
        conn.get("commit")
    else:
        self.close_session(session)

    return result