code: def _encode_batched_write_command(
          namespace, operation, command, docs, check_keys, opts, ctx):
      
      buf = StringIO()
  
      to_send, _ = _batched_write_command_impl(
          namespace, operation, command, docs, check_keys, opts, ctx, buf)
      return buf.getvalue(), to_send
docs: Encode the next batched insert, update, or delete command.