<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def assert_valid(self, instance, value=None):
 """Check if tuple and contained properties are valid"""

        valid = super(Tuple, self).assert_valid(instance, value)
        if not valid:
            return False
        if value is None:
            value = instance._get(self.name)
            if value is None:
                return True
        if (
                (self.min_length is not None and len(value) < self.min_length)
                or
                (self.max_length is not None and len(value) > self.max_length)
        ):
            self.error(
                instance=instance,
                value=value,
                extra='(Length is {})'.format(len(value)),
            )
        for val in value:
            if not self.prop.assert_valid(instance, val):
                return False
        return True