(doc)
return _from_form_dict(doc) or _from_xform_instance(doc)
exclude device reports
exclude device reports
exclude device reports
def is_device_report(doc):
    """exclude device reports"""
    device_report_xmlns = "http://code.javarosa.org/devicereport"

    def _from_form_dict(doc):
        return isinstance(doc, dict) and "@xmlns" in doc and doc["@xmlns"] == device_report_xmlns

    def _from_xform_instance(doc):
        return getattr(doc, 'xmlns', None) == device_report_xmlns

    return _from_form_dict(doc) or _from_xform_instance(doc)
def is_device_report ( doc ) : device_report_xmlns = "http://code.javarosa.org/devicereport" def _from_form_dict ( doc ) : return isinstance ( doc , dict ) and "@xmlns" in doc and doc [ "@xmlns" ] == device_report_xmlns def _from_xform_instance ( doc ) : return getattr ( doc , 'xmlns' , None ) == device_report_xmlns return _from_form_dict ( doc ) or _from_xform_instance ( doc )