def METHOD_NAME(self, key, default=None):
    """When `key` is a full key, fetches the value for the given key (if
    any).
    If `key` is only a partial key (i.e. a truncated tuple) then returns a
    `TreeCacheNode`, which can be passed to the `iterate_tree_cache_*`
    functions to iterate over all entries in the cache with keys that start
    with the given partial key.
    """
    node = self.root
    for k in key[:-1]:
        node = node.METHOD_NAME(k, None)
        if node is None:
            return default
    return node.METHOD_NAME(key[-1], default)