<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def map_metabolite2kegg(metabolite):
 """ Return a KEGG compound identifier for the metabolite if it exists. First see if there is an unambiguous mapping to a single KEGG compound ID provided with the model. If not, check if there is any KEGG compound ID in a list of mappings. KEGG IDs may map to compounds, drugs and glycans. KEGG compound IDs are sorted so we keep the lowest that is there. If none of this works try mapping to KEGG via the CompoundMatcher by the name of the metabolite. If the metabolite cannot be mapped at all we simply map it back to its own ID. Parameters metabolite : cobra.Metabolite The metabolite to be mapped to its KEGG compound identifier. Returns ------- None If the metabolite could not be mapped. str The smallest KEGG compound identifier that was found. """

    logger.debug("Looking for KEGG compound identifier for %s.", metabolite.id)
    kegg_annotation = metabolite.annotation.get("kegg.compound")
    if kegg_annotation is None:
        # TODO (Moritz Beber): Currently name matching is very slow and
        #  inaccurate. We disable it until there is a better solution.
        # if metabolite.name:
        #     # The compound matcher uses regular expression and chokes
        #     # with a low level error on `[` in the name, for example.
        #     df = compound_matcher.match(metabolite.name)
        #     try:
        #         return df.loc[df["score"] > threshold, "CID"].iat[0]
        #     except (IndexError, AttributeError):
        #         logger.warning(
        #             "Could not match the name %r to any kegg.compound "
        #             "annotation for metabolite %s.",
        #             metabolite.name, metabolite.id
        #         )
        #         return
        # else:
        logger.warning("No kegg.compound annotation for metabolite %s.",
                       metabolite.id)
        return
    if isinstance(kegg_annotation, string_types) and \
            kegg_annotation.startswith("C"):
        return kegg_annotation
    elif isinstance(kegg_annotation, Iterable):
        try:
            return get_smallest_compound_id(kegg_annotation)
        except ValueError:
            return
    logger.warning(
        "No matching kegg.compound annotation for metabolite %s.",
        metabolite.id
    )
    return