docs: def build_rupture_node(rupt, probs_occur):
      """
      :param rupt: a hazardlib rupture object
      :param probs_occur: a list of floats with sum 1
      """
      s = sum(probs_occur)
      if abs(s - 1) > pmf.PRECISION:
          raise ValueError('The sum of %s is not 1: %s' % (probs_occur, s))
      h = rupt.hypocenter
      hp_dict = dict(lon=h.longitude, lat=h.latitude, depth=h.depth)
      rupt_nodes = [Node('magnitude', {}, rupt.mag),
                    Node('rake', {}, rupt.rake),
                    Node('hypocenter', hp_dict)]
      rupt_nodes.extend(rupt.surface.surface_nodes)
      geom = rupt.surface.surface_nodes[0].tag
      if len(rupt.surface.surface_nodes) > 1:
          name = 'multiPlanesRupture'
      elif geom == 'planarSurface':
          name = 'singlePlaneRupture'
      elif geom == 'simpleFaultGeometry':
          name = 'simpleFaultRupture'
      elif geom == 'complexFaultGeometry':
          name = 'complexFaultRupture'
      elif geom == 'griddedSurface':
          name = 'griddedRupture'
      return Node(name, {'probs_occur': probs_occur}, nodes=rupt_nodes)