def reset_partition_offset(self, partition):
LATEST = -<NUM_LIT:1><EOL>EARLIEST = -<NUM_LIT:2><EOL>if self.auto_offset_reset == '<STR_LIT>':<EOL><INDENT>reqs = [OffsetRequest(self.topic, partition, LATEST, <NUM_LIT:1>)]<EOL><DEDENT>elif self.auto_offset_reset == '<STR_LIT>':<EOL><INDENT>reqs = [OffsetRequest(self.topic, partition, EARLIEST, <NUM_LIT:1>)]<EOL><DEDENT>else:<EOL><INDENT>if sys.exc_info() == (None, None, None):<EOL><INDENT>raise OffsetOutOfRangeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>raise  <EOL><DEDENT>log.info('<STR_LIT>',<EOL>self.auto_offset_reset, self.topic, partition)<EOL>try:<EOL><INDENT>(resp, ) = self.client.send_offset_request(reqs)<EOL><DEDENT>except KafkaError as e:<EOL><INDENT>log.error('<STR_LIT>',<EOL>e.__class__.__name__, self.topic, partition)<EOL><DEDENT>else:<EOL><INDENT>self.offsets[partition] = resp.offsets[<NUM_LIT:0>]<EOL>self.fetch_offsets[partition] = resp.offsets[<NUM_LIT:0>]<EOL>return resp.offsets[<NUM_LIT:0>]<EOL><DEDENT>
Update offsets using auto_offset_reset policy (smallest|largest)

        Arguments:
            partition (int): the partition for which offsets should be updated

        Returns: Updated offset on success, None on failure