def ips_assign(self, region, *assignments):
for a in assignments:<EOL><INDENT>if not '<STR_LIT:address>' in a or not '<STR_LIT>' in a:<EOL><INDENT>raise ValueError("<STR_LIT>".format(a))<EOL><DEDENT><DEDENT>if isinstance(region, Region):<EOL><INDENT>region = region.id<EOL><DEDENT>self.client.post('<STR_LIT>', data={<EOL>"<STR_LIT>": region,<EOL>"<STR_LIT>": [ a for a in assignments ],<EOL>})<EOL>
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