code: def subkey_for_path(self, path):
          
          force_public = (path[-4:] == '.pub')
          if force_public:
              path = path[:-4]
          key = self
          if path:
              invocations = path.split("/")
              for v in invocations:
                  is_hardened = v[-1] in ("'pH")
                  if is_hardened:
                      v = v[:-1]
                  v = int(v)
                  key = key.subkey(i=v, is_hardened=is_hardened, as_private=key.secret_exponent() is not None)
          if force_public and key.secret_exponent() is not None:
              key = key.public_copy()
          return key
docs: path: a path of subkeys denoted by numbers and slashes. Use H or p
              for private key derivation. End with .pub to force the key
              public.
  
          Examples: 1H/5/2/1 would call subkey(i=1, is_hardened=True)
              .subkey(i=5).subkey(i=2).subkey(i=1) and then yield the
              private key 0/0/458.pub would call subkey(i=0).subkey(i=0)
              .subkey(i=458) and then yield the public key
  
          You should choose one of the H or p convention for private key
          derivation and stick with it.