code: def generate_layered_dag(node, width=5, layers=5):
      random.seed(42)
  
      nodes = [node.bind(f"start_{i}") for i in range(layers)]
      for _ in range(layers - 1):
          new_nodes = []
          for j in range(width):
              random.shuffle(nodes)
              new_nodes.append(node.bind(*nodes))
          nodes = new_nodes
      return node.bind(*nodes)
  
file_path: ray/python/ray/workflow/tests/test_complex_workflow.py
imports: import pytest
  import random
  import ray
  from ray import workflow
label_desc: Use image node_id 5 for calling a global function with example usage: generate_layered_dag(node, width, layers) and returns: node