input: Write a function to simulate a vending machine process.
  assert vending_machine_process([("insert_coin", 100), ("add_item", "soda", 50), ("purchase_item", "soda"), ("return_change")]) == 50
  assert vending_machine_process([("insert_coin", 200), ("add_item", "chips", 75), ("add_item", "candy", 25), ("purchase_item", "chips"), ("purchase_item", "candy"), ("return_change")]) == 100
  assert vending_machine_process([("insert_coin", 150), ("add_item", "water", 100), ("purchase_item", "water"), ("return_change")]) == 50
output: def vending_machine_process(actions):
      balance = 0
      inventory = {}
  
      for action in actions:
          if action[0] == "insert_coin":
              balance += action[1]
          elif action[0] == "add_item":
              inventory[action[1]] = action[2]
          elif action[0] == "purchase_item":
              item = action[1]
              if item in inventory and balance >= inventory[item]:
                  balance -= inventory[item]
                  del inventory[item]
          elif action[0] == "return_change":
              return balance