def commit(self):
if self.high_water_mark:<EOL><INDENT>self.logger.info("<STR_LIT>", self.high_water_mark)<EOL>self.commit_partition_offsets(self.high_water_mark)<EOL>self.update_consumer_offsets(self.high_water_mark)<EOL><DEDENT>else:<EOL><INDENT>self.update_consumer_offsets(self.initial_offsets)<EOL><DEDENT>
Commit this context's offsets:

 -  If the high-water mark has moved, commit up to and position the
    consumer at the high-water mark.
 -  Otherwise, reset to the consumer to the initial offsets.