Python code for uRight project