code: def gen_all_signatures(nvidia_dali_path, api):
      """Generate the signatures for "fn" or "ops" api.
  
      Parameters
      ----------
      nvidia_dali_path : Path
          The path to the wheel pre-packaging to the nvidia/dali directory.
      api : str
          "fn" or "ops"
      """
      nvidia_dali_path = Path(nvidia_dali_path)
  
      with closing(
          StubFileManager(nvidia_dali_path, api)
      ) as stub_manager:
          sig_groups = _group_signatures(api)
  
          # Python-only and the manually defined ones are reexported from their respective modules
          for schema_name, op in (
              sig_groups["python_only"] + sig_groups["python_wrapper"]
          ):
              _, module_nesting, op_name = _names._process_op_name(
                  schema_name, api=api
              )
  
              stub_manager.get(module_nesting).write(
                  f"\n\nfrom {op._impl_module} import"
                  f" ({op.__name__} as {op.__name__})\n\n"
              )
  
          # we do not go over sig_groups["hidden_or_internal"] at all as they are supposed to not be
          # directly visible
  
          # Runtime generated classes use fully specified stubs.
          for schema_name, op in sig_groups["generated"]:
              _, module_nesting, op_name = _names._process_op_name(
                  schema_name, api=api
              )
              schema = _b.TryGetSchema(schema_name)
  
              if api == "fn":
                  stub_manager.get(module_nesting).write(
                      _gen_fn_signature(schema, schema_name, op_name)
                  )
              else:
                  stub_manager.get(module_nesting).write(
                      _gen_ops_signature(schema, schema_name, op_name)
                  )
  
imports: from inspect import Parameter, Signature
  import ast
  import os
  from pathlib import Path
  from contextlib import closing
  from typing import Union, Optional
  from typing import Sequence, List, Any
  from nvidia.dali import backend
  from nvidia.dali import types
  from nvidia.dali.ops import _registry, _names, _docs
  from nvidia.dali import types
  from nvidia.dali import ops, fn
label_desc: Use image node_id 23 for calling a global function with example usage: gen_all_signatures(nvidia_dali_path, api) without return types