code: def test_check_restructuredtext_with_syntax_highlight(self):
      # Don't fail if there is a `code` or `code-block` directive
  
      example_rst_docs = []
      example_rst_docs.append(
          textwrap.dedent(
              """\
              Here's some code:
  
              .. code:: python
  
                  def foo():
                      pass
              """
          )
      )
      example_rst_docs.append(
          textwrap.dedent(
              """\
              Here's some code:
  
              .. code-block:: python
  
                  def foo():
                      pass
              """
          )
      )
  
      for rest_with_code in example_rst_docs:
          pkg_info, dist = self.create_dist(
              long_description=rest_with_code
          )
          cmd = check(dist)
          cmd.check_restructuredtext()
          msgs = cmd._check_rst_data(rest_with_code)
          if pygments is not None:
              self.assertEqual(len(msgs), 0)
          else:
              self.assertEqual(len(msgs), 1)
              self.assertEqual(
                  str(msgs[0][1]),
                  "Cannot analyze code. Pygments package not found.",
              )
  
file_path: catboost/contrib/tools/python/src/Lib/distutils/tests/test_check.py
imports: import textwrap
  import unittest
  from test.test_support import run_unittest
  from distutils.command.check import check, HAS_DOCUTILS
  from distutils.tests import support
  from distutils.errors import DistutilsSetupError
label_desc: Use image node_id 5 for calling the CheckTestCase obj's underlying member method code with example usage: obj.test_check_restructuredtext_with_syntax_highlight() without return types