def convert_to_index_sliceable(obj, key):
idx = obj.index<EOL>if isinstance(key, slice):<EOL><INDENT>return idx._convert_slice_indexer(key, kind='<STR_LIT>')<EOL><DEDENT>elif isinstance(key, str):<EOL><INDENT>if obj._data.items.contains(key):<EOL><INDENT>return None<EOL><DEDENT>if idx.is_all_dates:<EOL><INDENT>try:<EOL><INDENT>return idx._get_string_slice(key)<EOL><DEDENT>except (KeyError, ValueError, NotImplementedError):<EOL><INDENT>return None<EOL><DEDENT><DEDENT><DEDENT>return None<EOL>
if we are index sliceable, then return my slicer, otherwise return None