Function getReversedScopes