def add_docs_batched(config: Config,
                     batch_size: int = read_env_vars_and_defaults_ints(EnvVars.MARQO_MAX_DOCUMENTS_BATCH_SIZE), **kwargs):
    """
    Helper function to batch large add_documents calls in testing
    Default batch size is the default max add docs count env var

    Must be called with raw kwargs (without AddDocsParams), as validation for this class will reject docs with large doc count.
    """
    docs = kwargs["docs"]
    kwargs_without_docs = deepcopy(kwargs)
    del kwargs_without_docs["docs"]

    for i in range(0, len(docs), batch_size):
        config.document.add_documents(add_docs_params=AddDocsParams(docs=docs[i:i+batch_size], **kwargs_without_docs))

    Helper function to batch large add_documents calls in testing
    Default batch size is the default max add docs count env var

    Must be called with raw kwargs (without AddDocsParams), as validation for this class will reject docs with large doc count.
    
tests/integ_tests/utils/transition.py