Per Python docs, favor open() over file() except for typechecking

See note in https://docs.python.org/2/library/functions.html#file
Merge pull request #17462 from hulu/favor-open

Per Python docs, favor open() over file() except for typechecking