def METHOD_NAME(response, json_parser="json"):
    lds = response.xpath('//script[@type="application/ld+json"]//text()').getall()
    for ld in lds:
        try:
            if json_parser == "json5":
                ld_obj = json5.loads(ld)
            elif json_parser == "chompjs":
                ld_obj = chompjs.parse_js_object(ld)
            else:
                ld_obj = json.loads(ld, strict=False)
        except (json.decoder.JSONDecodeError, ValueError):
            continue
        if isinstance(ld_obj, dict):
            if "@graph" in ld_obj:
                yield from filter(None, ld_obj["@graph"])
            else:
                yield ld_obj
        elif isinstance(ld_obj, list):
            yield from filter(None, ld_obj)
        else:
            raise TypeError(ld_obj)