code: def view_examples(
      sources: PathOrPathsOrDictOfStrList,
      references: PathOrPathsOrDictOfStrList,
      hypothesis: Optional[PathOrPathsOrDictOfStrList] = None,
      metrics: Optional[List[str]] = None,
      query: str = "",
      page_sz: int = DEFAULT_PAGE_SIZE,
      page_no: int = DEFAULT_PAGE_NO,
      sorting: VizSeqSortingType = VizSeqSortingType.original,
      need_g_translate: bool = False,
      disable_alignment: bool = False,
  ):
      _src = VizSeqDataSources(sources)
      _ref = VizSeqDataSources(references)
      _hypo = VizSeqDataSources(hypothesis)
      if _hypo.n_sources == 0:
          metrics = None
      assert len(_src) == len(_ref)
      assert _hypo.n_sources == 0 or len(_ref) == len(_hypo)
  
      _need_g_translate = need_g_translate and _src.has_text
      view = VizSeqDataPageView.get(
          _src,
          _ref,
          _hypo,
          page_sz,
          page_no,
          metrics=metrics,
          query=query,
          sorting=sorting.value,
          need_lang_tags=_need_g_translate,
          disable_alignment=disable_alignment,
      )
  
      google_translation = []
      if _need_g_translate:
          for i, s in enumerate(view.cur_src_text):
              google_translation.append(
                  get_g_translate(s, view.trg_lang[i])
              )
  
      html = env.get_template("ipynb_view.html").render(
          enum_metrics=VizSeqDataPageView.get_enum(metrics),
          enum_models=VizSeqDataPageView.get_enum(_hypo.text_names),
          cur_idx=view.cur_idx,
          src=view.viz_src,
          ref=view.viz_ref,
          hypo=view.viz_hypo,
          enum_src_names_and_types=VizSeqDataPageView.get_enum(
              zip(_src.names, [t.name for t in _src.data_types])
          ),
          enum_ref_names=list(enumerate(_ref.names)),
          sent_scores=view.viz_sent_scores,
          google_translation=google_translation,
          span_highlight_js=SPAN_HIGHTLIGHT_JS,
          total_examples=view.total_examples,
          n_samples=view.n_samples,
          n_cur_samples=view.n_cur_samples,
      )
      return HTML(html)
  
file_path: vizseq/vizseq/ipynb/core.py
imports: from typing import List, Optional
  from jinja2 import Environment, PackageLoader, select_autoescape
  import matplotlib.pyplot
  import numpy
  from IPython.display import HTML, display
  from vizseq._data import VizSeqDataSources, PathOrPathsOrDictOfStrList, VizSeqNGrams, VizSeqStats, get_g_translate, set_g_cred_path
  from vizseq._visualizers import SPAN_HIGHTLIGHT_JS
  from vizseq._view import VizSeqDataPageView, VizSeqWebView, VizSeqSortingType, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_NO
  from vizseq.scorers import get_scorer_ids, get_scorer, get_scorer_name
  from vizseq._utils.logger import logger
label_desc: Use image node_id 2 for calling a global function with example usage: view_examples(sources, references, hypothesis, metrics, query, page_sz, page_no, sorting, need_g_translate, disable_alignment) and returns: HTML