def METHOD_NAME(
    model_settings: ModelSettings, env_params: ExtraDict
) -> ExtraDict:
    """
    This function returns the Extra field of the Settings.
    It merges them, iff they're both present, from the
    environment AND model settings file. Precedence is
    giving to the environment.
    """
    # Both `parameters` and `extra` are Optional, so we
    # need to get the value, or nothing.
    settings_params = (
        model_settings.parameters.extra
        if model_settings.parameters is not None
        else None
    )
    if settings_params is None and env_params == {}:
        # There must be settings provided by at least the environment OR model settings
        raise MissingHuggingFaceSettings()
    # Set the default value
    settings_params = settings_params or {}
    # Overwrite any conflicting keys, giving precedence to the environment
    settings_params.update(env_params)
    return ExtraDict(settings_params)