class_docstr: Controls the setup and execution of a pipeline of processes.
class_docstr_tok: ["Controls","the","setup","and","execution","of","a","pipeline","of","processes","."]
docstr: Disconnect nodes
  See the docstring for connect for format.
docstr_tok: ["Disconnect","nodes","See","the","docstring","for","connect","for","format","."]
code: def disconnect(self, *args):
      """Disconnect nodes
      See the docstring for connect for format.
      """
      if len(args) == 1:
          connection_list = args[0]
      elif len(args) == 4:
          connection_list = [(args[0], args[2], [(args[1], args[3])])]
      else:
          raise TypeError(
              "disconnect() takes either 4 arguments, or 1 list "
              "of connection tuples (%d args given)" % len(args)
          )
  
      for srcnode, dstnode, conn in connection_list:
          logger.debug(
              "disconnect(): %s->%s %s", srcnode, dstnode, str(conn)
          )
          if self in [srcnode, dstnode]:
              raise IOError(
                  "Workflow connect cannot contain itself as node: src[%s] "
                  "dest[%s] workflow[%s]"
              ) % (srcnode, dstnode, self.name)
  
          # If node is not in the graph, not connected
          if not self._has_node(srcnode) or not self._has_node(dstnode):
              continue
  
          edge_data = self._graph.get_edge_data(
              srcnode, dstnode, {"connect": []}
          )
          ed_conns = [(c[0], c[1]) for c in edge_data["connect"]]
  
          remove = []
          for edge in conn:
              if edge in ed_conns:
                  # idx = ed_conns.index(edge)
                  remove.append((edge[0], edge[1]))
  
          logger.debug("disconnect(): remove list %s", str(remove))
          for el in remove:
              edge_data["connect"].remove(el)
              logger.debug(
                  "disconnect(): removed connection %s", str(el)
              )
  
          if not edge_data["connect"]:
              self._graph.remove_edge(srcnode, dstnode)
          else:
              self._graph.add_edges_from(
                  [(srcnode, dstnode, edge_data)]
              )
  
imports: import os
  import os.path
  import sys
  from datetime import datetime
  from copy import deepcopy
  import pickle
  import shutil
  import numpy
  from ...None import config, logging
  from ...utils.misc import str2bool
  from ...utils.functions import getsource, create_function_from_source
  from ...interfaces.base import traits, TraitedSpec, TraitDictObject, TraitListObject
  from ...utils.filemanip import save_json
  from .utils import generate_expanded_graph, export_graph, write_workflow_prov, write_workflow_resources, format_dot, topological_sort, get_print_name, merge_dict, format_node
  from .base import EngineBase
  from .nodes import MapNode
label_desc: Use image node_id 4 for calling the Workflow obj's underlying member method code with example usage: obj.disconnect() without return types