<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(self, data, owner=None):
 """Validate input data in returning an empty list if true. :param data: data to validate with this schema. :param Schema owner: schema owner. :raises: Exception if the data is not validated. """

        if isinstance(data, DynamicValue):
            data = data()

        if data is None and not self.nullable:
            raise ValueError('Value can not be null')

        elif data is not None:

            isdict = isinstance(data, dict)

            for name, schema in iteritems(self.getschemas()):

                if name == 'default':
                    continue

                if name in self.required:
                    if (
                        (isdict and name not in data) or
                        (not isdict and not hasattr(data, name))
                    ):
                        part1 = (
                            'Mandatory property {0} by {1} is missing in {2}.'.
                            format(name, self, data)
                        )
                        part2 = '{0} expected.'.format(schema)
                        error = '{0} {1}'.format(part1, part2)

                        raise ValueError(error)

                elif (isdict and name in data) or hasattr(data, name):

                    value = data[name] if isdict else getattr(data, name)
                    schema._validate(data=value, owner=self)