Given a reference ( pointer to pointer ) to the head of a list and an int , inserts a new node on the front of the list .
def push ( head_ref , new_data ) : NEW_LINE INDENT new_node = Node ( new_data , head_ref , None ) NEW_LINE if head_ref != None : NEW_LINE INDENT head_ref . prev = new_node NEW_LINE head_ref = new_node NEW_LINE DEDENT return head_ref NEW_LINE DEDENT