def _NormalizeKeyPath(self, key_path):
    """Normalizes a Windows Registry key path.

    Args:
      key_path (str): Windows Registry key path.

    Returns:
      str: normalized Windows Registry key path.
    """
    normalized_key_path = key_path.lower()
    # The Registry key path should start with:
    # HKEY_LOCAL_MACHINE\System\ControlSet followed by 3 digits
    # which makes 39 characters.
    if (len(normalized_key_path) < 39 or
        not normalized_key_path.startswith(self._CONTROL_SET_PREFIX)):
      return normalized_key_path

    # Key paths that contain ControlSet### must be normalized to
    # CurrentControlSet.
    return ''.join([
        self._NORMALIZED_CONTROL_SET_PREFIX, normalized_key_path[39:]])
def _NormalizeKeyPath ( self , key_path ) : normalized_key_path = key_path . lower ( ) if ( len ( normalized_key_path ) < 39 or not normalized_key_path . startswith ( self . _CONTROL_SET_PREFIX ) ) : return normalized_key_path return '' . join ( [ self . _NORMALIZED_CONTROL_SET_PREFIX , normalized_key_path [ 39 : ] ] )
Normalizes a Windows Registry key path.

    Args:
      key_path (str): Windows Registry key path.

    Returns:
      str: normalized Windows Registry key path.