Iterate through records in WET file object.

def wet_records_from_file_obj(f, take_ownership=False):
  """Iterate through records in WET file object."""
  while True:
    record = WETRecord.read(f)

    if record is None:
      break

    if not record.url:
      continue

    yield record

  if take_ownership:
    f.close()