# Path: meltingpot/python/utils/scenarios/wrappers/base.py
# class Wrapper(substrate.Substrate):
#   def __init__(self, env: substrate.Substrate):
#   def reset(self, *args, **kwargs) -> ...:
#   def step(self, *args, **kwargs) -> ...:
#   def reward_spec(self, *args, **kwargs) -> ...:
#   def discount_spec(self, *args, **kwargs) -> ...:
#   def observation_spec(self, *args, **kwargs) -> ...:
#   def action_spec(self, *args, **kwargs) -> ...:
#   def close(self, *args, **kwargs) -> ...:
#   def observation(self, *args, **kwargs) -> ...:
#   def events(self, *args, **kwargs) -> ...:
#   def list_property(self, *args, **kwargs) -> ...:
#   def write_property(self, *args, **kwargs) -> ...:
#   def read_property(self, *args, **kwargs) -> ...:
#   def observables(self, *args, **kwargs) -> ...:


from typing import Any, Dict, Optional
from meltingpot.python.utils.scenarios.wrappers import base
import dm_env
import numpy as np
# limitations under the License.
"""The Default Observation Wrapper adds an empty field to the observation.

For instance, this wrapper can be used to add an INVENTORY observation for all
players, if one is not already there. This is useful to match APIs between
different environments that expose different observations.
"""





def _setdefault(dictionary: Dict[str, Any], key: str,
                value: Any) -> Dict[str, Any]:
  """Sets the default value of `key` to `value` if necessary.

  Args:
    dictionary: the dictionary to add a default for.
    key: The key to add a default for.
    value: The default value to add if key is missing.

  Returns:
    Either dictionary or a copy wiht the default value added.
  """
  if key in dictionary:
    return dictionary
  else:
    return dict(dictionary, **{key: value})



# Path: meltingpot/python/utils/scenarios/wrappers/base.py
# class Wrapper(substrate.Substrate):
#   def __init__(self, env: substrate.Substrate):
#   def reset(self, *args, **kwargs) -> ...:
#   def step(self, *args, **kwargs) -> ...:
#   def reward_spec(self, *args, **kwargs) -> ...:
#   def discount_spec(self, *args, **kwargs) -> ...:
#   def observation_spec(self, *args, **kwargs) -> ...:
#   def action_spec(self, *args, **kwargs) -> ...:
#   def close(self, *args, **kwargs) -> ...:
#   def observation(self, *args, **kwargs) -> ...:
#   def events(self, *args, **kwargs) -> ...:
#   def list_property(self, *args, **kwargs) -> ...:
#   def write_property(self, *args, **kwargs) -> ...:
#   def read_property(self, *args, **kwargs) -> ...:
#   def observables(self, *args, **kwargs) -> ...:


# Path: meltingpot/python/utils/scenarios/wrappers/default_observation_wrapper.py
from typing import Any, Dict, Optional
from meltingpot.python.utils.scenarios.wrappers import base
import dm_env
import numpy as np

# limitations under the License.
"""The Default Observation Wrapper adds an empty field to the observation.

For instance, this wrapper can be used to add an INVENTORY observation for all
players, if one is not already there. This is useful to match APIs between
different environments that expose different observations.
"""





def _setdefault(dictionary: Dict[str, Any], key: str,
                value: Any) -> Dict[str, Any]:
  """Sets the default value of `key` to `value` if necessary.

  Args:
    dictionary: the dictionary to add a default for.
    key: The key to add a default for.
    value: The default value to add if key is missing.

  Returns:
    Either dictionary or a copy wiht the default value added.
  """
  if key in dictionary:
    return dictionary
  else:
    return dict(dictionary, **{key: value})



class Wrapper(base.Wrapper):