<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def version(rest):
	"Get the version of pmxbot or one of its plugins"
	pkg = rest.strip() or 'pmxbot'
	if pkg.lower() == 'python':
		return sys.version.split()[0]
	return importlib_metadata.version(pkg)