<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def number_of_trajectories(self, stride=None):
 r""" Returns the number of trajectories. Parameters stride: None (default) or np.ndarray Returns ------- int : number of trajectories """

        if not IteratorState.is_uniform_stride(stride):
            n = len(np.unique(stride[:, 0]))
        else:
            n = self.ntraj
        return n