<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _sliced_shape(shape, keys):
 """ Returns the shape that results from slicing an array of the given shape by the given keys. (1, 10, 90, 1) """

    keys = _full_keys(keys, len(shape))

    sliced_shape = []
    shape_dim = -1
    for key in keys:
        shape_dim += 1
        if _is_scalar(key):
            continue
        elif isinstance(key, slice):
            size = len(range(*key.indices(shape[shape_dim])))
            sliced_shape.append(size)
        elif isinstance(key, np.ndarray) and key.dtype == np.dtype('bool'):
            # Numpy boolean indexing.
            sliced_shape.append(builtins.sum(key))
        elif isinstance(key, (tuple, np.ndarray)):
            sliced_shape.append(len(key))
        elif key is np.newaxis:
            shape_dim -= 1
            sliced_shape.append(1)
        else:
            raise ValueError('Invalid indexing object "{}"'.format(key))

    sliced_shape = tuple(sliced_shape)
    return sliced_shape