code: def test_tr_flex_list(self):
      expected = []
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected), expected
      )
  
      # test int list
      expected = [1, 2, 3, 4, 5, None]
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected), expected
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, int), expected
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, int, ignore_cast_failure=True),
          expected,
      )
  
      # test datetime list
      from_zone = GMT(0)
      to_zone = GMT(4.5)
      d1 = dt.datetime(2010, 10, 10, 10, 10, 10).replace(
          tzinfo=from_zone
      )
      d2 = d1.astimezone(to_zone)
      expected = [d1, d2, None]
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected), expected
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, dt.datetime), expected
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(
              expected, dt.datetime, ignore_cast_failure=True
          ),
          expected,
      )
      # test image list
      img_gray_auto_png = image.Image(
          current_file_dir + "/images/nested/sample_grey.png"
      )
      img_color_jpg = image.Image(
          current_file_dir + "/images/sample.jpg", "JPG"
      )
      expected = [img_gray_auto_png, img_color_jpg, None]
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected), expected
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, image.Image), expected
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(
              expected, image.Image, ignore_cast_failure=True
          ),
          expected,
      )
      # test str list
      expected = ["a", "b", "c", None]
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected), expected
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, str), expected
      )
  
      # test array list
      expected = [
          array.array("d", range(5)),
          array.array("d", range(5)),
          None,
      ]
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected), expected
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, array.array), expected
      )
      expected = [[float(i) for i in range(5)], range(5), None]
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected),
          [
              array.array("d", range(5)),
              array.array("d", range(5)),
              None,
          ],
      )
  
      # test int array
      expected = array.array("d", range(5))
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected), list(range(5))
      )
  
      expected = [
          1,
          1.0,
          "1",
          [1.0, 1.0, 1.0],
          ["a", "b", "c"],
          {},
          {"a": 1},
          None,
      ]
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, int, ignore_cast_failure=True),
          [1, 1, None],
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, float, ignore_cast_failure=True),
          [1.0, 1.0, None],
      )
      # Anything can be cast to a string
      # self.assert_equal_with_lambda_check(_tr_flex_list(expected, str, ignore_cast_failure=True), ['1', '1', None])
      self.assert_equal_with_lambda_check(
          _tr_flex_list(
              expected, array.array, ignore_cast_failure=True
          ),
          [array.array("d", [1.0, 1.0, 1.0]), None],
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, list, ignore_cast_failure=True),
          [[1.0, 1.0, 1.0], ["a", "b", "c"], None],
      )
      self.assert_equal_with_lambda_check(
          _tr_flex_list(expected, dict, ignore_cast_failure=True),
          [{}, {"a": 1}, None],
      )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import numpy
  from numpy import nan
  import array
  import datetime
  from ..data_structures import image
  from ..None import SArray
  import os
  from .._cython.cy_flexible_type import _translate_through_flexible_type
  from .._cython.cy_flexible_type import _translate_through_flex_list
  from .._cython.cy_flexible_type import infer_type_of_list
  from .._cython.cy_flexible_type import _get_inferred_column_type, _all_convertable
  from .._cython.cy_flexible_type import _check_ft_pyobject_hint_path
  from .._cython.cy_flexible_type import pytype_from_type_name
  from .._cython.cy_flexible_type import GMT
  import datetime
  from itertools import product
  from copy import copy
  import pytest
  import sys
label_desc: Use image node_id 12 for calling the FlexibleTypeTest obj's underlying member method code with example usage: obj.test_tr_flex_list() without return types