code: def _format_variable_name(name: str, graph_name: str) -> str:
      """
      1. replace invalid characters in node name
      2. variables name (full name space) is too long, shorten the name by removing the prefix ```graph_name```
      """
      name = (
          name[len(graph_name) :]
          if name.startswith(graph_name)
          else name
      )
      name = name.replace("/", "__")
  
      # https://stackoverflow.com/questions/3303312/how-do-i-convert-a-string-to-a-valid-variable-name-in-python
      name = re.sub(r"\W|^(?=\d)", "_", name)
  
      if name.startswith("__") and (len(name) > 2 and name[2] != "_"):
          # name can't start with double underscore
          # it's reserved in Python: https://stackoverflow.com/a/1301409/6837658
          # but it's actually very common in our generated code
          name = name[1:]
      elif name.startswith("_"):
          # to avoid conflicts between '_' and '__'
          name = "i" + name
  
      return name
  
file_path: nni/nni/nas/space/pytorch/codegen.py
imports: import logging
  import re
  from typing import Dict, List, Tuple, Any, cast
  from nni.common.device import Device, GPUDevice
  from nni.nas.space.graph import IllegalGraphError, Edge, Graph, Node, GraphModelSpace
  from nni.nas.space.graph_op import PyTorchOperation
  from nni.nas.utils import STATE_DICT_PY_MAPPING
  from .op_def import ToDevice
label_desc: Use image node_id 4 for calling a global function with example usage: _format_variable_name(name, graph_name) and returns: name