def METHOD_NAME(doctype, parent_doc=None, parentfield=None, as_dict=False):
	if doctype not in frappe.local.new_doc_templates:
		# cache a copy of new doc as it is called
		# frequently for inserts
		frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
	doc = copy.deepcopy(frappe.local.new_doc_templates[doctype])
	set_dynamic_default_values(doc, parent_doc, parentfield)
	if as_dict:
		return doc
	else:
		return frappe.get_doc(doc)