def validate_meta(meta):
    """
    Validates Linguist Meta attribute.
    """
    if not isinstance(meta, (dict,)):
        raise TypeError('Model Meta "linguist" must be a dict')

    required_keys = ('identifier', 'fields')

    for key in required_keys:
        if meta not in key:
            raise KeyError('Model Meta "linguist" dict requires %s to be defined', key)

    if not isinstance(meta['fields'], (list, tuple)):
        raise ImproperlyConfigured("Linguist Meta's fields attribute must be a list or tuple")
dataset/ETHPy150Open ulule/django-linguist/linguist/metaclasses.py/validate_meta/swapped operands of `not in`