# Path: gslib/exception.py
# NO_URLS_MATCHED_PREFIX = 'No URLs matched'
# 
# Path: gslib/exception.py
# NO_URLS_MATCHED_TARGET = NO_URLS_MATCHED_PREFIX + ': %s'
# 
# Path: gslib/tests/testcase/integration_testcase.py
# def SkipForS3(reason):
#   if RUN_S3_TESTS:
#     return unittest.skip(reason)
#   else:
#     return lambda func: func


import os
import re
import sys
import gslib.tests.testcase as testcase
import gslib.tests.util as util
from unittest import mock
from gslib.exception import NO_URLS_MATCHED_PREFIX
from gslib.exception import NO_URLS_MATCHED_TARGET
from gslib.tests.testcase.base import MAX_BUCKET_LENGTH
from gslib.tests.testcase.integration_testcase import SkipForS3
from gslib.tests.util import GenerationFromURI as urigen
from gslib.tests.util import ObjectToURI as suri
from gslib.tests.util import SetBotoConfigForTest
from gslib.tests.util import SetEnvironmentForTest
from gslib.utils.retry_util import Retry
                              stdin=stdin)
      num_objects = len(object_strings)
      # Asserting for operation completion
      if '-q' not in command_and_args and not self._use_gcloud_storage:
        if '-m' in command_and_args:
          self.assertIn('[%d/%d objects]' % (num_objects, num_objects), stderr)
        else:
          self.assertIn('[%d objects]' % num_objects, stderr)

      stderr = self._CleanRmUiOutputBeforeChecking(stderr)
      stderr_set = set(stderr.splitlines())
      if '' in stderr_set:
        stderr_set.remove('')  # Avoid groups represented by an empty string.
      if MACOS_WARNING in stderr_set:
        stderr_set.remove(MACOS_WARNING)
      self.assertEqual(stderr_set, expected_stderr_lines)
    else:
      cumulative_stderr_lines = set()

      @Retry(AssertionError, tries=5, timeout_secs=1)
      def _RunRmCommandAndCheck():
        """Runs/retries the command updating+checking cumulative output."""
        stderr = self.RunGsUtil(command_and_args,
                                return_stderr=True,
                                expected_status=None,
                                stdin=stdin)
        stderr = self._CleanRmUiOutputBeforeChecking(stderr)
        update_lines = True
        # Retry 404's and 409's due to eventual listing consistency, but don't
        # add the output to the set.

# Path: gslib/exception.py
# NO_URLS_MATCHED_PREFIX = 'No URLs matched'
# 
# Path: gslib/exception.py
# NO_URLS_MATCHED_TARGET = NO_URLS_MATCHED_PREFIX + ': %s'
# 
# Path: gslib/tests/testcase/integration_testcase.py
# def SkipForS3(reason):
#   if RUN_S3_TESTS:
#     return unittest.skip(reason)
#   else:
#     return lambda func: func


# Path: gslib/tests/test_rm.py
import os
import re
import sys
import gslib.tests.testcase as testcase
import gslib.tests.util as util
from unittest import mock
from gslib.exception import NO_URLS_MATCHED_PREFIX
from gslib.exception import NO_URLS_MATCHED_TARGET
from gslib.tests.testcase.base import MAX_BUCKET_LENGTH
from gslib.tests.testcase.integration_testcase import SkipForS3
from gslib.tests.util import GenerationFromURI as urigen
from gslib.tests.util import ObjectToURI as suri
from gslib.tests.util import SetBotoConfigForTest
from gslib.tests.util import SetEnvironmentForTest
from gslib.utils.retry_util import Retry

                              stdin=stdin)
      num_objects = len(object_strings)
      # Asserting for operation completion
      if '-q' not in command_and_args and not self._use_gcloud_storage:
        if '-m' in command_and_args:
          self.assertIn('[%d/%d objects]' % (num_objects, num_objects), stderr)
        else:
          self.assertIn('[%d objects]' % num_objects, stderr)

      stderr = self._CleanRmUiOutputBeforeChecking(stderr)
      stderr_set = set(stderr.splitlines())
      if '' in stderr_set:
        stderr_set.remove('')  # Avoid groups represented by an empty string.
      if MACOS_WARNING in stderr_set:
        stderr_set.remove(MACOS_WARNING)
      self.assertEqual(stderr_set, expected_stderr_lines)
    else:
      cumulative_stderr_lines = set()

      @Retry(AssertionError, tries=5, timeout_secs=1)
      def _RunRmCommandAndCheck():
        """Runs/retries the command updating+checking cumulative output."""
        stderr = self.RunGsUtil(command_and_args,
                                return_stderr=True,
                                expected_status=None,
                                stdin=stdin)
        stderr = self._CleanRmUiOutputBeforeChecking(stderr)
        update_lines = True
        # Retry 404's and 409's due to eventual listing consistency, but don't
        # add the output to the set.

        if (NO_URLS_MATCHED_PREFIX in stderr or