code: def compute_recall_at_k(
      video_embeddings,
      text_embeddings,
      k_values,
      suffix="",
      suffix_separator="_",
      text_to_video_retrieval=True,
  ):
      """Compute text -> video retrieval recall at K.
  
      Args:
        video_embeddings: shape [batch_size, d], or list of such shapes
        text_embeddings: shape [batch_size, d]
        k_values: Recall@K computed for different K ranks.
        suffix: Suffix to add to the summary
        suffix_separator: Separator before adding the suffix
        text_to_video_retrieval: Text to video retrieval vs video to text retrieval
  
      Returns:
        summary: Dictionary containing the recall@K for different K values.
      """
      logits = compute_inner_product(video_embeddings, text_embeddings)
      # Transpose logits from text - video retrieval
      if text_to_video_retrieval:
          logits = np.transpose(logits)
      summary = {}
      if suffix:
          suffix = suffix_separator + suffix
      # K x Batch_size
      matches = np.zeros((len(k_values), logits.shape[0]))
  
      for i in range(logits.shape[0]):
          logits_text_i = logits[i, :]
          logits_argsorted = np.argsort(logits_text_i, axis=-1)
          inners_indicator = logits_argsorted == i
          for j, k in enumerate(
              k_values
          ):  # Over all captions for video i.
              matches[j, i] = np.mean(
                  np.any(inners_indicator[-k:], axis=-1)
              )
      for matches_for_k, k in zip(matches, k_values):
          summary[f"recall@{k}{suffix}"] = np.mean(matches_for_k)
  
      return summary
  
imports: import os
  import re
  from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, Union
  from absl import logging
  import flax
  from flax import struct
  from flax.core import frozen_dict
  import flax.linen
  from flax.training import checkpoints
  import jax
  import jax.numpy
  import jax.profiler
  import ml_collections
  import numpy
  import optax
  from scenic.dataset_lib import dataset_utils
  from scenic.model_lib.base_models import base_model
  from scenic.projects.baselines.clip import model
  from scenic.train_lib import lr_schedules
  from scenic.train_lib import optimizers
  from scenic.train_lib import train_utils
  from tensorflow.io import gfile
label_desc: Use image node_id 13 for calling a global function with example usage: compute_recall_at_k(video_embeddings, text_embeddings, k_values, suffix, suffix_separator, text_to_video_retrieval) and returns: summary