def get_largest_ring_size(molecule):
  """Calculates the largest ring size in the molecule.

  Refactored from
  https://github.com/wengong-jin/icml18-jtnn/blob/master/bo/run_bo.py

  Args:
    molecule: Chem.Mol. A molecule.

  Returns:
    Integer. The largest ring size.
  """
  cycle_list = molecule.GetRingInfo().AtomRings()
  if cycle_list:
    cycle_length = max([len(j) for j in cycle_list])
  else:
    cycle_length = 0
  return cycle_length