def get(tree, name):
    """ Return a float value attribute NAME from TREE.
    """
    if name in tree.attrib:
        value = tree.attrib[name]
    else:
        return float("nan")
    try:
        a = float(value)
    except ValueError:
        a = float("nan")
    return a