code: def normalize_utf8_with_offsets_map(
      input, normalization_form="NFKC", name=None
  ):
      r"""Normalizes each UTF-8 string in the input tensor using the specified rule.
  
      Returns normalized strings and an offset map used by another operation to map
      post-normalized string offsets to pre-normalized string offsets.
  
      See http://unicode.org/reports/tr15/
  
      #### Examples:
  
      >>> # input: <string>[num_strings]
      >>> normalize_utf8_with_offsets_map(["株式会社", "ＫＡＤＯＫＡＷＡ"])
      >>> # output: <string>[num_strings], <variant>[num_strings]
      NormalizeUTF8WithOffsetsMap(output=<tf.Tensor: shape=(2,), dtype=string,
      numpy=
      array([b'\xe6\xa0\xaa\xe5\xbc\x8f\xe4\xbc\x9a\xe7\xa4\xbe', b'KADOKAWA'],
            dtype=object)>, offsets_map=<tf.Tensor: shape=(2,), dtype=variant,
            numpy=<unprintable>>)
  
      Args:
        input: A `Tensor` or `RaggedTensor` of type string. (Must be UTF-8.)
        normalization_form: One of the following string values ('NFC', 'NFKC',
          'NFD', 'NFKD'). Default is 'NFKC'. NOTE: `NFD` and `NFKD` for
          `normalize_utf8_with_offsets_map` will not be available until the
          tf.text release w/ ICU 69 (scheduled after 4/2021).
        name: The name for this op (optional).
  
      Returns:
        A tuple of (results, offsets_map) where:
  
        results: A `Tensor` or `RaggedTensor` of type string, with normalized
          contents.
        offsets_map: A `Tensor` or `RaggedTensor` of type `variant`, used to map
          the post-normalized string offsets to pre-normalized string offsets. It
          has the same shape as the results tensor. offsets_map is an input to
          `find_source_offsets` op.
      """
      with ops.name_scope(name, "NormalizeUTF8WithOffsets", [input]):
          input_tensor = (
              ragged_tensor.convert_to_tensor_or_ragged_tensor(
                  input, dtype=dtypes.string
              )
          )
          if ragged_tensor.is_ragged(input_tensor):
              (
                  result,
                  offsets_map,
              ) = gen_normalize_ops.normalize_utf8_with_offsets_map(
                  input_tensor.flat_values, normalization_form
              )
              return input_tensor.with_flat_values(
                  result
              ), input_tensor.with_flat_values(offsets_map)
          else:
              return gen_normalize_ops.normalize_utf8_with_offsets_map(
                  input_tensor, normalization_form
              )
  
file_path: text/tensorflow_text/python/ops/normalize_ops.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops.ragged import ragged_conversion_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.framework import load_library
  from tensorflow.python.platform import resource_loader
label_desc: Use image node_id 3 for calling a global function with example usage: normalize_utf8_with_offsets_map(input, normalization_form, name) and returns: input_tensor,  input_tensor, gen_normalize_ops