code: def test_maybe_unwrap_optional(self):
      def assert_unwrapped(query, expected):
          unwrapped, result = pure_typing_utils.maybe_unwrap_optional(
              query
          )
          with self.subTest(f"unwrap_optional({query}) == {expected}"):
              self.assertTrue(unwrapped)
              self.assertEqual(result, expected)
  
      def assert_not_unwrapped(query):
          unwrapped, _ = pure_typing_utils.maybe_unwrap_optional(query)
          with self.subTest(f"{query} is not optional."):
              self.assertFalse(unwrapped)
  
      assert_unwrapped(Optional[int], int)
      assert_unwrapped(Optional[list[int]], list[int])
      assert_unwrapped(
          Optional[list[Optional[int]]], list[Optional[int]]
      )
      assert_unwrapped(Optional[Optional[int]], int)
      assert_unwrapped(Union[str, None], str)
      assert_unwrapped(Union[None, str], str)
      assert_unwrapped(Union[str, None, None], str)
      assert_not_unwrapped(str)
      assert_not_unwrapped(None)
      assert_not_unwrapped(Union[None, None])
      assert_not_unwrapped(Union[list, dict, None])
  
imports: from typing import Optional, Union
  import tensorflow
  from tfx.utils import pure_typing_utils
label_desc: Use image node_id 1 for calling the PureTypingUtilsTest obj's underlying member method code with example usage: obj.test_maybe_unwrap_optional() without return types