code: def _replace_invalid_char_with_underscore(name):
      return re.sub("[^a-zA-Z0-9_]", "_", name)
  
imports: import re
  import warnings
  from collections import OrderedDict
  from coremltools import _logger
  from coremltools.converters.mil.input_types import EnumeratedShapes, ImageType, Shape
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, types
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 2 for calling the NameSanitizer obj's underlying member method code with example usage: obj._replace_invalid_char_with_underscore(name) and returns: re