def test_tag():
    """Test that the tag attribute works correctly."""
    class DummyModel(Model):
        """The simplest instance of Model possible."""
    x = DummyModel()
    x.tag['foo']['bar'] = 5

    assert len(x.tag.keys()) == 1
    assert len(x.tag['foo'].keys()) == 1
    assert x.tag['foo']['bar'] == 5

    assert x.tag not in 'bar'
    x.tag['bar']['baz'] = 3
    assert 'bar' in x.tag
    assert 'baz' in x.tag['bar']
    assert len(x.tag.keys()) == 2
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/tests/test_model.py/test_tag/swapped operands of `not in`