def launch_topologies(cl_args, topology_file, tmp_dir):
<EOL>defn_files = glob.glob(tmp_dir + '<STR_LIT>')<EOL>if len(defn_files) == <NUM_LIT:0>:<EOL><INDENT>return SimpleResult(Status.HeronError, "<STR_LIT>" % tmp_dir)<EOL><DEDENT>results = []<EOL>for defn_file in defn_files:<EOL><INDENT>topology_defn = topology_pb2.Topology()<EOL>try:<EOL><INDENT>handle = open(defn_file, "<STR_LIT:rb>")<EOL>topology_defn.ParseFromString(handle.read())<EOL>handle.close()<EOL><DEDENT>except Exception as e:<EOL><INDENT>err_context = "<STR_LIT>" % (defn_file, e)<EOL>return SimpleResult(Status.HeronError, err_context)<EOL><DEDENT>Log.info("<STR_LIT>", topology_defn.name, launch_mode_msg(cl_args))<EOL>if cl_args['<STR_LIT>'] == config.SERVER_MODE:<EOL><INDENT>res = launch_topology_server(<EOL>cl_args, topology_file, defn_file, topology_defn.name)<EOL><DEDENT>else:<EOL><INDENT>res = launch_a_topology(<EOL>cl_args, tmp_dir, topology_file, defn_file, topology_defn.name)<EOL><DEDENT>results.append(res)<EOL><DEDENT>return results<EOL>
Launch topologies
:param cl_args:
:param topology_file:
:param tmp_dir:
:return: list(Responses)