docstr: Test that `convert_anything_to_df` creates a copy of the original
  dataframe if `ensure_copy` is True.
docstr_tok: ["Test","that","`","convert_anything_to_df","`","creates","a","copy","of","the","original","dataframe","if","`","ensure_copy","`","is","True","."]
code: def test_convert_anything_to_df_ensure_copy(self):
      """Test that `convert_anything_to_df` creates a copy of the original
      dataframe if `ensure_copy` is True.
      """
      orginal_df = pd.DataFrame(
          {
              "integer": [1, 2, 3],
              "float": [1.0, 2.1, 3.2],
              "string": ["foo", "bar", None],
          },
          index=[1.0, "foo", 3],
      )
  
      converted_df = type_util.convert_anything_to_df(
          orginal_df, ensure_copy=True
      )
      # Apply a change
      converted_df["integer"] = [4, 5, 6]
      # Ensure that the original dataframe is not changed
      self.assertEqual(orginal_df["integer"].to_list(), [1, 2, 3])
  
      converted_df = type_util.convert_anything_to_df(
          orginal_df, ensure_copy=False
      )
      # Apply a change
      converted_df["integer"] = [4, 5, 6]
      # The original dataframe should be changed here since ensure_copy is False
      self.assertEqual(orginal_df["integer"].to_list(), [4, 5, 6])
  
imports: import enum
  import unittest
  from collections import namedtuple
  from datetime import date
  from decimal import Decimal
  from typing import Any
  from unittest.mock import patch
  import numpy
  import pandas
  import plotly.graph_objs
  import pytest
  from pandas.api.types import infer_dtype
  from parameterized import parameterized
  from streamlit import errors, type_util
  from streamlit.errors import StreamlitAPIException
  from tests.streamlit.data_mocks import BASE_TYPES_DF, DATETIME_TYPES_DF, INTERVAL_TYPES_DF, LIST_TYPES_DF, NUMBER_TYPES_DF, PERIOD_TYPES_DF, SHARED_TEST_CASES, SPECIAL_TYPES_DF, UNSUPPORTED_TYPES_DF, TestCaseMetadata, TestObject
  from tests.streamlit.snowpark_mocks import DataFrame
  from tests.streamlit.snowpark_mocks import Row
  from tests.testutil import create_snowpark_session, patch_config_options
label_desc: Use image node_id 10 for calling the TypeUtilTest obj's underlying member method code with example usage: obj.test_convert_anything_to_df_ensure_copy() without return types