code: def set_compression(self, comp=COMP_DEFAULT, size=COMP_SIZE):
          
          if comp not in COMPRESSORS:
              if comp == COMP_LZ4F:
                  raise ValueError('lz4f compression not available, required lz4framed')
              else:
                  raise ValueError('Invalid compression method')
          if not isinstance(size, int_types) or size < 1:
              raise ValueError('size must be non-negative integer')
          self.__comp_default = comp
          self.__comp_size = size
          return self.__comp_default, self.__comp_size
docs: Override compression method (defined by container) and threshold