code: def _invert_normalize_polygons_and_line_strings(
      inputs,
      inputs_old,
      estimate_ntype_func,
      cls_single_name,
      cls_oi_name,
      get_entities_func,
      get_points_func,
  ):
      # TODO get rid of this deferred import
      from imgaug.augmentables.kps import Keypoint
  
      ntype = estimate_ntype_func(inputs_old)
      if ntype == "None":
          assert inputs is None, (
              "Expected (normalized) polygons/line strings to be None due "
              "(unnormalized) polygons/line strings being None. Got type %s "
              "instead." % (type(inputs),)
          )
          return inputs
      if ntype in ["array[float]", "array[int]", "array[uint]"]:
          input_dtype = inputs_old.dtype
          return restore_dtype_and_merge(
              [
                  [
                      get_points_func(entity)
                      for entity in get_entities_func(oi)
                  ]
                  for oi in inputs
              ],
              input_dtype,
          )
      if ntype == cls_single_name:
          assert len(inputs) == 1, (
              "Expected a single %s instance after normalization "
              "due to getting a single %s before normalization. "
              "Got %d instances instead."
              % (
                  cls_oi_name,
                  cls_single_name,
                  len(inputs),
              )
          )
          assert len(get_entities_func(inputs[0])) == 1, (
              "Expected a %s instance containing a single "
              "%s after normalization due to getting a single %s "
              "before normalization. Got %d instances instead."
              % (
                  cls_oi_name,
                  cls_single_name,
                  cls_single_name,
                  len(get_entities_func(inputs[0])),
              )
          )
          return get_entities_func(inputs[0])[0]
      if ntype == cls_oi_name:
          assert len(inputs) == 1, (
              "Expected a single %s instance after normalization "
              "due to getting a single %s before normalization. "
              "Got %d instances instead."
              % (
                  cls_oi_name,
                  cls_oi_name,
                  len(inputs),
              )
          )
          return inputs[0]
      if ntype == "iterable[empty]":
          assert inputs is None, (
              "Expected polygons/line strings after normalization to be None, "
              "due to the polygons/line strings before normalization being an "
              "empty iterable. Got type %s instead." % (type(inputs),)
          )
          return []
      if ntype in [
          "iterable-array[float]",
          "iterable-array[int]",
          "iterable-array[uint]",
      ]:
          nonempty, _, _ = find_first_nonempty(inputs_old)
          input_dtype = nonempty.dtype
          return [
              restore_dtype_and_merge(
                  [
                      get_points_func(entity)
                      for entity in get_entities_func(oi)
                  ],
                  input_dtype,
              )
              for oi in inputs
          ]
      if ntype == "iterable-tuple[number,size=2]":
          assert len(inputs) == 1, (
              "Expected a single %s instance after normalization "
              "due to getting an iterable of (x,y) tuples before "
              "normalization. Got %d instances instead."
              % (
                  cls_oi_name,
                  len(inputs),
              )
          )
          assert len(get_entities_func(inputs[0])) == 1, (
              "Expected a %s instance after normalization "
              "containing a single %s instance due to getting an iterable "
              "of (x,y) tuples before normalization. "
              "Got a %s with %d %s instances instead."
              % (
                  cls_oi_name,
                  cls_single_name,
                  cls_oi_name,
                  cls_single_name,
                  len(inputs),
              )
          )
          return [
              (point[0], point[1])
              for point in get_points_func(
                  get_entities_func(inputs[0])[0]
              )
          ]
      if ntype == "iterable-Keypoint":
          assert len(inputs) == 1, (
              "Expected a single %s instance after normalization "
              "due to getting an iterable of Keypoint before "
              "normalization. Got %d instances instead."
              % (
                  cls_oi_name,
                  len(inputs),
              )
          )
          assert len(get_entities_func(inputs[0])) == 1, (
              "Expected a %s instance after normalization "
              "containing a single %s instance due to getting an iterable "
              "of Keypoint before normalization. "
              "Got a %s with %d %s instances instead."
              % (
                  cls_oi_name,
                  cls_single_name,
                  cls_oi_name,
                  cls_single_name,
                  len(inputs),
              )
          )
          return [
              Keypoint(x=point[0], y=point[1])
              for point in get_points_func(
                  get_entities_func(inputs[0])[0]
              )
          ]
      if ntype == ("iterable-%s" % (cls_single_name,)):
          assert len(inputs) == 1, (
              "Expected a single %s instance after normalization "
              "due to getting an iterable of %s before "
              "normalization. Got %d instances instead."
              % (
                  cls_oi_name,
                  cls_single_name,
                  len(inputs),
              )
          )
          assert len(get_entities_func(inputs[0])) == len(inputs_old), (
              "Expected a %s instance after normalization "
              "containing a single %s instance due to getting an iterable "
              "of %s before normalization. "
              "Got a %s with %d %s instances instead."
              % (
                  cls_oi_name,
                  cls_single_name,
                  cls_single_name,
                  cls_oi_name,
                  cls_single_name,
                  len(inputs),
              )
          )
          return get_entities_func(inputs[0])
      if ntype == ("iterable-%s" % (cls_oi_name,)):
          return inputs
      if ntype == "iterable-iterable[empty]":
          assert inputs is None, (
              "Expected polygons/line strings after normalization to be None, "
              "due to the polygons/line strings before normalization being an "
              "empty iterable of iterables. Got type %s instead."
              % (type(inputs),)
          )
          return inputs_old[:]
      if ntype in [
          "iterable-iterable-array[float]",
          "iterable-iterable-array[int]",
          "iterable-iterable-array[uint]",
      ]:
          nonempty, _, _ = find_first_nonempty(inputs_old)
          input_dtype = nonempty.dtype
          return [
              [
                  restore_dtype_and_merge(
                      get_points_func(entity), input_dtype
                  )
                  for entity in get_entities_func(oi)
              ]
              for oi in inputs
          ]
      if ntype == "iterable-iterable-tuple[number,size=2]":
          assert len(inputs) == 1, (
              "Expected a single %s instance after normalization "
              "due to getting an iterable of iterables of (x,y) tuples before "
              "normalization. Got %d instances instead."
              % (
                  cls_oi_name,
                  len(inputs),
              )
          )
          return [
              [
                  (point[0], point[1])
                  for point in get_points_func(entity)
              ]
              for entity in get_entities_func(inputs[0])
          ]
      if ntype == "iterable-iterable-Keypoint":
          assert len(inputs) == 1, (
              "Expected a single %s instance after normalization "
              "due to getting an iterable of iterables of Keypoint before "
              "normalization. Got %d instances instead."
              % (
                  cls_oi_name,
                  len(inputs),
              )
          )
          return [
              [
                  Keypoint(x=point[0], y=point[1])
                  for point in get_points_func(entity)
              ]
              for entity in get_entities_func(inputs[0])
          ]
      if ntype == ("iterable-iterable-%s" % (cls_single_name,)):
          return [get_entities_func(oi) for oi in inputs]
      if ntype == "iterable-iterable-iterable[empty]":
          return inputs_old[:]
      if ntype == "iterable-iterable-iterable-tuple[number,size=2]":
          return [
              [
                  [
                      (point[0], point[1])
                      for point in get_points_func(entity)
                  ]
                  for entity in get_entities_func(oi)
              ]
              for oi in inputs
          ]
  
      assert (
          ntype == "iterable-iterable-iterable-Keypoint"
      ), "Got unknown normalization type '%s'." % (ntype,)
      return [
          [
              [
                  Keypoint(x=point[0], y=point[1])
                  for point in get_points_func(entity)
              ]
              for entity in get_entities_func(oi)
          ]
          for oi in inputs
      ]
  
imports: from __future__ import print_function, division, absolute_import
  import functools
  import numpy
  from ..None import imgaug
  from ..None import dtypes
  from .base import IAugmentable
label_desc: Use image node_id 22 for calling a global function with example usage: _invert_normalize_polygons_and_line_strings(inputs, inputs_old, estimate_ntype_func, cls_single_name, cls_oi_name, get_entities_func, get_points_func) and returns: unknown, inputs, restore_dtype_and_merge, get_entities_func, inputs, list, unknown, unknown, unknown, get_entities_func, inputs, inputs_old, unknown, unknown, unknown, unknown, inputs_old, unknown