<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def release(self, subnets):
 """ 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. """


        if isinstance(subnets, str) or isinstance(subnets, IPNetwork):
            subnets = [subnets]
        subnets_iter = (
            str(subnet) if isinstance(subnet, IPNetwork) else subnet
            for subnet in subnets
        )
        try:
            with self._create_lock():
                for subnet in subnets_iter:
                    self._release(self.create_lease_object_from_subnet(subnet))
        except (utils.TimerException, IOError):
            raise LagoSubnetLeaseLockException(self.path)