def _analyze(self):
if self.value is None or self.value == self.previous:<EOL><INDENT>pass<EOL><DEDENT>elif self._operation == "<STR_LIT>":<EOL><INDENT>self._append = self.value<EOL><DEDENT>elif self._operation == "<STR_LIT>":<EOL><INDENT>self._prepend = self.value.value<EOL><DEDENT>elif self.previous is None:<EOL><INDENT>self._assignments = self.value<EOL><DEDENT>elif len(self.value) < len(self.previous):<EOL><INDENT>self._assignments = self.value<EOL><DEDENT>elif len(self.previous) == <NUM_LIT:0>:<EOL><INDENT>self._assignments = self.value<EOL><DEDENT>else:<EOL><INDENT>search_space = len(self.value) - max(<NUM_LIT:0>, len(self.previous)-<NUM_LIT:1>)<EOL>search_size = len(self.previous)<EOL>for i in range(search_space):<EOL><INDENT>j = i + search_size<EOL>sub = self.value[i:j]<EOL>idx_cmp = lambda idx: self.previous[idx] == sub[idx]<EOL>if idx_cmp(<NUM_LIT:0>) and idx_cmp(-<NUM_LIT:1>) and self.previous == sub:<EOL><INDENT>self._prepend = self.value[:i] or None<EOL>self._append = self.value[j:] or None<EOL>break<EOL><DEDENT><DEDENT>if self._prepend is self._append is None:<EOL><INDENT>self._assignments = self.value<EOL><DEDENT><DEDENT>self._analyzed = True<EOL>
works out the updates to be performed