code: def _grpc_error(code, details):
      # Monkey patch insertion for the methods a real grpc.RpcError would have.
      error = grpc.RpcError("RPC error %r: %s" % (code, details))
      error.code = lambda: code
      error.details = lambda: details
      return error
  
imports: from unittest import mock
  import grpc
  import grpc_testing
  import numpy
  from tensorboard import errors
  from tensorboard import test
  from tensorboard import context
  from tensorboard.data import grpc_provider
  from tensorboard.data import provider
  from tensorboard.data.proto import data_provider_pb2
  from tensorboard.data.proto import data_provider_pb2_grpc
  from tensorboard.util import tensor_util
label_desc: Use image node_id 2 for calling a global function with example usage: _grpc_error(code, details) and returns: error