def _parse_weekday(val):
        ''' Try to match a day-of-week abbreviation, then try a day-of-week full name '''
        val = val.title()
        try:
            return list(calendar.day_abbr).index(val)
        except ValueError:
            try:
                return list(calendar.day_name).index(val)
            except ValueError:
                return None
def _parse_weekday ( val ) : val = val . title ( ) try : return list ( calendar . day_abbr ) . index ( val ) except ValueError : try : return list ( calendar . day_name ) . index ( val ) except ValueError : return None
Try to match a day-of-week abbreviation, then try a day-of-week full name