code: def run():
      channel = grpc.insecure_channel("127.0.0.1:50051")
      stub = monster_grpc_fb.MonsterStorageStub(channel)
  
      b = flatbuffers.Builder(0)
      name2 = b.CreateString(test_monster_name2)
      name1 = b.CreateString(test_monster_name1)
      Monster.MonsterStart(b)
      Monster.MonsterAddName(b, name2)
      monster2 = Monster.MonsterEnd(b)
      test1 = b.CreateString(test_string)
  
      Monster.MonsterStartInventoryVector(b, len(test_inventory))
      for i in range(0, len(test_inventory)):
          b.PrependByte(test_inventory[i])
      inv = b.EndVector()
  
      Monster.MonsterStartTest4Vector(b, 2)
      Test.CreateTest(b, 10, 20)
      Test.CreateTest(b, 30, 40)
      test4 = b.EndVector()
  
      Monster.MonsterStartTestarrayofstringVector(b, 1)
      b.PrependUOffsetTRelative(test1)
      test_array_of_string = b.EndVector()
  
      Monster.MonsterStart(b)
  
      Monster.MonsterAddHp(b, test_hp)
      Monster.MonsterAddName(b, name1)
      Monster.MonsterAddColor(b, test_color)
      pos = Vec3.CreateVec3(
          b,
          test_X,
          test_Y,
          test_Z,
          test_test1,
          test_color,
          test_a,
          test_b,
      )
      Monster.MonsterAddPos(b, pos)
      Monster.MonsterAddInventory(b, inv)
      Monster.MonsterAddTestType(b, test_testtype)
      Monster.MonsterAddTest(b, monster2)
      Monster.MonsterAddTest4(b, test4)
      Monster.MonsterAddEnemy(b, monster2)
      Monster.MonsterAddTestarrayofstring(b, test_array_of_string)
      monster = Monster.MonsterEnd(b)
  
      b.Finish(monster)
  
      stat_response = stub.Store(bytes(b.Output()))
  
      s = Stat.Stat().GetRootAsStat(stat_response, 0)
  
      assert s.Id().decode("utf-8") == test_stat_id
      assert s.Val() == test_stat_val
      assert s.Count() == test_stat_count
  
      monster_reponses = stub.Retrieve(stat_response)
      count = 0
      for monster_reponse in monster_reponses:
          m = Monster.Monster().GetRootAsMonster(monster_reponse, 0)
          assert (
              m.Name().decode("utf-8")
              == test_monsters_name_retrieve[count]
          )
          count = count + 1
  
file_path: flatbuffers/grpc/tests/grpctest.py
imports: from __future__ import print_function
  import os
  import sys
  import grpc
  import flatbuffers
  from concurrent import futures
  import MyGame.Example.Monster
  import MyGame.Example.Stat
  import MyGame.Example.Vec3
  import MyGame.Example.Test
  import MyGame.Example.monster_test_grpc_fb
label_desc: Use image node_id 2 for calling a global function with example usage: run() without return types