code: def test_translate(input_str, vocab, output_str):
      out = utils.translate(input_str, vocab, unknown_char="■")
      assert out == output_str
  
file_path: doctr/tests/common/test_datasets_utils.py
imports: import numpy
  import pytest
  from doctr.datasets import utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_translate(input_str, vocab, output_str) without return types