code: def _compute_paths(self, transform=None):
      import numpy as np
  
      visual_vertices = self._visual_vertices
      if transform is None:
          transform = self.get_transform()
      trans = transform.transform
      trans_inv = transform.inverted().transform
  
      # Loops split the largest wedge left open by other
      # edges of that vertex. The algo is:
      # (i) Find what vertices each loop belongs to
      # (ii) While going through the edges, record the angles
      #      for vertices with loops
      # (iii) Plot each loop based on the recorded angles
      loop_vertex_dict = {}
      for i, edge_vertices in enumerate(visual_vertices):
          if edge_vertices[0] == edge_vertices[1]:
              if edge_vertices[0] not in loop_vertex_dict:
                  loop_vertex_dict[edge_vertices[0]] = {
                      "indices": [],
                      "sizes": [],
                      "edge_angles": [],
                  }
                  if self._directed:
                      loop_vertex_dict[edge_vertices[0]][
                          "arrow_sizes"
                      ] = []
                      loop_vertex_dict[edge_vertices[0]][
                          "arrow_widths"
                      ] = []
              loop_vertex_dict[edge_vertices[0]]["indices"].append(i)
  
      # Get actual coordinates of the vertex border (rough)
      paths = []
      for i, edge_vertices in enumerate(visual_vertices):
          if self._directed:
              if (self._arrow_sizes is None) or (
                  self._arrow_widths is None
              ):
                  arrow_size = 0
                  arrow_width = 0
              else:
                  arrow_size = self._arrow_sizes[i]
                  arrow_width = self._arrow_widths[i]
  
          # Loops are positioned post-facto in the space left by the othter edges
          if edge_vertices[0] == edge_vertices[1]:
              paths.append(None)
              loop_vertex_dict[edge_vertices[0]]["sizes"].append(
                  self._loop_sizes[i],
              )
              if self._directed:
                  loop_vertex_dict[edge_vertices[0]][
                      "arrow_sizes"
                  ].append(
                      arrow_size,
                  )
                  loop_vertex_dict[edge_vertices[0]][
                      "arrow_widths"
                  ].append(
                      arrow_width,
                  )
              continue
  
          coords = np.vstack(
              [
                  edge_vertices[0].position,
                  edge_vertices[1].position,
              ]
          )
          coordst = trans(coords)
          sizes = self._get_edge_vertex_sizes(edge_vertices)
          if self._curved is not None:
              curved = self._curved[i]
          else:
              curved = False
  
          if self._directed:
              path = self._compute_path_directed(
                  coordst,
                  sizes,
                  trans_inv,
                  curved,
                  arrow_size,
                  arrow_width,
              )
          else:
              path = self._compute_path_undirected(
                  coordst,
                  sizes,
                  trans_inv,
                  curved,
              )
  
          # Collect angles for this vertex, to be used for loops plotting below
          angles = self._compute_edge_angles(
              path, trans, self._directed, curved
          )
          if edge_vertices[0] in loop_vertex_dict:
              loop_vertex_dict[edge_vertices[0]]["edge_angles"].append(
                  angles[0]
              )
          if edge_vertices[1] in loop_vertex_dict:
              loop_vertex_dict[edge_vertices[1]]["edge_angles"].append(
                  angles[1]
              )
  
          # Add the path for this non-loop edge
          paths.append(path)
  
      # Deal with loops at the end
      for visual_vertex, ldict in loop_vertex_dict.items():
          coords = np.vstack([visual_vertex.position] * 2)
          coordst = trans(coords)
          vertex_size = self._get_edge_vertex_sizes([visual_vertex])[0]
  
          edge_angles = ldict["edge_angles"]
          if edge_angles:
              edge_angles.sort()
              # Circle around
              edge_angles.append(edge_angles[0] + 2 * pi)
              wedges = [
                  (a2 - a1)
                  for a1, a2 in zip(edge_angles[:-1], edge_angles[1:])
              ]
              # Argsort
              imax = max(range(len(wedges)), key=lambda i: wedges[i])
              angle1, angle2 = edge_angles[imax], edge_angles[imax + 1]
          else:
              # Isolated vertices with loops
              angle1, angle2 = -pi, pi
  
          nloops = len(ldict["indices"])
          for i in range(nloops):
              angle1i = angle1 + (angle2 - angle1) * i / nloops
              angle2i = angle1 + (angle2 - angle1) * (i + 1) / nloops
              if self._directed:
                  loop_kwargs = {
                      "arrow_size": ldict["arrow_sizes"][i],
                      "arrow_width": ldict["arrow_widths"][i],
                  }
              else:
                  loop_kwargs = {}
              path = self._compute_path_loop(
                  coordst[0],
                  vertex_size,
                  ldict["sizes"][i],
                  angle1i,
                  angle2i,
                  trans_inv,
                  angle_padding_fraction=0.1,
                  **loop_kwargs,
              )
              paths[ldict["indices"][i]] = path
  
      return paths
  
imports: from math import atan2, cos, pi, sin
  from igraph.drawing.baseclasses import AbstractEdgeDrawer
  from igraph.drawing.metamagic import AttributeCollectorBase
  from igraph.drawing.matplotlib.utils import find_matplotlib
  from igraph.drawing.utils import get_bezier_control_points_for_curved_edge, FakeModule
label_desc: Use image node_id 4 for calling the EdgeCollection obj's underlying member method code with example usage: obj._compute_paths(transform) and returns: paths