code: def _format_key(key: str, prefix: Optional[str] = None) -> str:
      """Prepend prefix is necessary."""
      if prefix is None:
          return key
      return f"{prefix}.{key}"
  
imports: import csv
  import datetime
  import json
  import logging
  import pathlib
  from typing import Any, ClassVar, Mapping, Optional, TextIO, Union
  from .base import ResultTracker
  from ..constants import PYKEEN_LOGS
  from ..utils import flatten_dictionary, normalize_path
label_desc: Use image node_id 1 for calling a global function with example usage: _format_key(key, prefix) and returns: prefix, str, key, key