def add_entity_errors(<EOL>self,<EOL>property_name,<EOL>direct_errors=None,<EOL>schema_errors=None<EOL>):
if direct_errors is None and schema_errors is None:<EOL><INDENT>return self<EOL><DEDENT>if direct_errors is not None:<EOL><INDENT>if property_name not in self.errors:<EOL><INDENT>self.errors[property_name] = dict()<EOL><DEDENT>if '<STR_LIT>' not in self.errors[property_name]:<EOL><INDENT>self.errors[property_name]['<STR_LIT>'] = []<EOL><DEDENT>if type(direct_errors) is not list:<EOL><INDENT>direct_errors = [direct_errors]<EOL><DEDENT>for error in direct_errors:<EOL><INDENT>if not isinstance(error, Error):<EOL><INDENT>err = '<STR_LIT>'<EOL>raise x.InvalidErrorType(err.format(Error))<EOL><DEDENT>self.errors[property_name]['<STR_LIT>'].append(error)<EOL><DEDENT><DEDENT>if schema_errors is not None:<EOL><INDENT>if isinstance(schema_errors, Result):<EOL><INDENT>schema_errors = schema_errors.errors<EOL><DEDENT>if not schema_errors:<EOL><INDENT>return self<EOL><DEDENT>if property_name not in self.errors:<EOL><INDENT>self.errors[property_name] = dict()<EOL><DEDENT>if '<STR_LIT>' not in self.errors[property_name]:<EOL><INDENT>self.errors[property_name]['<STR_LIT>'] = schema_errors<EOL><DEDENT>else:<EOL><INDENT>self.errors[property_name]['<STR_LIT>'] = self.merge_errors(<EOL>self.errors[property_name]['<STR_LIT>'],<EOL>schema_errors<EOL>)<EOL><DEDENT><DEDENT>return self<EOL>
Attach nested entity errors
Accepts a list errors coming from validators attached directly,
or a dict of errors produced by a nested schema.

:param property_name: str, property name
:param direct_errors: list, errors from validators attached directly
:param schema_errors: dict, errors from nested schema
:return: shiftschema.result.Result