class_docstr: The core class of DeepGraph (dg).
  
  This class encapsulates the graph representation as ``pandas.DataFrame``
  objects in its attributes ``v`` and ``e``. It can be initialized with a
  node table ``v``, whose rows represent the nodes of the graph, as well
  as an edge table ``e``, whose rows represent edges between the nodes.
  
  Given a node table ``v``, it provides methods to iteratively compute
  pairwise relations between the nodes using arbitrary, user-defined
  functions. These methods provide arguments to parallelize the
  computation and control memory consumption (see ``create_edges`` and
  ``create_edges_ft``).
  
  Also provides methods to partition nodes, edges or an entire graph by
  the graph's properties and labels, and to create common network
  representations and graph objects of popular Python network packages.
  
  Furthermore, it provides methods to visualize graphs and their
  properties and to benchmark the graph construction parameters.
  
  Optionally, the convenience parameter ``supernode_labels_by`` can be
  passed, creating supernode labels by enumerating all distinct (tuples
  of) values of a (multiple) column(s) of ``v`` . Superedge labels can be
  created analogously, by passing the parameter ``superedge_labels_by``.
  
  Parameters
  ----------
  v : pandas.DataFrame or pandas.HDFStore, optional (default=None)
      The node table, a table representation of the nodes of a graph. The
      index of ``v`` must be unique and represents the node indices. The
      column names of ``v`` represent the types of features of the nodes,
      and each cell represents a feature of a node. Only a reference to
      the input DataFrame is created, not a copy. May also be a
      ``pandas.HDFStore``, but only ``create_edges`` and
      ``create_edges_ft`` may then be used (so far).
  
  e : pandas.DataFrame, optional (default=None)
      The edge table, a table representation of the edges between the
      nodes given by ``v``. Its index has to be a
      ``pandas.core.index.MultiIndex``, whose first level contains the
      indices of the source nodes, and the second level contains the
      indices of the target nodes. Each row of ``e`` represents an edge,
      column names of ``e`` represent the types of relations of the edges,
      and each cell in ``e`` represents a relation of an edge. Only a
      reference to the input DataFrame is created, not a copy.
  
  supernode_labels_by : dict, optional (default=None)
      A dictionary whose keys are strings and their values are (lists of)
      column names of ``v``. Appends a column to ``v`` for each key, whose
      values correspond to supernode labels, enumerating all distinct
      (tuples of) values of the column(s) given by the dict's value.
  
  superedge_labels_by : dict, optional (default=None)
      A dictionary whose keys are strings and their values are (lists of)
      column names of ``e``. Appends a column to ``e`` for each key, whose
      values correspond to superedge labels enumerating all distinct
      (tuples of) values of the column(s) given by the dict's value.
  
  Attributes
  ----------
  v : pandas.DataFrame
      See Parameters.
  
  e : pandas.DataFrame
      See Parameters.
  
  n : int
      Property: Number of nodes.
  
  m : int
      Property: Number of edges.
  
  f : pd.DataFrame
      Property: types of features and number of features of corresponding
      type.
  
  r : pd.DataFrame
      Property: types of relations and number of relations of
      corresponding type.
class_docstr_tok: ["The","core","class","of","DeepGraph","(","dg",")",".","This","class","encapsulates","the","graph","representation","as","``","pandas.DataFrame","``","objects","in","its","attributes","``","v","``","and","``","e","``",".","It","can","be","initialized","with","a","node","table","``","v","``",",","whose","rows","represent","the","nodes","of","the","graph",",","as","well","as","an","edge","table","``","e","``",",","whose","rows","represent","edges","between","the","nodes",".","Given","a","node","table","``","v","``",",","it","provides","methods","to","iteratively","compute","pairwise","relations","between","the","nodes","using","arbitrary",",","user-defined","functions",".","These","methods","provide","arguments","to","parallelize","the","computation","and","control","memory","consumption","(","see","``","create_edges","``","and","``","create_edges_ft","``",")",".","Also","provides","methods","to","partition","nodes",",","edges","or","an","entire","graph","by","the","graph","'s","properties","and","labels",",","and","to","create","common","network","representations","and","graph","objects","of","popular","Python","network","packages",".","Furthermore",",","it","provides","methods","to","visualize","graphs","and","their","properties","and","to","benchmark","the","graph","construction","parameters",".","Optionally",",","the","convenience","parameter","``","supernode_labels_by","``","can","be","passed",",","creating","supernode","labels","by","enumerating","all","distinct","(","tuples","of",")","values","of","a","(","multiple",")","column","(","s",")","of","``","v","``",".","Superedge","labels","can","be","created","analogously",",","by","passing","the","parameter","``","superedge_labels_by","``",".","Parameters","--","--","--","--","--","v",":","pandas.DataFrame","or","pandas.HDFStore",",","optional","(","default=None",")","The","node","table",",","a","table","representation","of","the","nodes","of","a","graph",".","The","index","of","``","v","``","must","be","unique","and","represents","the","node","indices",".","The","column","names","of","``","v","``","represent","the","types","of","features","of","the","nodes",",","and","each","cell","represents","a","feature","of","a","node",".","Only","a","reference","to","the","input","DataFrame","is","created",",","not","a","copy",".","May","also","be","a","``","pandas.HDFStore","``",",","but","only","``","create_edges","``","and","``","create_edges_ft","``","may","then","be","used","(","so","far",")",".","e",":","pandas.DataFrame",",","optional","(","default=None",")","The","edge","table",",","a","table","representation","of","the","edges","between","the","nodes","given","by","``","v","``",".","Its","index","has","to","be","a","``","pandas.core.index.MultiIndex","``",",","whose","first","level","contains","the","indices","of","the","source","nodes",",","and","the","second","level","contains","the","indices","of","the","target","nodes",".","Each","row","of","``","e","``","represents","an","edge",",","column","names","of","``","e","``","represent","the","types","of","relations","of","the","edges",",","and","each","cell","in","``","e","``","represents","a","relation","of","an","edge",".","Only","a","reference","to","the","input","DataFrame","is","created",",","not","a","copy",".","supernode_labels_by",":","dict",",","optional","(","default=None",")","A","dictionary","whose","keys","are","strings","and","their","values","are","(","lists","of",")","column","names","of","``","v","``",".","Appends","a","column","to","``","v","``","for","each","key",",","whose","values","correspond","to","supernode","labels",",","enumerating","all","distinct","(","tuples","of",")","values","of","the","column","(","s",")","given","by","the","dict","'s","value",".","superedge_labels_by",":","dict",",","optional","(","default=None",")","A","dictionary","whose","keys","are","strings","and","their","values","are","(","lists","of",")","column","names","of","``","e","``",".","Appends","a","column","to","``","e","``","for","each","key",",","whose","values","correspond","to","superedge","labels","enumerating","all","distinct","(","tuples","of",")","values","of","the","column","(","s",")","given","by","the","dict","'s","value",".","Attributes","--","--","--","--","--","v",":","pandas.DataFrame","See","Parameters",".","e",":","pandas.DataFrame","See","Parameters",".","n",":","int","Property",":","Number","of","nodes",".","m",":","int","Property",":","Number","of","edges",".","f",":","pd.DataFrame","Property",":","types","of","features","and","number","of","features","of","corresponding","type",".","r",":","pd.DataFrame","Property",":","types","of","relations","and","number","of","relations","of","corresponding","type","."]
docstr: Return a ``networkx.MultiDiGraph`` representation.
  
  Create a ``networkx.MultiDiGraph`` representation of the graph given by
  ``v`` and ``e``. As opposed to ``return_nx_graph``, where every row of
  ``e`` is treated as one edge, this method treats every cell of
  ``e`` as one edge. The input argument ``features`` indicates which node
  properties to transfer. ``relations`` indicates which edges to
  transfer. Whether to drop edges with NA values can be controlled by
  ``dropna``.
  
  Needs pandas >= 0.17.0.
  
  Parameters
  ----------
  features : bool, str, or array_like, optional (default=False)
      Indicates which types of features to transfer as node attributes.
      Can be column name(s) of ``v``, False or True. If False, create no
      node attributes. If True, create node attributes for every column
      in ``v``. If str or array_like, must be column name(s) of ``v``
      indicating which types of features to transfer.
  
  relations : bool, str, or array_like, optional (default=False)
      Indicates which cells of ``e`` to transfer as edges. Can be False,
      True, or a (list of) column name(s) of ``e``. If False (default),
      all cells of ``e`` are translated to edges, but their values are
      not transferred as edge attributes. If True, all cells of ``e`` are
      translated, and their values are transferred as edge attributes. If
      str or array_like, must be column name(s) of ``e``, restricting the
      translation of cells to edges to ``e[relations]`` (values are
      transferred as edge attributes).
  
  dropna : bool, optional (default=True)
      Whether to drop edges with NA values. Cells in ``e`` with NA values
      are not translated to edges.
  
  Returns
  -------
  nx_g : networkx.MultiDiGraph
  
  See also
  --------
  return_nx_graph
  return_cs_graph
  return_gt_graph
docstr_tok: ["Return","a","``","networkx.MultiDiGraph","``","representation",".","Create","a","``","networkx.MultiDiGraph","``","representation","of","the","graph","given","by","``","v","``","and","``","e","``",".","As","opposed","to","``","return_nx_graph","``",",","where","every","row","of","``","e","``","is","treated","as","one","edge",",","this","method","treats","every","cell","of","``","e","``","as","one","edge",".","The","input","argument","``","features","``","indicates","which","node","properties","to","transfer",".","``","relations","``","indicates","which","edges","to","transfer",".","Whether","to","drop","edges","with","NA","values","can","be","controlled","by","``","dropna","``",".","Needs","pandas",">","=","0.17.0",".","Parameters","--","--","--","--","--","features",":","bool",",","str",",","or","array_like",",","optional","(","default=False",")","Indicates","which","types","of","features","to","transfer","as","node","attributes",".","Can","be","column","name","(","s",")","of","``","v","``",",","False","or","True",".","If","False",",","create","no","node","attributes",".","If","True",",","create","node","attributes","for","every","column","in","``","v","``",".","If","str","or","array_like",",","must","be","column","name","(","s",")","of","``","v","``","indicating","which","types","of","features","to","transfer",".","relations",":","bool",",","str",",","or","array_like",",","optional","(","default=False",")","Indicates","which","cells","of","``","e","``","to","transfer","as","edges",".","Can","be","False",",","True",",","or","a","(","list","of",")","column","name","(","s",")","of","``","e","``",".","If","False","(","default",")",",","all","cells","of","``","e","``","are","translated","to","edges",",","but","their","values","are","not","transferred","as","edge","attributes",".","If","True",",","all","cells","of","``","e","``","are","translated",",","and","their","values","are","transferred","as","edge","attributes",".","If","str","or","array_like",",","must","be","column","name","(","s",")","of","``","e","``",",","restricting","the","translation","of","cells","to","edges","to","``","e","[","relations","]","``","(","values","are","transferred","as","edge","attributes",")",".","dropna",":","bool",",","optional","(","default=True",")","Whether","to","drop","edges","with","NA","values",".","Cells","in","``","e","``","with","NA","values","are","not","translated","to","edges",".","Returns","--","--","--","-","nx_g",":","networkx.MultiDiGraph","See","also","--","--","--","--","return_nx_graph","return_cs_graph","return_gt_graph"]
code: def return_nx_multigraph(
      self, features=False, relations=False, dropna=True
  ):
      """Return a ``networkx.MultiDiGraph`` representation.
  
      Create a ``networkx.MultiDiGraph`` representation of the graph given by
      ``v`` and ``e``. As opposed to ``return_nx_graph``, where every row of
      ``e`` is treated as one edge, this method treats every cell of
      ``e`` as one edge. The input argument ``features`` indicates which node
      properties to transfer. ``relations`` indicates which edges to
      transfer. Whether to drop edges with NA values can be controlled by
      ``dropna``.
  
      Needs pandas >= 0.17.0.
  
      Parameters
      ----------
      features : bool, str, or array_like, optional (default=False)
          Indicates which types of features to transfer as node attributes.
          Can be column name(s) of ``v``, False or True. If False, create no
          node attributes. If True, create node attributes for every column
          in ``v``. If str or array_like, must be column name(s) of ``v``
          indicating which types of features to transfer.
  
      relations : bool, str, or array_like, optional (default=False)
          Indicates which cells of ``e`` to transfer as edges. Can be False,
          True, or a (list of) column name(s) of ``e``. If False (default),
          all cells of ``e`` are translated to edges, but their values are
          not transferred as edge attributes. If True, all cells of ``e`` are
          translated, and their values are transferred as edge attributes. If
          str or array_like, must be column name(s) of ``e``, restricting the
          translation of cells to edges to ``e[relations]`` (values are
          transferred as edge attributes).
  
      dropna : bool, optional (default=True)
          Whether to drop edges with NA values. Cells in ``e`` with NA values
          are not translated to edges.
  
      Returns
      -------
      nx_g : networkx.MultiDiGraph
  
      See also
      --------
      return_nx_graph
      return_cs_graph
      return_gt_graph
  
      """
  
      import networkx as nx
  
      # create empty MultiDiGraph
      nx_g = nx.MultiDiGraph()
  
      # select features
      if features is False:
          vt = pd.DataFrame(index=self.v.index)
      elif features is True:
          vt = self.v
      elif _is_array_like(features):
          vt = self.v[features]
      else:
          vt = self.v[features].to_frame()
  
      # create nx compatible tuple, (index, weight_dict)
      vt = vt.to_dict("index")
      vt = ((key, value) for key, value in vt.items())
  
      # add nodes
      nx_g.add_nodes_from(vt)
  
      # select relations
      if hasattr(self, "e"):
          if relations is False:
              if dropna:
                  et = self.e.count(axis=1).to_dict()
                  et = ((key,) * value for key, value in et.items())
                  et = chain(*et)
              else:
                  ncol = len(self.e.columns)
                  et = self.e.index
                  et = ((key,) * ncol for key in et)
                  et = chain(*et)
  
          elif relations is True:
              et = _iter_edges(self.e, dropna)
  
          elif _is_array_like(relations):
              et = self.e[relations]
              et = _iter_edges(et, dropna)
  
          else:
              et = self.e[relations].to_frame()
              et = _iter_edges(et, dropna)
  
          # add edges
          nx_g.add_edges_from(et)
  
      return nx_g
  
imports: import inspect
  import os
  from datetime import datetime
  from itertools import chain
  from deepgraph.iterators_and_indexers import _matrix_iterator, _ft_iterator, _iter_edges, _initiate_create_edges, _aggregate_super_table
  from deepgraph.utils import _is_array_like, _dic_translator, _create_bin_edges, _flatten
  import numpy
  import pandas
label_desc: Use image node_id 11 for calling the DeepGraph obj's underlying member method code with example usage: obj.return_nx_multigraph(features, relations, dropna) and returns: nx_g