How to Override python function to customize erpnext

How to Override python function to customize erpnext or use in app

For context probably this refers to this earlier post How to Override python function to customize erpnext or use in app