code: def update_or_create(self, location, contact_address, with_status=False, **kw):
          
          updated, created = False, False
          location_ref = location_helper(location)
          if location_ref in self:
              for ca in self:
                  if ca.location_ref == location_ref:
                      ca.update(
                          address=contact_address if 'dynamic' not in contact_address\
                              else 'First DHCP Interface ip',
                          dynamic='true' if 'dynamic' in contact_address else 'false')
                      updated = True
          else:
              self.data.setdefault('contact_addresses', []).append(
                  dict(address=contact_address if 'dynamic' not in contact_address\
                          else 'First DHCP Interface ip',
                       dynamic='true' if 'dynamic' in contact_address else 'false',
                       location_ref=location_ref))
              created = True
          
          if updated or created:
              self.update()
          if with_status:
              return self, updated, created
          return self
docs: Update an existing contact address or create if the location does
          not exist.
          
          :param str location: name of the location, the location will be added
              if it doesn't exist
          :param str contact_address: contact address IP. Can be the string 'dynamic'
              if this should be a dynamic contact address (i.e. on DHCP interface)
          :param bool with_status: if set to True, a 3-tuple is returned with 
              (Element, modified, created), where the second and third tuple
              items are booleans indicating the status
          :raises UpdateElementFailed: failed to update element with reason
          :rtype: ContactAddressNode