def is_datecode(stamp):
    """
    This function will return True or False, depending if the supplied stamp
    can be interpreted as a date-code string of the format YYWWD
    """
    if type(stamp) == str:
        if len(stamp) == 5:
            year = stamp[0:2]
            if not year.isdigit():
                return False
            week = stamp[2:4]
            if week.isdigit():
                week = int(week)
                if (week < 1) or (week > 53):
                    return False
            else:
                return False
            day = stamp[4]
            if day.isdigit():
                day = int(day)
                if (day < 1) or (day > 7):
                    return False
                else:
                    return True
            else:
                return False
        else:
            return False
    else:
        return False