class_docstr: Basic rectangle representation using kiwi solver variables
class_docstr_tok: ["Basic","rectangle","representation","using","kiwi","solver","variables"]
code: def soft_constraints(self):
      sol = self.solver
      if self.tightwidth:
          suggest = 0.0
      else:
          suggest = 20.0
      c = self.pref_width == suggest
      for i in c:
          sol.addConstraint(i | "required")
      if self.tightheight:
          suggest = 0.0
      else:
          suggest = 20.0
      c = self.pref_height == suggest
      for i in c:
          sol.addConstraint(i | "required")
  
      c = [(self.width >= suggest), (self.height >= suggest)]
      for i in c:
          sol.addConstraint(i | 150000)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import itertools
  import kiwisolver
  import logging
  import numpy
  import warnings
  import matplotlib
label_desc: Use image node_id 8 for calling the LayoutBox obj's underlying member method code with example usage: obj.soft_constraints() without return types