<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log(channel, rest):
 	""" 	Enable or disable logging for a channel; 	use 'please' to start logging and 'stop please' to stop. 	"""

	words = [s.lower() for s in rest.split()]
	if 'please' not in words:
		return
	include = 'stop' not in rest
	existing = set(pmxbot.config.log_channels)
	# add the channel if include, otherwise remove the channel
	op = existing.union if include else existing.difference
	pmxbot.config.log_channels = list(op([channel]))