docs: def validate_header(fields,  # type: Sequence[FieldSpec]
                      column_names  # type: Sequence[str]
                      ):
      # type: (...) -> None
      """ Validate the `column_names` according to the specification in
          `fields`.
  
          :param fields: The `FieldSpec` objects forming the
              specification.
          :param column_names: A sequence of column identifier.
          :raises FormatError: When the number of columns or the column
              identifiers don't match the specification.
      """
      if len(fields) != len(column_names):
          msg = 'Header has {} columns when {} are expected.'.format(
              len(column_names), len(fields))
          raise FormatError(msg)
  
      for f, column in zip(fields, column_names):
          if f.identifier != column:
              msg = "Column has identifier '{}' when '{}' is expected.".format(
                  column, f.identifier)
              raise FormatError(msg)