This function foo is repeated several times, but there is no explanation of what foo is. Do I use the actual function foo? Do I use any random identifier? Does this function need to exist on the local or the worker process? Can anyone clarify?
Foo and bar are common words used as placeholders in programming. Wikipedia explains it better than I can: “… used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept.”
In that case the documentation needs to be updated. Any code example should actually work when you type it out unless the person writing the docs is trying really hard to frustrate readers.
In this case foo is expected to be a function that takes 2D array as a parameter, and is defined in the remote process. So you could, for example, think of the term foo being replaced with the function norm. I agree this is confiusing as written.