code: def requests_to_spark(p):
      return {
          "requestLine": {"method": p.method, "uri": p.url},
          "headers": [
              {"name": name, "value": value}
              for name, value in p.headers.items()
              if name != "Content-Length"
          ],
          "entity": None
          if p.body is None
          else (
              {
                  "content": p.body,
                  "isChunked": False,
                  "isRepeatable": True,
                  "isStreaming": False,
              }
          ),
      }
  
imports: from pyspark import SparkContext
  from pyspark.sql.types import StructType
  from pyspark.sql.functions import col, udf
  import json
label_desc: Use image node_id 1 for calling a global function with example usage: requests_to_spark(p) and returns: dict