code: def generate_random_dag(node, max_rounds=40):
      random.seed(42)
  
      max_inputs = int(max_rounds**0.5)
      nodes = [node.bind("start")]
      for _ in range(max_rounds):
          n_samples = random.randint(1, min(len(nodes), max_inputs))
          inputs = random.sample(nodes, n_samples)
          nodes.append(node.bind(*inputs))
      return nodes[-1]
  
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 4 for calling a global function with example usage: generate_random_dag(node, max_rounds) and returns: nodes