def METHOD_NAME(metric: TrialMetric | dict[str, Any]) -> None:
    """
    Reports final result to NNI.
    ``metric`` should either be a float, or a dict that ``metric['default']`` is a float.
    If ``metric`` is a dict, ``metric['default']`` will be used by tuner,
    and other items can be visualized with web portal.
    Typically ``metric`` is the final accuracy or loss.
    Parameters
    ----------
    metric : :class:`~nni.typehint.TrialMetric`
        The final result.
    """
    assert _params or trial_env_vars.NNI_PLATFORM is None, \
        'nni.get_next_parameter() needs to be called before report_final_result'
    get_default_trial_command_channel().send_metric(
        parameter_id=_params['parameter_id'] if _params else None,
        trial_job_id=trial_env_vars.NNI_TRIAL_JOB_ID,
        type='FINAL',
        sequence=0,
        value=cast(TrialMetric, metric)
    )