<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def completedefault(self, text, line, *_):
 """ Autocomplete table names in queries """

        tokens = line.split()
        try:
            before = tokens[-2]
            complete = before.lower() in ("from", "update", "table", "into")
            if tokens[0].lower() == "dump":
                complete = True
            if complete:
                return [
                    t + " "
                    for t in self.engine.cached_descriptions
                    if t.startswith(text)
                ]
        except KeyError:
            pass