def select(arrays, selection, inplace=True):
    """
    If inplace is True, modifies arrays to only contain the selection
    Otherwise it creates a new arrays object with the selection in place
    """
    if inplace:
        for key in arrays:
            arrays[key] = arrays[key][selection]
    else:
        return { k : v[selection] for k, v in arrays.items() }