def _process_scopes(scopes):
all_scopes = set()<EOL>sufficient_scopes = set()<EOL>for scope_set in scopes:<EOL><INDENT>scope_set_scopes = frozenset(scope_set.split())<EOL>all_scopes.update(scope_set_scopes)<EOL>sufficient_scopes.add(scope_set_scopes)<EOL><DEDENT>return all_scopes, sufficient_scopes<EOL>
Parse a scopes list into a set of all scopes and a set of sufficient scope sets.

       scopes: A list of strings, each of which is a space-separated list of scopes.
         Examples: ['scope1']
                   ['scope1', 'scope2']
                   ['scope1', 'scope2 scope3']

       Returns:
         all_scopes: a set of strings, each of which is one scope to check for
         sufficient_scopes: a set of sets of strings; each inner set is
           a set of scopes which are sufficient for access.
           Example: {{'scope1'}, {'scope2', 'scope3'}}