docstr: A binding is consistent with the dict if its variable is not already bound, OR if its
  variable is already bound to its argument.
  
  :param variable: ``Variable`` The variable to bind
  :param binding: ``Expression`` The atomic to which 'variable' should be bound
  :raise BindingException: If the variable cannot be bound in this dictionary
docstr_tok: ["A","binding","is","consistent","with","the","dict","if","its","variable","is","not","already","bound",",","OR","if","its","variable","is","already","bound","to","its","argument",".",":","param","variable",":","``","Variable","``","The","variable","to","bind",":","param","binding",":","``","Expression","``","The","atomic","to","which","'variable","'","should","be","bound",":","raise","BindingException",":","If","the","variable","can","not","be","bound","in","this","dictionary"]
code: def __setitem__(self, variable, binding):
      """
      A binding is consistent with the dict if its variable is not already bound, OR if its
      variable is already bound to its argument.
  
      :param variable: ``Variable`` The variable to bind
      :param binding: ``Expression`` The atomic to which 'variable' should be bound
      :raise BindingException: If the variable cannot be bound in this dictionary
      """
      assert isinstance(variable, Variable)
      assert isinstance(binding, Expression)
  
      try:
          existing = self[variable]
      except KeyError:
          existing = None
  
      if not existing or binding == existing:
          self.d[variable] = binding
      elif isinstance(binding, IndividualVariableExpression):
          # Since variable is already bound, try to bind binding to variable
          try:
              existing = self[binding.variable]
          except KeyError:
              existing = None
  
          binding2 = VariableExpression(variable)
  
          if not existing or binding2 == existing:
              self.d[binding.variable] = binding2
          else:
              raise BindingException(
                  "Variable %s already bound to another "
                  "value" % (variable)
              )
      else:
          raise BindingException(
              "Variable %s already bound to another "
              "value" % (variable)
          )
  
imports: import operator
  from collections import defaultdict
  from functools import reduce
  from nltk.inference.api import BaseProverCommand, Prover
  from nltk.sem import skolemize
  from nltk.sem.logic import AndExpression, ApplicationExpression, EqualityExpression, Expression, IndividualVariableExpression, NegatedExpression, OrExpression, Variable, VariableExpression, is_indvar, unique_variable
label_desc: Use image node_id 2 for calling the BindingDict obj's underlying member method code with example usage: obj.__setitem__(variable, binding) without return types