code: def GetAPFSVolumeByPathSpec(self, path_spec):
      
      volume_index = apfs_helper.APFSContainerPathSpecGetVolumeIndex(path_spec)
      if volume_index is None:
        return None
  
      return self._fsapfs_container.get_volume(volume_index)
docs: Retrieves an APFS volume for a path specification.
  
      Args:
        path_spec (PathSpec): path specification.
  
      Returns:
        pyfsapfs.volume: an APFS volume or None if not available.