<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(obj, required_properties=None, additional_properties=None, ignore_optional_property_errors=None):
 """Try to parse the given ``obj`` as a validator instance. - :py:class:`Validator` instance, return it. - :py:class:`Validator` subclass, instantiate it without arguments and return it. - :py:attr:`~Validator.name` of a known :py:class:`Validator` subclass, instantiate the subclass without arguments and return it. - otherwise find the first registered :py:class:`Validator` factory that can create it. The search order is the reverse of the factory registration order. The caller is responsible for ensuring there are no ambiguous values that can be parsed by more than one factory. :param required_properties: Specifies for this parse call whether parsed :py:class:`~valideer.validators.Object` properties are required or optional by default. It can be: - ``True`` for required. - ``False`` for optional. - ``None`` to use the value of the :py:attr:`~valideer.validators.Object.REQUIRED_PROPERTIES` attribute. :param additional_properties: Specifies for this parse call the schema of all :py:class:`~valideer.validators.Object` properties that are not explicitly defined as optional or required. It can also be: - ``True`` to allow any value for additional properties. - ``False`` to disallow any additional properties. - :py:attr:`~valideer.validators.Object.REMOVE` to remove any additional properties from the adapted object. - ``None`` to use the value of the :py:attr:`~valideer.validators.Object.ADDITIONAL_PROPERTIES` attribute. :param ignore_optional_property_errors: Determines if invalid optional properties are ignored: - ``True`` to ignore invalid optional properties. - ``False`` to raise ValidationError for invalid optional properties. - ``None`` to use the value of the :py:attr:`~valideer.validators.Object.IGNORE_OPTIONAL_PROPERTY_ERRORS` attribute. :raises SchemaError: If no appropriate validator could be found. .. warning:: Passing ``required_properties`` and/or ``additional_properties`` with value other than ``None`` may be non intuitive for schemas that involve nested validators. Take for example the following schema:: v = V.parse({ "x": "integer", "child": V.Nullable({ "y": "integer" }) }, required_properties=True) Here the top-level properties 'x' and 'child' are required but the nested 'y' property is not. This is because by the time :py:meth:`parse` is called, :py:class:`~valideer.validators.Nullable` has already parsed its argument with the default value of ``required_properties``. Several other builtin validators work similarly to :py:class:`~valideer.validators.Nullable`, accepting one or more schemas to parse. In order to parse an arbitrarily complex nested validator with the same value for ``required_properties`` and/or ``additional_properties``, use the :py:func:`parsing` context manager instead:: with V.parsing(required_properties=True):
 v = V.parse({ "x": "integer", "child": V.Nullable({ "y": "integer" }) }) """

    if not (required_properties is
            additional_properties is
            ignore_optional_property_errors is None):
        with parsing(required_properties=required_properties,
                     additional_properties=additional_properties,
                     ignore_optional_property_errors=ignore_optional_property_errors):
            return parse(obj)

    validator = None

    if isinstance(obj, Validator):
        validator = obj
    elif inspect.isclass(obj) and issubclass(obj, Validator):
        validator = obj()
    else:
        try:
            validator = _NAMED_VALIDATORS[obj]
        except (KeyError, TypeError):
            for factory in _VALIDATOR_FACTORIES:
                validator = factory(obj)
                if validator is not None:
                    break
        else:
            if inspect.isclass(validator) and issubclass(validator, Validator):
                _NAMED_VALIDATORS[obj] = validator = validator()

    if not isinstance(validator, Validator):
        raise SchemaError("%r cannot be parsed as a Validator" % obj)

    return validator