def defaults(opts, *defaults):
    """defaults({'a': 'a'}, {'a': 'b', 'b': 'b'}) -> {'a': 'a', 'b': 'b'}

    Set defaults in a dictionary.
    """
    for default in defaults:
        for key, value in default.iteritems():
            if key not in opts:
                opts[key] = value
    return opts
