code: def jaccard_similarity(list1: list, list2: list) -> float:
      """
      Calculates the Jaccard Index (JI) between two lists.
  
      Args:
          list1 (list): List of elements in set A.
          list2 (list): List of elements in set B.
      Returns:
          float: The Jaccard Index between list1 and list2.
      Example:
          >>> jaccard_similarity([1,2,3], [2,3,4])
          0.5
      """
  
      if len(list1) == 0 or len(list2) == 0:
          return 0
      else:
          intersection = len(
              set(list1).intersection(list2)
          )  # no need to call list here
          union = (
              len(list1 + list2) - intersection
          )  # you only need to call len once here
          return intersection / union
  
file_path: pykale/kale/evaluate/similarity_metrics.py
imports: import logging
  import os
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  import pandas
  from kale.prepdata.tabular_transform import apply_confidence_inversion
label_desc: Use image node_id 1 for calling a global function with example usage: jaccard_similarity(list1, list2) and returns: int, unknown