@contextmanager<EOL><INDENT>def scope(self, *args, **kwargs):<DEDENT>
new_scope = args[<NUM_LIT:0>] if isinstance(args[<NUM_LIT:0>], Base) else self.find(*args, **kwargs)<EOL>self._scopes.append(new_scope)<EOL>try:<EOL><INDENT>yield<EOL><DEDENT>finally:<EOL><INDENT>self._scopes.pop()<EOL><DEDENT>
Executes the wrapped code within the context of a node. ``scope`` takes the same options
as :meth:`find`. For the duration of the context, any command to Capybara will be handled
as though it were scoped to the given element. ::

    with scope("xpath", "//div[@id='delivery-address']"):
        fill_in("Street", value="12 Main Street")

Just as with :meth:`find`, if multiple elements match the selector given to ``scope``, an
error will be raised, and just as with :meth:`find`, this behavior can be controlled
through the ``match`` and ``exact`` options.

It is possible to omit the first argument, in that case, the selector is assumed to be of
the type set in :data:`capybara.default_selector`. ::

    with scope("div#delivery-address"):
        fill_in("Street", value="12 Main Street")

Note that a lot of uses of ``scope`` can be replaced more succinctly with chaining::

    find("div#delivery-address").fill_in("Street", value="12 Main Street")

Args:
    *args: Variable length argument list for the call to :meth:`find`.
    **kwargs: Arbitrary keywords arguments for the call to :meth:`find`.