(self, objects)
return result
Transform stix to dict and deep copy the dict.
Transform stix to dict and deep copy the dict.
Transform stix to dict and deep copy the dict .
def deep_copy_stix(self, objects):
        """
        Transform stix to dict and deep copy the dict.
        """
        result = []
        for obj in objects:
            obj = dict(obj)
            if 'external_references' in obj:
                for i in range(len(obj['external_references'])):
                    obj['external_references'][i] = dict(
                        obj['external_references'][i])
            if 'kill_chain_phases' in obj:
                for i in range(len(obj['kill_chain_phases'])):
                    obj['kill_chain_phases'][i] = dict(obj['kill_chain_phases'][i])
            if 'modified' in obj:
                obj['modified'] = str(obj['modified'])
            if 'definition' in obj:
                obj['definition'] = dict(obj['definition'])
            obj['created'] = str(obj['created'])
            result.append(obj)
        return result
def deep_copy_stix ( self , objects ) : result = [ ] for obj in objects : obj = dict ( obj ) if 'external_references' in obj : for i in range ( len ( obj [ 'external_references' ] ) ) : obj [ 'external_references' ] [ i ] = dict ( obj [ 'external_references' ] [ i ] ) if 'kill_chain_phases' in obj : for i in range ( len ( obj [ 'kill_chain_phases' ] ) ) : obj [ 'kill_chain_phases' ] [ i ] = dict ( obj [ 'kill_chain_phases' ] [ i ] ) if 'modified' in obj : obj [ 'modified' ] = str ( obj [ 'modified' ] ) if 'definition' in obj : obj [ 'definition' ] = dict ( obj [ 'definition' ] ) obj [ 'created' ] = str ( obj [ 'created' ] ) result . append ( obj ) return result