code: def _compress_for_consolidate(max_vol, plan, **kwargs):
      
      target = None
      new_target = None
      d_vol = 0
      temp_aspirates = []
      new_transfer_plan = []
  
      def _append_aspirates():
          nonlocal d_vol, temp_aspirates, new_transfer_plan, target
          if not temp_aspirates:
              return
          for a in temp_aspirates:
              new_transfer_plan.append({
                  'aspirate': {
                      'location': a['location'], 'volume': a['volume']
                  }
              })
          new_transfer_plan.append({
              'dispense': {
                  'location': target, 'volume': d_vol
              }
          })
          d_vol = 0
          temp_aspirates = []
  
      for i, p in enumerate(plan):
          this_vol = p['aspirate']['volume']
          new_target = p['dispense']['location']
          if (new_target is not target) or (this_vol + d_vol > max_vol):
              _append_aspirates()
          target = new_target
          d_vol += this_vol
          temp_aspirates.append(p['aspirate'])
      _append_aspirates()
      return new_transfer_plan
docs: Combines as many aspirates as can fit within the maximum volume