def METHOD_NAME(table_metadata: catalog.Table) -> pd.Series:
    """Build unit of measure.
    The unit of measure is created using the `indicator_name` field. We have come up with some rules, which
    you can explore in the source code of the function. Some examples are:
    - Any name containing string "(%...)" is assigned the unit "%..."
    - Any name containing string "(%)" is assigned the unit "%"
    - Any name containing string "(...$)" is assigned the unit "...$"
    - Any name containing string "(days)" is assigned the unit "days"
    The output is a pandas Series with the unit of measure for each variable.
    Parameters
    ----------
    table_metadata : catalog.Table
        Metadata table.
    Returns
    -------
    catalog.Variable
        Variable with units.
    """
    # extract units
    unit_1 = table_metadata["indicator_name"].str.extract(r"\((% [^\)]*)\)")  # (%...)
    unit_12 = table_metadata["indicator_name"].str.extract(r"\((%), tertiary\)")  # (%, tertiary)
    unit_2 = table_metadata["indicator_name"].str.extract(r"\(([^\)]*\$)\)")  # (...$)
    unit_3 = table_metadata["indicator_name"].str.extract(r"\(([^\)]*\%)\)")  # (...%)
    unit_4 = table_metadata["indicator_name"].str.extract(r"[Ee]xpected ([Yy]ears)")  # Expected years...
    unit_4[0] = unit_4[0].apply(lambda x: x.lower() if not pd.isnull(x) else np.nan)
    unit_5 = table_metadata["indicator_name"].str.extract(r"\((per[^%)]*)\)")  # (per...)
    unit_6 = table_metadata["indicator_name"].str.extract(r"\((?:calendar )?(days)\)")  # (days)
    unit_7 = table_metadata["indicator_name"].str.extract(r"\((liters)[^\)]*\)")  # (liters...)
    # Build units
    units = pd.concat([unit_1, unit_12, unit_2, unit_3, unit_4, unit_5, unit_6, unit_7], axis=1)
    # Sanity check
    assert all((-units.isna()).sum(axis=1) <= 1), "Multiple units found!"
    # Final formatting
    units.columns = range(units.shape[1])
    units_ = units[0]
    for i in range(1, units.shape[1]):
        units_ = units_.fillna(units[i])
    # Replace NaNs with empty strings
    units_ = units_.fillna("")
    # Check if units_ is as expected (perhaps new units? wrong units detected?)
    # units_.to_csv("wb_gender.units.check.csv", index=False)
    units_check = pd.read_csv(THIS_DIRECTORY / "wb_gender.units.check.csv")["0"].squeeze()
    assert units_.equals(units_check.fillna("")), (
        "Units are not as expected. Please review the output of _build_unit function. If the output looks fine, then"
        " update auxiliary file wb_gender.units.check.csv."
    )
    return units_