def convert_to_index_sliceable(obj, key):
 idx = obj.index
 if isinstance(key, slice):
  return idx._convert_slice_indexer(key, kind='getitem')
 elif isinstance(key, compat.string_types):
  if (key in obj._data.items):
   return None
  if idx.is_all_dates:
   try:
    return idx._get_string_slice(key)
   except (KeyError, ValueError, NotImplementedError):
    return None
 return None

def convert_to_index_sliceable ( obj , key ) : idx = obj . index if isinstance ( key , slice ) : return idx . _convert_slice_indexer ( key , kind = 'getitem' ) elif isinstance ( key , compat . string_types ) : if ( key in obj . _data . items ) : return None if idx . is_all_dates : try : return idx . _get_string_slice ( key ) except ( KeyError , ValueError , NotImplementedError ) : return None return None
if we are index sliceable .