code: def test_jaccard_index_random_strings():
      # Seed the rng before random string generation.
      random.seed(42)
      num_strings = 100
      jaccard_width = 5
      common_strings = _make_list_of_strings_of_random_length(
          num_strings, jaccard_width, 50
      )
      uncommon_strings1 = _make_list_of_strings_of_random_length(
          num_strings, jaccard_width, 10
      )
      uncommon_strings2 = _make_list_of_strings_of_random_length(
          num_strings, jaccard_width, 20
      )
      str1 = cudf.Series(uncommon_strings1).str.cat(
          cudf.Series(common_strings)
      )
      str2 = cudf.Series(uncommon_strings2).str.cat(
          cudf.Series(common_strings)
      )
  
      # adopted from https://github.com/rapidsai/rapids-deduplication/issues/36
      da = str1.str.character_ngrams(jaccard_width, True)
      db = str2.str.character_ngrams(jaccard_width, True)
      da = da.list.unique()
      db = db.list.unique()
      da = da.explode()
      db = db.explode()
      da = da.to_frame()
      db = db.to_frame()
      da = da.reset_index()
      db = db.reset_index()
      da = da.rename(columns={0: "token"})
      db = db.rename(columns={0: "token"})
      db["match"] = 1
      inter = da.merge(db, on=["index", "token"], how="left")
      inter = inter.groupby("index")["match"].sum()
      union = da.merge(db, on=["index", "token"], how="outer")
      union = union.groupby("index").size()
      res = inter / union
      res.fillna(0, inplace=True)
      res = res.sort_index()
      res = res.values.astype("float32")
      expected = cudf.Series(res)
  
      actual = str1.str.jaccard_index(str2, jaccard_width)
      assert_eq(expected, actual)
  
imports: import random
  import string
  import numpy
  import pytest
  import cudf
  from cudf.core.byte_pair_encoding import BytePairEncoder
  from cudf.core.tokenize_vocabulary import TokenizeVocabulary
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 25 for calling a global function with example usage: test_jaccard_index_random_strings() without return types