def release(self, subnets):
if isinstance(subnets, str) or isinstance(subnets, IPNetwork):<EOL><INDENT>subnets = [subnets]<EOL><DEDENT>subnets_iter = (<EOL>str(subnet) if isinstance(subnet, IPNetwork) else subnet<EOL>for subnet in subnets<EOL>)<EOL>try:<EOL><INDENT>with self._create_lock():<EOL><INDENT>for subnet in subnets_iter:<EOL><INDENT>self._release(self.create_lease_object_from_subnet(subnet))<EOL><DEDENT><DEDENT><DEDENT>except (utils.TimerException, IOError):<EOL><INDENT>raise LagoSubnetLeaseLockException(self.path)<EOL><DEDENT>
Free the lease of the given subnets

Args:
    subnets (list of str or netaddr.IPAddress): dotted ipv4 subnet in
        CIDR notation (for example ```192.168.200.0/24```) or IPAddress
        object.

Raises:
    LagoSubnetLeaseException: If subnet is a str and can't be parsed
    LagoSubnetLeaseLockException:
        If the lock to self.path can't be acquired.