def _get_node_attr(node, attr, default=False):
    if node.hasAttribute(attr):
        return str(node.getAttribute(attr))
    if default is False:
        raise InvalidPackage('The "%s" tag must have the attribute "%s"' % (node.tagName, attr))
    return default
:param default: False means value is required
dataset/ETHPy150Open ros-infrastructure/catkin_pkg/src/catkin_pkg/package.py/_get_node_attr