code: def _triangulate_python(vertices_2d, segments):
      segments = segments.reshape(len(segments) // 2, 2)
      T = Triangulation(vertices_2d, segments)
      T.triangulate()
      vertices_2d = T.pts
      triangles = T.tris.ravel()
      return vertices_2d, triangles
  
imports: from __future__ import division, print_function
  from itertools import permutations
  import numpy
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling a global function with example usage: _triangulate_python(vertices_2d, segments) and returns: vertices_2d,  triangles