def extract_ast_species(ast):
    """Extract species from ast.species set of tuples (id, label)"""

    species_id = "None"
    species_label = "None"
    species = [
        (species_id, species_label) for (species_id, species_label) in ast.species if species_id
    ]

    if len(species) == 1:
        (species_id, species_label) = species[0]

    if not species_id:
        species_id = "None"
        species_label = "None"

    log.debug(f"AST Species: {ast.species}  Species: {species}  SpeciesID: {species_id}")

    return (species_id, species_label)
Extract species from ast.species set of tuples (id, label)