(data, analyst, source, reference, method="STIX Import",
                    hdr_events=True, use_hdr_src=True, obs_as_ind=False)
return ret
If given the path to a file (SITX file or .zip of STIX files), open
            the file. Take file-like object, parse the STIX data, and import
            into CRITs.

            :param data: The full path to the file or a file-like object.
            :type : str or
            :param analyst: The analyst's username.
            :type analyst: str
            :param source: The name of the CRITs Source assocaited with this data.
            :type source: str
            :param reference: A reference to the data's source.
            :type reference: str
            :param method: The method of acquiring or importing this document.
            :type method: str
            :param hdr_events: Whether or not we should make an Event for this document.
            :type hdr_events: bool
            :param use_hdr_src: If True, try to use STIX Header Information Source
                                instead of the "source" & "reference" parameters.
            :type use_hdr_src: boolean
            :returns: dict
If given the path to a file (SITX file or .zip of STIX files), open
            the file. Take file-like object, parse the STIX data, and import
            into CRITs.
If given the path to a file ( SITX file or . zip of STIX files ) open the file . Take file - like object parse the STIX data and import into CRITs .
def import_stix(data, analyst, source, reference, method="STIX Import",
                    hdr_events=True, use_hdr_src=True, obs_as_ind=False):
        """
            If given the path to a file (SITX file or .zip of STIX files), open
            the file. Take file-like object, parse the STIX data, and import
            into CRITs.

            :param data: The full path to the file or a file-like object.
            :type : str or
            :param analyst: The analyst's username.
            :type analyst: str
            :param source: The name of the CRITs Source assocaited with this data.
            :type source: str
            :param reference: A reference to the data's source.
            :type reference: str
            :param method: The method of acquiring or importing this document.
            :type method: str
            :param hdr_events: Whether or not we should make an Event for this document.
            :type hdr_events: bool
            :param use_hdr_src: If True, try to use STIX Header Information Source
                                instead of the "source" & "reference" parameters.
            :type use_hdr_src: boolean
            :returns: dict
        """

        if isinstance(data, basestring):
            ret = handlers.import_standards_doc(data, analyst, method,
                                                reference, hdr_events,
                                                source=source,
                                                use_hdr_src=use_hdr_src,
                                                obs_as_ind=obs_as_ind)
            return ret
        try:
            with open(data, 'r') as f:
                ret = handlers.process_stix_upload(f, analyst, source, reference,
                                                   use_hdr_src, import_now=True)
        except IOError as e:
            ret = {'status': False,
                   'msg': 'Error reading STIX file - %s' % e}
        return ret
def import_stix ( data , analyst , source , reference , method = "STIX Import" , hdr_events = True , use_hdr_src = True , obs_as_ind = False ) : if isinstance ( data , basestring ) : ret = handlers . import_standards_doc ( data , analyst , method , reference , hdr_events , source = source , use_hdr_src = use_hdr_src , obs_as_ind = obs_as_ind ) return ret try : with open ( data , 'r' ) as f : ret = handlers . process_stix_upload ( f , analyst , source , reference , use_hdr_src , import_now = True ) except IOError as e : ret = { 'status' : False , 'msg' : 'Error reading STIX file - %s' % e } return ret