def GetSubkeyByPath(self, key_path):
if not self._registry_key and self._registry:<EOL><INDENT>self._GetKeyFromRegistry()<EOL><DEDENT>subkey = self<EOL>for path_segment in key_paths.SplitKeyPath(key_path):<EOL><INDENT>subkey = subkey.GetSubkeyByName(path_segment)<EOL>if not subkey:<EOL><INDENT>break<EOL><DEDENT><DEDENT>return subkey<EOL>
Retrieves a subkey by path.

        Args:
          key_path (str): path of the subkey.

        Returns:
          WinRegistryKey: Windows Registry subkey or None if not found.