<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lindex(self, key, index):
 """Emulate lindex."""


        redis_list = self._get_list(key, 'LINDEX')

        if self._encode(key) not in self.redis:
            return None

        try:
            return redis_list[index]
        except (IndexError):
            # Redis returns nil if the index doesn't exist
            return None