# Path: streetlearn/python/environment/streetlearn.py
# _MIN_ZOOM = 1
# _MAX_ZOOM = 32
# ACTIONS = {
#     'move_forward': _action(1, 0.0, 0.0, 0.0),
#     'horizontal_rotation': _action(0, 1.0, 0.0, 0.0),
#     'vertical_rotation': _action(0, 0.0, 1.0, 0.0),
#     'map_zoom': _action(0, 0.0, 0.0, 1.0),
# }
# NUM_ACTIONS = 4
# ACTION_SETS = {
#     "streetlearn_default": lambda rotation_speed: (
#         ACTIONS["move_forward"],
#         ACTIONS["horizontal_rotation"] * (-rotation_speed),
#         ACTIONS["horizontal_rotation"] * rotation_speed),
#     "streetlearn_fast_rotate": lambda rotation_speed: (
#         ACTIONS["move_forward"],
#         ACTIONS["horizontal_rotation"] * (-rotation_speed),
#         ACTIONS["horizontal_rotation"] * (-rotation_speed * 3),
#         ACTIONS["horizontal_rotation"] * rotation_speed,
#         ACTIONS["horizontal_rotation"] * rotation_speed * 3),
#     "streetlearn_tilt": lambda rotation_speed: (
#         ACTIONS["move_forward"],
#         ACTIONS["horizontal_rotation"] * (-rotation_speed),
#         ACTIONS["horizontal_rotation"] * rotation_speed,
#         ACTIONS["vertical_rotation"] * rotation_speed,
#         ACTIONS["vertical_rotation"] * (-rotation_speed)),
# }
# def _action(*entries):
# def get_action_set(action_spec, rotation_speed):
# def _log_dictionary(dictionary):
#   def __init__(self, dataset_path, config, game, engine=None):
#   def config(self):
#   def seed(self):
#   def game(self):
#   def field_of_view(self):
#   def current_pano_id(self):
#   def frame_cap(self):
#   def frame_cap(self, value):
#   def frame_count(self):
#   def graph(self):
#   def engine(self):
#   def neighbor_resolution(self):
#   def bbox_lat_min(self):
#   def bbox_lat_max(self):
#   def bbox_lng_min(self):
#   def bbox_lng_max(self):
#   def cache_size(self):
#   def observation_spec(self):
#   def action_set(self):
#   def action_spec(self):
#   def reset(self):
#   def goto(self, pano_id, yaw):
#   def step(self, action):
#   def observation(self):
#   def reward(self):
#   def done(self):
#   def info(self):
#   def prev_reward(self):
#   def prev_action(self):
#   def get_metadata(self, pano_id):
#   def render(self):
# class StreetLearn(object):


from absl import logging
from streetlearn.python.environment import streetlearn
import numpy as np
    """
    # Check that batch_size is a multiple of num_env_per_shared_cache and that
    # the action_spec, rotation_speed and observations are compatible between
    # all environments.
    batch_size = len(games)
    assert batch_size > 0
    assert num_env_per_shared_cache > 0
    num_env_per_shared_cache = min(num_env_per_shared_cache, batch_size)
    num_unique_node_caches = int(batch_size / num_env_per_shared_cache)
    logging.info('batch_size: %d, num_env_per_shared_cache: %d',
                 batch_size, num_env_per_shared_cache)
    logging.info('num_unique_node_caches: %d', num_unique_node_caches)
    assert (num_env_per_shared_cache * num_unique_node_caches) == batch_size
    assert len(configs) == batch_size
    for k in range(1, batch_size):
      assert configs[0]['action_spec'] == configs[k]['action_spec']
      assert configs[0]['rotation_speed'] == configs[k]['rotation_speed']
      observations = configs[k]['observations'].sort()
      assert configs[0]['observations'].sort() == observations

    # Instantiate the environments.
    self._envs = []
    k = 0
    for i in range(num_unique_node_caches):
      logging.info('Instantiating environment %d with a new node_cache', k)
      self._envs.append(streetlearn.StreetLearn(
          dataset_path, configs[k], games[k]))
      k += 1
      for j in range(1, num_env_per_shared_cache):
        logging.info('Instantiating environment %d reusing last node_cache', k)

# Path: streetlearn/python/environment/streetlearn.py
# _MIN_ZOOM = 1
# _MAX_ZOOM = 32
# ACTIONS = {
#     'move_forward': _action(1, 0.0, 0.0, 0.0),
#     'horizontal_rotation': _action(0, 1.0, 0.0, 0.0),
#     'vertical_rotation': _action(0, 0.0, 1.0, 0.0),
#     'map_zoom': _action(0, 0.0, 0.0, 1.0),
# }
# NUM_ACTIONS = 4
# ACTION_SETS = {
#     "streetlearn_default": lambda rotation_speed: (
#         ACTIONS["move_forward"],
#         ACTIONS["horizontal_rotation"] * (-rotation_speed),
#         ACTIONS["horizontal_rotation"] * rotation_speed),
#     "streetlearn_fast_rotate": lambda rotation_speed: (
#         ACTIONS["move_forward"],
#         ACTIONS["horizontal_rotation"] * (-rotation_speed),
#         ACTIONS["horizontal_rotation"] * (-rotation_speed * 3),
#         ACTIONS["horizontal_rotation"] * rotation_speed,
#         ACTIONS["horizontal_rotation"] * rotation_speed * 3),
#     "streetlearn_tilt": lambda rotation_speed: (
#         ACTIONS["move_forward"],
#         ACTIONS["horizontal_rotation"] * (-rotation_speed),
#         ACTIONS["horizontal_rotation"] * rotation_speed,
#         ACTIONS["vertical_rotation"] * rotation_speed,
#         ACTIONS["vertical_rotation"] * (-rotation_speed)),
# }
# def _action(*entries):
# def get_action_set(action_spec, rotation_speed):
# def _log_dictionary(dictionary):
#   def __init__(self, dataset_path, config, game, engine=None):
#   def config(self):
#   def seed(self):
#   def game(self):
#   def field_of_view(self):
#   def current_pano_id(self):
#   def frame_cap(self):
#   def frame_cap(self, value):
#   def frame_count(self):
#   def graph(self):
#   def engine(self):
#   def neighbor_resolution(self):
#   def bbox_lat_min(self):
#   def bbox_lat_max(self):
#   def bbox_lng_min(self):
#   def bbox_lng_max(self):
#   def cache_size(self):
#   def observation_spec(self):
#   def action_set(self):
#   def action_spec(self):
#   def reset(self):
#   def goto(self, pano_id, yaw):
#   def step(self, action):
#   def observation(self):
#   def reward(self):
#   def done(self):
#   def info(self):
#   def prev_reward(self):
#   def prev_action(self):
#   def get_metadata(self, pano_id):
#   def render(self):
# class StreetLearn(object):


# Path: streetlearn/python/environment/batched_streetlearn.py
from absl import logging
from streetlearn.python.environment import streetlearn
import numpy as np

    """
    # Check that batch_size is a multiple of num_env_per_shared_cache and that
    # the action_spec, rotation_speed and observations are compatible between
    # all environments.
    batch_size = len(games)
    assert batch_size > 0
    assert num_env_per_shared_cache > 0
    num_env_per_shared_cache = min(num_env_per_shared_cache, batch_size)
    num_unique_node_caches = int(batch_size / num_env_per_shared_cache)
    logging.info('batch_size: %d, num_env_per_shared_cache: %d',
                 batch_size, num_env_per_shared_cache)
    logging.info('num_unique_node_caches: %d', num_unique_node_caches)
    assert (num_env_per_shared_cache * num_unique_node_caches) == batch_size
    assert len(configs) == batch_size
    for k in range(1, batch_size):
      assert configs[0]['action_spec'] == configs[k]['action_spec']
      assert configs[0]['rotation_speed'] == configs[k]['rotation_speed']
      observations = configs[k]['observations'].sort()
      assert configs[0]['observations'].sort() == observations

    # Instantiate the environments.
    self._envs = []
    k = 0
    for i in range(num_unique_node_caches):
      logging.info('Instantiating environment %d with a new node_cache', k)
      self._envs.append(streetlearn.StreetLearn(
          dataset_path, configs[k], games[k]))
      k += 1
      for j in range(1, num_env_per_shared_cache):
        logging.info('Instantiating environment %d reusing last node_cache', k)

        self._envs.append(streetlearn.StreetLearn(