code: def to_bytes(self, request=None):
          '''Called to transform the collection of
          ``streams`` into the content string.
          This method can be overwritten by derived classes.
  
          :param streams: a collection (list or dictionary) containing
              ``strings/bytes`` used to build the final ``string/bytes``.
          :return: a string or bytes
          '''
          data = bytearray()
          for chunk in self.stream(request):
              if isinstance(chunk, str):
                  chunk = chunk.encode(self.charset)
              data.extend(chunk)
          return bytes(dataf to_bytes(self, request=None):
          '''Called to transform the collection of
          ``streams`` into the content string.
          This method can be overwritten by derived classes.
  
          :param streams: a collection (list or dictionary) containing
              ``strings/bytes`` used to build the final ``string/bytes``.
          :return: a string or bytes
          '''
          data = bytearray()
          for chunk in self.stream(request):
              if isinstance(chunk, str):
                  chunk = chunk.encode(self.charset)
              data.extend(chunk)
          return bytes(data)
docs: Called to transform the collection of
          ``streams`` into the content string.
          This method can be overwritten by derived classes.
  
          :param streams: a collection (list or dictionary) containing
              ``strings/bytes`` used to build the final ``string/bytes``.
          :return: a string or bytes