def networkMultiMode(self, *tags, recordType = True, nodeCount = True, edgeWeight = True, stemmer = None, edgeAttribute = None):
        """Creates a network of the objects found by all tags in _tags_, each node is marked by which tag spawned it making the resultant graph n-partite.

        A **networkMultiMode()** looks are each item in the collection and extracts its values for the tags given by _tags_. Then for all objects returned an edge is created between them, regardless of their type. Each node will have an attribute call `'type'` that gives the tag that created it or both if both created it, e.g. if `'LA'` were in _tags_ node `'English'` would have the type attribute be `'LA'`.

        For example if _tags_ was set to `['CR', 'UT', 'LA']`, a three mode network would be created, composed of a co-citation network from the `'CR'` tag. Then each citation would also have edges to all the languages of Records that cited it and to the WOS number of the those Records.

        The number of times each object occurs is count if _nodeCount_ is `True` and the edges count the number of co-occurrences if _edgeWeight_ is `True`. Both are`True` by default.

        # Parameters

        _tags_ : `str`, `str`, `str`, ... or `list [str]`

        > Any number of tags, or a list of tags

        _nodeCount_ : `optional [bool]`

        > Default `True`, if `True` each node will have an attribute called `'count'` that contains an int giving the number of time the object occurred.

        _edgeWeight_ : `optional [bool]`

        > Default `True`, if `True` each edge will have an attribute called `'weight'` that contains an int giving the number of time the two objects co-occurrenced.

        _stemmer_ : `optional [func]`

        > Default `None`, If _stemmer_ is a callable object, basically a function or possibly a class, it will be called for the ID of every node in the graph, note that all IDs are strings.

        > For example: the function `f = lambda x: x[0]` if given as the stemmer will cause all IDs to be the first character of their unstemmed IDs. e.g. the title `'Goos-Hanchen and Imbert-Fedorov shifts for leaky guided modes'` will create the node `'G'`.

        # Returns

        `networkx Graph`

        > A networkx Graph with the objects of the tags _tags_ as nodes and their co-occurrences as edges
        """
        if len(tags) == 1:
            if not isinstance(tags[0], str):
                try:
                    tags = list(tags[0])
                except TypeError:
                    raise TagError("'{}' is not a string it cannot be a tag.".format(tags[0]))
        for t in (i for i in tags if not isinstance(i, str)):
            raise TagError("{} is not a string it cannot be a tag.".format(t))
        stemCheck = False
        if stemmer is not None:
            if isinstance(stemmer, collections.abc.Callable):
                stemCheck = True
            else:
                raise TagError("stemmer must be Callable, e.g. a function or class with a __call__ method.")
        count = 0
        progArgs = (0, "Starting to make a " + str(len(tags)) + "-mode network of: " + ', '.join(tags))
        if metaknowledge.VERBOSE_MODE:
            progKwargs = {'dummy' : False}
        else:
            progKwargs = {'dummy' : True}
        with _ProgressBar(*progArgs, **progKwargs) as PBar:
            if edgeAttribute is not None:
                grph = nx.MultiGraph()
            else:
                grph = nx.Graph()
            for R in self:
                if PBar:
                    count += 1
                    PBar.updateVal(count / len(self), "Analyzing: " + str(R))
                contents = []
                for t in tags:
                    tmpVal = R.get(t)
                    if stemCheck:
                        if tmpVal:
                            if isinstance(tmpVal, list):
                                contents.append((t, [stemmer(str(v)) for v in tmpVal]))
                            else:
                                contents.append((t, [stemmer(str(tmpVal))]))
                    else:
                        if tmpVal:
                            if isinstance(tmpVal, list):
                                contents.append((t, [str(v) for v in tmpVal]))
                            else:
                                contents.append((t, [str(tmpVal)]))
                for i, vlst1 in enumerate(contents):
                    for node1 in vlst1[1]:
                        for vlst2 in contents[i + 1:]:
                            for node2 in vlst2[1]:
                                if edgeAttribute:
                                    for edgeVal in edgeVals:
                                        if grph.has_edge(node1, node2, key = edgeVal):
                                            if edgeWeight:
                                                for i, a in grph.edges[node1, node2].items():
                                                    if a['key'] == edgeVal:
                                                        grph[node1][node2][i]['weight'] += 1
                                                        break
                                        else:
                                            if edgeWeight:
                                                attrDict = {'key' : edgeVal, 'weight' : 1}
                                            else:
                                                attrDict = {'key' : edgeVal}
                                            grph.add_edge(node1, node2, **attrDict)
                                elif edgeWeight:
                                    try:
                                        grph.edges[node1, node2]['weight'] += 1
                                    except KeyError:
                                        grph.add_edge(node1, node2, weight = 1)
                                else:
                                    if not grph.has_edge(node1, node2):
                                        grph.add_edge(node1, node2)
                        if nodeCount:
                            try:
                                grph.node[node1]['count'] += 1
                            except KeyError:
                                try:
                                    grph.node[node1]['count'] = 1
                                    if recordType:
                                        grph.node[node1]['type'] = vlst1[0]
                                except KeyError:
                                    if recordType:
                                        grph.add_node(node1, type = vlst1[0])
                                    else:
                                        grph.add_node(node1)
                        else:
                            if not grph.has_node(node1):
                                if recordType:
                                    grph.add_node(node1, type = vlst1[0])
                                else:
                                    grph.add_node(node1)
                            elif recordType:
                                try:
                                    grph.node[node1]['type'] += vlst1[0]
                                except KeyError:
                                    grph.node[node1]['type'] = vlst1[0]
            if PBar:
                PBar.finish("Done making a {}-mode network of: {}".format(len(tags), ', '.join(tags)))
        return grph
def networkMultiMode ( self , * tags , recordType = True , nodeCount = True , edgeWeight = True , stemmer = None , edgeAttribute = None ) : if len ( tags ) == 1 : if not isinstance ( tags [ 0 ] , str ) : try : tags = list ( tags [ 0 ] ) except TypeError : raise TagError ( "'{}' is not a string it cannot be a tag." . format ( tags [ 0 ] ) ) for t in ( i for i in tags if not isinstance ( i , str ) ) : raise TagError ( "{} is not a string it cannot be a tag." . format ( t ) ) stemCheck = False if stemmer is not None : if isinstance ( stemmer , collections . abc . Callable ) : stemCheck = True else : raise TagError ( "stemmer must be Callable, e.g. a function or class with a __call__ method." ) count = 0 progArgs = ( 0 , "Starting to make a " + str ( len ( tags ) ) + "-mode network of: " + ', ' . join ( tags ) ) if metaknowledge . VERBOSE_MODE : progKwargs = { 'dummy' : False } else : progKwargs = { 'dummy' : True } with _ProgressBar ( * progArgs , ** progKwargs ) as PBar : if edgeAttribute is not None : grph = nx . MultiGraph ( ) else : grph = nx . Graph ( ) for R in self : if PBar : count += 1 PBar . updateVal ( count / len ( self ) , "Analyzing: " + str ( R ) ) contents = [ ] for t in tags : tmpVal = R . get ( t ) if stemCheck : if tmpVal : if isinstance ( tmpVal , list ) : contents . append ( ( t , [ stemmer ( str ( v ) ) for v in tmpVal ] ) ) else : contents . append ( ( t , [ stemmer ( str ( tmpVal ) ) ] ) ) else : if tmpVal : if isinstance ( tmpVal , list ) : contents . append ( ( t , [ str ( v ) for v in tmpVal ] ) ) else : contents . append ( ( t , [ str ( tmpVal ) ] ) ) for i , vlst1 in enumerate ( contents ) : for node1 in vlst1 [ 1 ] : for vlst2 in contents [ i + 1 : ] : for node2 in vlst2 [ 1 ] : if edgeAttribute : for edgeVal in edgeVals : if grph . has_edge ( node1 , node2 , key = edgeVal ) : if edgeWeight : for i , a in grph . edges [ node1 , node2 ] . items ( ) : if a [ 'key' ] == edgeVal : grph [ node1 ] [ node2 ] [ i ] [ 'weight' ] += 1 break else : if edgeWeight : attrDict = { 'key' : edgeVal , 'weight' : 1 } else : attrDict = { 'key' : edgeVal } grph . add_edge ( node1 , node2 , ** attrDict ) elif edgeWeight : try : grph . edges [ node1 , node2 ] [ 'weight' ] += 1 except KeyError : grph . add_edge ( node1 , node2 , weight = 1 ) else : if not grph . has_edge ( node1 , node2 ) : grph . add_edge ( node1 , node2 ) if nodeCount : try : grph . node [ node1 ] [ 'count' ] += 1 except KeyError : try : grph . node [ node1 ] [ 'count' ] = 1 if recordType : grph . node [ node1 ] [ 'type' ] = vlst1 [ 0 ] except KeyError : if recordType : grph . add_node ( node1 , type = vlst1 [ 0 ] ) else : grph . add_node ( node1 ) else : if not grph . has_node ( node1 ) : if recordType : grph . add_node ( node1 , type = vlst1 [ 0 ] ) else : grph . add_node ( node1 ) elif recordType : try : grph . node [ node1 ] [ 'type' ] += vlst1 [ 0 ] except KeyError : grph . node [ node1 ] [ 'type' ] = vlst1 [ 0 ] if PBar : PBar . finish ( "Done making a {}-mode network of: {}" . format ( len ( tags ) , ', ' . join ( tags ) ) ) return grph
Creates a network of the objects found by all tags in _tags_, each node is marked by which tag spawned it making the resultant graph n-partite.

        A **networkMultiMode()** looks are each item in the collection and extracts its values for the tags given by _tags_. Then for all objects returned an edge is created between them, regardless of their type. Each node will have an attribute call `'type'` that gives the tag that created it or both if both created it, e.g. if `'LA'` were in _tags_ node `'English'` would have the type attribute be `'LA'`.

        For example if _tags_ was set to `['CR', 'UT', 'LA']`, a three mode network would be created, composed of a co-citation network from the `'CR'` tag. Then each citation would also have edges to all the languages of Records that cited it and to the WOS number of the those Records.

        The number of times each object occurs is count if _nodeCount_ is `True` and the edges count the number of co-occurrences if _edgeWeight_ is `True`. Both are`True` by default.

        # Parameters

        _tags_ : `str`, `str`, `str`, ... or `list [str]`

        > Any number of tags, or a list of tags

        _nodeCount_ : `optional [bool]`

        > Default `True`, if `True` each node will have an attribute called `'count'` that contains an int giving the number of time the object occurred.

        _edgeWeight_ : `optional [bool]`

        > Default `True`, if `True` each edge will have an attribute called `'weight'` that contains an int giving the number of time the two objects co-occurrenced.

        _stemmer_ : `optional [func]`

        > Default `None`, If _stemmer_ is a callable object, basically a function or possibly a class, it will be called for the ID of every node in the graph, note that all IDs are strings.

        > For example: the function `f = lambda x: x[0]` if given as the stemmer will cause all IDs to be the first character of their unstemmed IDs. e.g. the title `'Goos-Hanchen and Imbert-Fedorov shifts for leaky guided modes'` will create the node `'G'`.

        # Returns

        `networkx Graph`

        > A networkx Graph with the objects of the tags _tags_ as nodes and their co-occurrences as edges