class_docstr: A default field for a dataclass, that uses a function to calculate the
  value if none was passed.
  
  The function can take arguments, which are other fields of the annotated
  dataclass, which can also be `OrElse` fields. In case of circular
  dependencies an error is thrown.
  
  ::
  
      @serde.dataclass
      class X:
          a: int
          b: int = serde.OrElse(lambda a: a + 1)
          c: int = serde.OrEsle(lambda c: c * 2)
  
      x = X(1)
      assert x.b == 2
      assert x.c == 4
  ```
class_docstr_tok: ["A","default","field","for","a","dataclass",",","that","uses","a","function","to","calculate","the","value","if","none","was","passed",".","The","function","can","take","arguments",",","which","are","other","fields","of","the","annotated","dataclass",",","which","can","also","be","`","OrElse","`","fields",".","In","case","of","circular","dependencies","an","error","is","thrown",".",":",":","@","serde.dataclass","class","X",":","a",":","int","b",":","int","=","serde.OrElse","(","lambda","a",":","a","+","1",")","c",":","int","=","serde.OrEsle","(","lambda","c",":","c","*","2",")","x","=","X","(","1",")","assert","x.b","==","2","assert","x.c","==","4","``","`"]
code: def _call(self, env):
      kwargs = {attr: env[attr] for attr in self.parameters}
      return self.fn(**kwargs)
  
imports: import dataclasses
  import inspect
  from types import SimpleNamespace
  from typing import TYPE_CHECKING, cast, Any, Callable, ClassVar, Generic, TypeVar
  from gluonts.itertools import select
  from gluonts.pydantic import pydantic, dataclass
label_desc: Use image node_id 2 for calling the OrElse obj's underlying member method code with example usage: obj._call(env) and returns: self