How does submitting Delivery note change delivery status of sales order

Hello guys, can someone point me to the code or show me which part of the code implements the changing of the sales order delivery status upon submission of Delivery note.
Your help will be much appreciated, thanks.

This? erpnext/delivery_note.py at develop · frappe/erpnext · GitHub

Use case or scenario?

Thanks @umair let me go through it and see if i can figure it out