code: def generators_from_logdir(logdir):
    
    subdirs = io_wrapper.GetLogdirSubdirectories(logdir)
    generators = [
        itertools.chain(*[
            generator_from_event_file(os.path.join(subdir, f))
            for f in tf.io.gfile.listdir(subdir)
            if io_wrapper.IsTensorFlowEventsFile(os.path.join(subdir, f))
        ]) for subdir in subdirs
    ]
    return generators
docs: Returns a list of event generators for subdirectories with event files.
  
    The number of generators returned should equal the number of directories
    within logdir that contain event files. If only logdir contains event files,
    returns a list of length one.
  
    Args:
      logdir: A log directory that contains event files.
  
    Returns:
      List of event generators for each subdirectory with event files.