code: def _consume_scope(self):
      
      if not self._at_scope():
        return None, []
      scope = self._unconsumed_args.pop()
      flags = self._consume_flags()
      return scope, flags
docs: Returns a pair (scope, list of flags encountered in that scope).
  
      Note that the flag may be explicitly scoped, and therefore not actually belong to this scope.
  
      For example, in:
  
      ./pants --compile-java-partition-size-hint=100 compile <target>
  
      --compile-java-partition-size-hint should be treated as if it were --partition-size-hint=100
      in the compile.java scope.