class_docstr: Test utils.py.
class_docstr_tok: ["Test","utils.py","."]
docstr: Test function _flatten_list.
docstr_tok: ["Test","function","_flatten_list","."]
code: def test_flatten_list(self):
      """Test function _flatten_list."""
      x = ["X1", ["M1", "M2"], "Y1", ["Y2"]]
      fl = _flatten_list(x)
      np.testing.assert_array_equal(fl, ["X1", "M1", "M2", "Y1", "Y2"])
      x = ["Xaa", "Xbb", "Xcc"]
      np.testing.assert_array_equal(_flatten_list(x), x)
      # With tuples
      xt = ["Xaa", ("Xbb", "Xcc")]
      fl = _flatten_list(xt)
      assert fl == xt
      np.testing.assert_array_equal(
          _flatten_list(xt, include_tuple=True), x
      )
      assert _flatten_list(1) == 1  # x is not iterable
      assert _flatten_list([(1), (2)]) == [1, 2]
  
file_path: pingouin/pingouin/tests/test_utils.py
imports: import pandas
  import numpy
  import pytest
  import pingouin
  from unittest import TestCase
  from pingouin.utils import print_table, _postprocess_dataframe, _get_round_setting_for, _perm_pval, _check_eftype, _check_dataframe, remove_na, _flatten_list, _is_sklearn_installed, _is_statsmodels_installed, _is_mpmath_installed
label_desc: Use image node_id 4 for calling the TestUtils obj's underlying member method code with example usage: obj.test_flatten_list() without return types