code: def test_null_byte_char(request, all_parsers):
      # see gh-2741
      data = "\x00,foo"
      names = ["a", "b"]
      parser = all_parsers
  
      if parser.engine == "c" or (parser.engine == "python" and PY311):
          if parser.engine == "python" and PY311:
              request.applymarker(
                  pytest.mark.xfail(
                      reason="In Python 3.11, this is read as an empty character not null"
                  )
              )
          expected = DataFrame([[np.nan, "foo"]], columns=names)
          out = parser.read_csv(StringIO(data), names=names)
          tm.assert_frame_equal(out, expected)
      else:
          if parser.engine == "pyarrow":
              # CSV parse error: Empty CSV file or block: "
              # cannot infer number of columns"
              pytest.skip(
                  reason="https://github.com/apache/arrow/issues/38676"
              )
          else:
              msg = "NULL byte detected"
          with pytest.raises(ParserError, match=msg):
              parser.read_csv(StringIO(data), names=names)
  
imports: import codecs
  import csv
  from io import StringIO
  import os
  from pathlib import Path
  import numpy
  import pytest
  from pandas.compat import PY311
  from pandas.errors import EmptyDataError, ParserError, ParserWarning
  from pandas import DataFrame
  import pandas._testing
label_desc: Use image node_id 12 for calling a global function with example usage: test_null_byte_char(request, all_parsers) without return types