'Retrieve descriptions of reddit\'s OAuth2 scopes.
If no scopes are given, information on all scopes are returned.
Invalid scope(s) will result in a 400 error with body that indicates
the invalid scope(s).'

@allow_oauth2_access
@validate(scope_str=nop('scopes', docs={'scopes': '(optional)    An    OAuth2    scope    string'}))
@api_docs.api_doc(api_docs.api_section.misc)
def GET_scopes(self, scope_str):

    scopes = OAuth2Scope((scope_str or self.THREE_SIXTY))
    if (scope_str and (not scopes.is_valid())):
        invalid = [s for s in scopes.scopes if (s not in scopes.scope_info)]
        error = {'error': 'invalid_scopes', 'invalid_scopes': invalid}
        http_err = HTTPBadRequest()
        http_err.error_data = error
        abort(http_err)
    return self.api_wrapper({k: v for (k, v) in scopes.details() if k})
