plpy.execute('...') statements not in logs
In situations like this, the auto explain module, with log_nested_statements and log_min_duration set to 0 should show the statements executed inside of functions in PostgreSQL.