code: def partition_payload(data, key, thresh):
      
      data = data[key]
      for i in range(0, len(data), thresh):
          yield {key: data[i:i + thresh]}
docs: Yield partitions of a payload
  
      e.g. with a threshold of 2:
  
      { "dataElements": [1, 2, 3] }
      -->
      { "dataElements": [1, 2] }
         and
      { "dataElements": [3] }
  
      :param data: the payload
      :param key: the key of the dict to partition
      :param thresh: the maximum value of a chunk
      :return: a generator where __next__ is a partition of the payload