Find all files with the extension .py in the directories listed in the PATH environment variable, and then search for the string "function main" in each of those files, and print the name of each file that contains the string.
find $(echo $PATH | tr ':' ' ') -maxdepth 1 -type f -name "*.py" -exec grep -l 'function main' {} \;