code: def make_multiple_message_benchmark(get_view):
      class AsyncMessagesSuite:
          param_names = ["Number of engines", "number_of_messages"]
          timer = timeit.default_timer
          timeout = 180
          params = [engines, number_of_messages]
  
          view = None
          client = None
          reply = None
  
          def setup(self, number_of_engines, number_of_messages):
              self.client = ipp.Client(profile="asv")
              self.view = get_view(self)
              self.view.targets = list(range(number_of_engines))
  
              wait_for(lambda: len(self.client) >= number_of_engines)
  
          def time_async_messages(
              self, number_of_engines, number_of_messages
          ):
              replies = []
              for i in range(number_of_messages):
                  reply = self.view.apply_async(
                      echo, np.array([0] * 1000, dtype=np.int8)
                  )
                  replies.append(reply)
              for reply in replies:
                  reply.get()
  
          def teardown(self, *args):
              if self.client:
                  self.client.close()
  
      return AsyncMessagesSuite
  
imports: import os
  import time
  import timeit
  import numpy
  import ipyparallel
label_desc: Use image node_id 4 for calling a global function with example usage: make_multiple_message_benchmark(get_view) and returns: AsyncMessagesSuite