def _non_reducing_slice(slice_):
 kinds = tuple((list(compat.string_types) + [ABCSeries, np.ndarray, Index, list]))
 if isinstance(slice_, kinds):
  slice_ = IndexSlice[:, slice_]
 def pred(part):
  return (isinstance(part, slice) or is_list_like(part))
 if (not is_list_like(slice_)):
  if (not isinstance(slice_, slice)):
   slice_ = [[slice_]]
  else:
   slice_ = [slice_]
 else:
  slice_ = [(part if pred(part) else [part]) for part in slice_]
 return tuple(slice_)

def _non_reducing_slice ( slice_ ) : kinds = tuple ( ( list ( compat . string_types ) + [ ABCSeries , np . ndarray , Index , list ] ) ) if isinstance ( slice_ , kinds ) : slice_ = IndexSlice [ : , slice_ ] def pred ( part ) : return ( isinstance ( part , slice ) or is_list_like ( part ) ) if ( not is_list_like ( slice_ ) ) : if ( not isinstance ( slice_ , slice ) ) : slice_ = [ [ slice_ ] ] else : slice_ = [ slice_ ] else : slice_ = [ ( part if pred ( part ) else [ part ] ) for part in slice_ ] return tuple ( slice_ )
ensurse that a slice doesnt reduce to a series or scalar .