<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def index(self, *args, **kwargs):
 """Index documents, in the current session"""

        self.check_session()
        result = self.session.index(*args, **kwargs)
        if self.autosession:
            self.commit()
        return result