<commit_before>from django.db import models
from .helper import bulk_update


class BulkUpdateManager(models.Manager):
    def bulk_update(self, objs, update_fields=None,
                    exclude_fields=None, batch_size=None):
        return bulk_update(
            objs, update_fields=update_fields,
            exclude_fields=exclude_fields, using=self.db,
            batch_size=batch_size)
<commit_msg>[#47] Fix that makes the manager work for using() and read/write router scenarios<commit_after>from django.db import models
from django.db.models.manager import BaseManager
from .helper import bulk_update


class BulkUpdateQuerySet(models.QuerySet):
    def bulk_update(self, objs, update_fields=None, exclude_fields=None):
        self._for_write = True
        bulk_update(objs, update_fields=update_fields,
                    exclude_fields=exclude_fields, using=self.db)


class BulkUpdateManager(BaseManager.from_queryset(BulkUpdateQuerySet)):
    pass

{'fraction_non_alphanumeric': 0.07533539731682147, 'fraction_numerical': 0.0020639834881320948, 'mean_word_length': 3.9238578680203045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1512337', 'n_tokens_mistral': 280, 'n_tokens_neox': 271, 'n_words': 63}