nodes: 0, module; 1, function_definition; 2, function_name:dispersion; 3, parameters; 4, block; 5, identifier:words; 6, identifier:corpus; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, dictionary_splat_pattern; 15, expression_statement; 16, comment:# Instantiate the visualizer; 17, expression_statement; 18, comment:# Fit and transform the visualizer (calls draw); 19, expression_statement; 20, comment:# Return the axes object on the visualizer; 21, return_statement; 22, identifier:y; 23, None; 24, identifier:ax; 25, None; 26, identifier:colors; 27, None; 28, identifier:colormap; 29, None; 30, identifier:labels; 31, None; 32, identifier:annotate_docs; 33, False; 34, identifier:ignore_case; 35, False; 36, identifier:kwargs; 37, comment:""" Displays lexical dispersion plot for words in a corpus
  
      This helper function is a quick wrapper to utilize the DisperstionPlot
      Visualizer for one-off analysis
  
      Parameters
      ----------
  
      words : list
          A list of words whose dispersion will be examined within a corpus
  
      y : ndarray or Series of length n
          An optional array or series of target or class values for
          instances. If this is specified, then the points will be colored
          according to their class.
  
      corpus : list
          Should be provided as a list of documents that contain
          a list of words in the order they appear in the document.
  
      ax : matplotlib axes, default: None
          The axes to plot the figure on.
  
      labels : list of strings
          The names of the classes in the target, used to create a legend.
          Labels must match names of classes in sorted order.
  
      colors : list or tuple of colors
          Specify the colors for each individual class
  
      colormap : string or matplotlib cmap
          Qualitative colormap for discrete target
  
      annotate_docs : boolean, default: False
          Specify whether document boundaries will be displayed.  Vertical lines
          are positioned at the end of each document.
  
      ignore_case : boolean, default: False
  	Specify whether input  will be case-sensitive.
  
      kwargs : dict
          Pass any additional keyword arguments to the super class.
  
      Returns
      -------
      ax: matplotlib axes
          Returns the axes that the plot was drawn on
      """; 38, assignment; 39, call; 40, attribute; 41, identifier:visualizer; 42, call; 43, attribute; 44, argument_list; 45, identifier:visualizer; 46, identifier:ax; 47, identifier:DispersionPlot; 48, argument_list; 49, identifier:visualizer; 50, identifier:fit; 51, identifier:corpus; 52, identifier:y; 53, dictionary_splat; 54, identifier:words; 55, keyword_argument; 56, keyword_argument; 57, keyword_argument; 58, keyword_argument; 59, keyword_argument; 60, keyword_argument; 61, dictionary_splat; 62, identifier:kwargs; 63, identifier:ax; 64, identifier:ax; 65, identifier:colors; 66, identifier:colors; 67, identifier:colormap; 68, identifier:colormap; 69, identifier:ignore_case; 70, identifier:ignore_case; 71, identifier:labels; 72, identifier:labels; 73, identifier:annotate_docs; 74, identifier:annotate_docs; 75, identifier:kwargs
code: def dispersion(words, corpus, y=None, ax=None, colors=None, colormap=None,
                 labels=None, annotate_docs=False, ignore_case=False, **kwargs):
      """ Displays lexical dispersion plot for words in a corpus
  
      This helper function is a quick wrapper to utilize the DisperstionPlot
      Visualizer for one-off analysis
  
      Parameters
      ----------
  
      words : list
          A list of words whose dispersion will be examined within a corpus
  
      y : ndarray or Series of length n
          An optional array or series of target or class values for
          instances. If this is specified, then the points will be colored
          according to their class.
  
      corpus : list
          Should be provided as a list of documents that contain
          a list of words in the order they appear in the document.
  
      ax : matplotlib axes, default: None
          The axes to plot the figure on.
  
      labels : list of strings
          The names of the classes in the target, used to create a legend.
          Labels must match names of classes in sorted order.
  
      colors : list or tuple of colors
          Specify the colors for each individual class
  
      colormap : string or matplotlib cmap
          Qualitative colormap for discrete target
  
      annotate_docs : boolean, default: False
          Specify whether document boundaries will be displayed.  Vertical lines
          are positioned at the end of each document.
  
      ignore_case : boolean, default: False
  	Specify whether input  will be case-sensitive.
  
      kwargs : dict
          Pass any additional keyword arguments to the super class.
  
      Returns
      -------
      ax: matplotlib axes
          Returns the axes that the plot was drawn on
      """
  
      # Instantiate the visualizer
      visualizer = DispersionPlot(
          words, ax=ax, colors=colors, colormap=colormap,
          ignore_case=ignore_case, labels=labels,
          annotate_docs=annotate_docs, **kwargs
      )
  
      # Fit and transform the visualizer (calls draw)
      visualizer.fit(corpus, y, **kwargs)
  
      # Return the axes object on the visualizer
      return visualizer.ax