docs: def up_by_arrival(*filters, local_dir=".", remote_dir=DEFAULT_REMOTE_DIR):
      """Monitors a local directory and
      generates sets of new files to be uploaded to FlashAir.
      Sets to upload are generated in a tuple like (Direction.up, {...}).
      The generator yields before each upload actually takes place."""
      local_monitor = watch_local_files(*filters, local_dir=local_dir)
      _, file_set = next(local_monitor)
      _notify_sync_ready(len(file_set), local_dir, remote_dir)
      for new_arrivals, file_set in local_monitor:
          yield Direction.up, new_arrivals  # where new_arrivals is possibly empty
          if new_arrivals:
              _notify_sync(Direction.up, new_arrivals)
              up_by_files(new_arrivals, remote_dir)
              _notify_sync_ready(len(file_set), local_dir, remote_dir)