code: def _k_core(graph, *args):
      """Returns some k-cores of the graph.
  
      The method accepts an arbitrary number of arguments representing
      the desired indices of the M{k}-cores to be returned. The arguments
      can also be lists or tuples. The result is a single L{Graph} object
      if an only integer argument was given, otherwise the result is a
      list of L{Graph} objects representing the desired k-cores in the
      order the arguments were specified. If no argument is given, returns
      all M{k}-cores in increasing order of M{k}.
      """
      if len(args) == 0:
          indices = range(graph.vcount())
          return_single = False
      else:
          return_single = True
          indices = []
          for arg in args:
              try:
                  indices.extend(arg)
              except Exception:
                  indices.append(arg)
  
      if len(indices) > 1 or hasattr(args[0], "__iter__"):
          return_single = False
  
      corenesses = graph.coreness()
      result = []
      vidxs = range(graph.vcount())
      for idx in indices:
          core_idxs = [
              vidx for vidx in vidxs if corenesses[vidx] >= idx
          ]
          result.append(graph.subgraph(core_idxs))
  
      if return_single:
          return result[0]
      return result
  
file_path: python-igraph/src/igraph/community.py
imports: from igraph._igraph import GraphBase
  from igraph.clustering import VertexDendrogram, VertexClustering
  from igraph.utils import deprecated
  from typing import List, Sequence, Tuple
label_desc: Use image node_id 10 for calling a global function with example usage: _k_core(graph) and returns: result, result