<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def map_package(shutit_pexpect_session, package, install_type):
 	"""If package mapping exists, then return it, else return package. 	"""

	if package in PACKAGE_MAP.keys():
		for itype in PACKAGE_MAP[package].keys():
			if itype == install_type:
				ret = PACKAGE_MAP[package][install_type]
				if isinstance(ret,str):
					return ret
				if callable(ret):
					ret(shutit_pexpect_session)
					return ''
	# Otherwise, simply return package
	return package