grr/core/grr_response_core/lib/util/collection.py
def StartsWith(this, that):
  """Checks whether an items of one iterable are a prefix of another.

  Args:
    this: An iterable that needs to be checked.
    that: An iterable of which items must match the prefix of `this`.

  Returns:
    `True` if `that` is a prefix of `this`, `False` otherwise.
  """
  this_iter = iter(this)
  that_iter = iter(that)

  while True:
    try:
      this_value = next(that_iter)
    except StopIteration:
      return True

    try:
      that_value = next(this_iter)
    except StopIteration:
      return False

    if this_value != that_value:
      return False
Checks whether an items of one iterable are a prefix of another.

  Args:
    this: An iterable that needs to be checked.
    that: An iterable of which items must match the prefix of `this`.

  Returns:
    `True` if `that` is a prefix of `this`, `False` otherwise.
  
Checks whether an items of one iterable are a prefix of another.
Checks whether an items of one iterable are a prefix of another .
def StartsWith(this, that):
  this_iter = iter(this)
  that_iter = iter(that)
  while True:
    try:
      this_value = next(that_iter)
    except StopIteration:
      return True
    try:
      that_value = next(this_iter)
    except StopIteration:
      return False
    if this_value != that_value:
      return False
def StartsWith ( this , that ) : this_iter = iter ( this ) that_iter = iter ( that ) while True : try : this_value = next ( that_iter ) except StopIteration : return True try : that_value = next ( this_iter ) except StopIteration : return False if this_value != that_value : return False
Checks whether an items of one iterable are a prefix of another.
Checks whether an items of one iterable are a prefix of another .
"""Checks whether an items of one iterable are a prefix of another.

  Args:
    this: An iterable that needs to be checked.
    that: An iterable of which items must match the prefix of `this`.

  Returns:
    `True` if `that` is a prefix of `this`, `False` otherwise.
  """
`True` if `that` is a prefix of `this`, `False` otherwise.
` True ` if ` that ` is a prefix of ` this ` ` False ` otherwise .
this
An iterable that needs to be checked.
An iterable that needs to be checked .
that
An iterable of which items must match the prefix of `this`.
An iterable of which items must match the prefix of ` this ` .