# Path: spriteworld/factor_distributions.py
# _MAX_TRIES = int(1e5)
# class AbstractDistribution(object):
# class Continuous(AbstractDistribution):
# class Discrete(AbstractDistribution):
# class Mixture(AbstractDistribution):
# class Intersection(AbstractDistribution):
# class Product(AbstractDistribution):
# class SetMinus(AbstractDistribution):
# class Selection(AbstractDistribution):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def __str__(self):
#   def _get_rng(self, rng=None):
#   def keys(self):
#   def __init__(self, key, minval, maxval, dtype='float32'):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, key, candidates, probs=None):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components, probs=None):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components, index_for_sampling=0):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, base, hold_out):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, base, filtering):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
# 
# Path: spriteworld/sprite_generators.py
# def generate_sprites(factor_dist, num_sprites=1):
#   def _generate():
# def chain_generators(*sprite_generators):
#   def _generate():
# def sample_generator(sprite_generators, p=None):
#   def _generate():
# def shuffle(sprite_generator):
#   def _generate():
# 
# Path: spriteworld/tasks.py
# class AbstractTask(object):
# class NoReward(AbstractTask):
# class FindGoalPosition(AbstractTask):
# class Clustering(AbstractTask):
# class MetaAggregated(AbstractTask):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self):
#   def reward(self, unused_sprites):
#   def success(self, unused_sprites):
#   def __init__(self,
#                filter_distrib=None,
#                goal_position=(0.5, 0.5),
#                terminate_distance=0.05,
#                terminate_bonus=0.0,
#                weights_dimensions=(1, 1),
#                sparse_reward=False,
#                raw_reward_multiplier=50):
#   def _single_sprite_reward(self, sprite):
#   def _filtered_sprites_rewards(self, sprites):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self,
#                cluster_distribs,
#                termination_threshold=2.5,
#                terminate_bonus=0.0,
#                sparse_reward=False,
#                reward_range=10):
#   def _cluster_assignments(self, sprites):
#   def _compute_clustering_metric(self, sprites):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self,
#                subtasks,
#                reward_aggregator='sum',
#                termination_criterion='all',
#                terminate_bonus=0.0):
#   def reward(self, sprites):
#   def success(self, sprites):
#   REWARD_AGGREGATOR = {
#       'sum': np.nansum,
#       'max': np.nanmax,
#       'min': np.nanmin,
#       'mean': np.nanmean
#   }
#   TERMINATION_CRITERION = {'all': np.all, 'any': np.any}
# 
# Path: spriteworld/configs/cobra/common.py
# def action_space():
# def renderers():


import os
from spriteworld import factor_distributions as distribs
from spriteworld import sprite_generators
from spriteworld import tasks
from spriteworld.configs.cobra import common
      distribs.Discrete('scale', [0.13]),
      distribs.Continuous('c1', 0.3, 1.),
      distribs.Continuous('c2', 0.9, 1.),
  ])
  target_hue = distribs.Continuous('c0', 0., 0.4)
  distractor_hue = distribs.Continuous('c0', 0.5, 0.9)
  target_factors = distribs.Product([
      target_hue,
      shared_factors,
  ])
  distractor_factors = distribs.Product([
      distractor_hue,
      shared_factors,
  ])

  target_sprite_gen = sprite_generators.generate_sprites(
      target_factors, num_sprites=MODES_NUM_TARGETS[mode])
  distractor_sprite_gen = sprite_generators.generate_sprites(
      distractor_factors, num_sprites=NUM_DISTRACTORS)
  sprite_gen = sprite_generators.chain_generators(target_sprite_gen,
                                                  distractor_sprite_gen)
  # Randomize sprite ordering to eliminate any task information from occlusions
  sprite_gen = sprite_generators.shuffle(sprite_gen)

  task = tasks.FindGoalPosition(
      filter_distrib=target_hue, terminate_distance=TERMINATE_DISTANCE)

  config = {
      'task': task,
      'action_space': common.action_space(),

# Path: spriteworld/factor_distributions.py
# _MAX_TRIES = int(1e5)
# class AbstractDistribution(object):
# class Continuous(AbstractDistribution):
# class Discrete(AbstractDistribution):
# class Mixture(AbstractDistribution):
# class Intersection(AbstractDistribution):
# class Product(AbstractDistribution):
# class SetMinus(AbstractDistribution):
# class Selection(AbstractDistribution):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def __str__(self):
#   def _get_rng(self, rng=None):
#   def keys(self):
#   def __init__(self, key, minval, maxval, dtype='float32'):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, key, candidates, probs=None):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components, probs=None):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components, index_for_sampling=0):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, base, hold_out):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, base, filtering):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
# 
# Path: spriteworld/sprite_generators.py
# def generate_sprites(factor_dist, num_sprites=1):
#   def _generate():
# def chain_generators(*sprite_generators):
#   def _generate():
# def sample_generator(sprite_generators, p=None):
#   def _generate():
# def shuffle(sprite_generator):
#   def _generate():
# 
# Path: spriteworld/tasks.py
# class AbstractTask(object):
# class NoReward(AbstractTask):
# class FindGoalPosition(AbstractTask):
# class Clustering(AbstractTask):
# class MetaAggregated(AbstractTask):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self):
#   def reward(self, unused_sprites):
#   def success(self, unused_sprites):
#   def __init__(self,
#                filter_distrib=None,
#                goal_position=(0.5, 0.5),
#                terminate_distance=0.05,
#                terminate_bonus=0.0,
#                weights_dimensions=(1, 1),
#                sparse_reward=False,
#                raw_reward_multiplier=50):
#   def _single_sprite_reward(self, sprite):
#   def _filtered_sprites_rewards(self, sprites):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self,
#                cluster_distribs,
#                termination_threshold=2.5,
#                terminate_bonus=0.0,
#                sparse_reward=False,
#                reward_range=10):
#   def _cluster_assignments(self, sprites):
#   def _compute_clustering_metric(self, sprites):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self,
#                subtasks,
#                reward_aggregator='sum',
#                termination_criterion='all',
#                terminate_bonus=0.0):
#   def reward(self, sprites):
#   def success(self, sprites):
#   REWARD_AGGREGATOR = {
#       'sum': np.nansum,
#       'max': np.nanmax,
#       'min': np.nanmin,
#       'mean': np.nanmean
#   }
#   TERMINATION_CRITERION = {'all': np.all, 'any': np.any}
# 
# Path: spriteworld/configs/cobra/common.py
# def action_space():
# def renderers():


# Path: spriteworld/configs/cobra/goal_finding_more_targets.py
import os
from spriteworld import factor_distributions as distribs
from spriteworld import sprite_generators
from spriteworld import tasks
from spriteworld.configs.cobra import common

      distribs.Discrete('scale', [0.13]),
      distribs.Continuous('c1', 0.3, 1.),
      distribs.Continuous('c2', 0.9, 1.),
  ])
  target_hue = distribs.Continuous('c0', 0., 0.4)
  distractor_hue = distribs.Continuous('c0', 0.5, 0.9)
  target_factors = distribs.Product([
      target_hue,
      shared_factors,
  ])
  distractor_factors = distribs.Product([
      distractor_hue,
      shared_factors,
  ])

  target_sprite_gen = sprite_generators.generate_sprites(
      target_factors, num_sprites=MODES_NUM_TARGETS[mode])
  distractor_sprite_gen = sprite_generators.generate_sprites(
      distractor_factors, num_sprites=NUM_DISTRACTORS)
  sprite_gen = sprite_generators.chain_generators(target_sprite_gen,
                                                  distractor_sprite_gen)
  # Randomize sprite ordering to eliminate any task information from occlusions
  sprite_gen = sprite_generators.shuffle(sprite_gen)

  task = tasks.FindGoalPosition(
      filter_distrib=target_hue, terminate_distance=TERMINATE_DISTANCE)

  config = {
      'task': task,
      'action_space': common.action_space(),

      'renderers': common.renderers(),