code: def apply_to(self, x, columns=False):
          if isinstance(x, np.ndarray) and len(x.shape) == 2 and x.shape[0] == 3 and columns:
              return np.dot(self.r, x)
          if isinstance(x, np.ndarray) and (x.shape == (3, ) or (len(x.shape) == 2 and x.shape[1] == 3)) and not columns:
              return np.dot(x, self.r.transpose())
          elif isinstance(x, Complete):
              return Complete(np.dot(self.r, x.r), np.dot(self.r, x.t))
          elif isinstance(x, Translation):
              return Complete(self.r, np.dot(self.r, x.t))
          elif isinstance(x, Rotation):
              return Rotation(np.dot(self.r, x.r))
          elif isinstance(x, UnitCell):
              return UnitCell(np.dot(self.r, x.matrix), x.active)
          else:
              raise ValueError("Can not apply this rotation to %s" % x)