Yes, you shouldn't use '_get_data_from_disk` directly. Instead of the if/else you should be able to use

    Y = np.array([ep for ep in epochs])