class_docstr: Wraps env configurations to include extra rllib metadata.
  
  These attributes can be used to parameterize environments per process.
  For example, one might use `worker_index` to control which data file an
  environment reads in on initialization.
  
  RLlib auto-sets these attributes when constructing registered envs.
docstr: Sets missing keys of self to the values given in `defaults`.
  
  If `defaults` contains keys that already exist in self, don't override
  the values with these defaults.
  
  Args:
      defaults: The key/value pairs to add to self, but only for those
          keys in `defaults` that don't exist yet in self.
  
  .. testcode::
      :skipif: True
  
      from ray.rllib.env.env_context import EnvContext
      env_ctx = EnvContext({"a": 1, "b": 2}, worker_index=0)
      env_ctx.set_defaults({"a": -42, "c": 3})
      print(env_ctx)
  
  .. testoutput::
  
      {"a": 1, "b": 2, "c": 3}
docstr_tok: ["Sets","missing","keys","of","self","to","the","values","given","in","`","defaults","`",".","If","`","defaults","`","contains","keys","that","already","exist","in","self",",","do","n't","override","the","values","with","these","defaults",".","Args",":","defaults",":","The","key\/value","pairs","to","add","to","self",",","but","only","for","those","keys","in","`","defaults","`","that","do","n't","exist","yet","in","self",".","..","testcode",":",":",":","skipif",":","True","from","ray.rllib.env.env_context","import","EnvContext","env_ctx","=","EnvContext","(","{","``","a","''",":","1",",","``","b","''",":","2","}",",","worker_index=0",")","env_ctx.set_defaults","(","{","``","a","''",":","-42",",","``","c","''",":","3","}",")","print","(","env_ctx",")","..","testoutput",":",":","{","``","a","''",":","1",",","``","b","''",":","2",",","``","c","''",":","3","}"]
code: def set_defaults(self, defaults: dict) -> None:
      """Sets missing keys of self to the values given in `defaults`.
  
      If `defaults` contains keys that already exist in self, don't override
      the values with these defaults.
  
      Args:
          defaults: The key/value pairs to add to self, but only for those
              keys in `defaults` that don't exist yet in self.
  
      .. testcode::
          :skipif: True
  
          from ray.rllib.env.env_context import EnvContext
          env_ctx = EnvContext({"a": 1, "b": 2}, worker_index=0)
          env_ctx.set_defaults({"a": -42, "c": 3})
          print(env_ctx)
  
      .. testoutput::
  
          {"a": 1, "b": 2, "c": 3}
      """
      for key, value in defaults.items():
          if key not in self:
              self[key] = value
  
file_path: ray/rllib/env/env_context.py
imports: import copy
  from typing import Optional
  from ray.rllib.utils.annotations import PublicAPI
  from ray.rllib.utils.typing import EnvConfigDict
label_desc: Use image node_id 3 for calling the EnvContext obj's underlying member method code with example usage: obj.set_defaults(defaults) without return types