def _check_setitem_copy(self, stacklevel=4, t='setting', force=False):
    "\n\n        Parameters\n        ----------\n        stacklevel : integer, default 4\n           the level to show of the stack when the error is output\n        t : string, the type of setting error\n        force : boolean, default False\n           if True, then force showing an error\n\n        validate if we are doing a settitem on a chained copy.\n\n        If you call this function, be sure to set the stacklevel such that the\n        user will see the error *at the level of setting*\n\n        It is technically possible to figure out that we are setting on\n        a copy even WITH a multi-dtyped pandas object. In other words, some\n        blocks may be views while other are not. Currently _is_view will ALWAYS\n        return False for multi-blocks to avoid having to handle this case.\n\n        df = DataFrame(np.arange(0,9), columns=['count'])\n        df['group'] = 'b'\n\n        # This technically need not raise SettingWithCopy if both are view\n        # (which is not # generally guaranteed but is usually True.  However,\n        # this is in general not a good practice and we recommend using .loc.\n        df.iloc[0:5]['group'] = 'a'\n\n        "
    if (force or self._is_copy):
        value = config.get_option('mode.chained_assignment')
        if (value is None):
            return
        try:
            gc.collect(2)
            if (not gc.get_referents(self._is_copy())):
                self._is_copy = None
                return
        except Exception:
            pass
        try:
            if (self._is_copy().shape == self.shape):
                self._is_copy = None
                return
        except Exception:
            pass
        if isinstance(self._is_copy, string_types):
            t = self._is_copy
        elif (t == 'referant'):
            t = '\nA value is trying to be set on a copy of a slice from a DataFrame\n\nSee the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy'
        else:
            t = '\nA value is trying to be set on a copy of a slice from a DataFrame.\nTry using .loc[row_indexer,col_indexer] = value instead\n\nSee the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy'
        if (value == 'raise'):
            raise com.SettingWithCopyError(t)
        elif (value == 'warn'):
            warnings.warn(t, com.SettingWithCopyWarning, stacklevel=stacklevel)
Parameters
----------
stacklevel : integer, default 4
   the level to show of the stack when the error is output
t : string, the type of setting error
force : boolean, default False
   if True, then force showing an error

validate if we are doing a settitem on a chained copy.

If you call this function, be sure to set the stacklevel such that the
user will see the error *at the level of setting*

It is technically possible to figure out that we are setting on
a copy even WITH a multi-dtyped pandas object. In other words, some
blocks may be views while other are not. Currently _is_view will ALWAYS
return False for multi-blocks to avoid having to handle this case.

df = DataFrame(np.arange(0,9), columns=['count'])
df['group'] = 'b'

# This technically need not raise SettingWithCopy if both are view
# (which is not # generally guaranteed but is usually True.  However,
# this is in general not a good practice and we recommend using .loc.
df.iloc[0:5]['group'] = 'a'
def _check_setitem_copy(self, stacklevel=4, t='setting', force=False):
    "\n\n        Parameters\n        ----------\n        stacklevel : integer, default 4\n           the level to show of the stack when the error is output\n        t : string, the type of setting error\n        force : boolean, default False\n           if True, then force showing an error\n\n        validate if we are doing a settitem on a chained copy.\n\n        If you call this function, be sure to set the stacklevel such that the\n        user will see the error *at the level of setting*\n\n        It is technically possible to figure out that we are setting on\n        a copy even WITH a multi-dtyped pandas object. In other words, some\n        blocks may be views while other are not. Currently _is_view will ALWAYS\n        return False for multi-blocks to avoid having to handle this case.\n\n        df = DataFrame(np.arange(0,9), columns=['count'])\n        df['group'] = 'b'\n\n        # This technically need not raise SettingWithCopy if both are view\n        # (which is not # generally guaranteed but is usually True.  However,\n        # this is in general not a good practice and we recommend using .loc.\n        df.iloc[0:5]['group'] = 'a'\n\n        "
    if (force or self._is_copy):
        value = config.get_option('mode.chained_assignment')
        if (value is None):
            return
        try:
            gc.collect(2)
            if (not gc.get_referents(self._is_copy())):
                self._is_copy = None
                return
        except Exception:
            pass
        try:
            if (self._is_copy().shape == self.shape):
                self._is_copy = None
                return
        except Exception:
            pass
        if isinstance(self._is_copy, string_types):
            t = self._is_copy
        elif (t == 'referant'):
            t = '\nA value is trying to be set on a copy of a slice from a DataFrame\n\nSee the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy'
        else:
            t = '\nA value is trying to be set on a copy of a slice from a DataFrame.\nTry using .loc[row_indexer,col_indexer] = value instead\n\nSee the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy'
        if (value == 'raise'):
            raise com.SettingWithCopyError(t)
        elif (value == 'warn'):
            warnings.warn(t, com.SettingWithCopyWarning, stacklevel=stacklevel)