code: def _compile_object(self, schema):
          
          base_validate = self._compile_mapping(
              schema, invalid_msg='object value')
  
          def validate_object(path, data):
              if schema.cls is not UNDEFINED and not isinstance(data, schema.cls):
                  raise er.ObjectInvalid('expected a {0!r}'.format(schema.cls), path)
              iterable = _iterate_object(data)
              iterable = ifilter(lambda item: item[1] is not None, iterable)
              out = base_validate(path, iterable, {})
              return type(data)(**out)
  
          return validate_object
docs: Validate an object.
  
          Has the same behavior as dictionary validator but work with object
          attributes.
  
          For example:
  
              >>> class Structure(object):
              ...     def __init__(self, one=None, three=None):
              ...         self.one = one
              ...         self.three = three
              ...
              >>> validate = Schema(Object({'one': 'two', 'three': 'four'}, cls=Structure))
              >>> with raises(er.MultipleInvalid, "not a valid value for object value @ data['one']"):
              ...   validate(Structure(one='three'))