def write_iocs(self, directory=None, source=None):
"""<STR_LIT>"""<EOL>if not source:<EOL><INDENT>source = self.iocs_11<EOL><DEDENT>if len(source) < <NUM_LIT:1>:<EOL><INDENT>log.error('<STR_LIT>')<EOL>return False<EOL><DEDENT>if not directory:<EOL><INDENT>directory = os.getcwd()<EOL><DEDENT>if os.path.isfile(directory):<EOL><INDENT>log.error('<STR_LIT>')<EOL>return False<EOL><DEDENT>output_dir = os.path.abspath(directory)<EOL>utils.safe_makedirs(output_dir)<EOL>log.info('<STR_LIT>' % (str(output_dir)))<EOL>for iocid in source:<EOL><INDENT>ioc_obj = source[iocid]<EOL>ioc_obj.write_ioc_to_file(output_dir=output_dir, force=True)<EOL><DEDENT>return True<EOL>
:param directory: Directory to write IOCs to.  If not provided, the current working directory is used.
:param source:  Dictionary contianing iocid -> IOC mapping.  Defaults to self.iocs_11.
:return: