code: def random_walk(network):
      
      latest = network.latest_transmission_recipient()
  
      if (not network.transmissions() or latest is None):
          sender = random.choice(network.nodes(type=Source))
      else:
          sender = latest
  
      receiver = random.choice(sender.neighbors(direction="to", type=Agent))
  
      sender.transmit(to_whom=receiver)
docs: Take a random walk from a source.
  
      Start at a node randomly selected from those that receive input from a
      source. At each step, transmit to a randomly-selected downstream node.