code: def _convert_node(node: Any, convert: Union[ConvertMode, str]) -> Any:
      if OmegaConf.is_config(node):
          if convert == ConvertMode.ALL:
              node = OmegaConf.to_container(node, resolve=True)
          elif convert == ConvertMode.PARTIAL:
              node = OmegaConf.to_container(
                  node,
                  resolve=True,
                  structured_config_mode=SCMode.DICT_CONFIG,
              )
          elif convert == ConvertMode.OBJECT:
              node = OmegaConf.to_container(
                  node,
                  resolve=True,
                  structured_config_mode=SCMode.INSTANTIATE,
              )
      return node
  
imports: import copy
  import functools
  from enum import Enum
  from textwrap import dedent
  from typing import Any, Callable, Dict, List, Sequence, Tuple, Union
  from omegaconf import OmegaConf, SCMode
  from omegaconf._utils import is_structured_config
  from hydra._internal.utils import _locate
  from hydra.errors import InstantiationException
  from hydra.types import ConvertMode, TargetConf
label_desc: Use image node_id 8 for calling a global function with example usage: _convert_node(node, convert) and returns: node