code: def _is_molecule_linear(self, mol):
          
          if mol.NumAtoms() < 3:
              return True
          a1 = mol.GetAtom(1)
          a2 = mol.GetAtom(2)
          for i in range(3, mol.NumAtoms()+1):
              angle = float(mol.GetAtom(i).GetAngle(a2, a1))
              if angle < 0.0:
                  angle = -angle
              if angle > 90.0:
                  angle = 180.0 - angle
              if angle > self._angle_tolerance:
                  return False
          return True
docs: Is the molecule a linear one
  
          Args:
              mol: The molecule. OpenBabel OBMol object.
  
          Returns:
              Boolean value.