code: def fetchcbatch(self):
          '''Return a CBatch object of any data currently in the buffer or
             if no data currently in buffer then fetch a batch'''
          if not self._last_operation.is_columnar:
              raise NotSupportedError("Server does not support columnar "
                                      "fetching")
          if not self.has_result_set:
              raise ProgrammingError(
                  "Trying to fetch results on an operation with no results.")
          if len(self._buffer) > 0:
              log.debug('fetchcbatch: buffer has data in. Returning it and wiping buffer')
              batch = self._buffer
              self._buffer = Batch()
              return batch
          elif self._last_operation_active:
              log.debug('fetchcbatch: buffer empty and op is active => fetching '
                        'more data')
              batch = (self._last_operation.fetch(
                           self.description,
                           self.buffersize,
                           convert_types=self.convert_types))
              if len(batch) == 0:
                 return None
              return batch
          else:
             return Nonf fetchcbatch(self):
          '''Return a CBatch object of any data currently in the buffer or
             if no data currently in buffer then fetch a batch'''
          if not self._last_operation.is_columnar:
              raise NotSupportedError("Server does not support columnar "
                                      "fetching")
          if not self.has_result_set:
              raise ProgrammingError(
                  "Trying to fetch results on an operation with no results.")
          if len(self._buffer) > 0:
              log.debug('fetchcbatch: buffer has data in. Returning it and wiping buffer')
              batch = self._buffer
              self._buffer = Batch()
              return batch
          elif self._last_operation_active:
              log.debug('fetchcbatch: buffer empty and op is active => fetching '
                        'more data')
              batch = (self._last_operation.fetch(
                           self.description,
                           self.buffersize,
                           convert_types=self.convert_types))
              if len(batch) == 0:
                 return None
              return batch
          else:
             return None
docs: Return a CBatch object of any data currently in the buffer or
             if no data currently in buffer then fetch a batch