code: def update_function_order_in_functsions_yaml():
      d = utils.load_yaml_ordered(
          open(join(here, "functions.yaml"), "r")
      )
  
      order_info_by_id = {}
      order_info = OrderedDict()
  
      duplicated = {}
      missing = {}
  
      for cat_name, cat_info in d.items():
          for func_name, func_info in d[cat_name].items():
              order_info[func_name] = OrderedDict()
  
              default_full_name = func_name
              default_arg = ""
              if "arguments" in func_info:
                  for arg, arg_info in func_info["arguments"].items():
                      default_arg += type_to_pack_format(
                          arg_info["type"]
                      )
              if default_arg == "":
                  default_arg = "Empty"
              else:
                  default_full_name = func_name + "_" + default_arg
  
              if (
                  "function_ids" in func_info
                  and func_info["function_ids"] is not None
              ):
                  for func_arg, func_id in func_info[
                      "function_ids"
                  ].items():
                      full_name = func_name
                      if func_arg != "Empty":
                          full_name = func_name + "_" + func_arg
  
                      if func_id in order_info_by_id:
                          if func_id not in duplicated:
                              duplicated[func_id] = [
                                  order_info_by_id[func_id]
                              ]
                          duplicated[func_id].append(full_name)
  
                      order_info_by_id[func_id] = full_name
                      order_info[func_name][full_name] = func_id
                  if default_full_name not in order_info[func_name]:
                      if cat_name not in missing:
                          missing[cat_name] = {}
                      if func_name not in missing[cat_name]:
                          missing[cat_name][func_name] = []
                      missing[cat_name][func_name].append(default_arg)
              else:
                  if cat_name not in missing:
                      missing[cat_name] = {}
                  if func_name not in missing[cat_name]:
                      missing[cat_name][func_name] = []
                  missing[cat_name][func_name].append(default_arg)
  
              if "c_runtime" not in func_info:
                  func_info["c_runtime"] = "not support"
  
      current_id = sorted(order_info_by_id.keys()).pop() + 1
      if missing:
          with open_api_level_yaml() as api_level_yaml:
              for cat_name in missing:
                  for func_name in missing[cat_name]:
                      for arg in missing[cat_name][func_name]:
                          if (
                              "function_ids"
                              not in d[cat_name][func_name]
                              or d[cat_name][func_name]["function_ids"]
                              is None
                          ):
                              d[cat_name][func_name][
                                  "function_ids"
                              ] = OrderedDict()
                          api_level_yaml.append_new_id(
                              func_name + "_" + arg, current_id
                          )
                          d[cat_name][func_name]["function_ids"][
                              arg
                          ] = current_id
                          current_id += 1
  
      if len(duplicated):
          print("")
          print(
              "############################################## Errors in functions.yaml(START)"
          )
          for func_id, functions in duplicated.items():
              if len(functions) > 1:
                  print(
                      "ID {} duplicated between {}.".format(
                          func_id, functions
                      )
                  )
          print(
              'Correct ID in "build-tools/code_generator/functions.yaml" manually.'
          )
          print(
              "############################################## Errors in functions.yaml(END)"
          )
          print("")
          import sys
  
          sys.exit(-1)
  
      utils.dump_yaml(
          d,
          open(join(here, "functions.yaml"), "w"),
          default_flow_style=False,
          width=80,
      )
  
file_path: nnabla/build-tools/code_generator/generate.py
imports: import sys
  from collections import OrderedDict
  from os.path import abspath, dirname, join, exists
  from contextlib import contextmanager
  import code_generator_utils
label_desc: Use image node_id 9 for calling a global function with example usage: update_function_order_in_functsions_yaml() without return types