code: def set_capacity(self, new_capacity, only_read=False):
          
          if not isinstance(new_capacity, int) or new_capacity <= 0:
              self.logger.warning('Parameter new_capacity %s must be greater than 0 and is an integer' % new_capacity)
              return
          self.capacity = new_capacity
docs: >>> cache = Cache(log_level=logging.WARNING)
          >>> cache.set_capacity(100)
          >>> cache.capacity
          100
          >>> cache.set_capacity('haha')
          >>> cache.capacity
          100