code: def random_targets(num_targets, src_dir):
      gen = GenRandom(src_dir)
  
      # N-1 static libraries, and 1 executable depending on all of them.
      targets = [Target(gen, LIB) for i in range(num_targets - 1)]
      for i in range(len(targets)):
          targets[i].deps = [
              t for t in targets[0:i] if random.random() < 0.05
          ]
  
      last_target = Target(gen, EXE)
      last_target.deps = targets[:]
      last_target.src_obj_pairs = last_target.src_obj_pairs[
          0:10
      ]  # Trim.
      targets.append(last_target)
      return targets
  
imports: import argparse
  import contextlib
  import os
  import random
  import sys
  import ninja_syntax
label_desc: Use image node_id 7 for calling a global function with example usage: random_targets(num_targets, src_dir) and returns: targets