Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if view is None:
self._num_views += 1
# Create a PDB object and write to file.
if system is not None:
try:
pdb = _SireIO.PDB2(system)
pdb.writeToFile(filename)
except:
raise IOError("Failed to write system to 'PDB' format.") from None
# Import NGLView when it is used for the first time.
import nglview as _nglview
# Create the NGLview object.
view = _nglview.show_file(filename)
# Return the view and display it.
return view.display(gui=gui)