code: def str2bool(value):
      
      try:
          if isinstance(value, (str, unicode)):
              return bool(util.strtobool(value))
      except NameError:  # python 3
          if isinstance(value, str):
              return bool(util.strtobool(value))
      return bool(value)
docs: Args:
          value - text to be converted to boolean
           True values: y, yes, true, t, on, 1
           False values: n, no, false, off, 0