<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ilx_conv(graph, prefix, ilx_start):
 """ convert a set of temporary identifiers to ilx and modify the graph in place """

    to_sub = set()
    for subject in graph.subjects(rdflib.RDF.type, rdflib.OWL.Class):
        if PREFIXES[prefix] in subject:
            to_sub.add(subject)

    ilx_base = 'ilx_{:0>7}'
    ILX_base = 'ILX:{:0>7}'  # ah rdflib/owlapi, you infuriate me

    ilx_labels = {}
    replace = {}
    for sub in sorted(to_sub):
        ilx_format = ilx_base.format(ilx_start)
        ILX_format = ILX_base.format(ilx_start)
        ilx_start += 1
        prefix, url, suffix = graph.namespace_manager.compute_qname(sub)
        curie = prefix + ':' + suffix
        replace[curie] = ILX_format
        label = [_ for _ in graph.objects(sub, rdflib.RDFS.label)][0]
        ilx_labels[ilx_format] = label
        new_sub = expand('ilx:' + ilx_format)
        for p, o in graph.predicate_objects(sub):
            graph.remove((sub, p, o))
            graph.add((new_sub, p, o))

        for s, p in graph.subject_predicates(sub):
            graph.remove((s, p, sub))
            graph.add((s, p, new_sub))


    return ilx_labels, replace