def calculate(self, sources: Sequence[prensor.NodeTensor], destinations: Sequence[expression.Expression], options: calculate_options.Options, side_info: Optional[prensor.Prensor]=None) -> prensor.NodeTensor:
    [root_node] = sources
    if isinstance(root_node, prensor.RootNodeTensor):
        return prensor.LeafNodeTensor(_get_proto_index_parent_index(root_node), _get_input_proto_index(root_node), is_repeated=False)
    raise ValueError('Illegal operation: expected a true root node: got {}'.format(str(root_node)))
def calculate(self, sources: Sequence[prensor.NodeTensor], destinations: Sequence[expression.Expression], options: calculate_options.Options, side_info: Optional[prensor.Prensor]=None) -> prensor.NodeTensor:
    [root_node] = sources
    if isinstance(root_node, prensor.RootNodeTensor):
        return prensor.LeafNodeTensor(_get_proto_index_parent_index(root_node), _get_input_proto_index(root_node), is_repeated=False)
    raise ValueError('Illegal operation: expected a true root node: got {}'.format(str(root_node)))