code: def _fit(self, df: pd.DataFrame) -> None:
      if isinstance(df, pd.DataFrame):
          if df.columns.duplicated().any():
              raise ValueError(
                  "Input DataFrame must have unique column names."
              )
          df_copy = df.copy()
          self._fit_core(df_copy)
      else:
          raise TypeError("Input must be a pandas DataFrame.")
      self._cols = list(df.columns)
      self._fitted = 1
  
imports: from abc import ABC, abstractmethod
  from copy import deepcopy
  from typing import Any, Dict, List, Tuple, Union
  import pandas
label_desc: Use image node_id 2 for calling the _TrainableMultivariateModel obj's underlying member method code with example usage: obj._fit(df) without return types