def get_casava_version(fastq1):
 if isinstance(fastq1, list):
  fastq_read_f_line1 = fastq1[0]
 else:
  fastq_read_f_line1 = fastq1.readline()
  fastq1.seek(0)
 post_casava_v180 = is_casava_v180_or_later(fastq_read_f_line1)
 if post_casava_v180:
  check_header_match_f = check_header_match_180_or_later
 else:
  check_header_match_f = check_header_match_pre180
 return check_header_match_f

def get_casava_version ( fastq1 ) : if isinstance ( fastq1 , list ) : fastq_read_f_line1 = fastq1 [ 0 ] else : fastq_read_f_line1 = fastq1 . readline ( ) fastq1 . seek ( 0 ) post_casava_v180 = is_casava_v180_or_later ( fastq_read_f_line1 ) if post_casava_v180 : check_header_match_f = check_header_match_180_or_later else : check_header_match_f = check_header_match_pre180 return check_header_match_f
determine the version of casava that was used to generate the fastq fastq1: open fastq file or list of lines .