code: def annotation_dict_for_label(
      text,
      lane,
      num_of_lanes,
      subplot_spacing,
      row_col="col",
      flipped=True,
      right_side=True,
      text_color="#0f0f0f",
  ):
      """
      Returns annotation dict for label of n labels of a 1xn or nx1 subplot.
  
      :param (str) text: the text for a label.
      :param (int) lane: the label number for text. From 1 to n inclusive.
      :param (int) num_of_lanes: the number 'n' of rows or columns in subplot.
      :param (float) subplot_spacing: the value for the horizontal_spacing and
          vertical_spacing params in your plotly.tools.make_subplots() call.
      :param (str) row_col: choose whether labels are placed along rows or
          columns.
      :param (bool) flipped: flips text by 90 degrees. Text is printed
          horizontally if set to True and row_col='row', or if False and
          row_col='col'.
      :param (bool) right_side: only applicable if row_col is set to 'row'.
      :param (str) text_color: color of the text.
      """
      l = (1 - (num_of_lanes - 1) * subplot_spacing) / (num_of_lanes)
      if not flipped:
          xanchor = "center"
          yanchor = "middle"
          if row_col == "col":
              x = (lane - 1) * (l + subplot_spacing) + 0.5 * l
              y = 1.03
              textangle = 0
          elif row_col == "row":
              y = (lane - 1) * (l + subplot_spacing) + 0.5 * l
              x = 1.03
              textangle = 90
      else:
          if row_col == "col":
              xanchor = "center"
              yanchor = "bottom"
              x = (lane - 1) * (l + subplot_spacing) + 0.5 * l
              y = 1.0
              textangle = 270
          elif row_col == "row":
              yanchor = "middle"
              y = (lane - 1) * (l + subplot_spacing) + 0.5 * l
              if right_side:
                  x = 1.0
                  xanchor = "left"
              else:
                  x = -0.01
                  xanchor = "right"
              textangle = 0
  
      annotation_dict = dict(
          textangle=textangle,
          xanchor=xanchor,
          yanchor=yanchor,
          x=x,
          y=y,
          showarrow=False,
          xref="paper",
          yref="paper",
          text=text,
          font=dict(size=13, color=text_color),
      )
      return annotation_dict
  
file_path: catboost/contrib/python/plotly/py2/plotly/figure_factory/utils.py
imports: from __future__ import absolute_import
  import decimal
  import six
  from plotly import exceptions
  from plotly.colors import DEFAULT_PLOTLY_COLORS, PLOTLY_SCALES, color_parser, colorscale_to_colors, colorscale_to_scale, convert_to_RGB_255, find_intermediate_color, hex_to_rgb, label_rgb, n_colors, unconvert_from_RGB_255, unlabel_rgb, validate_colors, validate_colors_dict, validate_colorscale, validate_scale_values
label_desc: Use image node_id 8 for calling a global function with example usage: annotation_dict_for_label(text, lane, num_of_lanes, subplot_spacing, row_col, flipped, right_side, text_color) and returns: annotation_dict