class_docstr: Class representing a resource that need to be calculated and will be used
  by one or more charts (PlotContainer).
  Computations will run in seperate thread and can support partial results.
  
  Parameters
  ----------
  arena : dalex.Arena
      Instance of Arena.
  
  Attributes
  --------
  arena : Arena
      Instance of dalex.Arena
  params : dict
      Dictionary with required param types as keys and param labels as values.
      This attribute is set when calling fit.
  mutex : _thread.lock
      Mutex used for data and progress attributes. See __init__ code for details.
  update_events : threading.Event
      Object used to block execution until update of results.
  cancel_signal : bool
      This variable is set to signal resource it should cancel computations.
  exception: Exception
      When exception occurs during computations, then that exception is saved to this variable
  is_done : bool
      Flag set by thread when computations are done.
  progress : float
      If progress is supprted, then value should be between [0,1]. For other situations -1 value must be set.
  data : dict
      Results of computations are placed there
  thread : threading.Thread
      Thread used for computations
class_docstr_tok: ["Class","representing","a","resource","that","need","to","be","calculated","and","will","be","used","by","one","or","more","charts","(","PlotContainer",")",".","Computations","will","run","in","seperate","thread","and","can","support","partial","results",".","Parameters","--","--","--","--","--","arena",":","dalex.Arena","Instance","of","Arena",".","Attributes","--","--","--","--","arena",":","Arena","Instance","of","dalex.Arena","params",":","dict","Dictionary","with","required","param","types","as","keys","and","param","labels","as","values",".","This","attribute","is","set","when","calling","fit",".","mutex",":","_thread.lock","Mutex","used","for","data","and","progress","attributes",".","See","__init__","code","for","details",".","update_events",":","threading.Event","Object","used","to","block","execution","until","update","of","results",".","cancel_signal",":","bool","This","variable","is","set","to","signal","resource","it","should","cancel","computations",".","exception",":","Exception","When","exception","occurs","during","computations",",","then","that","exception","is","saved","to","this","variable","is_done",":","bool","Flag","set","by","thread","when","computations","are","done",".","progress",":","float","If","progress","is","supprted",",","then","value","should","be","between","[","0,1","]",".","For","other","situations","-1","value","must","be","set",".","data",":","dict","Results","of","computations","are","placed","there","thread",":","threading.Thread","Thread","used","for","computations"]
docstr: Function starts computations for given params
  
  Parameters
  -----------
  params : dict
      Keys of this dict are params types (model, observation, variable, dataset)
      and values are corresponding params values (class Param).
  Returns
  --------
  Resource object
docstr_tok: ["Function","starts","computations","for","given","params","Parameters","--","--","--","--","--","-","params",":","dict","Keys","of","this","dict","are","params","types","(","model",",","observation",",","variable",",","dataset",")","and","values","are","corresponding","params","values","(","class","Param",")",".","Returns","--","--","--","--","Resource","object"]
code: def fit(self, params):
      """Function starts computations for given params
  
      Parameters
      -----------
      params : dict
          Keys of this dict are params types (model, observation, variable, dataset)
          and values are corresponding params values (class Param).
      Returns
      --------
      Resource object
      """
      required_params = {}
      for p in self.__class__.required_params:
          self.check_param(p, params.get(p))
      for p in self.__class__.required_params:
          required_params[p] = params.get(p)
          self.params[p] = params.get(p).get_label()
      with self.mutex:
          self.thread = threading.Thread(
              target=self._fit, kwargs=required_params
          )
          self.thread.start()
      return self
  
file_path: DALEX/python/dalex/dalex/arena/_resource.py
imports: import threading
  from .params import Param
  from ._option_base import OptionBase
label_desc: Use image node_id 2 for calling the Resource obj's underlying member method code with example usage: obj.fit(params) and returns: self