def is_special_slice(key):
 if isinstance(key, tuple):
  if (len(key) > 2):
   raise IndexError('Invalid index/slice.')
  key_elems = [key[0], key[1]]
 else:
  key_elems = [key]
 for elem in key_elems:
  if (not (isinstance(elem, (numbers.Number, slice)) or np.isscalar(elem))):
   return True
 return False

def is_special_slice ( key ) : if isinstance ( key , tuple ) : if ( len ( key ) > 2 ) : raise IndexError ( 'Invalid index/slice.' ) key_elems = [ key [ 0 ] , key [ 1 ] ] else : key_elems = [ key ] for elem in key_elems : if ( not ( isinstance ( elem , ( numbers . Number , slice ) ) or np . isscalar ( elem ) ) ) : return True return False
does the key contain a list .