def _convert_to_slice(string):
    """Convert slice-str to slice

    Examples:
        >>> _convert_to_slice('0:51')
        (slice(0, 52),)
        >>> _convert_to_slice('0:51,6:10')
        (slice(0, 52), slice(6, 11))
        >>> _convert_to_slice(',6:10')
        (slice(None), slice(6, 11))

    """
    slices = []
    for ele in string.split(','):
        if ele == '' or ele == ':':
            slices.append(slice(None))
        else:
            sps = []
            for sp in ele.split(':'):
                try:
                    sps.append(int(sp))
                except ValueError:
                    raise ValueError('Format error: {}'.format(string))
            if len(sps) == 1:
                sl = slice(sps[0], sps[0] + 1)
            elif len(sps) == 2:
                sl = slice(sps[0], sps[1] + 1)
            elif len(sps) == 3:
                sl = slice(sps[0], sps[1] + 1, sps[2])
            else:
                raise RuntimeError('Too many : {}'.format(string))
            slices.append(sl)
    return tuple(slices)
