def _add_to_batch(self, partition_key, row_key, request):
<EOL>if self._partition_key:<EOL><INDENT>if self._partition_key != partition_key:<EOL><INDENT>raise AzureBatchValidationError(_ERROR_INCORRECT_PARTITION_KEY_IN_BATCH)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._partition_key = partition_key<EOL><DEDENT>if row_key in self._row_keys:<EOL><INDENT>raise AzureBatchValidationError(_ERROR_DUPLICATE_ROW_KEY_IN_BATCH)<EOL><DEDENT>else:<EOL><INDENT>self._row_keys.append(row_key)<EOL><DEDENT>if len(self._requests) >= <NUM_LIT:100>:<EOL><INDENT>raise AzureBatchValidationError(_ERROR_TOO_MANY_ENTITIES_IN_BATCH)<EOL><DEDENT>self._requests.append((row_key, request))<EOL>
Validates batch-specific rules.

:param str partition_key:
    PartitionKey of the entity.
:param str row_key:
    RowKey of the entity.
:param request:
    the request to insert, update or delete entity