# Path: csc/divisi/labeled_tensor.py
# class OldDenseLabeledTensor(LabeledView):
# class OldSparseLabeledTensor(LabeledView):
#     def __repr__(self):
#     def __init__(self, *a, **kw):
#     def __repr__(self):
#     def dot(self, other):
#     def array_op(self, ufunc, *others):
#         def take_data(tensor):
#     def slice(self, mode, label):
#     def dense_slice(self, mode, label):
#     def load(cls, filebase):


from collections import defaultdict
from csc.divisi.labeled_tensor import SparseLabeledTensor
from semantic_network import SemanticNetwork
import copy
import logging

        self.num_nodes = num_nodes
        self.graph = graph
        self.tensor = self._build_analogy_tensor(graph, num_nodes, min_graph_edges,
                                                 min_feature_edges, max_feature_edges,
                                                 logging_interval=logging_interval)
        self.svd = self.tensor.svd(k=svd_dims)


    def _build_analogy_tensor(self, graph, num_nodes, min_graph_edges,
                              min_feature_edges, max_feature_edges,
                              logging_interval=None):

        '''
        Builds a tensor T whose rows correspond to maximal dense subgraphs of
        graph and whose columns are relation structures (n-ary relations
        formed by combining multiple binary relations).

        graph - The graph from which the tensor is built
        num_nodes - The size of each vertex set row
        min_graph_edges - The minimum number of edges in the graphs being indexed
        min_feature_edges - The minimum number of edges to include in a graph feature
        max_feature_edges - The minimum number of edges to include in a graph feature

        Note: the min_graph_edges parameter treats the graph as if it
        is undirected and untyped, meaning there is at most 1 edge
        between 2 vertices
        '''
        k_subgraphs = k_edge_subgraphs(graph, min_graph_edges, num_nodes,
                                         logging_interval=logging_interval)

# Path: csc/divisi/labeled_tensor.py
# class OldDenseLabeledTensor(LabeledView):
# class OldSparseLabeledTensor(LabeledView):
#     def __repr__(self):
#     def __init__(self, *a, **kw):
#     def __repr__(self):
#     def dot(self, other):
#     def array_op(self, ufunc, *others):
#         def take_data(tensor):
#     def slice(self, mode, label):
#     def dense_slice(self, mode, label):
#     def load(cls, filebase):


# Path: csc/divisi/crossbridge.py
from collections import defaultdict
from csc.divisi.labeled_tensor import SparseLabeledTensor
from semantic_network import SemanticNetwork
import copy
import logging


        self.num_nodes = num_nodes
        self.graph = graph
        self.tensor = self._build_analogy_tensor(graph, num_nodes, min_graph_edges,
                                                 min_feature_edges, max_feature_edges,
                                                 logging_interval=logging_interval)
        self.svd = self.tensor.svd(k=svd_dims)


    def _build_analogy_tensor(self, graph, num_nodes, min_graph_edges,
                              min_feature_edges, max_feature_edges,
                              logging_interval=None):

        '''
        Builds a tensor T whose rows correspond to maximal dense subgraphs of
        graph and whose columns are relation structures (n-ary relations
        formed by combining multiple binary relations).

        graph - The graph from which the tensor is built
        num_nodes - The size of each vertex set row
        min_graph_edges - The minimum number of edges in the graphs being indexed
        min_feature_edges - The minimum number of edges to include in a graph feature
        max_feature_edges - The minimum number of edges to include in a graph feature

        Note: the min_graph_edges parameter treats the graph as if it
        is undirected and untyped, meaning there is at most 1 edge
        between 2 vertices
        '''
        k_subgraphs = k_edge_subgraphs(graph, min_graph_edges, num_nodes,
                                         logging_interval=logging_interval)

        rel_tensor = SparseLabeledTensor(ndim=2)