code: def _validate_shebang(shebang, encoding):
      # Python parser starts to read a script using UTF-8 until
      # it gets a #coding:xxx cookie. The shebang has to be the
      # first line of a file, the #coding:xxx cookie cannot be
      # written before. So the shebang has to be encodable to
      # UTF-8.
      try:
          shebang.encode("utf-8")
      except UnicodeEncodeError:
          raise ValueError(
              "The shebang ({!r}) is not encodable "
              "to utf-8".format(shebang)
          )
  
      # If the script is encoded to a custom encoding (use a
      # #coding:xxx cookie), the shebang has to be encodable to
      # the script encoding too.
      try:
          shebang.encode(encoding)
      except UnicodeEncodeError:
          raise ValueError(
              "The shebang ({!r}) is not encodable "
              "to the script encoding ({})".format(shebang, encoding)
          )
  
file_path: catboost/contrib/python/setuptools/py3/setuptools/_distutils/command/build_scripts.py
imports: import os
  import re
  from stat import ST_MODE
  from distutils import sysconfig
  from ..core import Command
  from .._modified import newer
  from ..util import convert_path
  from distutils._log import log
  import tokenize
label_desc: Use image node_id 9 for calling the build_scripts obj's underlying member method code with example usage: obj._validate_shebang(shebang, encoding) without return types