code: def register_flops_formula(
      module_type: Any, formula: Callable[..., FlopsResult]
  ) -> None:
      """
      Register a FLOPs counting formula for a module.
  
      Parameters
      ----------
      module_type
          The module type to register the formula for.
          The class here needs to be a class, not an instantiated module.
      formula
          A function that takes in a module and its inputs, and returns :class:`FlopsResult`.
          Check :class:`FlopsParamsProfiler` for more details.
      """
      if module_type in _flops_formula:
          _logger.warning(
              "Formula for %s is already registered. It will be overwritten.",
              module_type,
          )
      _flops_formula[module_type] = formula
  
imports: from __future__ import annotations
  import logging
  from dataclasses import dataclass, fields
  from functools import partial, reduce
  from typing import Any, NamedTuple, Callable, cast
  from torch import nn
  import nni.nas.nn.pytorch
  from nni.mutable import Sample, Mutable, MutableExpression
  from nni.nas.nn.pytorch import ModelSpace
  from nni.nas.profiler import Profiler, ExpressionProfiler
  from .utils import MutableShape, ShapeTensor, submodule_input_output_shapes, standardize_arguments, argument_in_spec, concat_name
  from .utils._attrs import tuple_n_t, _getattr
label_desc: Use image node_id 10 for calling a global function with example usage: register_flops_formula(module_type, formula) without return types