def METHOD_NAME(self, v, arg2):
    if v == "bad-argument":
        raise ComplexError.ReallyBadArgument(20)
    elif v == "unexpected-error":
        raise ValueError("unexpected value")
    if arg2:
        if v:
            return v.upper()
        else:
            return None
    else:
        return v