class_docstr: Accessor to ``sklearn.cluster``.
class_docstr_tok: ["Accessor","to","``","sklearn.cluster","``","."]
code: def _maybe_target_series(self, value, key):
      if value is None:
          if not self._df.has_target():
              msg = (
                  "{key} can't be ommitted when ModelFrame doesn't have "
                  "target column"
              )
              raise ValueError(msg.format(key=key))
          elif self._df.has_multi_targets():
              msg = (
                  "{key} can't be ommitted when ModelFrame has multiple "
                  "target columns"
              )
              raise ValueError(msg.format(key=key))
          value = self._df.target
  
      elif not pd.api.types.is_list_like(value):
          value = self._df[value]
      return value
  
imports: import pandas
  from pandas_ml.core.accessor import _AccessorMethods, _attach_methods
label_desc: Use image node_id 2 for calling the SeabornMethods obj's underlying member method code with example usage: obj._maybe_target_series(value, key) and returns: value