code: def summarize_sequence_file(source_file, file_type=None):
      
      is_alignment = True
      avg_length = None
      min_length = sys.maxsize
      max_length = 0
      sequence_count = 0
  
      # Get an iterator and analyze the data.
      with common.FileType('rt')(source_file) as fp:
          if not file_type:
              file_type = fileformat.from_handle(fp)
          for record in SeqIO.parse(fp, file_type):
              sequence_count += 1
              sequence_length = len(record)
              if max_length != 0:
                  # If even one sequence is not the same length as the others,
                  # we don't consider this an alignment.
                  if sequence_length != max_length:
                      is_alignment = False
  
              # Lengths
              if sequence_length > max_length:
                  max_length = sequence_length
              if sequence_length < min_length:
                  min_length = sequence_length
  
              # Average length
              if sequence_count == 1:
                  avg_length = float(sequence_length)
              else:
                  avg_length = avg_length + ((sequence_length - avg_length) /
                                             sequence_count)
  
      # Handle an empty file:
      if avg_length is None:
          min_length = max_length = avg_length = 0
      if sequence_count <= 1:
          is_alignment = False
  
      return (source_file, str(is_alignment).upper(), min_length,
              max_length, avg_length, sequence_count)
docs: Summarizes a sequence file, returning a tuple containing the name,
      whether the file is an alignment, minimum sequence length, maximum
      sequence length, average length, number of sequences.