def _check_setitem_copy(self, stacklevel=<NUM_LIT:4>, t='<STR_LIT>', force=False):
if force or self._is_copy:<EOL><INDENT>value = config.get_option('<STR_LIT>')<EOL>if value is None:<EOL><INDENT>return<EOL><DEDENT>try:<EOL><INDENT>gc.collect(<NUM_LIT:2>)<EOL>if not gc.get_referents(self._is_copy()):<EOL><INDENT>self._is_copy = None<EOL>return<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>if self._is_copy().shape == self.shape:<EOL><INDENT>self._is_copy = None<EOL>return<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>if isinstance(self._is_copy, str):<EOL><INDENT>t = self._is_copy<EOL><DEDENT>elif t == '<STR_LIT>':<EOL><INDENT>t = ("<STR_LIT:\n>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>else:<EOL><INDENT>t = ("<STR_LIT:\n>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if value == '<STR_LIT>':<EOL><INDENT>raise com.SettingWithCopyError(t)<EOL><DEDENT>elif value == '<STR_LIT>':<EOL><INDENT>warnings.warn(t, com.SettingWithCopyWarning,<EOL>stacklevel=stacklevel)<EOL><DEDENT><DEDENT>
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'