def convert_values(self):
def stringify(value):<EOL><INDENT>if self.encoding is not None:<EOL><INDENT>encoder = partial(pprint_thing_encoded,<EOL>encoding=self.encoding)<EOL><DEDENT>else:<EOL><INDENT>encoder = pprint_thing<EOL><DEDENT>return encoder(value)<EOL><DEDENT>lhs, rhs = self.lhs, self.rhs<EOL>if is_term(lhs) and lhs.is_datetime and is_term(rhs) and rhs.is_scalar:<EOL><INDENT>v = rhs.value<EOL>if isinstance(v, (int, float)):<EOL><INDENT>v = stringify(v)<EOL><DEDENT>v = Timestamp(_ensure_decoded(v))<EOL>if v.tz is not None:<EOL><INDENT>v = v.tz_convert('<STR_LIT>')<EOL><DEDENT>self.rhs.update(v)<EOL><DEDENT>if is_term(rhs) and rhs.is_datetime and is_term(lhs) and lhs.is_scalar:<EOL><INDENT>v = lhs.value<EOL>if isinstance(v, (int, float)):<EOL><INDENT>v = stringify(v)<EOL><DEDENT>v = Timestamp(_ensure_decoded(v))<EOL>if v.tz is not None:<EOL><INDENT>v = v.tz_convert('<STR_LIT>')<EOL><DEDENT>self.lhs.update(v)<EOL><DEDENT>
Convert datetimes to a comparable value in an expression.