def insert(self, filename):
errors = []<EOL>if os.path.isfile(filename):<EOL><INDENT>log.info('<STR_LIT>'.format(filename))<EOL>if not self.parse(filename):<EOL><INDENT>log.warning('<STR_LIT>'.format(filename))<EOL>errors.append(filename)<EOL><DEDENT><DEDENT>elif os.path.isdir(filename):<EOL><INDENT>log.info('<STR_LIT>'.format(filename))<EOL>for fn in glob.glob(filename + os.path.sep + '<STR_LIT>'):<EOL><INDENT>if not os.path.isfile(fn):<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>if not self.parse(fn):<EOL><INDENT>log.warning('<STR_LIT>'.format(filename))<EOL>errors.append(fn)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>log.info('<STR_LIT>' % str(len(self)))<EOL>return errors<EOL>
Parses files to load them into memory and insert them into the class.

:param filename: File or directory pointing to .ioc files.
:return: A list of .ioc files which could not be parsed.