class_docstr: Identifies suboject of a class and applies
  functions recursively on them.
  
  Parameters
  ----------
  object: Any
      an object containing other (sub)objects
  base: Type
      the base class of the subobjects (to filter out other items)
  attribute: str
      the attribute containing the subobjects
  
  Note
  ----
  The current implementation is rather inefficient and could probably be
  improved a lot if this becomes critical
class_docstr_tok: ["Identifies","suboject","of","a","class","and","applies","functions","recursively","on","them",".","Parameters","--","--","--","--","--","object",":","Any","an","object","containing","other","(","sub",")","objects","base",":","Type","the","base","class","of","the","subobjects","(","to","filter","out","other","items",")","attribute",":","str","the","attribute","containing","the","subobjects","Note","--","--","The","current","implementation","is","rather","inefficient","and","could","probably","be","improved","a","lot","if","this","becomes","critical"]
docstr: Returns the corresponding subject if obj is from the
  base class, or directly the object otherwise.
docstr_tok: ["Returns","the","corresponding","subject","if","obj","is","from","the","base","class",",","or","directly","the","object","otherwise","."]
code: def _get_subobject(self, obj: X, key: tp.Any) -> tp.Any:
      """Returns the corresponding subject if obj is from the
      base class, or directly the object otherwise.
      """
      if isinstance(obj, self.cls):
          return getattr(obj, self.attribute)[key]
      return obj
  
imports: import os
  import sys
  import shutil
  import tempfile
  import subprocess
  from pathlib import Path
  import numpy
  from nevergrad.common import typing
label_desc: Use image node_id 4 for calling the Subobjects obj's underlying member method code with example usage: obj._get_subobject(obj, key) and returns: obj, getattr