<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetValueByPath(self, path_segments):
 """Retrieves a plist value by path. Args: path_segments (list[str]):
 path segment strings relative to the root of the plist. Returns: object: The value of the key specified by the path or None. """

    key = self.root_key
    for path_segment in path_segments:
      if isinstance(key, dict):
        try:
          key = key[path_segment]
        except KeyError:
          return None

      elif isinstance(key, list):
        try:
          list_index = int(path_segment, 10)
        except ValueError:
          return None

        key = key[list_index]

      else:
        return None

      if not key:
        return None

    return key