def is_bucket_updated(self, current_num_objects):
if current_num_objects > self.previous_num_objects:<EOL><INDENT>self.log.info(<EOL>'''<STR_LIT>'''.format(os.path.join(self.bucket, self.prefix)))<EOL>self.last_activity_time = get_time()<EOL>self.inactivity_seconds = <NUM_LIT:0><EOL>self.previous_num_objects = current_num_objects<EOL><DEDENT>elif current_num_objects < self.previous_num_objects:<EOL><INDENT>if self.allow_delete:<EOL><INDENT>self.previous_num_objects = current_num_objects<EOL>self.last_activity_time = get_time()<EOL>self.log.warning(<EOL>'''<STR_LIT>'''<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError(<EOL>'''<STR_LIT>'''.format(os.path.join(self.bucket, self.prefix))<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if self.last_activity_time:<EOL><INDENT>self.inactivity_seconds = (<EOL>get_time() - self.last_activity_time).total_seconds()<EOL><DEDENT>else:<EOL><INDENT>self.last_activity_time = get_time()<EOL>self.inactivity_seconds = <NUM_LIT:0><EOL><DEDENT>if self.inactivity_seconds >= self.inactivity_period:<EOL><INDENT>if current_num_objects >= self.min_objects:<EOL><INDENT>self.log.info(<EOL>'''<STR_LIT>'''.format(<EOL>current_num_objects,<EOL>os.path.join(self.bucket, self.prefix),<EOL>self.inactivity_period))<EOL>return True<EOL><DEDENT>warn_msg ='''<STR_LIT>'''.format(<EOL>os.path.join(self.bucket, self.prefix))<EOL>self.log.warning(warn_msg)<EOL>return False<EOL><DEDENT>return False<EOL><DEDENT>
Checks whether new objects have been uploaded and the inactivity_period
has passed and updates the state of the sensor accordingly.

:param current_num_objects: number of objects in bucket during last poke.
:type current_num_objects: int