当前位置: 首页>>代码示例>>Python>>正文


Python TypeConvertor.serializeSymbols方法代码示例

本文整理汇总了Python中netzob.Common.Type.TypeConvertor.TypeConvertor.serializeSymbols方法的典型用法代码示例。如果您正苦于以下问题:Python TypeConvertor.serializeSymbols方法的具体用法?Python TypeConvertor.serializeSymbols怎么用?Python TypeConvertor.serializeSymbols使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在netzob.Common.Type.TypeConvertor.TypeConvertor的用法示例。


在下文中一共展示了TypeConvertor.serializeSymbols方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: processUPGMA

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import serializeSymbols [as 别名]
    def processUPGMA(self):
        self.log.debug("Computing the associated matrix")

        # Serialize the symbols
        (serialSymbols, formatSymbols) = TypeConvertor.serializeSymbols(self.symbols, self.unitSize, self.scores)
        self.log.debug("Clustering input format " + formatSymbols)

        # Execute the Clustering part in C
        debug = False
        logging.debug("Execute the clustering part in C ...")
        (i_max, j_max, maxScore, scores) = _libNeedleman.getHighestEquivalentGroup(self.doInternalSlick, len(self.symbols), formatSymbols, serialSymbols, self.cb_executionStatus, debug)
        listScores = TypeConvertor.deserializeScores(self.symbols, scores)

        # Retrieve the scores for each association of symbols
        self.scores = {}
        for (iuid, juid, score) in listScores:
            if iuid not in self.scores.keys():
                self.scores[iuid] = {}
            if juid not in self.scores.keys():
                self.scores[juid] = {}
            self.scores[iuid][juid] = score
            if iuid not in self.scores[juid].keys():
                self.scores[juid][iuid] = score

        # Reduce the UPGMA matrix (merge symbols by similarity)
        self.computePhylogenicTree()
        return (i_max, j_max, maxScore)
开发者ID:KurSh,项目名称:netzob,代码行数:29,代码来源:UPGMA.py

示例2: deserializeGroups

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import serializeSymbols [as 别名]
    def deserializeGroups(self, symbols):
        # First we serialize the messages
        (serialSymbols, format) = TypeConvertor.serializeSymbols(symbols, self.unitSize, self.scores)

        debug = False
        return _libNeedleman.deserializeGroups(len(symbols), format, serialSymbols, debug)
开发者ID:KurSh,项目名称:netzob,代码行数:8,代码来源:UPGMA.py


注:本文中的netzob.Common.Type.TypeConvertor.TypeConvertor.serializeSymbols方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。