code: def test_from_pandas(self):
      pdf = pd.DataFrame(
          {"year": [2015, 2016], "month": [2, 3], "day": [4, 5]}
      )
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(psdf, pdf)
  
      pser = pdf.year
      psser = ps.from_pandas(pser)
  
      self.assert_eq(psser, pser)
  
      pidx = pdf.index
      psidx = ps.from_pandas(pidx)
  
      self.assert_eq(psidx, pidx)
  
      pmidx = pdf.set_index("year", append=True).index
      psmidx = ps.from_pandas(pmidx)
  
      self.assert_eq(psmidx, pmidx)
  
      expected_error_message = "Unknown data type: {}".format(
          type(psidx).__name__
      )
      with self.assertRaisesRegex(TypeError, expected_error_message):
          ps.from_pandas(psidx)
  
imports: import itertools
  import inspect
  import pandas
  import numpy
  from pyspark import pandas
  from pyspark.pandas.exceptions import PandasNotImplementedError
  from pyspark.pandas.namespace import _get_index_map, read_delta
  from pyspark.pandas.utils import spark_column_equals
  from pyspark.pandas.missing.general_functions import MissingPandasLikeGeneralFunctions
  from pyspark.testing.pandasutils import PandasOnSparkTestCase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 1 for calling the NamespaceTestsMixin obj's underlying member method code with example usage: obj.test_from_pandas() without return types