class_docstr: Embedding projector.
class_docstr_tok: ["Embedding","projector","."]
code: def _serve_metadata(self, request):
      run = request.args.get("run")
      if run is None:
          return Respond(
              request,
              'query parameter "run" is required',
              "text/plain",
              400,
          )
  
      name = request.args.get("name")
      if name is None:
          return Respond(
              request,
              'query parameter "name" is required',
              "text/plain",
              400,
          )
  
      num_rows = _parse_positive_int_param(request, "num_rows")
      if num_rows == -1:
          return Respond(
              request,
              "query parameter num_rows must be integer > 0",
              "text/plain",
              400,
          )
  
      self._update_configs()
      config = self._configs.get(run)
      if config is None:
          return Respond(
              request, 'Unknown run: "%s"' % run, "text/plain", 400
          )
      fpath = self._get_metadata_file_for_tensor(name, config)
      if not fpath:
          return Respond(
              request,
              'No metadata file found for tensor "%s" in the config file "%s"'
              % (name, self.config_fpaths[run]),
              "text/plain",
              400,
          )
      fpath = _rel_to_abs_asset_path(fpath, self.config_fpaths[run])
      if not tf.io.gfile.exists(fpath) or tf.io.gfile.isdir(fpath):
          return Respond(
              request,
              '"%s" not found, or is not a file' % fpath,
              "text/plain",
              400,
          )
  
      num_header_rows = 0
      with tf.io.gfile.GFile(fpath, "r") as f:
          lines = []
          # Stream reading the file with early break in case the file doesn't fit in
          # memory.
          for line in f:
              lines.append(line)
              if len(lines) == 1 and "\t" in lines[0]:
                  num_header_rows = 1
              if num_rows and len(lines) >= num_rows + num_header_rows:
                  break
      return Respond(request, "".join(lines), "text/plain")
  
imports: import collections
  import functools
  import imghdr
  import mimetypes
  import os
  import threading
  import numpy
  from werkzeug import wrappers
  from google.protobuf import json_format
  from google.protobuf import text_format
  from tensorboard import context
  from tensorboard.backend.event_processing import plugin_asset_util
  from tensorboard.backend.http_util import Respond
  from tensorboard.compat import tf
  from tensorboard.plugins import base_plugin
  from tensorboard.plugins.projector import metadata
  from tensorboard.plugins.projector.projector_config_pb2 import ProjectorConfig
  from tensorboard.util import tb_logging
label_desc: Use image node_id 18 for calling the ProjectorPlugin obj's underlying member method code with example usage: obj._serve_metadata(request) and returns: Respond, Respond, Respond, Respond, Respond, Respond, Respond