Fixtures Automation

Hello Friends,
can someone please assist me here…?
I want to direct generate fixtures in a doctype called “AV Fixture” its field name are custom_doctype, identified_filter, identified_app and identified_doctype
refer to the code below

def create_fixture(doc):
for identified_app in frappe.get_installed_apps():
for hook in frappe.get_hooks(“fixtures”, app_name=identified_app):
filters = None
if isinstance(hook, dict):
custom_doctype = hook.get(“doctype”)
filters = hook.get(“filters”)
for filter in filters:
for identified_filter in list(filter[2]):
required_doctype = identified_filter.split(“-”)[0]
doc=frappe.new_doc(“AV Fixture”)
doc.custom_doctype = custom_doctype
doc.identified_filter = identified_filter
doc.identified_app = identified_app
doc.required_doctype = required_doctype

but frappe.new_doc does not work and also doesn’t insert into the database, please someone to help me here
is frappe.new_doc doesn’t work within for loop…???

thanks in advance