code: def load_monolingual_dataset(
      bin_path,
      is_source=False,
      char_source_dict=None,
      log_verbose=True,
      num_examples_limit: Optional[int] = None,
  ):
      if log_verbose:
          print(
              "Starting to load binarized monolingual data file.",
              flush=True,
          )
  
      if not PathManager.exists(bin_path):
          raise ValueError(
              f"Monolingual binary path {bin_path} not found!"
          )
  
      if char_source_dict is not None and is_source:
          dataset = (
              char_data.InMemoryNumpyWordCharDataset.create_from_file(
                  path=bin_path
              )
          )
  
      else:
          dataset = pytorch_translate_data.InMemoryIndexedDataset.create_from_file(
              path=bin_path, num_examples_limit=num_examples_limit
          )
  
      if log_verbose:
          print(f"Finished loading dataset {bin_path}", flush=True)
  
      print(
          f"""| Loaded {len(dataset)} monolingual examples for """
          f"""{"source" if is_source else "target"}"""
      )
      return dataset
  
imports: from typing import Optional
  from fvcore.common.file_io import PathManager
  from pytorch_translate.data import char_data, data, weighted_data
label_desc: Use image node_id 2 for calling a global function with example usage: load_monolingual_dataset(bin_path, is_source, char_source_dict, log_verbose, num_examples_limit) and returns: dataset