'Return a name with the relativity desired by the caller.  If
origin is None, then self is returned.  Otherwise, if
relativize is true the name is relativized, and if relativize is
false the name is derelativized.
@rtype: dns.name.Name object'

def choose_relativity(self, origin=None, relativize=True):

    if origin:
        if relativize:
            return self.relativize(origin)
        else:
            return self.derelativize(origin)
    else:
        return self
