def get_ecs(definition):
    """Extract EC numbers from a KO definition.

    Parameters
    ----------
    definition : str
        KO definition.

    Returns
    -------
    list of str
        Extracted EC numbers.

    Examples
    --------
    K00930  acetylglutamate kinase [EC:2.7.2.8]
    K02618  oxepin-CoA hydrolase [EC:3.3.2.12 1.2.1.91]
    K09866  aquaporin-4
    """
    if definition.endswith(']'):
        idx = definition.find(' [EC:')
        if idx > 0:
            return definition[idx + 5:-1].split()