code: def map(self, msg):
          
          k = self.key_function(msg)
          key = k[0] if isinstance(k, (tuple, list)) else k
          return self.routing_table[key]
docs: Apply key function to ``msg`` to obtain a key. Return the routing table entry.