def convert_missing_indexer(indexer):
 if isinstance(indexer, dict):
  indexer = indexer['key']
  if isinstance(indexer, bool):
   raise KeyError('cannot use a single bool to index into setitem')
  return (indexer, True)
 return (indexer, False)

def convert_missing_indexer ( indexer ) : if isinstance ( indexer , dict ) : indexer = indexer [ 'key' ] if isinstance ( indexer , bool ) : raise KeyError ( 'cannot use a single bool to index into setitem' ) return ( indexer , True ) return ( indexer , False )
reverse convert a missing indexer .