def _non_reducing_slice(slice_):
    # default to column slice, like DataFrame
    # ['A', 'B'] -> IndexSlices[:, ['A', 'B']]
    kinds = tuple(list(compat.string_types) + [ABCSeries, np.ndarray, Index,
                                               list])
    if isinstance(slice_, kinds):
        slice_ = IndexSlice[:, slice_]

    def pred(part):
        # true when slice does *not* reduce
        return isinstance(part, slice) or com.is_list_like(part)

    if not com.is_list_like(slice_):
        if not isinstance(slice_, slice):
            # a 1-d slice, like df.loc[1]
            slice_ = [[slice_]]
        else:
            # slice(a, b, c)
            slice_ = [slice_]  # to tuplize later
    else:
        slice_ = [part if pred(part) else [part] for part in slice_]
    return tuple(slice_)
Give receiver the permission C{permission} over the object or class
dataset/ETHPy150Open pydata/pandas/pandas/core/indexing.py/_non_reducing_slice--crossover with--dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/common/permissions/shortcuts.py/give_permission_to