code: def keys(self, pattern='*'):
          
          # making sure the pattern is unicode/str.
          try:
              pattern = pattern.decode('utf-8')
              # This throws an AttributeError in python 3, or an
              # UnicodeEncodeError in python 2
          except (AttributeError, UnicodeEncodeError):
              pass
  
          # Make regex out of glob styled pattern.
          regex = fnmatch.translate(pattern)
          regex = re.compile(re.sub(r'(^|[^\\])\.', r'\1[^/]', regex))
  
          # Find every key that matches the pattern
          return [key for key in self.redis.keys() if regex.match(key.decode('utf-8'))]
docs: Emulate keys.