code: def _get_posters_html(
      movielens_posters_df: pd.DataFrame,
      df_item: pd.DataFrame,
      item_ids: Union[int, Iterable[Any]],
      col_description: str = "Recommended films:",
      image_width: Optional[int] = 500,
  ) -> str:
      if not isinstance(item_ids, collections.abc.Iterable):
          item_ids = [item_ids]
  
      top_movies_titles = [
          df_item[df_item["item_id"] == x]["movie_title"].iloc[0]
          for x in item_ids
      ]
      final_urls = []
  
      for item_id in item_ids:
          url = ""
          with suppress((ValueError, TypeError)):
              url = movielens_posters_df.query(f"item_id == {item_id}")[
                  "url"
              ].item()
  
          final_urls.append(url)
  
      final_df = pd.DataFrame(final_urls)
  
      final_df.index = top_movies_titles
      final_df.columns = [col_description]
  
      return df_to_html(
          df=final_df,
          image_cols=[col_description],
          transpose=True,
          image_width=image_width,
      )
  
file_path: collie/collie/movielens/visualize.py
imports: import collections
  from contextlib import suppress
  import random
  from typing import Any, Iterable, Optional, Union
  import pandas
  import collie
  from collie.movielens import read_movielens_df, read_movielens_df_item, read_movielens_posters_df
  from collie.utils import df_to_html
label_desc: Use image node_id 2 for calling a global function with example usage: _get_posters_html(movielens_posters_df, df_item, item_ids, col_description, image_width) and returns: df_to_html