code: def elaborate_borns_and_epsilon(ucell,
                                  borns,
                                  epsilon,
                                  primitive_matrix=None,
                                  supercell_matrix=None,
                                  is_symmetry=True,
                                  symmetrize_tensors=False,
                                  symprec=1e-5):
      
  
      assert len(borns) == ucell.get_number_of_atoms(), \
          "num_atom %d != len(borns) %d" % (ucell.get_number_of_atoms(),
                                            len(borns))
  
      if symmetrize_tensors:
          borns_, epsilon_ = symmetrize_borns_and_epsilon(
              borns,
              epsilon,
              ucell,
              symprec=symprec,
              is_symmetry=is_symmetry)
      else:
          borns_ = borns
          epsilon_ = epsilon
  
      indeps_in_supercell, indeps_in_unitcell = _extract_independent_atoms(
          ucell,
          primitive_matrix=primitive_matrix,
          supercell_matrix=supercell_matrix,
          is_symmetry=is_symmetry,
          symprec=symprec)
  
      return borns_[indeps_in_unitcell].copy(), epsilon_, indeps_in_supercell
docs: Symmetrize Born effective charges and dielectric constants and
      extract Born effective charges of symmetrically independent atoms
      for primitive cell.
  
  
       Args:
           ucell (Atoms): Unit cell structure
           borns (np.array): Born effective charges of ucell
           epsilon (np.array): Dielectric constant tensor
  
       Returns:
           (np.array) Born effective charges of symmetrically independent atoms
               in primitive cell
           (np.array) Dielectric constant
           (np.array) Atomic index mapping table from supercell to primitive cell
               of independent atoms
  
       Raises:
            AssertionError: Inconsistency of number of atoms or Born effective
                charges.
  
       Warning:
           Broken symmetry of Born effective charges