Modify LinkVisibity By Linkedbyview

Hi all, I need to set linked by view for more than 100 views. Using Dynamo, I am creating views from linked models, But I need to set linkedbyview for all views based on linked model. For Revit 2024, we have an API for that; is there any Python script to do it?
i found this python script from this page
Linkedbyview
But in this, I have to do it one by one; anyone can help modify the script so that the inputs of this python are IN(0), the view name of the linked model, and IN(1), the linked.instance model.