code: def get_annotations(
      df, annotations, kind="lines", theme=None, **kwargs
  ):
      """
      Generates an annotations object
  
      Parameters:
      -----------
              df : DataFrame
                      Original DataFrame of values
              annotations : dict or list
                      Dictionary of annotations
                      {x_point : text}
                      or
                      List of Plotly annotations
      """
  
      for key in list(kwargs.keys()):
          if key not in __ANN_KWARGS:
              raise Exception("Invalid keyword : '{0}'".format(key))
  
      theme_data = getTheme(theme)
  
      kwargs["fontcolor"] = kwargs.pop(
          "fontcolor", theme_data["annotations"]["fontcolor"]
      )
      kwargs["arrowcolor"] = kwargs.pop(
          "arrowcolor", theme_data["annotations"]["arrowcolor"]
      )
      kwargs["fontsize"] = kwargs.pop("fontsize", 12)
  
      def check_ann(annotation):
          local_list = []
  
          if "title" in annotation:
              local_list.append(
                  dict(
                      text=annotation["title"],
                      showarrow=False,
                      x=0,
                      y=1,
                      xref="paper",
                      yref="paper",
                      font={
                          "size": 24
                          if not "fontsize" in kwargs
                          else kwargs["fontsize"]
                      },
                  )
              )
  
              del annotation["title"]
              local_list.append(ann)
  
          elif "x" in annotation:
              ann = dict(
                  x=annotation["x"],
                  y=annotation.get("y", 0.5),
                  xref=annotation.get("xref", "x"),
                  yref=annotation.get("yref", kwargs.get("yref", "y1")),
                  text=annotation.get("text"),
                  showarrow=annotation.get("showarrow", True),
                  arrowhead=annotation.get("arrowhead", 7),
                  arrowcolor=annotation.get(
                      "arrowcolor", kwargs.get("arrowcolor")
                  ),
                  ax=annotation.get("ax", 0),
                  ay=annotation.get("ay", -100),
                  textangle=annotation.get("textangle", -90),
                  hovertext=annotation.get("hovertext", ""),
                  opacity=annotation.get("opacity", 1),
                  font=dict(
                      color=annotation.get(
                          "fontcolor",
                          annotation.get(
                              "color", kwargs.get("fontcolor")
                          ),
                      ),
                      size=annotation.get(
                          "fontsize",
                          annotation.get(
                              "size", kwargs.get("fontsize")
                          ),
                      ),
                  ),
              )
              local_list.append(ann)
  
          else:
              for k, v in list(annotation.items()):
                  if kind in ("candlestick", "ohlc", "candle"):
                      d = ta._ohlc_dict(df)
                      maxv = df[d["high"]].loc[k]
                      yref = "y2"
                  else:
                      maxv = df.loc[k].sum() if k in df.index else 0
                      yref = "y1"
                  ann = dict(
                      x=k,
                      y=maxv,
                      xref="x",
                      yref=yref,
                      text=v,
                      showarrow=kwargs.get("showarrow", True),
                      arrowhead=kwargs.get("arrowhead", 7),
                      arrowcolor=kwargs["arrowcolor"],
                      ax=kwargs.get("ax", 0),
                      ay=kwargs.get("ay", -100),
                      textangle=kwargs.get("textangle", -90),
                      hovertext=kwargs.get("hovertext", ""),
                      opacity=kwargs.get("opacity", 1),
                      font=dict(
                          color=kwargs["fontcolor"],
                          size=kwargs["fontsize"],
                      ),
                  )
                  local_list.append(ann)
  
          return local_list
  
      annotations = make_list(annotations)
      _list_ann = []
      for ann in annotations:
          _list_ann.extend(check_ann(ann))
      return _list_ann
  
imports: import copy
  import numpy
  import pandas
  import plotly.offline
  import plotly.figure_factory
  from plotly.graph_objs import Figure, Scatter, Line
  from plotly.subplots import make_subplots
  from .None import themes
  from .None import auth, ta
  from .colors import normalize, to_rgba
  from .utils import check_kwargs, deep_update, dict_replace_keyword, kwargs_from_keyword, merge_dict, is_list, make_list
label_desc: Use image node_id 5 for calling a global function with example usage: get_annotations(df, annotations, kind, theme) and returns: _list_ann, local_list