code: def IsTensorFlowEventsFile(path):
    
    if not path:
      raise ValueError('Path must be a nonempty string')
    return 'tfevents' in tf.compat.as_str_any(os.path.basename(path))
docs: Check the path name to see if it is probably a TF Events file.
  
    Args:
      path: A file path to check if it is an event file.
  
    Raises:
      ValueError: If the path is an empty string.
  
    Returns:
      If path is formatted like a TensorFlowEventsFile.