<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def subkey(self, i=0, is_hardened=False, as_private=None):
 """ Yield a child node for this node. i: the index for this node. is_hardened: use "hardened key derivation". That is, the public version of this node cannot calculate this child. as_private: set to True to get a private subkey. """

        if as_private is None:
            as_private = self.secret_exponent() is not None
        is_hardened = not not is_hardened
        as_private = not not as_private
        lookup = (i, is_hardened, as_private)
        if lookup not in self._subkey_cache:
            self._subkey_cache[lookup] = self._subkey(i, is_hardened, as_private)
        return self._subkey_cache[lookup]