<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def subsample(self, rate, random=False):
 """Returns a subsampled version of the PointCloud. Parameters rate : int Only every rate-th element of the PointCloud is returned. Returns ------- :obj:`PointCloud` A subsampled point cloud with N / rate total samples. Raises ------ ValueError If rate is not a positive integer. """

        if type(rate) != int and rate < 1:
            raise ValueError('Can only subsample with strictly positive integer rate')
        indices = np.arange(self.num_points)
        if random:
            np.random.shuffle(indices)
        subsample_inds = indices[::rate]
        subsampled_data = self._data[:,subsample_inds]
        return PointCloud(subsampled_data, self._frame), subsample_inds