<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_definition(self, definition_name, dict_to_test, definition=None):
 """Validate the given dict according to the given definition. Args: definition_name: name of the the definition. dict_to_test: dict to test. Returns: True if the given dict match the definition, False otherwise. """

        if (definition_name not in self.specification['definitions'].keys() and
                definition is None):
            # reject unknown definition
            return False

        # Check all required in dict_to_test
        spec_def = definition or self.specification['definitions'][definition_name]
        all_required_keys_present = all(req in dict_to_test.keys() for req in spec_def.get('required', {}))
        if 'required' in spec_def and not all_required_keys_present:
            return False

        # Check no extra arg & type
        properties_dict = spec_def.get('properties', {})
        for key, value in dict_to_test.items():
            if value is not None:
                if key not in properties_dict:  # Extra arg
                    return False
                else:  # Check type
                    if not self._validate_type(properties_dict[key], value):
                        return False

        return True