<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_keys(self, pattern='*', db=0):
 """ Run the ``KEYS`` command and return the list of matching keys. :param pattern: the pattern to filter keys by (default ``*``) :param db: the db number to query (default ``0``) """

        lines = output_lines(self.exec_redis_cli('KEYS', [pattern], db=db))
        return [] if lines == [''] else lines