code: def _set_inverse_triples_(
      dataset_instance: Dataset, create_inverse_triples: bool
  ) -> Dataset:
      # note: we only need to set the create_inverse_triples in the training factory.
      if (
          dataset_instance.create_inverse_triples
          and not create_inverse_triples
      ):
          assert dataset_instance.training.num_relations % 2 == 0
          dataset_instance.training.num_relations //= 2
      elif (
          create_inverse_triples
          and not dataset_instance.training.create_inverse_triples
      ):
          dataset_instance.training.num_relations *= 2
      dataset_instance.training.create_inverse_triples = (
          create_inverse_triples
      )
      return dataset_instance
  
file_path: pykeen/src/pykeen/datasets/utils.py
imports: import base64
  import hashlib
  import logging
  import pathlib
  import re
  from typing import Any, Collection, Iterable, Mapping, Optional, Pattern, Tuple, Type, Union
  import click
  from tqdm import tqdm
  from .base import Dataset, EagerDataset, PathDataset
  from ..constants import PYKEEN_DATASETS
  from ..triples import CoreTriplesFactory
label_desc: Use image node_id 5 for calling a global function with example usage: _set_inverse_triples_(dataset_instance, create_inverse_triples) and returns: dataset_instance