code: def _construct_bipartite_graph(
      cls, types, edges, directed=False, *args, **kwds
  ):
      """Creates a bipartite graph with the given vertex types and edges.
      This is similar to the default constructor of the graph, the
      only difference is that it checks whether all the edges go
      between the two vertex classes and it assigns the type vector
      to a C{type} attribute afterwards.
  
      Examples:
  
      >>> g = Graph.Bipartite([0, 1, 0, 1], [(0, 1), (2, 3), (0, 3)])
      >>> g.is_bipartite()
      True
      >>> g.vs["type"]
      [False, True, False, True]
  
      @param types: the vertex types as a boolean list. Anything that
        evaluates to C{False} will denote a vertex of the first kind,
        anything that evaluates to C{True} will denote a vertex of the
        second kind.
      @param edges: the edges as a list of tuples.
      @param directed: whether to create a directed graph. Bipartite
        networks are usually undirected, so the default is C{False}
  
      @return: the graph with a binary vertex attribute named C{"type"} that
        stores the vertex classes.
      """
      result = cls._Bipartite(types, edges, directed, *args, **kwds)
      result.vs["type"] = [bool(x) for x in types]
      return result
  
label_desc: Use image node_id 2 for calling a global function with example usage: _construct_bipartite_graph(cls, types, edges, directed) and returns: result