def METHOD_NAME(nodes, account_ids):
    for node in nodes:
        for account_id in account_ids:
            res = node.json_rpc(
                'query', {
                    'request_type': 'view_account',
                    'account_id': account_id,
                    'finality': 'optimistic'
                })
            logger.info(
                f"Lookup account '{account_id}' in node '{node.signer_key.account_id}': {res['result'] if 'result' in res else res['error']}"
            )