code: def _write_angle_information(gsd_file, structure):
      
  
      gsd_file.angles.N = len(structure.angles)
  
      unique_angle_types = set()
      for angle in structure.angles:
          t1, t2, t3 = angle.atom1.type, angle.atom2.type, angle.atom3.type
          t1, t3 = sorted([t1, t3], key=natural_sort)
          angle_type = ('-'.join((t1, t2, t3)))
          unique_angle_types.add(angle_type)
      unique_angle_types = sorted(list(unique_angle_types), key=natural_sort)
      gsd_file.angles.types = unique_angle_types
  
      angle_typeids = []
      angle_groups = []
      for angle in structure.angles:
          t1, t2, t3 = angle.atom1.type, angle.atom2.type, angle.atom3.type
          t1, t3 = sorted([t1, t3], key=natural_sort)
          angle_type = ('-'.join((t1, t2, t3)))
          angle_typeids.append(unique_angle_types.index(angle_type))
          angle_groups.append((angle.atom1.idx, angle.atom2.idx,
                               angle.atom3.idx))
  
      gsd_file.angles.typeid = angle_typeids
      gsd_file.angles.group = angle_groups
docs: Write the angles in the system.
  
      Parameters
      ----------
      gsd_file :
          The file object of the GSD file being written
      structure : parmed.Structure
          Parmed structure object holding system information