<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_data_segments(channels, start, end, connection):
 """Get available data segments for the given channels """

    allsegs = io_nds2.get_availability(channels, start, end,
                                       connection=connection)
    return allsegs.intersection(allsegs.keys())