code: def transform_symmop(self, symmop):
          # type: (Union[SymmOp, MagSymmOp]) -> Union[SymmOp, MagSymmOp]
          
          W = symmop.rotation_matrix
          w = symmop.translation_vector
          Q = np.linalg.inv(self.P)
          W_ = np.matmul(np.matmul(Q, W), self.P)
          I = np.identity(3)
          w_ = np.matmul(Q, (w + np.matmul(W - I, self.p)))
          if isinstance(symmop, MagSymmOp):
              return MagSymmOp.from_rotation_and_translation_and_time_reversal(
                  rotation_matrix=W_, translation_vec=w_,
                  time_reversal=symmop.time_reversal, tol=symmop.tol)
          elif isinstance(symmop, SymmOp):
              return SymmOp.from_rotation_and_translation(
                  rotation_matrix=W_, translation_vec=w_, tol=symmop.tol)
docs: Takes a symmetry operation and transforms it.
          :param symmop: SymmOp or MagSymmOp
          :return: