code: def __init__(self, logdir, model, cache_timeout):
      self._reader = LogReader(logdir)
      self._graph_reader = GraphReader(logdir)
      self._graph_reader.set_displayname(self._reader)
      if model:
          if "vdlgraph" in model:
              self._graph_reader.set_input_graph(model)
          self._reader.model = model
          self.model_name = os.path.basename(model)
      else:
          self.model_name = ""
      self.graph_reader_client_manager = ClientManager(
          self._graph_reader
      )
      # use a memory cache to reduce disk reading frequency.
      cache = MemCache(timeout=cache_timeout)
      self._cache = lib.cache_get(cache)
  
imports: import functools
  import gzip
  import json
  import os
  from io import BytesIO
  from flask import request
  from visualdl import LogReader
  from visualdl.python.cache import MemCache
  from visualdl.reader.graph_reader import GraphReader
  from visualdl.server import lib
  from visualdl.server.client_manager import ClientManager
  from visualdl.server.log import logger
label_desc: Use image node_id 1 to create a new Api object from inherited base classes: object with example: obj = Api(logdir, model, cache_timeout)