code: def partition_name_to_id(
      partition_name, is_input=False, is_output=False
  ):
      if is_input:
          partition_id = 0
      elif is_output:
          partition_id = 1
      else:
          prefix = "submod_"
          partition_id = int(partition_name.split(prefix)[-1]) + 2
      return partition_id
  
imports: import torch
  from torch.fx.graph_module import GraphModule
  from colossalai.legacy.pipeline.middleware.topo import Partition, PartitionInputVal, PartitionOutputVal, Topo
label_desc: Use image node_id 1 for calling a global function with example usage: partition_name_to_id(partition_name, is_input, is_output) and returns: partition_id