stock mr example for both java and python