def parse_gender(gender):
    """
    Parse gender, 1 for male, 0 for female.
    :param gender:
    :return:
    """
    if not gender:
        return None
    gender = gender.lower()
    if gender == 'male' or gender == 'm':
        return 1
    elif gender == 'female' or gender == 'f':
        return 0
    else:
        return None