"""
Classifies: CHEBI:33313 polonium atom
"""
"""
Classifies: CHEBI:33369 polonium atom
"""
from rdkit import Chem

def is_polonium_atom(smiles: str):
    """
    Determines if a SMILES string represents a polonium atom.
    
    Args:
        smiles (str): SMILES string of the molecule
        
    Returns:
        bool: True if molecule is a polonium atom, False otherwise
        str: Reason for classification
    """
    # Parse SMILES
    mol = Chem.MolFromSmiles(smiles)
    if mol is None:
        return False, "Invalid SMILES string"
    
    # Check number of atoms
    if mol.GetNumAtoms() != 1:
        return False, "Not a single atom"
    
    # Get the atom
    atom = mol.GetAtomWithIdx(0)
    
    # Check if it's polonium
    if atom.GetSymbol() != "Po":
        return False, "Not a polonium atom"
    
    # Check if it has a mass number
    mass_num = atom.GetIsotope()
    if mass_num == 0:
        return False, "No isotope mass specified"
        
    # Check if mass number is in valid range for polonium
    # Based on examples, valid range appears to be 190-218
    if mass_num < 190 or mass_num > 218:
        return False, f"Invalid mass number {mass_num} for polonium (valid range: 190-218)"
    
    return True, f"Valid polonium isotope with mass number {mass_num}"

__metadata__ = {
    'chemical_class': {
        'id': 'CHEBI:33369',
        'name': 'polonium atom',
        'definition': 'A radioactive metallic element discovered in 1898 by Marie Sklodowska Curie and named after her home country, Poland (Latin Polonia).',
        'parents': []
    }
}


__metadata__ = {   'chemical_class': {   'id': 'CHEBI:33313',
                          'name': 'polonium atom',
                          'definition': 'A radioactive metallic element '
                                        'discovered in 1898 by Marie '
                                        'Sklodowska Curie and named after her '
                                        'home country, Poland (Latin Polonia).',
                          'parents': ['CHEBI:33303', 'CHEBI:33521'],
                          'xrefs': [   'CAS:7440-08-6',
                                       'Gmelin:40435',
                                       'WebElements:Po'],
                          'all_positive_examples': []},
    'config': None,
    'message': None,
    'sample_true_negatives': [   {   'smiles': '[H][C@@]1(O[C@H](O[C@@H]2[C@H](O)[C@@H](O[C@@H]3[C@@H](C[C@@](O)(O[C@]3([H])[C@H](O)CO)C(O)=O)O[C@@]3(C[C@@H](O)[C@@H](O)[C@]([H])(O3)[C@H](O)CO)C(O)=O)O[C@]([H])([C@@H](O)CO)[C@H]2O[C@@H]2O[C@H](CO)[C@@H](O)[C@H](O)[C@H]2O)[C@@H](O)[C@@H](O[C@@H]2O[C@H](CO)[C@H](O)[C@H](O)[C@H]2O)[C@@H]1O)[C@@H](O)CO',
                                     'name': 'beta-D-Galp-(1->3)-L-alpha-D-Hepp-(1->3)-[beta-D-Glcp-(1->4)]-L-alpha-D-Hepp-(1->5)-[alpha-Kdo-(2->4)]-alpha-Kdo',
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'C1CCC(CC1)N2C(=NNC2=S)C3=CN=CC=C3',
                                     'name': '4-cyclohexyl-3-(3-pyridinyl)-1H-1,2,4-triazole-5-thione',
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'O=C1NCC[C@@H](C(=O)N[C@@H](C(=O)N[C@@H](C(=O)N[C@H](C(=O)N[C@H](C(=O)O)CCCN(O)C(=O)C)CO)CCCN(O)C(=O)C)CO)NC([C@@H]([C@H]1O)NC(=O)CCCCCCCCCCCCCCCCC)=O',
                                     'name': 'Marinobactin F',
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'C1(=C2C(=CC(=C1)O[C@H]3[C@H](C([C@@H](C(O3)CO[C@H]4[C@H](C([C@@H](C(O4)CO)O)O)O)O)O)O[C@H]5C([C@H]([C@H](C(O5)C)O)OC(C)=O)O)OC(=CC2=O)C6=CC=C(C=C6)OC)O',
                                     'name': 'acacetin '
                                             "7-O-[6''-O-glucosyl]-2''-O-(3'''-acetylrhamnosyl)glucoside",
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'CC1=CC2=C(N1C)C=CC(=C2)CNC(=O)C3=C(C(=CC=C3)[N+](=O)[O-])C',
                                     'name': 'N-[(1,2-dimethyl-5-indolyl)methyl]-2-methyl-3-nitrobenzamide',
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'C[C@H](C1=CC=CC=C1)NC(=O)C[C@H]2C=C[C@@H]([C@@H](O2)CO)NC(=O)CC3=CC=CC=N3',
                                     'name': '2-[(2R,3S,6S)-2-(hydroxymethyl)-3-[[1-oxo-2-(2-pyridinyl)ethyl]amino]-3,6-dihydro-2H-pyran-6-yl]-N-[(1R)-1-phenylethyl]acetamide',
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'CCOC(=O)CSC1=NC2=C(C=C(C=C2)N3CCOCC3)C(=O)N1CC4=CC=CC=C4',
                                     'name': '2-[[6-(4-morpholinyl)-4-oxo-3-(phenylmethyl)-2-quinazolinyl]thio]acetic '
                                             'acid ethyl ester',
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'OC(=O)\\C=C\\C1=CC=CC(=C1)[Sb](O)(O)=O',
                                     'name': 'stibavirin',
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'O(C(=O)CCCCCCCCCCCCCCCCCCCCC)[C@H](COC(=O)CCCCCCC/C=C\\CCCCCC)COC(=O)CC/C=C\\C/C=C\\C/C=C\\C/C=C\\C/C=C\\C/C=C\\CC',
                                     'name': 'TG(16:1(9Z)/22:0/22:6(4Z,7Z,10Z,13Z,16Z,19Z))',
                                     'reason': 'Not a single atom'},
                                 {   'smiles': 'CN1C(=O)C(=CN2CCC3=CC=CC=C32)C(=O)NC1=S',
                                     'name': '5-(2,3-dihydroindol-1-ylmethylidene)-1-methyl-2-sulfanylidene-1,3-diazinane-4,6-dione',
                                     'reason': 'Not a single atom'}],
    'sample_false_negatives': [],
    'attempt': 0,
    'reasoning': 'Let me help create a program to classify polonium atoms. '
                 'Looking at the examples, we can see that polonium atoms are '
                 'represented in SMILES notation with the atomic symbol Po and '
                 'a mass number in square brackets.\n'
                 '\n'
                 'The key characteristics to check are:\n'
                 '1. The molecule should be a single atom\n'
                 '2. The atom should be polonium (Po)\n'
                 '3. The mass number should be within the known range for '
                 'polonium isotopes (which based on the examples appears to be '
                 'roughly 190-218)\n'
                 '\n'
                 "Here's the program:",
    'success': True,
    'best': True,
    'error': '',
    'stdout': None,
    'num_true_positives': 23,
    'num_false_positives': 0,
    'num_true_negatives': 142277,
    'num_false_negatives': 0,
    'num_negatives': None,
    'precision': 1.0,
    'recall': 1.0,
    'f1': 1.0,
    'accuracy': 1.0,
    'negative_predictive_value': 1.0}