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