code: def _find_matching_instance(cache_key):
      """Find a running TensorBoard instance compatible with the cache key.
  
      Returns:
        A `TensorBoardInfo` object, or `None` if none matches the cache key.
      """
      infos = get_all()
      candidates = [
          info for info in infos if info.cache_key == cache_key
      ]
      for candidate in sorted(candidates, key=lambda x: x.port):
          # TODO(@wchargin): Check here that the provided port is still live.
          return candidate
      return None
  
imports: import base64
  import dataclasses
  import datetime
  import errno
  import json
  import os
  import subprocess
  import tempfile
  import time
  import typing
  from typing import Optional
  from tensorboard import version
  from tensorboard.util import tb_logging
label_desc: Use image node_id 11 for calling a global function with example usage: _find_matching_instance(cache_key) and returns: None, candidate