def _check_expected_dtype(self, obj, label):
if isinstance(obj, pd.Index):<EOL><INDENT>if label == '<STR_LIT:bool>':<EOL><INDENT>assert obj.dtype == '<STR_LIT:object>'<EOL><DEDENT>else:<EOL><INDENT>assert obj.dtype == label<EOL><DEDENT><DEDENT>elif isinstance(obj, pd.Series):<EOL><INDENT>if label.startswith('<STR_LIT>'):<EOL><INDENT>assert obj.dtype == '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>assert obj.dtype == label<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError<EOL><DEDENT>
Check whether obj has expected dtype depending on label
considering not-supported dtypes