code: def get_sub_dsp(self, nodes_bunch, edges_bunch=None):
          nodes_bunch = [self.get_node(u)[1][0] for u in nodes_bunch]
          sub_dsp = self.copy_structure(
              dmap=self.dmap.subgraph(nodes_bunch).copy()
          )
          nodes, dmap_out_degree = sub_dsp.nodes, sub_dsp.dmap.out_degree
          dmap_dv, dmap_rm_edge = self.default_values, sub_dsp.dmap.remove_edge
          dmap_rm_node = sub_dsp.dmap.remove_node
          for u in nodes_bunch:
              n = nodes[u].get('inputs', None)
              if n is not None and not set(n).issubset(nodes_bunch):
                  dmap_rm_node(u)
          if edges_bunch is not None:
              for e in edges_bunch:
                  dmap_rm_edge(*e)
          for u in [u for u, n in sub_dsp.dmap.nodes.items()
                    if n['type'] == 'function']:
              if not dmap_out_degree(u):
                  dmap_rm_node(u)
          from networkx import isolates
          sub_dsp.dmap.remove_nodes_from(list(isolates(sub_dsp.dmap)))
          sub_dsp.default_values = {k: dmap_dv[k] for k in dmap_dv if k in nodes}
          return sub_dsp