parameters: (path)
docstring: Create an event generator for file or directory at given path string.
docstring_summary: Create an event generator for file or directory at given path string.
docstring_tokens: Create an event generator for file or directory at given path string .
function: def _GeneratorFromPath(path):
    """Create an event generator for file or directory at given path string."""
    if IsTensorFlowEventsFile(path):
      return io_wrapper.CreateFileLoader(path)
    else:
      return directory_watcher.DirectoryWatcher(path, io_wrapper.CreateFileLoader,
                                                IsTensorFlowEventsFile)
function_tokens: def _GeneratorFromPath ( path ) : if IsTensorFlowEventsFile ( path ) : return io_wrapper . CreateFileLoader ( path ) else : return directory_watcher . DirectoryWatcher ( path , io_wrapper . CreateFileLoader , IsTensorFlowEventsFile )