def localStr(self, local_addr = None, local_port = None):
        l = []; w = l.append
        w('sip:')
        if self.username != None:
            w(self.username)
            for v in self.userparams:
                w(';%s' % v)
            if self.password != None:
                w(self.password % ':%s')
            w('@')
        if local_addr != None and 'my' in dir(self.host):
            w(local_addr)
        else:
            w(str(self.host))
        if self.port != None:
            if local_port != None and 'my' in dir(self.port):
                w(':%d' % local_port)
            else:
                w(':%d' % self.port)
        if self.usertype != None:
            w(';user=%s' % self.usertype)
        for n in ('transport', 'ttl', 'maddr', 'method', 'tag'):
            v = getattr(self, n)
            if v != None:
                w(';%s=%s' % (n, v))
        if self.lr:
            w(';lr')
        for v in self.other:
            w(';%s' % v)
        if self.headers:
            w('?')
            w('&'.join([('%s=%s' % (h.capitalize(), quote(v))) for (h, v) in self.headers.items()]))
        return ''.join(l)
dataset/ETHPy150Open hgascon/pulsar/pulsar/core/sippy/SipURL.py/SipURL.localStr/swapped operands of `%`