def dataset_docs_str(datasets=None):
  """Create dataset documentation string for given datasets.

  Args:
    datasets: list of datasets for which to create documentation.
              If None, then all available datasets will be used.

  Returns:
    string describing the datasets (in the MarkDown format).
  """
  module_to_builder = make_module_to_builder_dict(datasets)

  sections = sorted(list(module_to_builder.keys()))
  section_tocs = []
  section_docs = []
  for section in sections:
    builders = tf.nest.flatten(module_to_builder[section])
    builders = sorted(builders, key=lambda b: b.name)
    builder_docs = [document_single_builder(builder) for builder in builders]
    section_doc = SECTION_DATASETS.format(
        section_name=section, datasets="\n".join(builder_docs))
    section_toc = create_section_toc(section, builders)


    section_docs.append(section_doc)
    section_tocs.append(section_toc)

  full_doc = DOC.format(toc="\n".join(section_tocs),
                        datasets="\n".join(section_docs))
  return full_doc
def dataset_docs_str ( datasets = None ) : module_to_builder = make_module_to_builder_dict ( datasets ) sections = sorted ( list ( module_to_builder . keys ( ) ) ) section_tocs = [ ] section_docs = [ ] for section in sections : builders = tf . nest . flatten ( module_to_builder [ section ] ) builders = sorted ( builders , key = lambda b : b . name ) builder_docs = [ document_single_builder ( builder ) for builder in builders ] section_doc = SECTION_DATASETS . format ( section_name = section , datasets = "\n" . join ( builder_docs ) ) section_toc = create_section_toc ( section , builders ) section_docs . append ( section_doc ) section_tocs . append ( section_toc ) full_doc = DOC . format ( toc = "\n" . join ( section_tocs ) , datasets = "\n" . join ( section_docs ) ) return full_doc
Create dataset documentation string for given datasets.

  Args:
    datasets: list of datasets for which to create documentation.
              If None, then all available datasets will be used.

  Returns:
    string describing the datasets (in the MarkDown format).