def check_items(self, items):
<EOL>if self.templates.get("<STR_LIT>") and not self._updated(<EOL>"<STR_LIT>", self.templates["<STR_LIT>"], "<STR_LIT>"<EOL>):<EOL><INDENT>template = set(t["<STR_LIT>"] for t in self.templates["<STR_LIT>"]["<STR_LIT>"])<EOL><DEDENT>else:<EOL><INDENT>template = set(t["<STR_LIT>"] for t in self.item_fields())<EOL><DEDENT>template = template | set(<EOL>[<EOL>"<STR_LIT:path>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT:version>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT:filename>",<EOL>]<EOL>)<EOL>template = template | set(self.temp_keys)<EOL>for pos, item in enumerate(items):<EOL><INDENT>if set(item) == set(["<STR_LIT>", "<STR_LIT>", "<STR_LIT:version>", "<STR_LIT>", "<STR_LIT:key>", "<STR_LIT:data>"]):<EOL><INDENT>item = item["<STR_LIT:data>"]<EOL><DEDENT>to_check = set(i for i in list(item.keys()))<EOL>difference = to_check.difference(template)<EOL>if difference:<EOL><INDENT>raise ze.InvalidItemFields(<EOL>"<STR_LIT>"<EOL>% (pos + <NUM_LIT:1>, "<STR_LIT:U+0020>".join(i for i in difference))<EOL>)<EOL><DEDENT><DEDENT>return items<EOL>
Check that items to be created contain no invalid dict keys
Accepts a single argument: a list of one or more dicts
The retrieved fields are cached and re-used until a 304 call fails