In python there are two type or function arguments, args and kwargs. Args are those which are identified by their position when you call the function. Kwargs are those which are identified by the name you pass.
In python you must past those without name and later those with name. so val inds needs something like: indices=val_inds (whatever the name of the argument is in the function)