code: def _draw_wedge(
      ax,
      x,
      node,
      color,
      is_classifier,
      h=None,
      height_range=None,
      bins=None,
  ):
      xmin, xmax = ax.get_xlim()
      ymin, ymax = ax.get_ylim()
      x_range = xmax - xmin
      y_range = ymax - ymin
  
      tri_width = 0.036 * x_range
  
      wedge_ticks = []
  
      def _draw_tria(tip_x, tip_y, tri_width, tri_height):
          tria = np.array(
              [
                  [tip_x, tip_y],
                  [tip_x - tri_width / 2.0, tip_y - tri_height],
                  [tip_x + tri_width / 2.0, tip_y - tri_height],
              ]
          )
          t = patches.Polygon(tria, facecolor=color)
          t.set_clip_on(False)
          ax.add_patch(t)
          wedge_ticks.append(tip_x)
  
      if is_classifier:
          hr = h / (height_range[1] - height_range[0])
          tri_height = (
              y_range * 0.15 * 1 / hr
          )  # convert to graph coordinates (ugh)
          tip_y = -0.1 * y_range * 0.15 * 1 / hr
          if not node.is_categorical_split():
              # classification, normal split
              _draw_tria(x, tip_y, tri_width, tri_height)
          else:
              # classification: categorical split, draw multiple wedges
              # If we're highlighting a node, x will be one value not multiple.
              if np.size(x) == 1:
                  x = [x]  # normalize to a list even if one value
              for split_value in x:
                  # to display the wedge exactly in the middle of the vertical bar
                  for bin_index in range(len(bins) - 1):
                      if (
                          bins[bin_index]
                          <= split_value
                          <= bins[bin_index + 1]
                      ):
                          split_value = (
                              bins[bin_index] + bins[bin_index + 1]
                          ) / 2
                          break
                  _draw_tria(split_value, tip_y, tri_width, tri_height)
      else:
          # regression
          tri_height = y_range * 0.1
          _draw_tria(x, ymin, tri_width, tri_height)
      return wedge_ticks
  
imports: import os
  import re
  import tempfile
  import warnings
  import xml.etree.cElementTree
  from pathlib import Path
  from sys import platform
  import graphviz
  import numpy
  import pandas
  from matplotlib import patches
  from numpy import ndarray
  from numbers import Number
  from typing import Tuple, Sequence
label_desc: Use image node_id 12 for calling a global function with example usage: _draw_wedge(ax, x, node, color, is_classifier, h, height_range, bins) and returns: wedge_ticks