

def run(self, ip_address, region=None):
    if region:
        cs = self.pyrax.connect_to_cloudservers(region=region)
    else:
        cs = self.pyrax.cloudservers
    servers = cs.list()
    result = None
    for server in servers:
        item = to_server_dict(server=server)
        public_ips = item.get('public_ips', [])
        if (ip_address in public_ips):
            result = item
            break
    return result

dataset/ETHPy150Open StackStorm/st2contrib/packs/rackspace/actions/get_vm_by_ip.py GetVMByIP.run/original