<commit_before>"""Calculate the effective refractive index for a 1D mode."""

from typing import List
from typing_extensions import Literal

import numpy as np
from scipy.optimize import fsolve


def calculate_effective_permittivity(
    epsilon_film: float,
    epsilon_substrate: float,
    epsilon_cladding: float,
    thickness: float,
    wavelength: float,
    polarization: Literal["te", "tm"],
)-> List[float]:
    """
    Calculate the effective refractive index for a 1D mode.

    .. code::

        -----------------      |
        epsilon_cladding      inf
        -----------------      |
        epsilon_film        thickness
        -----------------      |
        epsilon_substrate     inf
        -----------------      |

    Args:
        epsilon_film: Relative permittivity of the film.
        epsilon_substrate: Relative permittivity of the substrate.
        epsilon_cladding: Relative permittivity of the cladding.
        thickness: Thickness of the film.
        wavelength: Wavelength.
        polarization: Either "te" or "tm".

    Returns:
        List of effective permittivity.
    """
    if polarization == "te":<commit_msg>fix pre-commit<commit_after>"""Calculate the effective refractive index for a 1D mode."""

from typing import List

import numpy as np
from scipy.optimize import fsolve
from typing_extensions import Literal


def calculate_effective_permittivity(
    epsilon_film: float,
    epsilon_substrate: float,
    epsilon_cladding: float,
    thickness: float,
    wavelength: float,
    polarization: Literal["te", "tm"],
) -> List[float]:
    """
    Calculate the effective refractive index for a 1D mode.

    .. code::

        -----------------      |
        epsilon_cladding      inf
        -----------------      |
        epsilon_film        thickness
        -----------------      |
        epsilon_substrate     inf
        -----------------      |

    Args:
        epsilon_film: Relative permittivity of the film.
        epsilon_substrate: Relative permittivity of the substrate.
        epsilon_cladding: Relative permittivity of the cladding.
        thickness: Thickness of the film.
        wavelength: Wavelength.
        polarization: Either "te" or "tm".

    Returns:
        List of effective permittivity.
    """
    if polarization == "te":
{'fraction_non_alphanumeric': 0.12446167097329888, 'fraction_numerical': 0.0017226528854435831, 'mean_word_length': 1.9110275689223057, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4661703', 'n_tokens_mistral': 637, 'n_tokens_neox': 586, 'n_words': 192}