matcher.py 文件源码

python
阅读 61 收藏 0 点赞 0 评论 0

项目:dbas 作者: hhucn 项目源码 文件源码
def __sort_array(list):
    """
    Returns sorted array, based on the distance

    :param list: Array
    :return: Array
    """
    return_list = []
    newlist = sorted(list, key=lambda k: k['distance'])

    if mechanism == 'SequenceMatcher':  # sort descending
        newlist = reversed(newlist)

    # add index
    for index, dict in enumerate(newlist):
        dict['index'] = index
        return_list.append(dict)

    return return_list
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号