code: def are_collinear(magmoms):
          
          magmoms = [Magmom(magmom) for magmom in magmoms]
          if not Magmom.have_consistent_saxis(magmoms):
              magmoms = Magmom.get_consistent_set(magmoms)
  
          # convert to numpy array for convenience
          magmoms = np.array([list(magmom) for magmom in magmoms])
          magmoms = magmoms[np.any(magmoms, axis=1)] # remove zero magmoms
          if len(magmoms) == 0:
              return True
  
          # use first moment as reference to compare against
          ref_magmom = magmoms[0]
          # magnitude of cross products != 0 if non-collinear with reference
          num_ncl = np.count_nonzero(np.linalg.norm(np.cross(ref_magmom, magmoms), axis=1))
          if num_ncl > 0:
              return False
          else:
              return True
docs: Method checks to see if a set of magnetic moments are collinear
          with each other.
          :param magmoms: list of magmoms (Magmoms, scalars or vectors)
          :return: bool