code: def find_flops_formula(
      module: nn.Module,
  ) -> Callable[..., FlopsResult] | None:
      """
      Find the FLOPs counting formula for a module. In the following order:
  
      1. If the module has a ``_count_flops`` method, use it.
      2. If the module type is in the registry, use the registered formula.
  
      Parameters
      ----------
      module
          The module to find the formula for.
  
      Returns
      -------
      formula
          The FLOPs counting formula.
      """
      if hasattr(module.__class__, "_count_flops"):
          return module.__class__._count_flops  # type: ignore
      elif type(module) in _flops_formula:
          return _flops_formula[type(module)]  # type: ignore
      return None
  
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 11 for calling a global function with example usage: find_flops_formula(module) and returns: None, module, _flops_formula