<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def symmetrize_borns_and_epsilon(borns, epsilon, ucell, primitive_matrix=None, supercell_matrix=None, symprec=1e-5, is_symmetry=True):
 """Symmetrize Born effective charges and dielectric tensor Parameters borns: array_like Born effective charges. shape=(unitcell_atoms, 3, 3) dtype='double' epsilon: array_like Dielectric constant shape=(3, 3) dtype='double' ucell: PhonopyAtoms Unit cell primitive_matrix: array_like, optional Primitive matrix. This is used to select Born effective charges in primitive cell. If None (default), Born effective charges in unit cell are returned. shape=(3, 3) dtype='double' supercell_matrix: array_like, optional Supercell matrix. This is used to select Born effective charges in **primitive cell**. Supercell matrix is needed because primitive cell is created first creating supercell from unit cell, then the primitive cell is created from the supercell. If None (defautl), 1x1x1 supercell is created. shape=(3, 3) dtype='int' symprec: float, optional Symmetry tolerance. Default is 1e-5 is_symmetry: bool, optinal By setting False, symmetrization can be switched off. Default is True. """


    lattice = ucell.get_cell()
    positions = ucell.get_scaled_positions()
    u_sym = Symmetry(ucell, is_symmetry=is_symmetry, symprec=symprec)
    rotations = u_sym.get_symmetry_operations()['rotations']
    translations = u_sym.get_symmetry_operations()['translations']
    ptg_ops = u_sym.get_pointgroup_operations()
    epsilon_ = _symmetrize_2nd_rank_tensor(epsilon, ptg_ops, lattice)

    for i, Z in enumerate(borns):
        site_sym = u_sym.get_site_symmetry(i)
        Z = _symmetrize_2nd_rank_tensor(Z, site_sym, lattice)

    borns_ = np.zeros_like(borns)
    for i in range(len(borns)):
        count = 0
        for r, t in zip(rotations, translations):
            count += 1
            diff = np.dot(positions, r.T) + t - positions[i]
            diff -= np.rint(diff)
            dist = np.sqrt(np.sum(np.dot(diff, lattice) ** 2, axis=1))
            j = np.nonzero(dist < symprec)[0][0]
            r_cart = similarity_transformation(lattice.T, r)
            borns_[i] += similarity_transformation(r_cart, borns[j])
        borns_[i] /= count

    sum_born = borns_.sum(axis=0) / len(borns_)
    borns_ -= sum_born

    if (abs(borns - borns_) > 0.1).any():
        lines = ["Born effective charge symmetry is largely broken. "
                 "Largest different among elements: "
                 "%s" % np.amax(abs(borns - borns_))]
        import warnings
        warnings.warn("\n".join(lines))

    if primitive_matrix is None:
        return borns_, epsilon_
    else:
        scell, pcell = _get_supercell_and_primitive(
            ucell,
            primitive_matrix=primitive_matrix,
            supercell_matrix=supercell_matrix,
            symprec=symprec)
        idx = [scell.u2u_map[i] for i in scell.s2u_map[pcell.p2s_map]]
        return borns_[idx], epsilon_