def __init__(self, name, schema_dict):
        self.name = name
        if not isinstance(schema_dict, collections.Mapping):
            msg = (_('Schema definition of "%(pname)s" must be a dict.')
                   % dict(pname=name))
            ExceptionCollector.appendException(InvalidSchemaError(message=msg))

        try:
            schema_dict['type']
        except __HOLE__:
            msg = (_('Schema definition of "%(pname)s" must have a "type" '
                     'attribute.') % dict(pname=name))
            ExceptionCollector.appendException(InvalidSchemaError(message=msg))

        self.schema = schema_dict
        self._len = None
        self.constraints_list = []
dataset/ETHPy150Open openstack/tosca-parser/toscaparser/elements/constraints.py/Schema.__init__