code: def prefixes(self, key):
          '''
          Returns a list with keys of this DAWG that are prefixes of the ``key``.
          '''
          res = []
          index = self.dct.ROOT
          if not isinstance(key, bytes):
              key = key.encode('utf8')
  
          pos = 1
  
          for ch in key:
              index = self.dct.follow_char(int_from_byte(ch), index)
              if not index:
                  break
  
              if self._has_value(index):
                  res.append(key[:pos].decode('utf8'))
              pos += 1
  
          return ref prefixes(self, key):
          '''
          Returns a list with keys of this DAWG that are prefixes of the ``key``.
          '''
          res = []
          index = self.dct.ROOT
          if not isinstance(key, bytes):
              key = key.encode('utf8')
  
          pos = 1
  
          for ch in key:
              index = self.dct.follow_char(int_from_byte(ch), index)
              if not index:
                  break
  
              if self._has_value(index):
                  res.append(key[:pos].decode('utf8'))
              pos += 1
  
          return res
docs: Returns a list with keys of this DAWG that are prefixes of the ``key``.