<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def render(ont, query_ids, args):
 """ Writes or displays graph """

    if args.slim.find('m') > -1:
        logging.info("SLIMMING")
        g = get_minimal_subgraph(g, query_ids)
    w = GraphRenderer.create(args.to)
    if args.showdefs:
        w.config.show_text_definition = True
    if args.render:
        if 'd' in args.render:
            logging.info("Showing text defs")
            w.config.show_text_definition = True
    if args.outfile is not None:
        w.outfile = args.outfile
    w.write(ont, query_ids=query_ids, container_predicates=args.container_properties)