code: def assert_not_namedtuple(x):
      if (
          isinstance(x, tuple)
          and
          # TODO(b/144192902): Use a namedtuple checking utility.
          hasattr(x, "_fields")
          and isinstance(x._fields, collections.Sequence)
          and all(isinstance(f, six.string_types) for f in x._fields)
      ):
          raise ValueError(
              "Received namedtuple ({}) with fields `{}` as input. namedtuples "
              "cannot, in general, be unambiguously resolved into `x`, `y`, "
              "and `sample_weight`. For this reason Keras has elected not to "
              "support them. If you would like the value to be unpacked, "
              "please explicitly convert it to a tuple before passing it to "
              "Keras.".format(x.__class__, x._fields)
          )
  
imports: import collections
  import functools
  import math
  import typing
  import jax
  import jax.numpy
  import numpy
  import six
  import typing_extensions
  from elegy import types, utils
label_desc: Use image node_id 9 for calling a global function with example usage: assert_not_namedtuple(x) without return types