def rewrite_references_json(json_content, rewrite_json):
for ref in json_content:<EOL><INDENT>if ref.get("<STR_LIT:id>") and ref.get("<STR_LIT:id>") in rewrite_json:<EOL><INDENT>for key, value in iteritems(rewrite_json.get(ref.get("<STR_LIT:id>"))):<EOL><INDENT>ref[key] = value<EOL><DEDENT><DEDENT><DEDENT>return json_content<EOL>
general purpose references json rewriting by matching the id value