<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate(data, schema, defined_keys=False):
 """ Main entry point for the validation engine. :param data: The incoming data, as a dictionary object. :param schema: The schema from which data will be validated against """

    if isinstance(data, dict):
        validator = Validator(data, schema, defined_keys=defined_keys)
        validator.validate()
    else:
        raise TypeError('expected data to be of type dict, but got: %s' % type(data))