@reversed_processor<EOL><INDENT>def agnostic_extend(self, new_length):<DEDENT>
'''<STR_LIT>'''<EOL>si = self.copy()<EOL>si._bits = new_length<EOL>leading_1_lb = False<EOL>leading_1_ub = False<EOL>ub_msb = self._get_msb(self.upper_bound, self.bits)<EOL>lb_msb = self._get_msb(self.lower_bound, self.bits)<EOL>case_6 = False<EOL>if lb_msb == <NUM_LIT:1>:<EOL><INDENT>if ub_msb == <NUM_LIT:1> and self.upper_bound > self.lower_bound:<EOL><INDENT>leading_1_ub = True<EOL><DEDENT>if ub_msb == <NUM_LIT:1> and self.lower_bound > self.upper_bound:<EOL><INDENT>leading_1_ub = True<EOL>leading_1_lb = True<EOL><DEDENT>if ub_msb == <NUM_LIT:1> and self.lower_bound == self.upper_bound:<EOL><INDENT>leading_1_ub = True<EOL>case_6 = True<EOL><DEDENT><DEDENT>elif ub_msb == <NUM_LIT:1>:<EOL><INDENT>leading_1_ub = True<EOL><DEDENT>if leading_1_lb:<EOL><INDENT>mask = (<NUM_LIT:2> ** new_length - <NUM_LIT:1>) - (<NUM_LIT:2> ** self.bits - <NUM_LIT:1>)<EOL>si._lower_bound |= mask<EOL><DEDENT>if leading_1_ub:<EOL><INDENT>mask = (<NUM_LIT:2> ** new_length - <NUM_LIT:1>) - (<NUM_LIT:2> ** self.bits - <NUM_LIT:1>)<EOL>si._upper_bound |= mask<EOL><DEDENT>if case_6:<EOL><INDENT>si.stride = si.upper_bound - si.lower_bound<EOL><DEDENT>return si<EOL>
Unary operation: SignExtend

:param new_length: New length after sign-extension
:return: A new StridedInterval