Repository: quantumlib/Cirq

Issue:
Docs builds for GridInteractionLayer and XebResultDict are broken
**Description of the issue**
Currently we cannot run the `build_api_docs.py` and build the API docs for `GridInteractionLayer` or `XebResultDict`.

**How to reproduce the issue**

```
diff --git a/dev_tools/docs/build_api_docs.py b/dev_tools/docs/build_api_docs.py
index e3f0c79a..076a4acc 100644
--- a/dev_tools/docs/build_api_docs.py
+++ b/dev_tools/docs/build_api_docs.py
@@ -95,6 +95,11 @@ def generate_cirq():
         site_path=FLAGS.site_path,
         callbacks=[public_api.local_definitions_filter, filter_unwanted_inherited_methods],
         extra_docs=_doc.RECORDED_CONST_DOCS,
+        private_map={
+            # Opt to not build docs for these paths for now since they error.
+            "cirq.experiments": ["CrossEntropyResultDict", "GridInteractionLayer"],
+            "cirq.experiments.random_quantum_circuit_generation": ["GridInteractionLayer"],
+        },
     )
```
Removing the `private_map` entry in `build_api_docs.py` above and then running the build script gives:


```
Traceback (most recent call last):
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/generate_lib.py", line 546, in write_docs
    page_info = docs_for_object.docs_for_object(
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/pretty_docs/docs_for_object.py", line 89, in docs_for_object
    page_info.docs_for_object(parser_config)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/pretty_docs/base_page.py", line 164, in docs_for_object
    self.collect_docs(parser_config)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/pretty_docs/class_page.py", line 384, in collect_docs
    self._add_member(member_info, defining_class, parser_config)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/pretty_docs/class_page.py", line 337, in _add_member
    self._add_method(member_info, defining_class, parser_config)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/pretty_docs/class_page.py", line 277, in _add_method
    signature = signature_lib.generate_signature(
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/signature.py", line 589, in generate_signature
    return_annotation_source) = extract_fn(func)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/signature.py", line 624, in _extract_class_defaults_and_annotations
    ast_visitor.extract(cls)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/signature.py", line 140, in extract
    super().extract(cls)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/signature.py", line 58, in extract
    obj_source = textwrap.dedent(inspect.getsource(obj))
  File "/usr/lib/python3.9/inspect.py", line 1024, in getsource
    lines, lnum = getsourcelines(object)
  File "/usr/lib/python3.9/inspect.py", line 1006, in getsourcelines
    lines, lnum = findsource(object)
  File "/usr/lib/python3.9/inspect.py", line 851, in findsource
    raise OSError('could not find class definition')
OSError: could not find class definition

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/mbbrough/Desktop/Cirq/dev_tools/docs/build_api_docs.py", line 220, in <module>
    app.run(main)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/absl/app.py", line 312, in run
    _run_main(main, args)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/absl/app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "/home/mbbrough/Desktop/Cirq/dev_tools/docs/build_api_docs.py", line 79, in main
    generate_cirq()
  File "/home/mbbrough/Desktop/Cirq/dev_tools/docs/build_api_docs.py", line 106, in generate_cirq
    doc_generator.build(output_dir=FLAGS.output_dir)
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/generate_lib.py", line 847, in build
    write_docs(
  File "/home/mbbrough/Desktop/cirq_env/lib/python3.9/site-packages/tensorflow_docs/api_generator/generate_lib.py", line 559, in write_docs
    raise ValueError(
ValueError: Failed to generate docs for symbol: `cirq.experiments.GridInteractionLayer`
```

**Cirq version**
```
0.15.0dev
```




Discussion:
The docs for these symbols seem to generate fine with a newer versions of `tensorflow-docs` (I tried `3a6a7a3322de8620f0031ae3a0a4b62e40d1d7f2`).

Resolving patch:
diff --git a/dev_tools/docs/build_api_docs.py b/dev_tools/docs/build_api_docs.py
--- a/dev_tools/docs/build_api_docs.py
+++ b/dev_tools/docs/build_api_docs.py
@@ -95,11 +95,6 @@ def generate_cirq():
         site_path=FLAGS.site_path,
         callbacks=[public_api.local_definitions_filter, filter_unwanted_inherited_methods],
         extra_docs=_doc.RECORDED_CONST_DOCS,
-        private_map={
-            # Opt to not build docs for these paths for now since they error.
-            "cirq.experiments": ["CrossEntropyResultDict", "GridInteractionLayer"],
-            "cirq.experiments.random_quantum_circuit_generation": ["GridInteractionLayer"],
-        },
     )
     doc_controls.decorate_all_class_attributes(
         doc_controls.do_not_doc_inheritable, networkx.DiGraph, skip=[]


Test patch: