code: def setOption(self, name, value):
          
          if isinstance(value, bool):
              lock_and_call(
                  lambda: self._impl.setBoolOption(name, value),
                  self._lock
              )
          elif isinstance(value, int):
              lock_and_call(
                  lambda: self._impl.setIntOption(name, value),
                  self._lock
              )
          elif isinstance(value, float):
              lock_and_call(
                  lambda: self._impl.setDblOption(name, value),
                  self._lock
              )
          elif isinstance(value, basestring):
              lock_and_call(
                  lambda: self._impl.setOption(name, value),
                  self._lock
              )
          else:
              raise TypeError
docs: Set an AMPL option to a specified value.
  
          Args:
              name: Name of the option to be set (alphanumeric without spaces).
  
              value: The value the option must be set to.
  
          Raises:
              InvalidArgumet: if the option name is not valid.
  
              TypeError: if the value has an invalid type.