class_docstr: Math Dataset.
code: def _read_data_from_all_categories(
      self, directory, config, categories
  ):
      lines = []
      for category in categories:
          data_file = os.path.join(
              directory, _DATASET_VERSION, category, config
          )
          if tf.io.gfile.exists(data_file):
              with epath.Path(data_file).open() as f:
                  ls = f.read().split("\n")
  
                  for l in ls[::-1]:
                      if not l:
                          ls.remove(l)
  
                  lines.extend(ls)
  
      return lines
  
file_path: datasets/tensorflow_datasets/datasets/math_dataset/math_dataset_dataset_builder.py
imports: import os
  from absl import logging
  from etils import epath
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling the Builder obj's underlying member method code with example usage: obj._read_data_from_all_categories(directory, config, categories) and returns: lines