code: def planted_partition_graph(
      l, k, p_in, p_out, seed=None, directed=False
  ):
      """Returns the planted l-partition graph.
  
      This model partitions a graph with n=l*k vertices in
      l groups with k vertices each. Vertices of the same
      group are linked with a probability p_in, and vertices
      of different groups are linked with probability p_out.
  
      Parameters
      ----------
      l : int
        Number of groups
      k : int
        Number of vertices in each group
      p_in : float
        probability of connecting vertices within a group
      p_out : float
        probability of connected vertices between groups
      seed : integer, random_state, or None (default)
          Indicator of random number generation state.
          See :ref:`Randomness<randomness>`.
      directed : bool,optional (default=False)
        If True return a directed graph
  
      Returns
      -------
      G : NetworkX Graph or DiGraph
        planted l-partition graph
  
      Raises
      ------
      NetworkXError
        If `p_in`, `p_out` are not in `[0, 1]`
  
      Examples
      --------
      >>> G = nx.planted_partition_graph(4, 3, 0.5, 0.1, seed=42)
  
      See Also
      --------
      random_partition_model
  
      References
      ----------
      .. [1] A. Condon, R.M. Karp, Algorithms for graph partitioning
          on the planted partition model,
          Random Struct. Algor. 18 (2001) 116-140.
  
      .. [2] Santo Fortunato 'Community Detection in Graphs' Physical Reports
         Volume 486, Issue 3-5 p. 75-174. https://arxiv.org/abs/0906.0612
      """
      return random_partition_graph(
          [k] * l, p_in, p_out, seed=seed, directed=directed
      )
  
file_path: networkx/networkx/generators/community.py
imports: import itertools
  import math
  import networkx
  from networkx.utils import py_random_state
label_desc: Use image node_id 5 for calling a global function with example usage: planted_partition_graph(l, k, p_in, p_out, seed, directed) and returns: random_partition_graph