def parse_shift(shift): if shift in ['ML', 'AL', 'A/L', 'BH', 'SD']: return None, None, 8 if shift.startswith('T/'): return None, None, float(shift[2:]) if shift == 'N': return 21, 21 + 12, 12 if shift == 'R': return None, None, None if shift[0].isdigit(): start, end = shift.split('/') return float(start), float(end), float(end) - float(start) return None, None, None