<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def head(self, limit, partition=None, columns=None):
 """ Get the head records of a table or its partition. :param limit: records' size, 10000 at most :param partition: partition of this table :param columns: the columns which is subset of the table columns :type columns: list :return: records :rtype: list .. seealso:: :class:`odps.models.Record` """


        if limit <= 0:
            raise ValueError('limit number should >= 0.')

        params = {'data': '', 'linenum': limit}
        if partition is not None:
            if not isinstance(partition, odps_types.PartitionSpec):
                partition = odps_types.PartitionSpec(partition)
            params['partition'] = str(partition)
        if columns is not None and len(columns) > 0:
            col_name = lambda col: col.name if isinstance(col, odps_types.Column) else col
            params['cols'] = ','.join(col_name(col) for col in columns)

        resp = self._client.get(self.resource(), params=params, stream=True)
        with readers.RecordReader(self.schema, resp) as reader:
            for record in reader:
                yield record