<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, ac_schema_safe=True, ac_schema_errors=False, **options):
 """ Validate target object with given schema object, loaded from JSON schema. See also: https://python-jsonschema.readthedocs.org/en/latest/validate/ :parae data: Target object (a dict or a dict-like object) to validate :param schema: Schema object (a dict or a dict-like object) instantiated from schema JSON file or schema JSON string :param options: Other keyword options such as: - ac_schema_safe: Exception (jsonschema.ValidationError or jsonschema.SchemaError or others) will be thrown during validation process due to any validation or related errors. However, these will be catched by default, and will be re-raised if 'ac_safe' is False. - ac_schema_errors: Lazily yield each of the validation errors and returns all of them if validation fails. :return: (True if validation succeeded else False, error message[s]) """

    if not JSONSCHEMA_IS_AVAIL:
        return (True, _NA_MSG)

    options = anyconfig.utils.filter_options(("cls", ), options)
    if ac_schema_errors:
        return _validate_all(data, schema, **options)

    return _validate(data, schema, ac_schema_safe, **options)