code: def ips_assign(self, region, *assignments):
          
          for a in assignments:
              if not 'address' in a or not 'linode_id' in a:
                  raise ValueError("Invalid assignment: {}".format(a))
          if isinstance(region, Region):
              region = region.id
  
          self.client.post('/networking/ipv4/assign', data={
              "region": region,
              "assignments": [ a for a in assignments ],
          })
docs: Redistributes :any:`IP Addressees<IPAddress>` within a single region.
          This function takes a :any:`Region` and a list of assignments to make,
          then requests that the assignments take place.  If any :any:`Instance`
          ends up without a public IP, or with more than one private IP, all of
          the assignments will fail.
  
          Example usage::
  
             linode1 = Instance(client, 123)
             linode2 = Instance(client, 456)
  
             # swap IPs between linodes 1 and 2
             client.networking.assign_ips(linode1.region,
                                          linode1.ips.ipv4.public[0].to(linode2),
                                          linode2.ips.ipv4.public[0].to(linode1))
  
          :param region: The Region in which the assignments should take place.
                         All Instances and IPAddresses involved in the assignment
                         must be within this region.
          :type region: str or Region
          :param assignments: Any number of assignments to make.  See
                              :any:`IPAddress.to` for details on how to construct
                              assignments.
          :type assignments: dct