def is_factor_socket(socket):
    return (isinstance(socket, bpy.types.NodeSocketColor) and ((not socket.is_linked) or (socket.links[0] not in texture_node.path)))
def is_factor_socket(socket):
    return (isinstance(socket, bpy.types.NodeSocketColor) and ((not socket.is_linked) or (socket.links[0] not in texture_node.path)))