<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wet_records(wet_filepath):
 """Generate WETRecords from filepath."""

  if wet_filepath.endswith('.gz'):
    fopen = gzip.open
  else:
    fopen = tf.gfile.GFile

  with fopen(wet_filepath) as f:
    for record in wet_records_from_file_obj(f):
      yield record