'Validate a collection.
Returns a dict of validation info. Raises CollectionInvalid if
validation fails.
:Parameters:
- `name_or_collection`: A Collection object or the name of a
collection to validate.
- `scandata`: Do extra checks beyond checking the overall
structure of the collection.
- `full`: Have the server do a more thorough scan of the
collection. Use with `scandata` for a thorough scan
of the structure of the collection and the individual
documents.'

def validate_collection(self, name_or_collection, scandata=False, full=False):

    name = name_or_collection
    if isinstance(name, Collection):
        name = name.name
    if (not isinstance(name, string_type)):
        raise TypeError(('name_or_collection    must    be    an    instance    of    %s    or    Collection' % (string_type.__name__,)))
    result = self.command('validate', _unicode(name), scandata=scandata, full=full)
    valid = True
    if ('result' in result):
        info = result['result']
        if ((info.find('exception') != (-1)) or (info.find('corrupt') != (-1))):
            raise CollectionInvalid(('%s    invalid:    %s' % (name, info)))
    elif ('raw' in result):
        for (_, res) in iteritems(result['raw']):
            if ('result' in res):
                info = res['result']
                if ((info.find('exception') != (-1)) or (info.find('corrupt') != (-1))):
                    raise CollectionInvalid(('%s    invalid:    %s' % (name, info)))
            elif (not res.get('valid', False)):
                valid = False
                break
    elif (not result.get('valid', False)):
        valid = False
    if (not valid):
        raise CollectionInvalid(('%s    invalid:    %r' % (name, result)))
    return result
