def get_extended_due_date(node):
 if isinstance(node, dict):
  get = node.get
 else:
  get = partial(getattr, node)
 due_date = get('due', None)
 if (not due_date):
  return due_date
 extended = get('extended_due', None)
 if ((not extended) or (extended < due_date)):
  return due_date
 return extended

def get_extended_due_date ( node ) : if isinstance ( node , dict ) : get = node . get else : get = partial ( getattr , node ) due_date = get ( 'due' , None ) if ( not due_date ) : return due_date extended = get ( 'extended_due' , None ) if ( ( not extended ) or ( extended < due_date ) ) : return due_date return extended
gets the actual due date for the logged in student for this node .