code: def test_itersource_synchronize2_expansion():
      wf1 = pe.Workflow(name="test")
  
      node1 = pe.Node(EngineTestInterface(), name="node1")
      node1.iterables = [("input1", [1, 2]), ("input2", [3, 4])]
      node1.synchronize = True
      node2 = pe.Node(EngineTestInterface(), name="node2")
      wf1.connect(node1, "output1", node2, "input1")
      node3 = pe.Node(EngineTestInterface(), name="node3")
      node3.itersource = ("node1", ["input1", "input2"])
      node3.synchronize = True
      node3.iterables = [
          ("input1", "input2"),
          {(1, 3): [(5, 7), (6, 8)], (2, 4): [(None, 9)]},
      ]
      wf1.connect(node2, "output1", node3, "input1")
      node4 = pe.Node(EngineTestInterface(), name="node4")
      wf1.connect(node3, "output1", node4, "input1")
      wf3 = pe.Workflow(name="group")
      for i in [0, 1, 2]:
          wf3.add_nodes([wf1.clone(name="test%d" % i)])
      wf3._flatgraph = wf3._create_flat_graph()
  
      # each expanded graph clone has:
      # 2 node1 expansion nodes,
      # 1 node2 per node1 replicate,
      # 2 node3 replicates for the node1 input1 value 1,
      # 1 node3 replicates for the node1 input1 value 2 and
      # 1 node4 successor per node3 replicate
      # => 2 + 2 + (2 + 1) + 3 = 10 nodes per expanded graph clone
      # => 3 * 10 = 30 nodes in the group
      assert (
          len(pe.generate_expanded_graph(wf3._flatgraph).nodes()) == 30
      )
  
imports: from copy import deepcopy
  from glob import glob
  import os
  import pytest
  from ...None import engine
  from .test_base import EngineTestInterface
  import networkx
label_desc: Use image node_id 10 for calling a global function with example usage: test_itersource_synchronize2_expansion() without return types