Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def generate_scaffold(smiles: str, include_chirality: bool = False) -> str:
"""Compute the Bemis-Murcko scaffold for a SMILES string."""
if type(smiles) == str:
mol = Chem.MolFromSmiles(smiles)
else:
mol = smiles
engine = ScaffoldGenerator(include_chirality=include_chirality)
scaffold = engine.get_scaffold(mol)
return scaffold