code: def test_memory_warning(
      capsys, monkeypatch, split_builder: split_builder_lib.SplitBuilder
  ):
      def mock_psutil_virtual_memory():
          MockData = collections.namedtuple("MockData", ["total"])
          return MockData(total=0)
  
      monkeypatch.setattr(
          psutil, "virtual_memory", mock_psutil_virtual_memory
      )
      monkeypatch.setattr("sys.stdin", io.StringIO("n\n"))
  
      with pytest.raises(SystemExit) as pytest_wrapped_e:
          with split_builder.maybe_beam_pipeline():
              _ = split_builder.beam_pipeline
  
      assert pytest_wrapped_e.type == SystemExit
      assert pytest_wrapped_e.value.code == 1
  
      captured = capsys.readouterr()
      assert "Continue?" in captured.out
  
file_path: datasets/tensorflow_datasets/core/split_builder_test.py
imports: import collections
  import io
  import os
  import pathlib
  import apache_beam
  import psutil
  import pytest
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import split_builder
label_desc: Use image node_id 4 for calling a global function with example usage: test_memory_warning(capsys, monkeypatch, split_builder) and returns: MockData