def convert_datetime_for_arith(builder, dt_val, src_unit, dest_unit):
 (dt_val, dt_unit) = reduce_datetime_for_unit(builder, dt_val, src_unit, dest_unit)
 dt_factor = npdatetime.get_timedelta_conversion_factor(dt_unit, dest_unit)
 if (dt_factor is None):
  raise NotImplementedError(('cannot convert datetime64 from %r to %r' % (src_unit, dest_unit)))
 return scale_by_constant(builder, dt_val, dt_factor)

def convert_datetime_for_arith ( builder , dt_val , src_unit , dest_unit ) : ( dt_val , dt_unit ) = reduce_datetime_for_unit ( builder , dt_val , src_unit , dest_unit ) dt_factor = npdatetime . get_timedelta_conversion_factor ( dt_unit , dest_unit ) if ( dt_factor is None ) : raise NotImplementedError ( ( 'cannot convert datetime64 from %r to %r' % ( src_unit , dest_unit ) ) ) return scale_by_constant ( builder , dt_val , dt_factor )
convert datetime *dt_val* from *src_unit* to *dest_unit* .