class_docstr: Middleware for injecting client-side feature flags into the Context.
  
  The client webapp is expected to include a json-serialized version of its
  FeatureFlags in the `X-TensorBoard-Feature-Flags` header or the
  `tensorBoardFeatureFlags` query parameter. This middleware extracts the
  header or query parameter value and converts it into the client_feature_flags
  property for the DataProvider's Context object, where client_feature_flags
  is a Dict of string keys and arbitrary value types.
  
  In the event that both the header and query parameter are specified, the
  values from the header will take precedence.
code: def __call__(self, environ, start_response):
      header_feature_flags = self._parse_potential_header_param_flags(
          environ.get("HTTP_X_TENSORBOARD_FEATURE_FLAGS")
      )
      query_string_feature_flags = (
          self._parse_potential_query_param_flags(
              environ.get("QUERY_STRING")
          )
      )
  
      if not header_feature_flags and not query_string_feature_flags:
          return self._application(environ, start_response)
  
      # header flags take precedence
      for flag, value in header_feature_flags.items():
          query_string_feature_flags[flag] = value
  
      ctx = context.from_environ(environ).replace(
          client_feature_flags=query_string_feature_flags
      )
      context.set_in_environ(environ, ctx)
  
      return self._application(environ, start_response)
  
file_path: tensorboard/tensorboard/backend/client_feature_flags.py
imports: import json
  import urllib.parse
  from tensorboard import context
  from tensorboard import errors
label_desc: Use image node_id 2 for calling the ClientFeatureFlagsMiddleware obj's underlying member method code with example usage: obj.__call__(environ, start_response) and returns: self, self