[SPARK-3335] [SQL] [PySpark] support broadcast in Python UDF

After this patch, broadcast can be used in Python UDF.
The test cases in docstring will appear in API docs, so it's not good idea to put many test cases in docstring (especially for edge cases).