def _get_format_type(self):
        """ Determines format type based on whether or not all records
            are of the same length.

            Returns either 'csv' or 'fixed'
        """
        rec_length = collections.defaultdict(int)
        rec_cnt = 0
        for rec in fileinput.input(self.fqfn):
            rec_length[len(rec)] += 1
            rec_cnt += 1
            if rec_cnt > 1000:     # don't want to read millions of recs
                break
        fileinput.close()

        if len(rec_length) == 1:
            return 'fixed'
        else:
            return 'csv'
dataset/ETHPy150Open kenfar/DataGristle/gristle/file_type.py/FileTyper._get_format_type/original