def fill_nones(graph, value):
    """Replace every None in the graph with value.

    >>> g = from_dict(dict(
    ...     _self = None,
    ...     foo = None,
    ...     bar = "bar value",
    ...     baz = dict(
    ...         _self = "baz",
    ...         x = None,
    ...     ),
    ... ))
    >>> dbg_print(g)
    root: None
      +--bar: 'bar value'
      +--baz: 'baz'
      |  +--x: None
      +--foo: None
    >>> dbg_print(fill_nones(g, "FOO"))
    root: 'FOO'
      +--bar: 'bar value'
      +--baz: 'baz'
      |  +--x: 'FOO'
      +--foo: 'FOO'
    """
    return map(graph, lambda v: value if v is None else v)
