class_docstr: Check if variables can be expressed without using variables in invalid.
  
  Parameters
  ----------
  valid_equivalent
      Provides a dictionary mapping some invalid variables to valid ones that
      can be used instead.
code: def __init__(self, valid=None, invalid=None, valid_equivalent=None):
      if valid is None:
          valid = []
      if invalid is None:
          invalid = []
      if valid_equivalent is None:
          valid_equivalent = OrderedDict()
  
      # Nodes that are valid to have in the graph computing outputs
      self.valid = set(valid)
  
      # Nodes that are NOT valid to have in the graph computing outputs
      self.invalid = set(invalid)
  
      # Mapping from invalid variables to equivalent valid ones.
      self.valid_equivalent = valid_equivalent.copy()
      self.valid.update(list(valid_equivalent.values()))
      self.invalid.update(list(valid_equivalent.keys()))
  
imports: from __future__ import absolute_import, print_function, division
  import copy
  import logging
  import warnings
  from collections import OrderedDict
  import numpy
  import theano
  from theano.compat import izip
  from six import string_types, iteritems
  from six.moves import xrange
  from theano.compile.pfunc import rebuild_collect_shared
  from theano import gof, compat
  from theano import tensor, scalar
  from theano.tensor.basic import get_scalar_constant_value
label_desc: Use image node_id 1 to create a new Validator object from inherited base classes: object with example: obj = Validator(valid, invalid, valid_equivalent)