code: def _ensure_value_is_valid(self, value):
          
          if not isinstance(value, self.__class__.value_type):
              raise TypeError('{0} is not valid collection value, instance '
                              'of {1} required'.format(
                                  value, self.__class__.value_type))
          return value
docs: Ensure that value is a valid collection's value.