human
Complete this python program:
def get_doctypes_with_global_search(with_child_tables=True):
assistant
#Here is the Python program you requested.

    """Return doctypes with global search fields
    """
    def _get():
        global_search_doctypes = []
        filters = {}
        if (not with_child_tables):
            filters = {u'istable': [u'!=', 1], u'issingle': [u'!=', 1]}
        for d in frappe.get_all(u'DocType', fields=[u'name', u'module'], filters=filters):
            meta = frappe.get_meta(d.name)
            if (len(meta.get_global_search_fields()) > 0):
                global_search_doctypes.append(d)
        installed_apps = frappe.get_installed_apps()
        doctypes = [d.name for d in global_search_doctypes if (frappe.local.module_app[frappe.scrub(d.module)] in installed_apps)]
        return doctypes
    return frappe.cache().get_value(u'doctypes_with_global_search', _get)