code: def k_crust(G, k=None, core_number=None):
      """Returns the k-crust of G.
  
      The k-crust is the graph G with the edges of the k-core removed
      and isolated nodes found after the removal of edges are also removed.
  
      .. deprecated:: 3.3
         `k_crust` will not accept `MultiGraph` objects in version 3.5.
  
      Parameters
      ----------
      G : NetworkX graph
         A graph or directed graph.
      k : int, optional
        The order of the shell. If not specified return the main crust.
      core_number : dictionary, optional
        Precomputed core numbers for the graph G.
  
      Returns
      -------
      G : NetworkX graph
         The k-crust subgraph
  
      Raises
      ------
      NetworkXNotImplemented
          The k-crust is not implemented for multigraphs or graphs with self loops.
  
      Notes
      -----
      This definition of k-crust is different than the definition in [1]_.
      The k-crust in [1]_ is equivalent to the k+1 crust of this algorithm.
  
      For directed graphs the node degree is defined to be the
      in-degree + out-degree.
  
      Graph, node, and edge attributes are copied to the subgraph.
  
      Examples
      --------
      >>> degrees = [0, 1, 2, 2, 2, 2, 3]
      >>> H = nx.havel_hakimi_graph(degrees)
      >>> H.degree
      DegreeView({0: 1, 1: 2, 2: 2, 3: 2, 4: 2, 5: 3, 6: 0})
      >>> nx.k_crust(H, k=1).nodes
      NodeView((0, 4, 6))
  
      See Also
      --------
      core_number
  
      References
      ----------
      .. [1] A model of Internet topology using k-shell decomposition
         Shai Carmi, Shlomo Havlin, Scott Kirkpatrick, Yuval Shavitt,
         and Eran Shir, PNAS  July 3, 2007   vol. 104  no. 27  11150-11154
         http://www.pnas.org/content/104/27/11150.full
      """
  
      import warnings
  
      if G.is_multigraph():
          warnings.warn(
              (
                  "\n\n`k_crust` will not accept `MultiGraph` objects in version 3.5.\n"
                  "Convert it to an undirected graph instead, using::\n\n"
                  "\tG = nx.Graph(G)\n"
              ),
              category=DeprecationWarning,
              stacklevel=5,
          )
  
      # Default for k is one less than in _core_subgraph, so just inline.
      #    Filter is c[v] <= k
      if core_number is None:
          core_number = nx.core_number(G)
      if k is None:
          k = max(core_number.values()) - 1
      nodes = (v for v in core_number if core_number[v] <= k)
      return G.subgraph(nodes).copy()
  
file_path: networkx/networkx/algorithms/core.py
imports: import networkx
label_desc: Use image node_id 5 for calling a global function with example usage: k_crust(G, k, core_number) and returns: G