code: def SplitKeyPath(key_path, path_separator=definitions.KEY_PATH_SEPARATOR):
    
    # Split the path with the path separator and remove empty path segments.
    return list(filter(None, key_path.split(path_separator)))
docs: Splits the key path into path segments.
  
    Args:
      key_path (str): key path.
      path_separator (Optional[str]): path separator.
  
    Returns:
      list[str]: key path segments without the root path segment, which is an
          empty string.