<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def monitor(self, field, callback, poll_interval=None):
 """ Monitor `field` for change Will monitor ``field`` for change and execute ``callback`` when change is detected. Example usage:: def handle(resource, field, previous, current):
 print "Change from {} to {}".format(previous, current) switch = TapSwitch.objects.get(id=3) # Note that we monitor the entire state of the Hue Tap # switch rather than a specific field switch.monitor(lambda sw: sw.state.as_dict(), handle, poll_interval=0.2) # Execution will stop here and the API client will begin polling for changes hue_api.start_monitor_loop() Args: field (string):
 The name of the field to be monitored. This may also be a callable which will be called with the resource instance as its single argument and must return a value which can be compared to previous values. callback (callable):
 The callable to be called when a change is detected. It will be called with parameters as follows: * resource instance * field name, * previous value * current value. poll_interval (float):
 Interval between polling in seconds. Defaults to the API's `poll_interval` value (which defaults to 0.1 second. Returns: Monitor: """

        poll_interval = poll_interval or self.api.poll_interval

        monitor = self.monitor_class(
            resource=self,
            field=field,
            callback=callback,
            poll_interval=poll_interval,
            event_queue=self.api.event_queue,
            poll_pool=self.api.poll_pool,
        )
        monitor.start()
        return monitor