code: def has_scope(self, scope):
          
          if not self.is_oauth_session():
              return False
          if '*' in self._authentication:
              return True
          if isinstance(scope, six.string_types):
              scope = [scope]
          return all(s in self._authentication for s in scope)
docs: Return True if OAuth2 authorized for the passed in scope(s).