docs: def get_tail_incidence_matrix(H, nodes_to_indices, hyperedge_ids_to_indices):
      """Creates the incidence matrix of the tail nodes of the given
      hypergraph as a sparse matrix.
  
      :param H: the hypergraph for which to create the incidence matrix of.
      :param nodes_to_indices: for each node, maps the node to its
                              corresponding integer index.
      :param hyperedge_ids_to_indices: for each hyperedge ID, maps the hyperedge
                                      ID to its corresponding integer index.
      :returns: sparse.csc_matrix -- the incidence matrix as a sparse matrix.
      :raises: TypeError -- Algorithm only applicable to directed hypergraphs
  
      """
      if not isinstance(H, DirectedHypergraph):
          raise TypeError("Algorithm only applicable to directed hypergraphs")
  
      rows, cols = [], []
      for hyperedge_id, hyperedge_index in hyperedge_ids_to_indices.items():
          for node in H.get_hyperedge_tail(hyperedge_id):
              # get the mapping between the node and its ID
              rows.append(nodes_to_indices.get(node))
              cols.append(hyperedge_index)
  
      values = np.ones(len(rows), dtype=int)
      node_count = len(H.get_node_set())
      hyperedge_count = len(H.get_hyperedge_id_set())
  
      return sparse.csc_matrix((values, (rows, cols)),
                               shape=(node_count, hyperedge_count))