def nominal(x):
    """Return the nominal value of an uncertainty quantity.
     This free function allows multiple uncertain quantity types to be supported
     in a generic way."""
    try:
        return x.nominal
    except AttributeError:
        try:
            return x.value
        except AttributeError:
            return x
