code: def _extract_span(
      span: tuple[int, int], embs: np.ndarray, offsets: np.ndarray
  ) -> np.ndarray:
      start = offsets[span[0]]
      end = offsets[span[1]]
      # <float>[span_length, emb_dim]
      range_embs = embs[start:end]
      # <float>[emb_dim]
      pooled_embs = np.mean(range_embs, axis=0)
      return pooled_embs
  
imports: import os
  from collections.abc import Iterable
  from typing import Optional
  from absl import logging
  from lit_nlp.api import dataset
  from lit_nlp.api import dtypes
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import utils
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: _extract_span(span, embs, offsets) and returns: pooled_embs