code: def _replace_encoding(code, encoding):
      if "." in code:
          langname = code[: code.index(".")]
      else:
          langname = code
      # Convert the encoding to a C lib compatible encoding string
      norm_encoding = encodings.normalize_encoding(encoding)
      # print('norm encoding: %r' % norm_encoding)
      norm_encoding = encodings.aliases.aliases.get(
          norm_encoding.lower(), norm_encoding
      )
      # print('aliased encoding: %r' % norm_encoding)
      encoding = norm_encoding
      norm_encoding = norm_encoding.lower()
      if norm_encoding in locale_encoding_alias:
          encoding = locale_encoding_alias[norm_encoding]
      else:
          norm_encoding = norm_encoding.replace("_", "")
          norm_encoding = norm_encoding.replace("-", "")
          if norm_encoding in locale_encoding_alias:
              encoding = locale_encoding_alias[norm_encoding]
      # print('found encoding %r' % encoding)
      return langname + "." + encoding
  
imports: import sys
  import encodings
  import encodings.aliases
  import re
  import _collections_abc
  from builtins import str
  import functools
label_desc: Use image node_id 17 for calling a global function with example usage: _replace_encoding(code, encoding) and returns: unknown