code: def subgraph(self, graph=None, name=None, comment=None,
                   graph_attr=None, node_attr=None, edge_attr=None, body=None):
          
          if graph is None:
              kwargs = {'name': name, 'comment': comment,
                        'graph_attr': graph_attr, 'node_attr': node_attr,
                        'edge_attr': edge_attr, 'body': body}
              return SubgraphContext(self, kwargs)
  
          args = [name, comment, graph_attr, node_attr, edge_attr, body]
          if not all(a is None for a in args):
              raise ValueError('graph must be sole argument of subgraph()')
          if graph.directed != self.directed:
              raise ValueError('%r cannot add subgraph of different kind: %r '
                  % (self, graph))
          lines = ['\t' + line for line in graph.__iter__(subgraph=True)]
          self.body.extend(lines)
docs: Add the current content of the given sole ``graph`` argument as subgraph \
             or return a context manager returning a new graph instance created \
             with the given (``name``, ``comment``, etc.) arguments whose content is \
             added as subgraph when leaving the context manager's ``with``-block.
  
          Args:
              graph: An instance of the same kind (:class:`.Graph`, :class:`.Digraph`)
                     as the current graph (sole argument in non-with-block use).
              name: Subgraph name (``with``-block use).
              comment: Subgraph comment (``with``-block use).
              graph_attr: Subgraph-level attribute-value mapping (``with``-block use).
              node_attr: Node-level attribute-value mapping (``with``-block use).
              edge_attr: Edge-level attribute-value mapping (``with``-block use).
              body: Verbatim lines to add to the subgraph ``body`` (``with``-block use).
  
          See the :ref:`usage examples in the User Guide <subgraphs>`.
  
          .. note::
              If the ``name`` of the subgraph begins with ``'cluster'`` (all lowercase)
              the layout engine will treat it as a special cluster subgraph.