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

Hi,how can i customize Dashboard section of Project without changing core erpnext.

This code is from project_dashboard.py
I need to customize Project Dashboard

 from __future__ import unicode_literals
 from frappe import _
 
 def get_data():
 	return {
 		'heatmap': True,
 		'heatmap_message': _('This is based on the Time Sheets created against this project'),
 		'fieldname': 'project',
 		'transactions': [
 			{
 				'label': _('Project'),
 				'items': ['Task', 'Timesheet', 'Expense Claim', 'Issue' , 'Project Update']
 			},
 			{
 				'label': _('Material'),
 				'items': ['Material Request', 'BOM', 'Stock Entry']
 			},
 			{
				'label': _('Sales'),
 				'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
 			},
 			{
 				'label': _('Purchase'),
 				'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
 			},
 		]
 	}

you can monkey patch that function as explained here : Monkey Patching in Python (Dynamic Behavior) - GeeksforGeeks

you would do this in hooks.py for your app, since that gets called early in the bootstrap process, the project function will then be overridden.

Thanks @cjpit

For normal events like validate(),on_submit() function we are using hooks

can i have a sample program to manage this

Any sample code to know about monkey patching.i wrote monkey patching code in hooks.py and it is working fine.what if more functions to changes

can we write monkey patching in other files than hooks.py