(data, analyst, method, ref=None, hdr_events=False,
                         def_ci=None, source=None, use_hdr_src=False,
                         obs_as_ind=False, preview_only=False)
return ret
Import a standards document into CRITs.

    :param data: The document data to feed into
                 :class:`crits.standards.parsers.STIXParser`
    :type data: str
    :param analyst: The user importing the document.
    :type analyst: str
    :param method: The method of acquiring this document.
    :type method: str
    :param ref: The reference to this document.
    :type ref: str
    :param hdr_events: Whether or not we should make an Event for this document.
    :type hdr_events: bool
    :param def_ci: The default Indicator (confidence, impact).
    :type def_ci: tuple
    :param source: The name of the source who provided this document.
    :type source: str
    :param use_hdr_src: If True, try to use the STIX Header Information
                         Source instead of the value in "source" parameter
    :type use_hdr_src: boolean
    :param obs_as_ind: If True, create indicators for all qualifying
	                   observables instead of Domain and IP TLOs
    :type obs_as_ind: boolean
    :param preview_only: If True, nothing is imported and a preview is returned
    :type preview_only: boolean
    :returns: dict with keys:
              "success" (boolean),
              "reason" (str),
              "imported" (list),
              "failed" (list)
Import a standards document into CRITs.
Import a standards document into CRITs .
def import_standards_doc(data, analyst, method, ref=None, hdr_events=False,
                         def_ci=None, source=None, use_hdr_src=False,
                         obs_as_ind=False, preview_only=False):
    """
    Import a standards document into CRITs.

    :param data: The document data to feed into
                 :class:`crits.standards.parsers.STIXParser`
    :type data: str
    :param analyst: The user importing the document.
    :type analyst: str
    :param method: The method of acquiring this document.
    :type method: str
    :param ref: The reference to this document.
    :type ref: str
    :param hdr_events: Whether or not we should make an Event for this document.
    :type hdr_events: bool
    :param def_ci: The default Indicator (confidence, impact).
    :type def_ci: tuple
    :param source: The name of the source who provided this document.
    :type source: str
    :param use_hdr_src: If True, try to use the STIX Header Information
                         Source instead of the value in "source" parameter
    :type use_hdr_src: boolean
    :param obs_as_ind: If True, create indicators for all qualifying
	                   observables instead of Domain and IP TLOs
    :type obs_as_ind: boolean
    :param preview_only: If True, nothing is imported and a preview is returned
    :type preview_only: boolean
    :returns: dict with keys:
              "success" (boolean),
              "reason" (str),
              "imported" (list),
              "failed" (list)
    """

    ret = {
            'success': False,
            'reason': '',
            'imported': [],
            'failed': []
          }

    try:
        parser = STIXParser(data, analyst, method, def_ci, preview_only)
        parser.parse_stix(ref, hdr_events, source, use_hdr_src, obs_as_ind)
        parser.relate_objects()
    except STIXParserException as e:
        logger.exception(str(e))
        ret['reason'] = str(e.message)
        return ret
    except Exception as e:
        logger.exception(str(e))
        ret['reason'] = str(e)
        return ret

    ret['imported'] = parser.imported
    ret['failed'] = parser.failed
    ret['success'] = True
    return ret
def import_standards_doc ( data , analyst , method , ref = None , hdr_events = False , def_ci = None , source = None , use_hdr_src = False , obs_as_ind = False , preview_only = False ) : ret = { 'success' : False , 'reason' : '' , 'imported' : [ ] , 'failed' : [ ] } try : parser = STIXParser ( data , analyst , method , def_ci , preview_only ) parser . parse_stix ( ref , hdr_events , source , use_hdr_src , obs_as_ind ) parser . relate_objects ( ) except STIXParserException as e : logger . exception ( str ( e ) ) ret [ 'reason' ] = str ( e . message ) return ret except Exception as e : logger . exception ( str ( e ) ) ret [ 'reason' ] = str ( e ) return ret ret [ 'imported' ] = parser . imported ret [ 'failed' ] = parser . failed ret [ 'success' ] = True return ret