def METHOD_NAME(assignment):
    """Get name for an assignment"""
    if assignment.session.type.slug == 'regular':
        return assignment.session.group_at_the_time().name
    else:
        return assignment.session.name or assignment.timeslot.name