# -*- coding: utf-8 -*-

def filterSjy(node):
    """过滤输入"""
    return node['category'] == "sjy"


def filterJsfs(node):
    """过滤计算"""
    return node['category'] == "jsfs"


def filterScfs(node):
    """过滤输出"""
    return node['category'] == "scfs"


def getKey(list, key):
    """获取数据"""
    for x in list:
        if x["key"] == key:
            return x


def getLink(key, links):
    """获取连接"""
    list = []
    for link in links:
        if link['to'] == key:
            list.append(link['from'])
    return list;
