def METHOD_NAME(df_beis: pd.DataFrame, df_elec: pd.DataFrame) -> pd.DataFrame:
    """Combine BEIS data on UK historical electricity with the electricity mix data (after having selected rows for only
    the UK).
    There are different processing steps done to the data, see comments below in the code.
    Parameters
    ----------
    df_beis : pd.DataFrame
        Selected data from BEIS on UK historical electricity.
    df_elec : pd.DataFrame
        Selected data from the electricity mix (after having selected rows for the UK).
    Returns
    -------
    df_combined : pd.DataFrame
        Combined and processed data with a verified index.
    """
    # In the BEIS dataset, wind and solar are given as one joined variable.
    # Check if we can ignore it (since it's better to have the two sources separately).
    # Find the earliest year informed in the electricity mix for solar or wind generation.
    solar_or_wind_first_year = df_elec[df_elec["wind_generation"].notnull() | df_elec["solar_generation"].notnull()][
        "year"
    ].min()
    # Now check that, prior to that year, all generation from solar and wind was zero.
    assert df_beis[df_beis["year"] < solar_or_wind_first_year]["wind_and_solar_generation"].fillna(0).max() == 0
    # Therefore, since wind and solar is always zero (prior to the beginning of the electricity mix data)
    # we can ignore this column from the BEIS dataset.
    df_beis = df_beis.drop(columns=["wind_and_solar_generation"])
    # And create two columns of zeros for wind and solar.
    df_beis["solar_generation"] = 0
    df_beis["wind_generation"] = 0
    # Similarly, given that in the BEIS dataset there is no data about other renewable sources (apart from hydro, solar
    # and wind), we can assume that the contribution from other renewables is zero.
    df_beis["other_renewables_generation"] = 0
    # And ensure these new columns do not have any values after the electricity mix data begins.
    df_beis.loc[
        df_beis["year"] >= solar_or_wind_first_year,
        ["solar_generation", "wind_generation", "other_renewables_generation"],
    ] = np.nan
    # BEIS data on fuel input gives raw energy, but we want electricity generation (which is less, given the
    # inefficiencies of the process of burning fossil fuels).
    # They also include a variable on "implied efficiency", which they obtain by dividing the input energy by the total
    # electricity generation.
    # We multiply the raw energy by the efficiency to have an estimate of the electricity generated by each fossil fuel.
    # This only affects data prior to the beginning of the electricity mix's data (which is 1965 for renewables and
    # nuclear, and 1985 for the rest).
    for source in ["coal", "oil", "gas"]:
        df_beis[f"{source}_generation"] *= df_beis["implied_efficiency"]
    # Drop other unnecessary columns.
    df_beis = df_beis.drop(columns=["implied_efficiency"])
    # Combine BEIS and electricity mix data.
    df_combined = dataframes.combine_two_overlapping_dataframes(
        df1=df_elec, df2=df_beis, index_columns=["country", "year"]
    )
    # Add an index and sort conveniently.
    df_combined = df_combined.set_index(["country", "year"]).sort_index().sort_index(axis=1)
    return cast(pd.DataFrame, df_combined)