code: def write_training(
      labeled_pairs: TrainingData, file_obj: TextIO
  ) -> None:
      """
      Write a JSON file that contains labeled examples
  
      Args:
          labeled_pairs: A dictionary with two keys, `match` and `distinct`.
                         The values are lists that can contain pairs of records
          file_obj: file object to write training data to
  
      .. code:: python
  
          examples = {
              "match": [
                   ({'name' : 'Georgie Porgie'}, {'name' : 'George Porgie'}),
              ],
              "distinct": [
                  ({'name' : 'Georgie Porgie'}, {'name' : 'Georgette Porgette'}),
              ],
          }
          with open('training.json', 'w') as f:
              dedupe.write_training(examples, f)
  
      """
      json.dump(
          labeled_pairs, file_obj, cls=TupleEncoder, ensure_ascii=True
      )
  
file_path: dedupe/dedupe/serializer.py
imports: import json
  from typing import Any, Iterator, TextIO
  from dedupe._typing import TrainingData
label_desc: Use image node_id 4 for calling a global function with example usage: write_training(labeled_pairs, file_obj) without return types