code: def test_dataset_from_text_keep_in_memory(
      keep_in_memory, text_path, tmp_path
  ):
      cache_dir = tmp_path / "cache"
      expected_features = {"text": "string"}
      with assert_arrow_memory_increases() if keep_in_memory else assert_arrow_memory_doesnt_increase():
          dataset = TextDatasetReader(
              text_path,
              cache_dir=cache_dir,
              keep_in_memory=keep_in_memory,
          ).read()
      _check_text_dataset(dataset, expected_features)
  
file_path: datasets/tests/io/test_text.py
imports: import pytest
  from datasets import Dataset, DatasetDict, Features, NamedSplit, Value
  from datasets.io.text import TextDatasetReader
  from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases
label_desc: Use image node_id 2 for calling a global function with example usage: test_dataset_from_text_keep_in_memory(keep_in_memory, text_path, tmp_path) without return types