Fixed -- #21765 Contexts cannot be compared for equality.

Added additional Context.flatten() method with documentation, tests and release notes for version 1.7