input: Write a function to create a feature extraction function in Python to extract data from a json string. The function should take a json string as input, extract the "id", "title", and calculate the length of the "body" text, and return these as a dictionary.
  assert feature_extraction('{"id":111,"title":"This is a sample title","body":"This is a sample body text"}')=={"id": 111, "title": "This is a sample title", "body_len": 27}
  assert feature_extraction('{"id":222,"title":"Another title","body":"Another body text"}')=={"id": 222, "title": "Another title", "body_len": 18}
  assert feature_extraction('{"id":333,"title":"","body":"Some body text"}')=={"id": 333, "title": "", "body_len": 15}
  assert feature_extraction('{"id":444,"title":"Title with no body","body":""}')=={"id": 444, "title": "Title with no body", "body_len": 0}
  assert feature_extraction('{}')=={"id": None, "title": None, "body_len": None}
output: def feature_extraction(json_str):
      data = json.loads(json_str)
      id_val = data.get("id")
      title_val = data.get("title")
      body_len = len(data.get("body", ""))
      return {"id": id_val, "title": title_val, "body_len": body_len}