class_docstr: Base class of the walking strategies.
  
  Attributes:
      _is_support_remote: True if the walking strategy can be used with a
          remote Knowledge Graph, False Otherwise
          Defaults to True.
      kg: The global KG used later on for the worker process.
          Defaults to None.
      max_depth: The maximum depth of one walk.
      max_walks: The maximum number of walks per entity.
          Defaults to None.
      random_state: The random state to use to keep random determinism with
          the walking strategy.
          Defaults to None.
      sampler: The sampling strategy.
          Defaults to UniformSampler.
      with_reverse: True to extracts parents and children hops from an
          entity, creating (max_walks * max_walks) walks of 2 * depth,
          allowing also to centralize this entity in the walks. False
          otherwise. This doesn't work with NGramWalker and WLWalker.
          Defaults to False.
class_docstr_tok: ["Base","class","of","the","walking","strategies",".","Attributes",":","_is_support_remote",":","True","if","the","walking","strategy","can","be","used","with","a","remote","Knowledge","Graph",",","False","Otherwise","Defaults","to","True",".","kg",":","The","global","KG","used","later","on","for","the","worker","process",".","Defaults","to","None",".","max_depth",":","The","maximum","depth","of","one","walk",".","max_walks",":","The","maximum","number","of","walks","per","entity",".","Defaults","to","None",".","random_state",":","The","random","state","to","use","to","keep","random","determinism","with","the","walking","strategy",".","Defaults","to","None",".","sampler",":","The","sampling","strategy",".","Defaults","to","UniformSampler",".","with_reverse",":","True","to","extracts","parents","and","children","hops","from","an","entity",",","creating","(","max_walks","*","max_walks",")","walks","of","2","*","depth",",","allowing","also","to","centralize","this","entity","in","the","walks",".","False","otherwise",".","This","does","n't","work","with","NGramWalker","and","WLWalker",".","Defaults","to","False","."]
docstr: Fits the provided sampling strategy and then calls the
  private _extract method that is implemented for each of the
  walking strategies.
  
  Args:
      kg: The Knowledge Graph.
      entities: The entities to be extracted from the Knowledge Graph.
      verbose: The verbosity level.
          0: does not display anything;
          1: display of the progress of extraction and training of walks;
          2: debugging.
          Defaults to 0.
  
  Returns:
      The 2D matrix with its number of rows equal to the number of
      provided entities; number of column equal to the embedding size.
  
  Raises:
      WalkerNotSupported: If there is an attempt to use an invalid
          walking strategy to a remote Knowledge Graph.
docstr_tok: ["Fits","the","provided","sampling","strategy","and","then","calls","the","private","_extract","method","that","is","implemented","for","each","of","the","walking","strategies",".","Args",":","kg",":","The","Knowledge","Graph",".","entities",":","The","entities","to","be","extracted","from","the","Knowledge","Graph",".","verbose",":","The","verbosity","level",".","0",":","does","not","display","anything",";","1",":","display","of","the","progress","of","extraction","and","training","of","walks",";","2",":","debugging",".","Defaults","to","0",".","Returns",":","The","2D","matrix","with","its","number","of","rows","equal","to","the","number","of","provided","entities",";","number","of","column","equal","to","the","embedding","size",".","Raises",":","WalkerNotSupported",":","If","there","is","an","attempt","to","use","an","invalid","walking","strategy","to","a","remote","Knowledge","Graph","."]
code: def extract(
      self, kg: KG, entities: Entities, verbose: int = 0
  ) -> List[List[SWalk]]:
      """Fits the provided sampling strategy and then calls the
      private _extract method that is implemented for each of the
      walking strategies.
  
      Args:
          kg: The Knowledge Graph.
          entities: The entities to be extracted from the Knowledge Graph.
          verbose: The verbosity level.
              0: does not display anything;
              1: display of the progress of extraction and training of walks;
              2: debugging.
              Defaults to 0.
  
      Returns:
          The 2D matrix with its number of rows equal to the number of
          provided entities; number of column equal to the embedding size.
  
      Raises:
          WalkerNotSupported: If there is an attempt to use an invalid
              walking strategy to a remote Knowledge Graph.
  
      """
      if kg._is_remote and not self._is_support_remote:
          raise WalkerNotSupported(
              "Invalid walking strategy. Please, choose a walking strategy "
              + "that can fetch walks via a SPARQL endpoint server."
          )
  
      process = self.n_jobs if self.n_jobs is not None else 1
      if (kg._is_remote and kg.mul_req) and process >= 2:
          warnings.warn(
              "Using 'mul_req=True' and/or 'n_jobs>=2' speed up the "
              + "extraction of entity's walks, but may violate the policy "
              + "of some SPARQL endpoint servers.",
              category=RuntimeWarning,
              stacklevel=2,
          )
  
      if kg._is_remote and kg.mul_req:
          kg._fill_hops(entities)
  
      self.sampler.fit(kg)
      self._entities |= set(entities)
  
      with multiprocessing.Pool(
          process, self._init_worker, [kg]
      ) as pool:
          res = list(
              tqdm(
                  pool.imap(self._proc, entities),
                  total=len(entities),
                  disable=True if verbose == 0 else False,
              )
          )
      return self._post_extract(res)
  
imports: import multiprocessing
  import warnings
  from abc import ABC, abstractmethod
  from typing import List, Optional, Set
  import attr
  from tqdm import tqdm
  from pyrdf2vec.graphs import KG, Vertex
  from pyrdf2vec.samplers import Sampler, UniformSampler
  from pyrdf2vec.typings import Entities, EntityWalks, SWalk
  from pyrdf2vec.utils.validation import _check_max_depth, _check_jobs, _check_max_walks
label_desc: Use image node_id 2 for calling the Walker obj's underlying member method code with example usage: obj.extract(kg, entities, verbose) and returns: self