code: def test_finalize_options(self):
      pkg_dir, dist = self.create_dist()
      cmd = install_lib(dist)
  
      cmd.finalize_options()
      self.assertEqual(cmd.compile, 1)
      self.assertEqual(cmd.optimize, 0)
  
      # optimize must be 0, 1, or 2
      cmd.optimize = "foo"
      self.assertRaises(DistutilsOptionError, cmd.finalize_options)
      cmd.optimize = "4"
      self.assertRaises(DistutilsOptionError, cmd.finalize_options)
  
      cmd.optimize = "2"
      cmd.finalize_options()
      self.assertEqual(cmd.optimize, 2)
  
file_path: catboost/contrib/tools/python/src/Lib/distutils/tests/test_install_lib.py
imports: import os
  import sys
  import unittest
  from distutils.command.install_lib import install_lib
  from distutils.extension import Extension
  from distutils.tests import support
  from distutils.errors import DistutilsOptionError
  from test.test_support import run_unittest
label_desc: Use image node_id 1 for calling the InstallLibTestCase obj's underlying member method code with example usage: obj.test_finalize_options() without return types