def __getitem__(self, i):
    '\n        Indexing method.\n        Returns a Molecule object for given index (frame).\n        Returns a Trajectory object if used as slicing.\n\n        '
    if isinstance(i, slice):
        indices = range(len(self))[i.start:i.stop:i.step]
        if (len(indices) == 0):
            return []
        else:
            new_traj = Trajectory(molecule=self[indices[0]])
            for j in indices[1:]:
                new_traj.append(self[j])
            return new_traj
    else:
        return Molecule(atoms=self.atoms[i], coordinates=self.coordinates[i])
Indexing method.
Returns a Molecule object for given index (frame).
Returns a Trajectory object if used as slicing.
def __getitem__(self, i):
    '\n        Indexing method.\n        Returns a Molecule object for given index (frame).\n        Returns a Trajectory object if used as slicing.\n\n        '
    if isinstance(i, slice):
        indices = range(len(self))[i.start:i.stop:i.step]
        if (len(indices) == 0):
            return []
        else:
            new_traj = Trajectory(molecule=self[indices[0]])
            for j in indices[1:]:
                new_traj.append(self[j])
            return new_traj
    else:
        return Molecule(atoms=self.atoms[i], coordinates=self.coordinates[i])