added res python code