code: def test_register_bogus_dispatch_key(self) -> None:
      specification = (
          "func(Tensor a, Tensor b) -> (Tensor x, bool y, Tensor z)"
      )
      schema = torchgen.model.FunctionSchema.parse(specification)
      native_function = dataclasses.replace(
          DEFAULT_NATIVE_FUNCTION, func=schema
      )
  
      with self.assertRaisesRegex(
          RuntimeError,
          "Invalid dispatch key AutogradRandomTensor in derivatives.yaml for",
      ):
          load_derivatives.create_differentiability_info(
              defn_dict={
                  "name": specification,
                  "dispatch": {
                      "Default": {
                          "a": "grad_x",
                          "b": "grad_z",
                      },
                      "AutogradRandomTensor": {
                          "a": "grad_x",
                          "b": "grad_z",
                      },
                  },
              },
              functions_by_signature={
                  schema.signature(): [native_function]
              },
              functions_by_schema={specification: native_function},
              op_counter=typing.Counter[str](),
              used_dispatch_keys=set(),
          )
  
imports: import dataclasses
  import typing
  import unittest
  from collections import defaultdict
  from typing import Dict, List
  import torchgen.model
  import yaml
  from tools.autograd import gen_autograd_functions, load_derivatives
  from torchgen import dest
  from torchgen.api.types import CppSignatureGroup, DispatcherSignature
  from torchgen.context import native_function_manager
  from torchgen.gen import get_native_function_declarations, get_native_function_schema_registrations, LineLoader, static_dispatch
  from torchgen.model import BackendIndex, BackendMetadata, DispatchKey, Location, NativeFunction, OperatorName
  from torchgen.native_function_generation import add_generated_native_functions
  from torchgen.selective_build.selector import SelectiveBuilder
label_desc: Use image node_id 3 for calling the TestGenAutogradFunctions obj's underlying member method code with example usage: obj.test_register_bogus_dispatch_key() without return types