code: def random_uniform_k_out_graph(
      n, k, self_loops=True, with_replacement=True, seed=None
  ):
      """Returns a random `k`-out graph with uniform attachment.
  
      A random `k`-out graph with uniform attachment is a multidigraph
      generated by the following algorithm. For each node *u*, choose
      `k` nodes *v* uniformly at random (with replacement). Add a
      directed edge joining *u* to *v*.
  
      Parameters
      ----------
      n : int
          The number of nodes in the returned graph.
  
      k : int
          The out-degree of each node in the returned graph.
  
      self_loops : bool
          If True, self-loops are allowed when generating the graph.
  
      with_replacement : bool
          If True, neighbors are chosen with replacement and the
          returned graph will be a directed multigraph. Otherwise,
          neighbors are chosen without replacement and the returned graph
          will be a directed graph.
  
      seed : integer, random_state, or None (default)
          Indicator of random number generation state.
          See :ref:`Randomness<randomness>`.
  
      Returns
      -------
      NetworkX graph
          A `k`-out-regular directed graph generated according to the
          above algorithm. It will be a multigraph if and only if
          `with_replacement` is True.
  
      Raises
      ------
      ValueError
          If `with_replacement` is False and `k` is greater than
          `n`.
  
      See also
      --------
      random_k_out_graph
  
      Notes
      -----
      The return digraph or multidigraph may not be strongly connected, or
      even weakly connected.
  
      If `with_replacement` is True, this function is similar to
      :func:`random_k_out_graph`, if that function had parameter `alpha`
      set to positive infinity.
  
      """
      if with_replacement:
          create_using = nx.MultiDiGraph()
  
          def sample(v, nodes):
              if not self_loops:
                  nodes = nodes - {v}
              return (seed.choice(list(nodes)) for i in range(k))
  
      else:
          create_using = nx.DiGraph()
  
          def sample(v, nodes):
              if not self_loops:
                  nodes = nodes - {v}
              return seed.sample(list(nodes), k)
  
      G = nx.empty_graph(n, create_using)
      nodes = set(G)
      for u in G:
          G.add_edges_from((u, v) for v in sample(u, nodes))
      return G
  
file_path: networkx/networkx/generators/directed.py
imports: import numbers
  from collections import Counter
  import networkx
  from networkx.generators.classic import empty_graph
  from networkx.utils import discrete_sequence, py_random_state, weighted_choice
label_desc: Use image node_id 5 for calling a global function with example usage: random_uniform_k_out_graph(n, k, _loops, with_replacement, seed) and returns: G, unknown, seed