def scoped_format(txt, **objects):
pretty = objects.pop("<STR_LIT>", RecursiveAttribute.format_pretty)<EOL>expand = objects.pop("<STR_LIT>", RecursiveAttribute.format_expand)<EOL>attr = RecursiveAttribute(objects, read_only=True)<EOL>formatter = scoped_formatter(**objects)<EOL>return formatter.format(txt, pretty=pretty, expand=expand)<EOL>
Format a string with respect to a set of objects' attributes.

    Example:

        >>> Class Foo(object):
        >>>     def __init__(self):
        >>>         self.name = "Dave"
        >>> print scoped_format("hello {foo.name}", foo=Foo())
        hello Dave

    Args:
        objects (dict): Dict of objects to format with. If a value is a dict,
            its values, and any further neted dicts, will also format with dot
            notation.
        pretty (bool): See `ObjectStringFormatter`.
        expand (bool): See `ObjectStringFormatter`.