def list_slice(arr, sl):
    """
    Helper method to slice all arrays contained in a list.
    """
    if isinstance(arr, list) or isinstance(arr, tuple):
        ret = []
        for v in arr:
            ret.append(v[sl])
        return ret
    else:
        return arr[sl]