code: def test_dedup_input(cgo):
      lp, _ = _build_logical_with_mnist(3)
  
      opt = DedupInputOptimizer()
      opt.convert(lp)
  
      phy_models = cgo._assemble(lp)
  
      if len(cgo.available_devices) == 4:
          assert len(list(phy_models)) == 1
      elif len(cgo.available_devices) == 2:
          assert len(list(phy_models)) == 2
      elif len(cgo.available_devices) == 1:
          assert len(list(phy_models)) == 3
      else:
          raise ValueError(
              f"Invalid device count: {cgo.available_devices}"
          )
  
      cgo.shutdown()
  
imports: from pathlib import Path
  import pytest
  import torch
  import torch.nn
  import torchmetrics
  from torchvision.datasets import MNIST
  from torchvision import transforms
  from pytorch_lightning import seed_everything
  import nni
  from nni.experiment.config import RemoteConfig, RemoteMachineConfig
  from nni.nas.evaluator.pytorch import Lightning, DataLoader
  from nni.nas.execution import SequentialExecutionEngine
  from nni.nas.execution.cgo import CrossGraphOptimization
  from nni.nas.execution.cgo.evaluator import MultiModelLightningModule, MultiModelTrainer
  from nni.nas.execution.cgo.logical_optimizer.logical_plan import LogicalPlan
  from nni.nas.execution.cgo.logical_optimizer.opt_dedup_input import DedupInputOptimizer
  from nni.nas.space import Node, ModelStatus
  from nni.nas.space.pytorch import PytorchGraphModelSpace
  from nni.runtime.trial_command_channel import get_default_trial_command_channel, set_default_trial_command_channel
  from ut.sdk.helper.trial_command_channel import TestHelperTrialCommandChannel
label_desc: Use image node_id 10 for calling a global function with example usage: test_dedup_input(cgo) without return types