def JoinKeyPath(path_segments):
<EOL>path_segments = [<EOL>segment.split(definitions.KEY_PATH_SEPARATOR)<EOL>for segment in path_segments]<EOL>path_segments = [<EOL>element for sublist in path_segments for element in sublist]<EOL>path_segments = filter(None, path_segments)<EOL>key_path = definitions.KEY_PATH_SEPARATOR.join(path_segments)<EOL>if not key_path.startswith('<STR_LIT>'):<EOL><INDENT>key_path = '<STR_LIT>'.format(definitions.KEY_PATH_SEPARATOR, key_path)<EOL><DEDENT>return key_path<EOL>
Joins the path segments into key path.

    Args:
      path_segments (list[str]): Windows Registry key path segments.

    Returns:
      str: key path.