<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def revoke(self, cidr_ip=None, ec2_group=None):
 """ Revoke access to a CIDR range or EC2 SecurityGroup. You need to pass in either a CIDR block or an EC2 SecurityGroup from which to revoke access. @type cidr_ip: string @param cidr_ip: A valid CIDR IP range to revoke @type ec2_group: :class:`boto.ec2.securitygroup.SecurityGroup>` @rtype: bool @return: True if successful. """

        if isinstance(ec2_group, SecurityGroup):
            group_name = ec2_group.name
            group_owner_id = ec2_group.owner_id
            return self.connection.revoke_dbsecurity_group(
                self.name,
                ec2_security_group_name=group_name,
                ec2_security_group_owner_id=group_owner_id)

        # Revoking by CIDR IP range
        return self.connection.revoke_dbsecurity_group(
            self.name, cidr_ip=cidr_ip)