code: def test_optim_level(self):
      # CPython: check that Py_Main() doesn't increment Py_OptimizeFlag
      # twice when -X utf8 requires to parse the configuration twice (when
      # the encoding changes after reading the configuration, the
      # configuration is read again with the new encoding).
      code = "import sys; print(sys.flags.optimize)"
      out = self.get_output("-X", "utf8", "-O", "-c", code)
      self.assertEqual(out, "1")
      out = self.get_output("-X", "utf8", "-OO", "-c", code)
      self.assertEqual(out, "2")
  
      code = "import sys; print(sys.flags.ignore_environment)"
      out = self.get_output("-X", "utf8", "-E", "-c", code)
      self.assertEqual(out, "1")
  
imports: import locale
  import subprocess
  import sys
  import textwrap
  import unittest
  from test import support
  from test.support.script_helper import assert_python_ok, assert_python_failure
  from test.support import os_helper, MS_WINDOWS
label_desc: Use image node_id 15 for calling the UTF8ModeTests obj's underlying member method code with example usage: obj.test_optim_level() without return types