Fix pylint 'E0102 (function-redefined)' error

Fix pylint errors reported by 'E0102 (function-redefined)' check, and enable it.