Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(32)  |  Call(24)  |  Derive(0)  |  Import(8)

src/g/s/gsutil-3.42/gslib/name_expansion.py   gsutil(Download)
from bucket_listing_ref import BucketListingRef
from gslib.exception import CommandException
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
from gslib.storage_uri_builder import StorageUriBuilder
from wildcard_iterator import ContainsWildcard
        suri = self.suri_builder.StorageUri(uri_str)
        post_step1_iter = iter([BucketListingRef(suri)])
      post_step1_iter = PluralityCheckableIterator(post_step1_iter)
 
      # Step 2: Expand bucket subdirs and versions. The output from this
      else:
        post_step2_iter = _NonContainerTuplifyIterator(post_step1_iter)
      post_step2_iter = PluralityCheckableIterator(post_step2_iter)
 
      # Step 3. Expand directories and buckets. This step yields the iterated
          uri_to_iterate = blr.GetUri().clone_replace_name(wc)
        wc_iter = PluralityCheckableIterator(
            self._WildcardIterator(uri_to_iterate))
        src_uri_expands_to_multi = (src_uri_expands_to_multi
                                    or wc_iter.has_plurality())
    dir/c/
  """
  uri_strs = PluralityCheckableIterator(uri_strs)
  name_expansion_iterator = _NameExpansionIterator(
      command_name, proj_id_handler, headers, debug, logger,

src/g/s/gsutil-HEAD/gslib/name_expansion.py   gsutil(Download)
from bucket_listing_ref import BucketListingRef
from gslib.exception import CommandException
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
from gslib.storage_uri_builder import StorageUriBuilder
from wildcard_iterator import ContainsWildcard
        suri = self.suri_builder.StorageUri(uri_str)
        post_step1_iter = iter([BucketListingRef(suri)])
      post_step1_iter = PluralityCheckableIterator(post_step1_iter)
 
      # Step 2: Expand bucket subdirs and versions. The output from this
      else:
        post_step2_iter = _NonContainerTuplifyIterator(post_step1_iter)
      post_step2_iter = PluralityCheckableIterator(post_step2_iter)
 
      # Step 3. Expand directories and buckets. This step yields the iterated
          uri_to_iterate = blr.GetUri().clone_replace_name(wc)
        wc_iter = PluralityCheckableIterator(
            self._WildcardIterator(uri_to_iterate))
        src_uri_expands_to_multi = (src_uri_expands_to_multi
                                    or wc_iter.has_plurality())
    dir/c/
  """
  uri_strs = PluralityCheckableIterator(uri_strs)
  name_expansion_iterator = _NameExpansionIterator(
      command_name, proj_id_handler, headers, debug, logger,

src/g/s/gsutil-3.42/gslib/commands/ls.py   gsutil(Download)
from gslib.help_provider import HelpType
from gslib.help_provider import HELP_TYPE
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
from gslib.util import ListingStyle
from gslib.util import MakeHumanReadable
        # BLR's instantiated from a user-provided URI.
        blr_iterator = PluralityCheckableIterator(
            UriOnlyBlrExpansionIterator(
                self, blr, all_versions=self.all_versions))
        if blr_iterator.is_empty() and not ContainsWildcard(uri):

src/g/s/gsutil-3.42/gslib/commands/du.py   gsutil(Download)
from gslib.help_provider import HelpType
from gslib.help_provider import HELP_TYPE
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
from gslib.util import MakeHumanReadable
from gslib.util import NO_MAX
      # BLR's instantiated from a user-provided URI.
      blr_iterator = PluralityCheckableIterator(
          UriOnlyBlrExpansionIterator(
              self, blr, all_versions=self.all_versions))
      if blr_iterator.is_empty() and not ContainsWildcard(blr.GetUriString()):

src/g/s/gsutil-HEAD/gslib/commands/ls.py   gsutil(Download)
from gslib.help_provider import HelpType
from gslib.help_provider import HELP_TYPE
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
from gslib.util import ListingStyle
from gslib.util import MakeHumanReadable
        # BLR's instantiated from a user-provided URI.
        blr_iterator = PluralityCheckableIterator(
            UriOnlyBlrExpansionIterator(
                self, blr, all_versions=self.all_versions))
        if blr_iterator.is_empty() and not ContainsWildcard(uri):

src/g/s/gsutil-HEAD/gslib/commands/du.py   gsutil(Download)
from gslib.help_provider import HelpType
from gslib.help_provider import HELP_TYPE
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
from gslib.util import MakeHumanReadable
from gslib.util import NO_MAX
      # BLR's instantiated from a user-provided URI.
      blr_iterator = PluralityCheckableIterator(
          UriOnlyBlrExpansionIterator(
              self, blr, all_versions=self.all_versions))
      if blr_iterator.is_empty() and not ContainsWildcard(blr.GetUriString()):

src/g/s/gsutil-3.42/gslib/tests/test_plurality_checkable_iterator.py   gsutil(Download)
"""Unit tests for PluralityCheckableIterator"""
 
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
import gslib.tests.testcase as testcase
 
  def testPluralityCheckableIteratorWith0Elems(self):
    """Tests empty PluralityCheckableIterator."""
    input_list = range(0)
    it = iter(input_list)
    pcit = PluralityCheckableIterator(it)
  def testPluralityCheckableIteratorWith1Elem(self):
    """Tests PluralityCheckableIterator with 1 element."""
    input_list = range(1)
    it = iter(input_list)
    pcit = PluralityCheckableIterator(it)
  def testPluralityCheckableIteratorWith2Elems(self):
    """Tests PluralityCheckableIterator with 2 elements."""
    input_list = range(2)
    it = iter(input_list)
    pcit = PluralityCheckableIterator(it)
  def testPluralityCheckableIteratorWith3Elems(self):
    """Tests PluralityCheckableIterator with 3 elements."""
    input_list = range(3)
    it = iter(input_list)
    pcit = PluralityCheckableIterator(it)

src/g/s/gsutil-HEAD/gslib/tests/test_plurality_checkable_iterator.py   gsutil(Download)
"""Unit tests for PluralityCheckableIterator"""
 
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
import gslib.tests.testcase as testcase
 
  def testPluralityCheckableIteratorWith0Elems(self):
    """Tests empty PluralityCheckableIterator."""
    input_list = range(0)
    it = iter(input_list)
    pcit = PluralityCheckableIterator(it)
  def testPluralityCheckableIteratorWith1Elem(self):
    """Tests PluralityCheckableIterator with 1 element."""
    input_list = range(1)
    it = iter(input_list)
    pcit = PluralityCheckableIterator(it)
  def testPluralityCheckableIteratorWith2Elems(self):
    """Tests PluralityCheckableIterator with 2 elements."""
    input_list = range(2)
    it = iter(input_list)
    pcit = PluralityCheckableIterator(it)
  def testPluralityCheckableIteratorWith3Elems(self):
    """Tests PluralityCheckableIterator with 3 elements."""
    input_list = range(3)
    it = iter(input_list)
    pcit = PluralityCheckableIterator(it)