def getvalueor(row, name, mapping={}, default=None):
    """Return the value of name from row using a mapping and a default value."""
    if name in mapping:
        return row.get(mapping[name], default)
    else:
        return row.get(name, default)