for gtav_game in ['gtav.SaneDriving-v0', 'gtav.Speed-v0']:
    register(
        id=gtav_game,
        entry_point='universe.wrappers:WrappedGTAVEnv',
        max_episode_steps=10**7,
        tags={
            'vnc': True,
            'gtav': True,
            'runtime': 'vnc-windows',
        },
    )

# Welcome to Universe!
# This file contains the client-side registry of environments.

import logging
import os

# Suppress Twisted's warning about service_identity not being installed.
# We don't need service_identity right now and don't want to take it on
# as a dependency just to suppress this warning.
import warnings
warnings.filterwarnings(
    'ignore',
    message='You do not have a working installation of the service_identity'
)

from gym.envs.registration import register

import universe.scoreboard
import universe.configuration
from universe import error, envs
from universe.remotes import docker_remote
from universe.rewarder import merge_infos
from universe.runtimes.registration import runtime_spec

__all__ = [
    'configuration', 'envs', 'error', 'kube', 'pyprofile', 'remotes', 'rewarder', 'runtimes',
    'scoreboard', 'spaces', 'twisty', 'utils', 'vectorized', 'vncdriver', 'wrappers',
    'configure_logging', 'docker_image', 'enable_logfile',
    'logger', 'extra_logger']

def docker_image(runtime_id):
    logger.warn('DEPRECATION WARNING: universe.docker_image(runtime_id) is deprecated and will be removed soon. Use runtime_spec(runtime_id).image instead. ')
    return runtime_spec(runtime_id).image

logger = logging.getLogger(__name__)
extra_logger = logging.getLogger('universe.extra.'+__name__)

_logging_configured = False

def enable_logfile(path=None):
    raise error.Error('Renamed to "universe.configure_logging()"')

def configure_logging(path=None):
    """
    Set up log levels, and split verbose logs to a file

        Configure the client-side environment logs to print
        to stdout at "info" level, and also to print to a
        verbose log file located at /tmp/universe-<pid>.log
        or another path you specify at "debug" level.
        We suggest calling this method at the beginning of
        your script.
    """

    global _logging_configured
    if _logging_configured:
        return
    _logging_configured = True

    if path is False:
        # Disable logfile
        return
    elif path is None:
        path = '/tmp/universe-{}.log'.format(os.getpid())

    logger.info('Writing logs to file: %s', path)
    # Turn up extra_logger level
    extra_logger.setLevel(logging.DEBUG)
    if path == '-':
        return

    # Add file handler to root logger
    root_logger = logging.getLogger()
    formatter = logging.Formatter('[%(asctime)s] %(message)s')
    handler = logging.FileHandler(path, 'w', encoding='UTF-8')
    handler.setFormatter(formatter)
    root_logger.addHandler(handler)

    # Set extra_logger to *only* use file handler
    extra_logger.propagate = False
    extra_logger.addHandler(handler)

#    Universe environments are registered with the gym
#    environment registry when the universe module
#    is imported. We use the "tags" field to store
#    additional data specific to Universe.

#------------------------ Gym core environments -----------------------#
#     Asynchronous VNC versions of core gym environments,
#     such as CartPole and Pong

# Note on metadata:
#    Environments send on-screen metadata: the current time, and the
#    time the last action was received from the agent. This timestamp
#    data is used to compute action and observation lags. For core
#    environments, this data is sent using on-screen pixels that encode

metadata_pixels = {
    'type': 'pixels',
}

# Should be exactly the same as CartPole-v0
register(
    id='gym-core.CartPoleLowDSync-v0',
    entry_point='universe.wrappers:WrappedGymCoreSyncEnv',
    max_episode_steps=500,
    tags={
        'vnc': True,
        'runtime': 'gym-core',
        'metadata_encoding': metadata_pixels,
    },
    kwargs={
        'rewarder_observation': True,
        'gym_core_id': 'CartPole-v0',
},
    trials=2,
)

# Dynamics should match CartPole-v0, but have pixel observations
register(
    id='gym-core.CartPoleSync-v0',
    entry_point='universe.wrappers:WrappedGymCoreSyncEnv',
    max_episode_steps=500,
    tags={
        'vnc': True,
        'runtime': 'gym-core',
        'metadata_encoding': metadata_pixels,
    },
    kwargs={
        'gym_core_id': 'CartPole-v0',
    },
    trials=2,
)

# Async cartpole with 4-d observations
register(
    id='gym-core.CartPoleLowD-v0',
    entry_point='universe.wrappers:WrappedGymCoreEnv',
    max_episode_steps=500,
    tags={
        'vnc': True,
        'runtime': 'gym-core',
        'metadata_encoding': metadata_pixels,
    },
    kwargs={
        'rewarder_observation': True,
        'gym_core_id': 'CartPole-v0',
    },
    trials=2,
)

register(
    id='gym-core.CartPole-v0',
    entry_point='universe.wrappers:WrappedGymCoreEnv',
    max_episode_steps=500,
    tags={
        'vnc': True,
        'runtime': 'gym-core',
        'metadata_encoding': metadata_pixels,
    },
    kwargs={
        'gym_core_id': 'CartPole-v0',
    },
    trials=2,
)

# gym-core.Atari
for game in ['air_raid', 'alien', 'amidar', 'assault', 'asterix',
             'asteroids', 'atlantis', 'bank_heist', 'battle_zone',
             'beam_rider', 'berzerk', 'bowling', 'boxing', 'breakout',
             'carnival', 'centipede', 'chopper_command', 'crazy_climber',
             'demon_attack', 'double_dunk', 'elevator_action', 'enduro',
             'fishing_derby', 'freeway', 'frostbite', 'gopher', 'gravitar',
             'ice_hockey', 'jamesbond', 'journey_escape', 'kangaroo', 'krull',
             'kung_fu_master', 'montezuma_revenge', 'ms_pacman',
             'name_this_game', 'phoenix', 'pitfall', 'pong', 'pooyan',
             'private_eye', 'qbert', 'riverraid', 'road_runner', 'robotank',
             'seaquest', 'skiing', 'solaris', 'space_invaders', 'star_gunner',
             'tennis', 'time_pilot', 'tutankham', 'up_n_down', 'venture',
             'video_pinball', 'wizard_of_wor', 'yars_revenge', 'zaxxon']:
    # space_invaders should yield SpaceInvaders-v0 and SpaceInvaders-ram-v0
    base = ''.join([g.capitalize() for g in game.split('_')]) # SpaceInvaders

    for version in [0, 3]:
        gym_core_id = '{}-v{}'.format(base, version) # e.g. SpaceInvaders-v3
        register(
            id='gym-core.{}'.format(gym_core_id),
            entry_point='universe.wrappers:WrappedGymCoreEnv',
            max_episode_steps=100000,
            tags={
                'vnc': True,
                'atari': True,
                'runtime': 'gym-core',
                'metadata_encoding': metadata_pixels,
            },
            kwargs={
                'gym_core_id': gym_core_id,
            },
        )

        register(
            id='gym-core.{}Sync-v{}'.format(base, version),
            entry_point='universe.wrappers:WrappedGymCoreSyncEnv',
            max_episode_steps=100000,
            tags={
                'vnc': True,
                'atari': True,
                'runtime': 'gym-core',
                'metadata_encoding': metadata_pixels,
            },
            kwargs={
                'gym_core_id': gym_core_id,
            },
        )

        register(
            id='gym-core.{}30FPS-v{}'.format(base, version),
            entry_point='universe.wrappers:WrappedGymCoreEnv',
            max_episode_steps=100000,
            tags={
                'vnc': True,
                'atari': True,
                'runtime': 'gym-core',
                'metadata_encoding': metadata_pixels,
            },
            kwargs={
                'gym_core_id': gym_core_id,
                'fps': 30,
            },
        )

        register(
            id='gym-core.{}Slow-v{}'.format(base, version),
            entry_point='universe.wrappers:WrappedGymCoreEnv',
            max_episode_steps=100000,
            tags={
                'vnc': True,
                'atari': True,
                'runtime': 'gym-core',
                'metadata_encoding': metadata_pixels,
            },
            kwargs={
                'gym_core_id': gym_core_id,
                'fps': 15,
            },
        )

        deterministic_gym_core_id = '{}Deterministic-v{}'.format(base, version) # e.g. SpaceInvadersDeterministic-v3

        register(
            id='gym-core.{}Deterministic-v{}'.format(base, version),
            entry_point='universe.wrappers:WrappedGymCoreEnv',
            max_episode_steps=100000,
            tags={
                'vnc': True,
                'atari': True,
                'runtime': 'gym-core',
                'metadata_encoding': metadata_pixels,
            },
            kwargs={
                'gym_core_id': deterministic_gym_core_id,
            },
        )
        register(
            id='gym-core.{}DeterministicSlow-v{}'.format(base, version),
            entry_point='universe.wrappers:WrappedGymCoreEnv',
            max_episode_steps=75000,
            tags={
                'vnc': True,
                'atari': True,
                'runtime': 'gym-core',
                'metadata_encoding': metadata_pixels,
            },
            kwargs={
                'gym_core_id': deterministic_gym_core_id,
                'fps': 15,
            },
        )
        register(
            id='gym-core.{}DeterministicSync-v{}'.format(base, version),
            entry_point='universe.wrappers:WrappedGymCoreSyncEnv',
            max_episode_steps=75000,
            tags={
                'vnc': True,
                'atari': True,
                'runtime': 'gym-core',
                'metadata_encoding': metadata_pixels,
            },
            kwargs={
                'gym_core_id': deterministic_gym_core_id,
            },
        )

        no_frameskip_gym_core_id = '{}NoFrameskip-v{}'.format(base, version) # e.g. SpaceInvadersNoFrameskip-v3
        register(
            id='gym-core.{}NoFrameskip-v{}'.format(base, version),
            entry_point='universe.wrappers:WrappedGymCoreEnv',
            max_episode_steps=400000,
            tags={
                'vnc': True,
                'atari': True,
                'runtime': 'gym-core',
                'metadata_encoding': metadata_pixels,
            },
            kwargs={
                'gym_core_id': no_frameskip_gym_core_id,
            },
        )

#------------------------ Flash game environments ------------------------#
#     Browser-based flash games, run locally
#     in Chrome within a Docker container

# Note on metadata: flashgames send time metadata using
# an on-screen QR code

metadata_v1 = {
    'type': 'qrcode',
    'x': 914,
    'y': 658,
    'width': 100,
    'height': 100,
}

# Please keep this registry mirrored with the benchmarks in universe-envs/flashgames/gym_flashgames/__init__.py
# You can use universe-envs/flashgames/bin/manage export_env_ids_for_registration to generate this list.
for game in [
    'flashgames.1001ArabianNights-v0',
    'flashgames.21Balloons-v0',
    'flashgames.30Seconds-v0',
    'flashgames.3FootNinja-v0',
    'flashgames.3FootNinjaIi-v0',
    'flashgames.3dBuggyRacing-v0',
    'flashgames.3dClassicRacing-v0',
    'flashgames.3dFlashRacer-v0',
    'flashgames.3dFuriousDriver-v0',
    'flashgames.3dLaSupercars-v0',
    'flashgames.3dLaSupercars2-v0',
    'flashgames.3dMuscleCarRacer-v0',
    'flashgames.3dRallyFever-v0',
    'flashgames.3dRookieCop-v0',
    'flashgames.3dSpeedFever-v0',
    'flashgames.3dSportRampage-v0',
    'flashgames.3dSuperRide-v0',
    'flashgames.3dTestDrive-v0',
    'flashgames.3dTruckInTheWoods-v0',
    'flashgames.3dUrbanMadness-v0',
    'flashgames.3dUrbanMadness2-v0',
    'flashgames.4x4Monster3-v0',
    'flashgames.99BricksTheLegendOfGarry-v0',
    'flashgames.AWeekendAtTweetys-v0',
    'flashgames.AbductionGrannysVersion-v0',
    'flashgames.AchilliaTheGame-v0',
    'flashgames.AcidFactory-v0',
    'flashgames.AdrenalineChaser-v0',
    'flashgames.AdventuresOfBloo-v0',
    'flashgames.AeroDefense-v0',
    'flashgames.AerobaticMaster2-v0',
    'flashgames.Aerorumble-v0',
    'flashgames.AirWar1941-v0',
    'flashgames.AircraftRace-v0',
    'flashgames.AladdinAndTheWonderLamp-v0',
    'flashgames.AlchemySwap-v0',
    'flashgames.AliceNixsAdventure-v0',
    'flashgames.Alien-v0',
    'flashgames.AlienAssault-v0',
    'flashgames.AlienTransporter-v0',
    'flashgames.AmericanRacing-v0',
    'flashgames.AmericanRacingLvl2-v0',
    'flashgames.AmericanRacingLvl3-v0',
    'flashgames.AmericanRacingLvl4-v0',
    'flashgames.AmericanRacingLvl5-v0',
    'flashgames.AmericanRacingLvl6-v0',
    'flashgames.AmericanRacingLvl7-v0',
    'flashgames.AmericanRacingLvl8-v0',
    'flashgames.AmericanRacingLvl9-v0',
    'flashgames.AmericanRacingLvl10-v0',
    'flashgames.AmericanRacingLvl11-v0',
    'flashgames.AmericanRacingLvl12-v0',
    'flashgames.AmericanRacingLvl13-v0',
    'flashgames.AmericanRacingLvl14-v0',
    'flashgames.AmericanRacingLvl15-v0',
    'flashgames.AmericanRacingLvl16-v0',
    'flashgames.AmericanRacingLvl17-v0',
    'flashgames.AmericanRacingLvl18-v0',
    'flashgames.AmericanRacingLvl19-v0',
    'flashgames.AmericanRacingLvl20-v0',
    'flashgames.AmericanRacingLvl21-v0',
    'flashgames.AmericanRacingLvl22-v0',
    'flashgames.AmericanRacingLvl23-v0',
    'flashgames.AmericanRacingLvl24-v0',
    'flashgames.AmericanRacingLvl25-v0',
    'flashgames.AmericanRacing2-v0',
    'flashgames.AmigoPancho-v0',
    'flashgames.AmigoPancho3SheriffSancho-v0',
    'flashgames.AmigoPancho4Travel-v0',
    'flashgames.AmigoPanchoInAfghanistan-v0',
    'flashgames.AngryNewsVan-v0',
    'flashgames.AnimeClicker2-v0',
    'flashgames.AnotherLife2-v0',
    'flashgames.AntsGlider-v0',
    'flashgames.AnywayFish-v0',
    'flashgames.ArkanoidGame-v0',
    'flashgames.ArmyPursuit-v0',
    'flashgames.ArmySpeeder-v0',
    'flashgames.AspenSecret-v0',
    'flashgames.AsphaltMadness-v0',
    'flashgames.AssembleBots-v0',
    'flashgames.Astroman-v0',
    'flashgames.AtvRide-v0',
    'flashgames.Autoattack-v0',
    'flashgames.Avalancher-v0',
    'flashgames.AwesomeRun2-v0',
    'flashgames.BackHome-v0',
    'flashgames.BaldEagleJigsawPuzzle-v0',
    'flashgames.BalloonGods-v0',
    'flashgames.BalloonHero-v0',
    'flashgames.BalloonsPop-v0',
    'flashgames.Basement-v0',
    'flashgames.BeachCrazy-v0',
    'flashgames.BearInSuperActionAdventure-v0',
    'flashgames.BigWheelsTrial-v0',
    'flashgames.BikeTrial-v0',
    'flashgames.BikeTrial2-v0',
    'flashgames.BikeTrial3-v0',
    'flashgames.BikeTrial4-v0',
    'flashgames.Bimmin2-v0',
    'flashgames.BirdSlice-v0',
    'flashgames.BirdsFeeding-v0',
    'flashgames.BlackAndWhiteEscapeTheOffice-v0',
    'flashgames.BlackForce-v0',
    'flashgames.BlackInk-v0',
    'flashgames.BlackRacerJigsawPuzzle-v0',
    'flashgames.BlacksmithLab-v0',
    'flashgames.BlastTheMooks-v0',
    'flashgames.BlastTheMooksLevelPack-v0',
    'flashgames.Blix-v0',
    'flashgames.BlobsStory-v0',
    'flashgames.BlockysEscape-v0',
    'flashgames.BloodbathBay-v0',
    'flashgames.BloodyMonstersPack2-v0',
    'flashgames.Blosics2-v0',
    'flashgames.Blosics2LevelPack-v0',
    'flashgames.Blosics3-v0',
    'flashgames.BoatDrive-v0',
    'flashgames.BobbyNutcaseMotoJumping-v0',
    'flashgames.BoltThrough-v0',
    'flashgames.BombIt4-v0',
    'flashgames.BombIt6-v0',
    'flashgames.BombThePiratePigs-v0',
    'flashgames.BottleCaps-v0',
    'flashgames.BouncyCannon-v0',
    'flashgames.BoxBlocks-v0',
    'flashgames.BoxRacers-v0',
    'flashgames.BoxingLiveRound2-v0',
    'flashgames.BraveAstronaut-v0',
    'flashgames.BraveHeads-v0',
    'flashgames.BubbleAdventures-v0',
    'flashgames.BubbleBlubbs-v0',
    'flashgames.BubbleGlee-v0',
    'flashgames.BubbleHit-v0',
    'flashgames.BubbleHitChristmas-v0',
    'flashgames.BubbleHitHalloween-v0',
    'flashgames.BubbleHitPonyParade-v0',
    'flashgames.BubbleHitValentine-v0',
    'flashgames.BubbleMover-v0',
    'flashgames.BubblePop-v0',
    'flashgames.BubblePopAdventure-v0',
    'flashgames.BubbleRubble-v0',
    'flashgames.BubbleRubbleTheIsland-v0',
    'flashgames.BubbleShooterChallenge-v0',
    'flashgames.BubbleSlasher-v0',
    'flashgames.BubbleTanksTd15-v0',
    'flashgames.BubbleTub-v0',
    'flashgames.BubblesInSpace-v0',
    'flashgames.BugsGotGuns-v0',
    'flashgames.BuildBalance2-v0',
    'flashgames.BulletFury-v0',
    'flashgames.BulletHeaven-v0',
    'flashgames.BulletHeaven2-v0',
    'flashgames.Bullets-v0',
    'flashgames.BullfrogJigsawPuzzle-v0',
    'flashgames.BumbleTumble-v0',
    'flashgames.BunnyAndSquirt-v0',
    'flashgames.BunnyCannon-v0',
    'flashgames.BurgerBar-v0',
    'flashgames.BushRoyalRampage-v0',
    'flashgames.Business-v0',
    'flashgames.BusinessmanSimulator-v0',
    'flashgames.CableCapers2-v0',
    'flashgames.CakeQuest-v0',
    'flashgames.CandyMatch-v0',
    'flashgames.CandyMatchCrush-v0',
    'flashgames.CandySlider-v0',
    'flashgames.Canopy-v0',
    'flashgames.CanyonValleyRally-v0',
    'flashgames.CaptainNutty-v0',
    'flashgames.CaptainSteelbounce-v0',
    'flashgames.CardinalQuest2-v0',
    'flashgames.CarrotFantasy-v0',
    'flashgames.CarrotFantasy2Desert-v0',
    'flashgames.CarrotFantasy2Undersea-v0',
    'flashgames.CarrotFantasyExtreme2-v0',
    'flashgames.CarrotFantasyExtreme3-v0',
    'flashgames.CarsVsRobots-v0',
    'flashgames.CartoonCandy-v0',
    'flashgames.CastleRush-v0',
    'flashgames.CastleSolitaire-v0',
    'flashgames.CatGodVsSunKing2-v0',
    'flashgames.CatchTheStar-v0',
    'flashgames.Cattlepult-v0',
    'flashgames.CattlepultPlayerPack-v0',
    'flashgames.CavemanEscape-v0',
    'flashgames.CemeteryRoad-v0',
    'flashgames.CharlieTheDuck-v0',
    'flashgames.Chefday-v0',
    'flashgames.ChickCannont-v0',
    'flashgames.ChickInduce-v0',
    'flashgames.ChockABox-v0',
    'flashgames.ChristmasBubbles-v0',
    'flashgames.ChromaticTowerDefense-v0',
    'flashgames.ChuteAcademy-v0',
    'flashgames.CircuitSuperCarsRacing-v0',
    'flashgames.CitySiege3FubarLevelPack-v0',
    'flashgames.CitySkyTyping-v0',
    'flashgames.ClaustrophobiumFourStepsFromDeath-v0',
    'flashgames.Cleopatra-v0',
    'flashgames.ClickerMonsters-v0',
    'flashgames.ClimbOrDrown2-v0',
    'flashgames.ClimberGuy-v0',
    'flashgames.ClimbingSanta-v0',
    'flashgames.CloseCombat-v0',
    'flashgames.Cloud9-v0',
    'flashgames.ClubNitro-v0',
    'flashgames.Clusterobot-v0',
    'flashgames.CoastRunners-v0',
    'flashgames.CoasterCars2Contact-v0',
    'flashgames.CoasterCars2Megacross-v0',
    'flashgames.CoasterCarsBridgesTrack-v0',
    'flashgames.CoasterCarsCJackTrack-v0',
    'flashgames.CoasterRacer-v0',
    'flashgames.CoasterRacerLvl2-v0',
    'flashgames.CoasterRacerLvl3-v0',
    'flashgames.CoasterRacerLvl4-v0',
    'flashgames.CoasterRacerLvl5-v0',
    'flashgames.CoasterRacerLvl6-v0',
    'flashgames.CoasterRacerLvl7-v0',
    'flashgames.CoasterRacerLvl8-v0',
    'flashgames.CoasterRacer2-v0',
    'flashgames.CoasterRacer2Lvl2-v0',
    'flashgames.CoasterRacer2Lvl3-v0',
    'flashgames.CoasterRacer2Lvl4-v0',
    'flashgames.CoasterRacer2Lvl5-v0',
    'flashgames.CoasterRacer2Lvl6-v0',
    'flashgames.CoasterRacer2Lvl7-v0',
    'flashgames.CoasterRacer2Lvl8-v0',
    'flashgames.CoasterRacer2Lvl9-v0',
    'flashgames.CoasterRacer2Lvl10-v0',
    'flashgames.CoasterRacer2Bike-v0',
    'flashgames.CoasterRacer3-v0',
    'flashgames.CoffeeClicker-v0',
    'flashgames.ColorZapper-v0',
    'flashgames.Colordefense-v0',
    'flashgames.Colorfill-v0',
    'flashgames.Coloruid-v0',
    'flashgames.Colorwars-v0',
    'flashgames.Commando-v0',
    'flashgames.Commando2-v0',
    'flashgames.Conjure-v0',
    'flashgames.Connect2-v0',
    'flashgames.Conquerium-v0',
    'flashgames.Contra3TheAlienWars-v0',
    'flashgames.Cooliobeat-v0',
    'flashgames.Cooliodj-v0',
    'flashgames.CopperheadJigsawPuzzle-v0',
    'flashgames.CosmicSwitch-v0',
    'flashgames.CosmoGravity2-v0',
    'flashgames.CoverOrangeJourneyGangsters-v0',
    'flashgames.CowboyVsUfos-v0',
    'flashgames.Crane-v0',
    'flashgames.CrapImBroke-v0',
    'flashgames.CrazyDarts-v0',
    'flashgames.Crazycle-v0',
    'flashgames.CruiseAdventure-v0',
    'flashgames.Cruisin-v0',
    'flashgames.Crumbs2-v0',
    'flashgames.CrystalCurse-v0',
    'flashgames.CrystalStoryIi-v0',
    'flashgames.CupidBubbles-v0',
    'flashgames.CursedTreasureDontTouchMyGems-v0',
    'flashgames.CurveFever-v0',
    'flashgames.DaleAndPeakot-v0',
    'flashgames.DanceBattle-v0',
    'flashgames.DancingWithShadows-v0',
    'flashgames.DartsSim-v0',
    'flashgames.DaymareInvaders-v0',
    'flashgames.DeadHungry2-v0',
    'flashgames.DeathCabin-v0',
    'flashgames.DeathDiceOverdose-v0',
    'flashgames.DeepForest3dRace-v0',
    'flashgames.DeepFreeze-v0',
    'flashgames.Deliveryman-v0',
    'flashgames.DetectiveConrad-v0',
    'flashgames.Devilment-v0',
    'flashgames.DiamondCrashMania-v0',
    'flashgames.DigToChina-v0',
    'flashgames.DinoBubble-v0',
    'flashgames.DinoMeatHunt3Extra-v0',
    'flashgames.DirkValentine-v0',
    'flashgames.DisasterWillStrikeDefender-v0',
    'flashgames.DisasterWillStrikeUltimateDisaster-v0',
    'flashgames.DiscoverEurope-v0',
    'flashgames.Ditloid-v0',
    'flashgames.DnaLabRush-v0',
    'flashgames.Dodge-v0',
    'flashgames.DodgeAndCrash-v0',
    'flashgames.DolphinVolleyball-v0',
    'flashgames.DontPanic-v0',
    'flashgames.DoodleGod2Walkthrough-v0',
    'flashgames.DotGrowth-v0',
    'flashgames.Dots-v0',
    'flashgames.DotsRevamped-v0',
    'flashgames.DoubleEdged-v0',
    'flashgames.DoughSnake-v0',
    'flashgames.DragonChain-v0',
    'flashgames.DragonChronicles-v0',
    'flashgames.DragonFortress-v0',
    'flashgames.DragonFunflap-v0',
    'flashgames.DragonVsMonster-v0',
    'flashgames.DrawGems-v0',
    'flashgames.DreamChristmasLink-v0',
    'flashgames.DriftRunners-v0',
    'flashgames.DriftRunners2-v0',
    'flashgames.DriftRunners3d-v0',
    'flashgames.Drifters-v0',
    'flashgames.DrinkBeerNeglectFamily-v0',
    'flashgames.DriveToWreck-v0',
    'flashgames.DriveToWreck2-v0',
    'flashgames.DriveToWreck3-v0',
    'flashgames.Dropblox-v0',
    'flashgames.DualDimension-v0',
    'flashgames.DumperRush-v0',
    'flashgames.DungeonBlocks-v0',
    'flashgames.DuskDrive-v0',
    'flashgames.DuskRacers-v0',
    'flashgames.EasterBubbles-v0',
    'flashgames.EasterBunnyCollectCarrots-v0',
    'flashgames.EasterBunnyEggs-v0',
    'flashgames.EasterEggSlider-v0',
    'flashgames.EasterEggsChallenge-v0',
    'flashgames.EatToWin-v0',
    'flashgames.EctoHarvest-v0',
    'flashgames.EffingWorms-v0',
    'flashgames.EggzBlast-v0',
    'flashgames.EiffelTowerAtNight-v0',
    'flashgames.ElClassico-v0',
    'flashgames.ElainesBakery-v0',
    'flashgames.EmpireBusiness2Beta-v0',
    'flashgames.Enhanced-v0',
    'flashgames.EpicBattleFantasy4-v0',
    'flashgames.EpicDefender-v0',
    'flashgames.EpicDerbyRace-v0',
    'flashgames.EpicTimePirates-v0',
    'flashgames.EscapeTheRedGiant-v0',
    'flashgames.EuroKicks2016-v0',
    'flashgames.EvasiveRacers-v0',
    'flashgames.EvilMinion-v0',
    'flashgames.EvilSun-v0',
    'flashgames.EvolutionRacing-v0',
    'flashgames.EvolutionRacingLvl2-v0',
    'flashgames.EvolutionRacingLvl3-v0',
    'flashgames.EvolutionRacingLvl4-v0',
    'flashgames.EvolutionRacingLvl5-v0',
    'flashgames.EvolutionRacingLvl6-v0',
    'flashgames.EvolutionRacingLvl7-v0',
    'flashgames.EvolutionRacingLvl8-v0',
    'flashgames.EvolutionRacingLvl9-v0',
    'flashgames.EvolutionRacingLvl10-v0',
    'flashgames.EvolutionRacingLvl11-v0',
    'flashgames.EvolutionRacingLvl12-v0',
    'flashgames.EvolutionRacingLvl13-v0',
    'flashgames.EvolutionRacingLvl14-v0',
    'flashgames.EvolutionRacingLvl15-v0',
    'flashgames.EvolutionRacingLvl16-v0',
    'flashgames.ExperimentalShooter2-v0',
    'flashgames.ExploreTheCandies-v0',
    'flashgames.ExtremeAirWars-v0',
    'flashgames.ExtremeSkiing-v0',
    'flashgames.F1RacingChallenge-v0',
    'flashgames.FairyDefense-v0',
    'flashgames.FallDamage-v0',
    'flashgames.FarmRush-v0',
    'flashgames.FasterMiterMaster-v0',
    'flashgames.FeedMeMoar-v0',
    'flashgames.FeedOurDoughnutOverlords-v0',
    'flashgames.Filler-v0',
    'flashgames.Filler2-v0',
    'flashgames.FinalNinjaZero-v0',
    'flashgames.FinalSiege-v0',
    'flashgames.FindTheCandy3Kids-v0',
    'flashgames.Firebug-v0',
    'flashgames.FirefighterCannon-v0',
    'flashgames.FireworksGame-v0',
    'flashgames.FishAndDestroy-v0',
    'flashgames.FishEatFish-v0',
    'flashgames.FitItQuick-v0',
    'flashgames.FiveTil-v0',
    'flashgames.Fizzion-v0',
    'flashgames.Flagman-v0',
    'flashgames.FlappyAdventure-v0',
    'flashgames.FlappyBat-v0',
    'flashgames.FlappyCopter-v0',
    'flashgames.FlappyPanda-v0',
    'flashgames.FlashBombs-v0',
    'flashgames.FlashDrive-v0',
    'flashgames.FlashRace-v0',
    'flashgames.FlashRacer-v0',
    'flashgames.Flashcycle2-v0',
    'flashgames.FlashsBounty-v0',
    'flashgames.FlowerGuardian-v0',
    'flashgames.FlowerSolitaire-v0',
    'flashgames.FluffRush-v0',
    'flashgames.FlyAwayRabbit2-v0',
    'flashgames.FlyPlane-v0',
    'flashgames.FlyingCookieQuest-v0',
    'flashgames.FlyingKiwi-v0',
    'flashgames.FlyingTest-v0',
    'flashgames.Foosball2Player-v0',
    'flashgames.FootballHeads201314Ligue1-v0',
    'flashgames.FormulaRacer-v0',
    'flashgames.FormulaRacerLvl2-v0',
    'flashgames.FormulaRacerLvl3-v0',
    'flashgames.FormulaRacerLvl4-v0',
    'flashgames.FormulaRacerLvl5-v0',
    'flashgames.FormulaRacerLvl6-v0',
    'flashgames.FormulaRacerLvl7-v0',
    'flashgames.FormulaRacerLvl8-v0',
    'flashgames.FormulaRacer2012-v0',
    'flashgames.FormulaRacer2012Lvl2-v0',
    'flashgames.FormulaRacer2012Lvl3-v0',
    'flashgames.FormulaRacer2012Lvl4-v0',
    'flashgames.FormulaRacer2012Lvl5-v0',
    'flashgames.FormulaRacer2012Lvl6-v0',
    'flashgames.FormulaRacer2012Lvl7-v0',
    'flashgames.FormulaRacer2012Lvl8-v0',
    'flashgames.FormulaRacer2012Lvl9-v0',
    'flashgames.FormulaRacer2012Lvl10-v0',
    'flashgames.FormulaRacer2012Lvl11-v0',
    'flashgames.FormulaRacer2012Lvl12-v0',
    'flashgames.FormulaXspeed3d-v0',
    'flashgames.FoxSnakeJigsawPuzzle-v0',
    'flashgames.FpaWorld1Remix-v0',
    'flashgames.FreakyRun-v0',
    'flashgames.FredFigglehorn-v0',
    'flashgames.FreeSouls-v0',
    'flashgames.Free_to_use-v0',
    'flashgames.FreecellDuplex-v0',
    'flashgames.FrogEatFlies-v0',
    'flashgames.Frogged-v0',
    'flashgames.FrozenImps-v0',
    'flashgames.FrozenIslandsNewHorizons-v0',
    'flashgames.Funkostroll-v0',
    'flashgames.FunnyEaster-v0',
    'flashgames.GSwitch-v0',
    'flashgames.GalacticCats-v0',
    'flashgames.GalacticGems-v0',
    'flashgames.GalacticGems2-v0',
    'flashgames.GalacticGems2Accelerated-v0',
    'flashgames.GalacticGems2LevelPack-v0',
    'flashgames.GalacticGems2NewFrontiers-v0',
    'flashgames.GalaxyDefender-v0',
    'flashgames.GalaxyEvo2-v0',
    'flashgames.GalaxyMission-v0',
    'flashgames.GalleonFight-v0',
    'flashgames.GameInit-v0',
    'flashgames.Gameinit-v0',
    'flashgames.GamerMemoryTest-v0',
    'flashgames.GardenRush-v0',
    'flashgames.GasSand-v0',
    'flashgames.GemMania-v0',
    'flashgames.GemPop-v0',
    'flashgames.Gemclix-v0',
    'flashgames.Gemcraft-v0',
    'flashgames.GemstoneCastle-v0',
    'flashgames.GhostClimb2Player-v0',
    'flashgames.GiantsAndDwarvesTd-v0',
    'flashgames.GlobalRallyRacer-v0',
    'flashgames.Gloom-v0',
    'flashgames.Gluey2-v0',
    'flashgames.Go-v0',
    'flashgames.GoGreenGo-v0',
    'flashgames.GoKart3d-v0',
    'flashgames.Goldextraction-v0',
    'flashgames.GolfRun-v0',
    'flashgames.GonAndMon-v0',
    'flashgames.GrandPrixGo-v0',
    'flashgames.GrandPrixGo2-v0',
    'flashgames.GrappleCat-v0',
    'flashgames.GravityBall-v0',
    'flashgames.GravityGuy-v0',
    'flashgames.GravityThruster-v0',
    'flashgames.GroundBattles-v0',
    'flashgames.Growbox-v0',
    'flashgames.GsSoccerWorldCup-v0',
    'flashgames.GunExpress-v0',
    'flashgames.GunnerMayhem-v0',
    'flashgames.GunpowderAndFeathers-v0',
    'flashgames.HalloweenAdventureRun-v0',
    'flashgames.HalloweenExplorer-v0',
    'flashgames.HalloweenJam-v0',
    'flashgames.HammerBall-v0',
    'flashgames.Hamsterball-v0',
    'flashgames.HandsOff-v0',
    'flashgames.HappyBallz-v0',
    'flashgames.HappyBees-v0',
    'flashgames.HappyEasterEggs-v0',
    'flashgames.Harvest-v0',
    'flashgames.HarvestDay-v0',
    'flashgames.Hash-v0',
    'flashgames.Hearts-v0',
    'flashgames.HeatRushFuture-v0',
    'flashgames.HeatRushFutureLvl2-v0',
    'flashgames.HeatRushFutureLvl3-v0',
    'flashgames.HeatRushFutureLvl4-v0',
    'flashgames.HeatRushFutureLvl5-v0',
    'flashgames.HeatRushFutureLvl6-v0',
    'flashgames.HeatRushFutureLvl7-v0',
    'flashgames.HeatRushFutureLvl8-v0',
    'flashgames.HeatRushFutureLvl9-v0',
    'flashgames.HeatRushFutureLvl10-v0',
    'flashgames.HeatRushFutureLvl11-v0',
    'flashgames.HeatRushFutureLvl12-v0',
    'flashgames.HeatRushFutureLvl13-v0',
    'flashgames.HeatRushFutureLvl14-v0',
    'flashgames.HeatRushFutureLvl15-v0',
    'flashgames.HeatRushUsa-v0',
    'flashgames.HeatRushUsaLvl2-v0',
    'flashgames.HeatRushUsaLvl3-v0',
    'flashgames.HeatRushUsaLvl4-v0',
    'flashgames.HeatRushUsaLvl5-v0',
    'flashgames.HeatRushUsaLvl6-v0',
    'flashgames.HeatRushUsaLvl7-v0',
    'flashgames.HeatRushUsaLvl8-v0',
    'flashgames.HeatRushUsaLvl9-v0',
    'flashgames.HeatRushUsaLvl10-v0',
    'flashgames.HeatRushUsaLvl11-v0',
    'flashgames.HeatRushUsaLvl12-v0',
    'flashgames.HeatRushUsaLvl13-v0',
    'flashgames.HeatRushUsaLvl14-v0',
    'flashgames.HeatRushUsaLvl15-v0',
    'flashgames.HeatRushUsaLvl16-v0',
    'flashgames.HeavenAndHell-v0',
    'flashgames.HeavyLegion2-v0',
    'flashgames.HeliVsTower-v0',
    'flashgames.HelicopsTerritories-v0',
    'flashgames.Helicrane-v0',
    'flashgames.Helixteus-v0',
    'flashgames.HelmetBombers3-v0',
    'flashgames.HeroRoofTop-v0',
    'flashgames.HeroSimulator-v0',
    'flashgames.HeroesOfMangaraTheFrostCrown-v0',
    'flashgames.HexBattles-v0',
    'flashgames.HeySummer-v0',
    'flashgames.HighSpeedChase-v0',
    'flashgames.HighwayRevenge-v0',
    'flashgames.HiredHeroes-v0',
    'flashgames.HoldTheFort-v0',
    'flashgames.HoleInOne-v0',
    'flashgames.Hotspot-v0',
    'flashgames.HowDareYou-v0',
    'flashgames.HungerHunter-v0',
    'flashgames.HungryLittlePenguins-v0',
    'flashgames.HungryPiranha-v0',
    'flashgames.HunterForDismantlers-v0',
    'flashgames.HyperTravel-v0',
    'flashgames.IceBlock-v0',
    'flashgames.IceCreamFromSpace-v0',
    'flashgames.IceRun-v0',
    'flashgames.IceSlide-v0',
    'flashgames.Ics2-v0',
    'flashgames.IcyGifts2-v0',
    'flashgames.IdleChop-v0',
    'flashgames.IdleFarmer-v0',
    'flashgames.IdleLifting-v0',
    'flashgames.IdlePlanet-v0',
    'flashgames.ImitationNationSnakeGame-v0',
    'flashgames.IncrementalAcceleration-v0',
    'flashgames.Indefinite-v0',
    'flashgames.IndependenceDaySlacking2015-v0',
    'flashgames.InfectonatorSurvivorsAlphaDemo-v0',
    'flashgames.InfernalMess-v0',
    'flashgames.Infinitix-v0',
    'flashgames.InsaneCircle-v0',
    'flashgames.IntoSpace-v0',
    'flashgames.IslandDefense-v0',
    'flashgames.IsoblockerMaster-v0',
    'flashgames.ItsDarkInHell-v0',
    'flashgames.JakeTheSnake-v0',
    'flashgames.JamesTheCircusZebra-v0',
    'flashgames.JamesTheDeepSeaZebra-v0',
    'flashgames.JamesThePirateZebra-v0',
    'flashgames.JamesTheSpaceZebra-v0',
    'flashgames.JelliesFun-v0',
    'flashgames.JellyFriend-v0',
    'flashgames.JellySnake-v0',
    'flashgames.JetpackJackride-v0',
    'flashgames.JollySwipe-v0',
    'flashgames.JollySwipeLevelPack-v0',
    'flashgames.JonnyBackflip-v0',
    'flashgames.JumpOverTheRings-v0',
    'flashgames.Jumprunner-v0',
    'flashgames.Jumpz-v0',
    'flashgames.JungleCrash-v0',
    'flashgames.JungleEagle-v0',
    'flashgames.KamikazeRace-v0',
    'flashgames.KangoIslands-v0',
    'flashgames.KartOn-v0',
    'flashgames.KartRacing-v0',
    'flashgames.KartingSuperGo-v0',
    'flashgames.Kawairun-v0',
    'flashgames.KeeperOfTheGrove3-v0',
    'flashgames.Kinetikz-v0',
    'flashgames.Kinetikz2-v0',
    'flashgames.Kinetikz3-v0',
    'flashgames.KingRolla-v0',
    'flashgames.KitchenRestaurantCleanUp-v0',
    'flashgames.KnightsOfRock-v0',
    'flashgames.Knighttron-v0',
    'flashgames.Knockers-v0',
    'flashgames.Krome-v0',
    'flashgames.LaserCannon3LevelsPack-v0',
    'flashgames.LawnmowerRacing3d-v0',
    'flashgames.LaxAirbusParking-v0',
    'flashgames.Lazerman-v0',
    'flashgames.LearnToFlyIdle-v0',
    'flashgames.Legor9-v0',
    'flashgames.LessQuick-v0',
    'flashgames.LetsFall-v0',
    'flashgames.LevelEditor3-v0',
    'flashgames.LilyFighters-v0',
    'flashgames.LineGameLimeEdition-v0',
    'flashgames.LlamasInDistress-v0',
    'flashgames.LonelyEscapeAsylum-v0',
    'flashgames.LongJump-v0',
    'flashgames.Long_short-v0',
    'flashgames.LooneyAndJohny-v0',
    'flashgames.LuckyBalls-v0',
    'flashgames.LuxUltimate-v0',
    'flashgames.Madburger3-v0',
    'flashgames.MadpetSkateboarder2-v0',
    'flashgames.MagicSafari-v0',
    'flashgames.ManicRallyGo-v0',
    'flashgames.MapTurtleJigsawPuzzle-v0',
    'flashgames.MarblesShooter-v0',
    'flashgames.MarsColonyTd-v0',
    'flashgames.MarshmallowsEscape-v0',
    'flashgames.MashaCollectsButterflies-v0',
    'flashgames.MasterDifference-v0',
    'flashgames.Match2Collapse-v0',
    'flashgames.Match3Adventure-v0',
    'flashgames.Match3ChristmasPack-v0',
    'flashgames.Match3PresentBoxSaga-v0',
    'flashgames.MatchAndCrash-v0',
    'flashgames.MatchAndSpell-v0',
    'flashgames.MatchAroundTheWorld-v0',
    'flashgames.MatchCraft-v0',
    'flashgames.MatchCrypt-v0',
    'flashgames.MatchJong-v0',
    'flashgames.MatchMonsters-v0',
    'flashgames.MatchStars-v0',
    'flashgames.MatchTheBugz-v0',
    'flashgames.MatchTheFruits-v0',
    'flashgames.MatchToEnjoy-v0',
    'flashgames.MatchToEnjoyLevelPack-v0',
    'flashgames.MatchingSweetHearts-v0',
    'flashgames.MazeEye-v0',
    'flashgames.MedievalShark-v0',
    'flashgames.MeerkatMission-v0',
    'flashgames.MexicoRex-v0',
    'flashgames.MiceVsHammers-v0',
    'flashgames.Michimind-v0',
    'flashgames.MidnightCanine-v0',
    'flashgames.MidnightMiner-v0',
    'flashgames.MightyTower-v0',
    'flashgames.Mimelet-v0',
    'flashgames.MindImpulse-v0',
    'flashgames.MineDrop-v0',
    'flashgames.MineHero-v0',
    'flashgames.MinedigJourneyToHollowEarth-v0',
    'flashgames.MiniMachines-v0',
    'flashgames.MiniSportsChallenge-v0',
    'flashgames.MinicarHunt-v0',
    'flashgames.Minicarting-v0',
    'flashgames.MissionEscapeTheDojo-v0',
    'flashgames.ModelCarRacing-v0',
    'flashgames.MonkeyBlast-v0',
    'flashgames.MonkeyGems-v0',
    'flashgames.MonkeyGoHappyNinjaHunt2-v0',
    'flashgames.MonkeyManic-v0',
    'flashgames.MonsterChains-v0',
    'flashgames.MonsterLabFeedThemAll-v0',
    'flashgames.MonsterRun-v0',
    'flashgames.MonsterTroubles-v0',
    'flashgames.MonsterTruckFever-v0',
    'flashgames.MonsterTruckRally-v0',
    'flashgames.Moosters-v0',
    'flashgames.MotherLoad-v0',
    'flashgames.MotoMadness-v0',
    'flashgames.MotoTrialMania-v0',
    'flashgames.MotorWheels-v0',
    'flashgames.Mrbirdie-v0',
    'flashgames.MultiballMadness-v0',
    'flashgames.Multitask-v0',
    'flashgames.MummyMadness-v0',
    'flashgames.Mushbooms-v0',
    'flashgames.MushboomsLevelPack-v0',
    'flashgames.MushboomsLevelPack2-v0',
    'flashgames.MushroomFarmDefender-v0',
    'flashgames.MushyMishy-v0',
    'flashgames.MusicSmash-v0',
    'flashgames.MusicStomp-v0',
    'flashgames.MusicZap-v0',
    'flashgames.MysteriousPirateJewels-v0',
    'flashgames.MysticIndiaPop-v0',
    'flashgames.MysticalAncientTreasure-v0',
    'flashgames.NOfficialWebVersion-v0',
    'flashgames.NadiasRage-v0',
    'flashgames.NanoKingdoms2JokersRevenge-v0',
    'flashgames.NeonRace-v0',
    'flashgames.NeonRaceLvl2-v0',
    'flashgames.NeonRaceLvl3-v0',
    'flashgames.NeonRaceLvl4-v0',
    'flashgames.NeonRaceLvl5-v0',
    'flashgames.NeonRaceLvl6-v0',
    'flashgames.NeonRaceLvl7-v0',
    'flashgames.NeonRaceLvl8-v0',
    'flashgames.NeonRace2-v0',
    'flashgames.NeonRace2Lvl2-v0',
    'flashgames.NeonRace2Lvl3-v0',
    'flashgames.NeonRace2Lvl4-v0',
    'flashgames.NeonRace2Lvl5-v0',
    'flashgames.NeonRace2Lvl6-v0',
    'flashgames.NeonRace2Lvl7-v0',
    'flashgames.NeonRace2Lvl8-v0',
    'flashgames.NeonRace2Lvl9-v0',
    'flashgames.NeonRace2Lvl10-v0',
    'flashgames.NeonRace2Lvl11-v0',
    'flashgames.NeonRace2Lvl12-v0',
    'flashgames.NeonRace2Lvl13-v0',
    'flashgames.NeonRace2Lvl14-v0',
    'flashgames.NeonRace2Lvl15-v0',
    'flashgames.Neopods-v0',
    'flashgames.NervousLadybug-v0',
    'flashgames.NewSiberianSupercarsRacing-v0',
    'flashgames.NewSplitterPals-v0',
    'flashgames.NightDrivin-v0',
    'flashgames.NightRaceRally-v0',
    'flashgames.NinjaPainter-v0',
    'flashgames.NinjaPandaArena-v0',
    'flashgames.NinjaPandaCouple-v0',
    'flashgames.NinjaTrainingWorlds-v0',
    'flashgames.Nook-v0',
    'flashgames.NoughtsAndCrosses-v0',
    'flashgames.NoughtsAndCrossesExtreme-v0',
    'flashgames.NukeDefense-v0',
    'flashgames.Numz-v0',
    'flashgames.NuttyBoom-v0',
    'flashgames.ObamaAlienDefense-v0',
    'flashgames.OceanMatch-v0',
    'flashgames.Oddball2-v0',
    'flashgames.OffRoaders3d-v0',
    'flashgames.OfficeTrap-v0',
    'flashgames.Offroaders-v0',
    'flashgames.Offroaders2-v0',
    'flashgames.OkParking-v0',
    'flashgames.OldTv-v0',
    'flashgames.OozingForever-v0',
    'flashgames.OswaldTheAngryDwarf-v0',
    'flashgames.Overheat-v0',
    'flashgames.PaintWars-v0',
    'flashgames.Paintwars-v0',
    'flashgames.PanikInChocoland-v0',
    'flashgames.PapaLouie3WhenSundaesAttack-v0',
    'flashgames.PaperDefense-v0',
    'flashgames.ParachuteRetrospect-v0',
    'flashgames.ParallelLevels-v0',
    'flashgames.ParkingFury-v0',
    'flashgames.Parkour-v0',
    'flashgames.ParticleWarsExtreme-v0',
    'flashgames.Pathillogical-v0',
    'flashgames.PaulVaulting-v0',
    'flashgames.Peakart-v0',
    'flashgames.PearlBreaking-v0',
    'flashgames.Pel-v0',
    'flashgames.PenguinCubes-v0',
    'flashgames.PenguinHeroes-v0',
    'flashgames.PenguinSkate2-v0',
    'flashgames.PerilousJourney2-v0',
    'flashgames.Phit-v0',
    'flashgames.PickAndDig2-v0',
    'flashgames.PickUpTruckRacing-v0',
    'flashgames.PicnicPanicTd-v0',
    'flashgames.PigDestroyer-v0',
    'flashgames.PiggyWiggy-v0',
    'flashgames.PiggysCupcakeQuest-v0',
    'flashgames.PinBalls-v0',
    'flashgames.PinataWarriors-v0',
    'flashgames.PingPongSurvival-v0',
    'flashgames.PirateRunAway-v0',
    'flashgames.PiratesAndCannons-v0',
    'flashgames.PixelBasher-v0',
    'flashgames.PixelFighta-v0',
    'flashgames.PixelPurge-v0',
    'flashgames.PixelQuest-v0',
    'flashgames.PlaneRace-v0',
    'flashgames.PlaneRace2-v0',
    'flashgames.PlopPlopLite-v0',
    'flashgames.PocketRocket-v0',
    'flashgames.Pointer-v0',
    'flashgames.Pointless-v0',
    'flashgames.PoliceChaseCrackdown-v0',
    'flashgames.PoliceHotRacing-v0',
    'flashgames.PoliceInterceptor-v0',
    'flashgames.PolygonalFury-v0',
    'flashgames.Popopop-v0',
    'flashgames.Popopop2-v0',
    'flashgames.PouJetpack-v0',
    'flashgames.PouThanksgivingDaySlacking-v0',
    'flashgames.PowerCopter-v0',
    'flashgames.PowerSwing-v0',
    'flashgames.Primary-v0',
    'flashgames.PrincessBubblesRescuePrince-v0',
    'flashgames.PrincessToTheRescue-v0',
    'flashgames.ProjectMonochrome-v0',
    'flashgames.PuddingPie-v0',
    'flashgames.PufferFish-v0',
    'flashgames.PumpkinCollector-v0',
    'flashgames.PumpkinMan-v0',
    'flashgames.PumpkinsInZombieTown-v0',
    'flashgames.PunchBallJump-v0',
    'flashgames.PurifyTheLegendOfZ-v0',
    'flashgames.PuzzleMonsters-v0',
    'flashgames.PuzzleRescuePrime-v0',
    'flashgames.PyramidApocalypse-v0',
    'flashgames.Pyro-v0',
    'flashgames.Qoosh-v0',
    'flashgames.QuashBoard-v0',
    'flashgames.QubedMysteriousIsland-v0',
    'flashgames.QubeyTheCube-v0',
    'flashgames.Quick-v0',
    'flashgames.RabbitPlanetEscape-v0',
    'flashgames.RabbitRustler-v0',
    'flashgames.RacerKartz-v0',
    'flashgames.RacingSupercarChampionship-v0',
    'flashgames.RainbowDrops-v0',
    'flashgames.RapaNui-v0',
    'flashgames.Raze3-v0',
    'flashgames.Rb2-v0',
    'flashgames.Rbots-v0',
    'flashgames.ReachTheGoal-v0',
    'flashgames.RedBeard-v0',
    'flashgames.RedCode3-v0',
    'flashgames.RedFuryRacing-v0',
    'flashgames.ReleaseTheMooks-v0',
    'flashgames.ReleaseTheMooks2-v0',
    'flashgames.ReleaseTheMooks3-v0',
    'flashgames.Resonance-v0',
    'flashgames.RetroRunner-v0',
    'flashgames.Retron-v0',
    'flashgames.ReverseBoots-v0',
    'flashgames.RhythmBlasterV2-v0',
    'flashgames.RhythmRockets-v0',
    'flashgames.RhythmSnake-v0',
    'flashgames.RingsideHero-v0',
    'flashgames.RiseOfChampions-v0',
    'flashgames.RoadRacing-v0',
    'flashgames.RoadblockAttack-v0',
    'flashgames.RoboPop-v0',
    'flashgames.RobotDuelFight-v0',
    'flashgames.RobotWantsFishy-v0',
    'flashgames.RocketBootsInc-v0',
    'flashgames.Rocketeer-v0',
    'flashgames.RollTheCluster-v0',
    'flashgames.RollerRider-v0',
    'flashgames.RollingHills-v0',
    'flashgames.Rose-v0',
    'flashgames.RubbleRacer-v0',
    'flashgames.RunFaustoRun-v0',
    'flashgames.RunNGun-v0',
    'flashgames.RunRamRun-v0',
    'flashgames.RunRunRan-v0',
    'flashgames.RunSoldierRun-v0',
    'flashgames.RushOfTanks-v0',
    'flashgames.RussianTruck-v0',
    'flashgames.SafariTime-v0',
    'flashgames.SandcastleShowdown-v0',
    'flashgames.SantaClimbHere-v0',
    'flashgames.SantaMan-v0',
    'flashgames.SantaSituation-v0',
    'flashgames.SapphireClix-v0',
    'flashgames.SaveTheDummyHolidays-v0',
    'flashgames.SavingLittleAlien-v0',
    'flashgames.SchoolBusRacing-v0',
    'flashgames.Scribble-v0',
    'flashgames.Scribble2-v0',
    'flashgames.SeaPong-v0',
    'flashgames.ShamelessClone2-v0',
    'flashgames.Sheepster-v0',
    'flashgames.Sheepy-v0',
    'flashgames.ShimmyChute-v0',
    'flashgames.ShootTheCircle-v0',
    'flashgames.ShortCircuit-v0',
    'flashgames.SiegeHeroPiratePillage-v0',
    'flashgames.Sieger2LevelPack-v0',
    'flashgames.SiegerRebuiltToDestroy-v0',
    'flashgames.Sirtet-v0',
    'flashgames.SistersOfNoMercy-v0',
    'flashgames.SkiSim-v0',
    'flashgames.SkyIsland-v0',
    'flashgames.SkyKnight2-v0',
    'flashgames.SkyQuest-v0',
    'flashgames.Skytrip-v0',
    'flashgames.SliceTheBox-v0',
    'flashgames.SliceTheBoxRemaster-v0',
    'flashgames.SlingBaby-v0',
    'flashgames.SlipSlideSloth-v0',
    'flashgames.SmashTheSwine-v0',
    'flashgames.SmileyJumpFest-v0',
    'flashgames.SmileyPuzzle-v0',
    'flashgames.SmileyPuzzle2-v0',
    'flashgames.SmileyPuzzleGirlEdition-v0',
    'flashgames.SmileyShowdown-v0',
    'flashgames.SnackOnLittleCreatures-v0',
    'flashgames.SnailBob4-v0',
    'flashgames.Snake-v0',
    'flashgames.SnakeClassic-v0',
    'flashgames.SnakeFightArena-v0',
    'flashgames.SneakyScubaEscape-v0',
    'flashgames.SnowPrincessMakeup-v0',
    'flashgames.SnowQueen-v0',
    'flashgames.SnowQueen3-v0',
    'flashgames.SnowQueen4-v0',
    'flashgames.Solarsaurs-v0',
    'flashgames.SonicBubbles-v0',
    'flashgames.SpaceBounty-v0',
    'flashgames.SpaceColony-v0',
    'flashgames.SpaceMadness-v0',
    'flashgames.SpacePunkRacer-v0',
    'flashgames.SpacePunkRacerLvl2-v0',
    'flashgames.SpacePunkRacerLvl3-v0',
    'flashgames.SpacePunkRacerLvl4-v0',
    'flashgames.SpacePunkRacerLvl5-v0',
    'flashgames.SpacePunkRacerLvl6-v0',
    'flashgames.SpacePunkRacerLvl7-v0',
    'flashgames.SpacePunkRacerLvl8-v0',
    'flashgames.SpacemanMax-v0',
    'flashgames.SpanishLiga2016-v0',
    'flashgames.Sparks-v0',
    'flashgames.Spectrum-v0',
    'flashgames.SpectrumHeist-v0',
    'flashgames.SpectrumRunner-v0',
    'flashgames.SpeedBusters-v0',
    'flashgames.SpellIdle2-v0',
    'flashgames.SpinClimbGreen-v0',
    'flashgames.SpinSoar-v0',
    'flashgames.SpinSprint-v0',
    'flashgames.SpunkyVsAliens-v0',
    'flashgames.Stalingrad-v0',
    'flashgames.Stalingrad2-v0',
    'flashgames.Stalingrad3-v0',
    'flashgames.Stand-v0',
    'flashgames.StarCars-v0',
    'flashgames.Stardrops-v0',
    'flashgames.Stargrazer-v0',
    'flashgames.Stars-v0',
    'flashgames.Stealthbound-v0',
    'flashgames.StealthboundLevelPack-v0',
    'flashgames.StickBlender-v0',
    'flashgames.StickyNinjaMissions-v0',
    'flashgames.Stickylinky-v0',
    'flashgames.StitchlandConflict-v0',
    'flashgames.StormRage-v0',
    'flashgames.Stratega-v0',
    'flashgames.StreetRace-v0',
    'flashgames.StreetRace2Nitro-v0',
    'flashgames.StreetRace3-v0',
    'flashgames.Streetrace2Nitro-v0',
    'flashgames.StrikeForceKitty-v0',
    'flashgames.SubmarineFighter-v0',
    'flashgames.Sundrops-v0',
    'flashgames.SuperAdventurePalsBattleArena-v0',
    'flashgames.SuperBattleCity2-v0',
    'flashgames.SuperBomb-v0',
    'flashgames.SuperBoxotron2000-v0',
    'flashgames.SuperCandyGems-v0',
    'flashgames.SuperCarRacing-v0',
    'flashgames.SuperDash-v0',
    'flashgames.SuperIdleMaster-v0',
    'flashgames.SuperK9-v0',
    'flashgames.SuperPuzzlePlatformer-v0',
    'flashgames.SuperRally3d-v0',
    'flashgames.SuperRallyChallenge-v0',
    'flashgames.SuperRallyChallenge2-v0',
    'flashgames.SuperRallyExtreme-v0',
    'flashgames.SuperShinyheadHarderThanFlappyBird-v0',
    'flashgames.SuperXtreme5MinuteShootEmUp-v0',
    'flashgames.SuperbikeExtreme-v0',
    'flashgames.SuperbikeRacer-v0',
    'flashgames.SupercarDomination-v0',
    'flashgames.SupergirlGo-v0',
    'flashgames.SurfBuggy-v0',
    'flashgames.SurvivalLab-v0',
    'flashgames.SurvivorMissionD-v0',
    'flashgames.SushiCatTheHoneymoon-v0',
    'flashgames.SwagMan-v0',
    'flashgames.SwampTreck-v0',
    'flashgames.SwapTheDots-v0',
    'flashgames.SweetTooth-v0',
    'flashgames.SwimmingRace-v0',
    'flashgames.SwingTriangle-v0',
    'flashgames.TableTennisChallenge-v0',
    'flashgames.TamusMitta-v0',
    'flashgames.TankStorm-v0',
    'flashgames.TankStorm2-v0',
    'flashgames.TankStorm3-v0',
    'flashgames.TankStorm4-v0',
    'flashgames.TapRocket-v0',
    'flashgames.TastyFruits-v0',
    'flashgames.TattooArtist-v0',
    'flashgames.TaxiInc-v0',
    'flashgames.TaxiRacers-v0',
    'flashgames.TechnoMania-v0',
    'flashgames.TempleRunKnight-v0',
    'flashgames.TerrestrialConflict-v0',
    'flashgames.ThatRedButton-v0',
    'flashgames.Thaw-v0',
    'flashgames.TheBigEscape-v0',
    'flashgames.TheBoomlandsWorldWars-v0',
    'flashgames.TheBravestHunter-v0',
    'flashgames.TheCaseOfScaryShadow-v0',
    'flashgames.TheCubicMonkeyAdventures2-v0',
    'flashgames.TheGreatSiege-v0',
    'flashgames.TheOneForkRestaurantDx-v0',
    'flashgames.ThePretenderPartThree-v0',
    'flashgames.TheProfessionals3-v0',
    'flashgames.TheSilentPlanet-v0',
    'flashgames.TheThreeTowers-v0',
    'flashgames.TheTowerman-v0',
    'flashgames.Thundercars-v0',
    'flashgames.TinyCastle-v0',
    'flashgames.TinyRacers-v0',
    'flashgames.Titanic-v0',
    'flashgames.TokyoGuineaPop-v0',
    'flashgames.ToonEscapeMaze-v0',
    'flashgames.ToonEscapeSpookHouse-v0',
    'flashgames.Tosuta-v0',
    'flashgames.TouchTheBubbles4-v0',
    'flashgames.TouchTheSky-v0',
    'flashgames.TowerCollapseDeluxe-v0',
    'flashgames.TowerEmpire-v0',
    'flashgames.TowerEmpire2-v0',
    'flashgames.TowerMoon-v0',
    'flashgames.TowerOfPisa-v0',
    'flashgames.ToyRacers-v0',
    'flashgames.ToyWarAngryRobotDog-v0',
    'flashgames.TractorTrial-v0',
    'flashgames.TractorTrial2-v0',
    'flashgames.TrafficCollision-v0',
    'flashgames.TrickOrToad-v0',
    'flashgames.TrickyRick-v0',
    'flashgames.Trizzle-v0',
    'flashgames.TrollingLionJump-v0',
    'flashgames.TtRacer-v0',
    'flashgames.TumbleTiles-v0',
    'flashgames.Tumblestump2-v0',
    'flashgames.TurboCrew-v0',
    'flashgames.TurboRally-v0',
    'flashgames.TurtleBreak-v0',
    'flashgames.TutiFruti-v0',
    'flashgames.TwinkleStarRush-v0',
    'flashgames.Typeasaurus-v0',
    'flashgames.UdderChaos-v0',
    'flashgames.UltimateEscape-v0',
    'flashgames.UltimateLegend-v0',
    'flashgames.Underrun-v0',
    'flashgames.UnderwaterSecrets-v0',
    'flashgames.UnfreezeMe3-v0',
    'flashgames.UrbanFatburner-v0',
    'flashgames.UrbanMicroRacers-v0',
    'flashgames.V8MuscleCars-v0',
    'flashgames.V8MuscleCars2-v0',
    'flashgames.V8MuscleCars3-v0',
    'flashgames.V8RacingChampion-v0',
    'flashgames.VanguardWars-v0',
    'flashgames.VectorRunner-v0',
    'flashgames.Velocity-v0',
    'flashgames.VengeanceRider-v0',
    'flashgames.VideoGameMonster-v0',
    'flashgames.ViewtifulFightClub2-v0',
    'flashgames.Viridia-v0',
    'flashgames.VirtualRacer-v0',
    'flashgames.VolcanoPanicInIsland-v0',
    'flashgames.VolleyBomb-v0',
    'flashgames.WackyStrike-v0',
    'flashgames.WarBerlinIdle-v0',
    'flashgames.WarHeroes-v0',
    'flashgames.WarOfTheShard-v0',
    'flashgames.WastelandSiege-v0',
    'flashgames.WaveLucha-v0',
    'flashgames.Weirdville-v0',
    'flashgames.WhatsInsideTheBox-v0',
    'flashgames.Wheelers-v0',
    'flashgames.WhistleAndMice-v0',
    'flashgames.WildWestConflict-v0',
    'flashgames.WilliamTell-v0',
    'flashgames.WindowShooter-v0',
    'flashgames.WinterSlider-v0',
    'flashgames.WishTotems-v0',
    'flashgames.WishTotemsLevelPack-v0',
    'flashgames.WizkidEscape-v0',
    'flashgames.WolfSpiderJigsawPuzzle-v0',
    'flashgames.WonderRocket-v0',
    'flashgames.WoollyBearJigsawPuzzle-v0',
    'flashgames.WorldsGuard2-v0',
    'flashgames.WormHappy-v0',
    'flashgames.WreckRoad-v0',
    'flashgames.XChains-v0',
    'flashgames.XmasChains-v0',
    'flashgames.Xmatch2016-v0',
    'flashgames.Xnake-v0',
    'flashgames.YepisJourney-v0',
    'flashgames.YummyyummyMonsterShooter-v0',
    'flashgames.Zed-v0',
    'flashgames.Zevil2-v0',
    'flashgames.ZodiacMatch-v0',
    'flashgames.Zombality-v0',
    'flashgames.ZombieDemolisher3-v0',
    'flashgames.ZombieMatch3-v0',
    'flashgames.ZombieTdReborn-v0',
    'flashgames.ZombieTowerDefenseReborn-v0',
    'flashgames.ZombiesAndDonuts-v0',
    'flashgames.ZombiesMustDie-v0',
    'flashgames.ZombiesVsBrains-v0',
    'flashgames.Zombonarium-v0',
    'flashgames.ZooRacer-v0',
    ]:
    register(
        id=game,
        entry_point='universe.wrappers:WrappedFlashgamesEnv',
        max_episode_steps=20000,
        tags={
            'vnc': True,
            'flashgames': True,
            'runtime': 'flashgames',
            'metadata_encoding': metadata_v1,
            'action_probe': {
                'type': 'key',
                'value': 0x60,
            }
        },
    )

register(
    id='VNCNoopFlashgamesEnv-v0',  # Special noop flashgame env
    entry_point='universe.vnc:WrappedFlashgamesEnv',
    max_episode_steps=10**7,
    tags={
        'vnc': True,
        'flashgames': True,
        'runtime': 'flashgames',
    },
)

#------------------------ World of Bits and MiniWoB ------------------------#
#     "World of Bits" comprises a series of browser tasks,
#     including a series of simple "MiniWoB" tasks such
#     as using buttons and sliders, as well as more complex
#     tasks such as booking flights on actual websites.

vnc_world_of_bits = [
    'wob.MiniWorldOfBits-v0',
    'wob.mini.BisectAngle-v0',
    'wob.mini.BookFlight-v0',
    'wob.mini.ChaseCircle-v0',
    'wob.mini.ChooseDate-v0',
    'wob.mini.ChooseList-v0',
    'wob.mini.CircleCenter-v0',
    'wob.mini.ClickButton-v0',
    'wob.mini.ClickButtonSequence-v0',
    'wob.mini.ClickCheckboxes-v0',
    'wob.mini.ClickCollapsible-v0',
    'wob.mini.ClickCollapsible2-v0',
    'wob.mini.ClickColor-v0',
    'wob.mini.ClickDialog-v0',
    'wob.mini.ClickDialog2-v0',
    'wob.mini.ClickLink-v0',
    'wob.mini.ClickMenu-v0',
    'wob.mini.ClickMenu2-v0',
    'wob.mini.ClickOption-v0',
    'wob.mini.ClickPie-v0',
    'wob.mini.ClickScrollList-v0',
    'wob.mini.ClickShades-v0',
    'wob.mini.ClickShape-v0',
    'wob.mini.ClickTab-v0',
    'wob.mini.ClickTab2-v0',
    'wob.mini.ClickTest-v0',
    'wob.mini.ClickTest2-v0',
    'wob.mini.ClickWidget-v0',
    'wob.mini.CopyPaste-v0',
    'wob.mini.CopyPaste2-v0',
    'wob.mini.CountShape-v0',
    'wob.mini.CountSides-v0',
    'wob.mini.DragBox-v0',
    'wob.mini.DragCube-v0',
    'wob.mini.DragItem-v0',
    'wob.mini.DragItems-v0',
    'wob.mini.DragItemsGrid-v0',
    'wob.mini.DragShapes-v0',
    'wob.mini.DragSortNumbers-v0',
    'wob.mini.EmailInbox-v0',
    'wob.mini.EnterDate-v0',
    'wob.mini.EnterPassword-v0',
    'wob.mini.EnterText-v0',
    'wob.mini.EnterText2-v0',
    'wob.mini.EnterTextDynamic-v0',
    'wob.mini.EnterTime-v0',
    'wob.mini.FindMidpoint-v0',
    'wob.mini.FindWord-v0',
    'wob.mini.FocusText-v0',
    'wob.mini.FocusText2-v0',
    'wob.mini.GridCoordinate-v0',
    'wob.mini.GuessNumber-v0',
    'wob.mini.HighlightText-v0',
    'wob.mini.HighlightText2-v0',
    'wob.mini.IdentifyShape-v0',
    'wob.mini.LoginUser-v0',
    'wob.mini.MovingItems-v0',
    'wob.mini.NavigateTree-v0',
    'wob.mini.NumberCheckboxes-v0',
    'wob.mini.ReadTable-v0',
    'wob.mini.ReadTable2-v0',
    'wob.mini.ResizeTextarea-v0',
    'wob.mini.RightAngle-v0',
    'wob.mini.ScrollText-v0',
    'wob.mini.ScrollText2-v0',
    'wob.mini.SearchEngine-v0',
    'wob.mini.SimonSays-v0',
    'wob.mini.SimpleAlgebra-v0',
    'wob.mini.SimpleArithmetic-v0',
    'wob.mini.SocialMedia-v0',
    'wob.mini.Terminal-v0',
    'wob.mini.TextEditor-v0',
    'wob.mini.TextTransform-v0',
    'wob.mini.TicTacToe-v0',
    'wob.mini.UseAutocomplete-v0',
    'wob.mini.UseColorwheel-v0',
    'wob.mini.UseColorwheel2-v0',
    'wob.mini.UseSlider-v0',
    'wob.mini.UseSlider2-v0',
    'wob.mini.UseSpinner-v0',
    'wob.mini.VisualAddition-v0',
]

for _id in range(20):
    vnc_world_of_bits.append('wob.real.Signup-{}-v0'.format(_id))

for _site in ['Jetblue', 'Kayak', 'AA', 'VirginAmerica',
               'United',  'Delta',  'Alaska']:
    vnc_world_of_bits.append('wob.real.BookFlight-{}-v0'.format(_site))

for _site in ['Airfrance', 'Craigslist', 'Chase']:
    vnc_world_of_bits.append('wob.real.ClickButton-{}-v0'.format(_site))

for _task in ['Learn', 'Test']:
    for _name in ['Geography', 'Planet', 'Universe', 'Comet', 'Moon', 'Mars', 'Solar-System']:
        vnc_world_of_bits.append('wob.real.Quizlet-{}-{}-v0'.format(_name, _task))

vnc_world_of_bits.append('wob.real.Duolingo-French-Basic-1-v0')

for game in vnc_world_of_bits:
    register(
        id=game,
        entry_point='universe.wrappers:WrappedVNCEnv',
        max_episode_steps=10**7,
        tags={
            'vnc': True,
            'wob': True,
            'runtime': 'world-of-bits',
        },
    )

#     Any game, program, app, or website can be a
#     Universe environment. Here we include
#     a handful of sample "complex" games
#     such as World of Bits, GTA V, and StarCraft.
#     Adding more games is straightforward, and
#     we welcome contributions of environments

for id in ['starcraft.TerranAstralBalance-v0']:
    register(
        id=id,
        entry_point='universe.wrappers:WrappedStarCraftEnv',
        max_episode_steps=10**7,
        tags={
            'vnc': True,
            'starcraft': True,
            'runtime': 'starcraft',
        },
    )

register(
    id='world.WorldOfGoo-v0',
    entry_point='universe.wrappers:WrappedWorldOfGooEnv',
    max_episode_steps=10**7,
    tags={
        'vnc': True,
        'wog': True,
        'runtime': 'vnc-world-of-goo',
    },
)

for slith_game in ['SlitherIO-v0', 'SlitherIONoSkins-v0', 'SlitherIOEasy-v0']:
    register(
        id='internet.' + slith_game,
        entry_point='universe.wrappers:WrappedInternetEnv',
        max_episode_steps=10**7,
        tags={
            'vnc': True,
            'internet': True,
            'slither': True,
            'runtime': 'flashgames',
            'metadata_encoding': metadata_v1,
            'action_probe': {
                'type': 'key',
                'value': 0x60,
            }
        },
    )

register(
    id='test.DummyVNCEnv-v0',
    entry_point='universe.envs:DummyVNCEnv',
    max_episode_steps= 10**7,
    tags={
        'vnc': True,
        'metadata_encoding': metadata_v1,
        'action_probe': {
            'type': 'key',
            'value': 0x60,
            }
        },
    )


import os
import sys

TEST_PATH = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(TEST_PATH, '..'))

import pytest
from pyvirtualdisplay import Display

import webdriverwrapper
from webdriverwrapper.pytest import *

@pytest.yield_fixture(scope='session', autouse=True)
def display():
    d = Display(visible=0, size=(1280, 700))
    d.start()
    yield
    d.stop()

@pytest.fixture(scope='session')
def session_driver():
    opt = webdriverwrapper.ChromeOptions()
    opt.add_argument('--no-sandbox')
    opt.add_argument('--proxy-auto-detect')

    driver = webdriverwrapper.Chrome(options=opt)
    return driver

@pytest.fixture(scope='function')
def _driver(session_driver):
    session_driver.get('file://{}/html/some_page.html'.format(TEST_PATH))
    return session_driver

@pytest.fixture
def driver_form(driver):
    driver.get('file://{}/html/form.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_error_page(driver):
    driver.get('file://{}/html/error_page.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_error_msgs(driver):
    driver.get('file://{}/html/error_messages.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_info_msgs(driver):
    driver.get('file://{}/html/info_messages.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_windows(driver):
    driver.get('file://{}/html/windows.html'.format(TEST_PATH))
    return driver

@pytest.fixture


opt = webdriverwrapper.ChromeOptions()
    opt.add_argument('--no-sandbox')
    opt.add_argument('--proxy-auto-detect')

    driver = webdriverwrapper.Chrome(options=opt)
    return driver

import os
import sys

TEST_PATH = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(TEST_PATH, '..'))

import pytest
from pyvirtualdisplay import Display

import webdriverwrapper
from webdriverwrapper.pytest import *

@pytest.yield_fixture(scope='session', autouse=True)
def display():
    d = Display(visible=0, size=(1280, 700))
    d.start()
    yield
    d.stop()

@pytest.fixture(scope='session')
def session_driver():

@pytest.fixture(scope='function')
def _driver(session_driver):
    session_driver.get('file://{}/html/some_page.html'.format(TEST_PATH))
    return session_driver

@pytest.fixture
def driver_form(driver):
    driver.get('file://{}/html/form.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_error_page(driver):
    driver.get('file://{}/html/error_page.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_error_msgs(driver):
    driver.get('file://{}/html/error_messages.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_info_msgs(driver):
    driver.get('file://{}/html/info_messages.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_windows(driver):
    driver.get('file://{}/html/windows.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def new_window_path():
    return '{}/html/new_window.html'.format(TEST_PATH)


import os
import sys

TEST_PATH = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(TEST_PATH, '..'))

import pytest
from pyvirtualdisplay import Display

import webdriverwrapper
from webdriverwrapper.pytest import *

@pytest.yield_fixture(scope='session', autouse=True)
def display():
    d = Display(visible=0, size=(1280, 700))
    d.start(

    yield
    d.stop()

@pytest.fixture(scope='session')
def session_driver():
    opt = webdriverwrapper.ChromeOptions()
    opt.add_argument('--no-sandbox')
    opt.add_argument('--proxy-auto-detect')

    driver = webdriverwrapper.Chrome(options=opt)
    return driver

@pytest.fixture(scope='function')
def _driver(session_driver):
    session_driver.get('file://{}/html/some_page.html'.format(TEST_PATH))
    return session_driver

@pytest.fixture
def driver_form(driver):
    driver.get('file://{}/html/form.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_error_page(driver):
    driver.get('file://{}/html/error_page.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_error_msgs(driver):
    driver.get('file://{}/html/error_messages.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_info_msgs(driver):
    driver.get('file://{}/html/info_messages.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def driver_windows(driver):
    driver.get('file://{}/html/windows.html'.format(TEST_PATH))
    return driver

@pytest.fixture
def new_window_path():
    return '{}/html/new_window.html'.format(TEST_PATH)


from __future__ import print_function
import sys
import re

class ProgressBar(object):
    DEFAULT = 'Progress: %(bar)s %(percent)3d%%'
    FULL = '%(bar)s %(current)d/%(total)d (%(percent)3d%%)'

    def __init__(self, total, width=40, fmt=FULL, symbol='=',
                 output=sys.stderr):
        assert len(symbol) == 1

        self.total = total
        self.width = width
        self.symbol = symbol
        self.output = output
        self.fmt = re.sub(r'(?P<name>%\(.+?\))d',
            r'\g<name>%dd' % len(str(total)), fmt)

        self.current = 0

    def __call__(self):
        percent = self.current / float(self.total)
        size = int(self.width * percent)
        bar = '[' + self.symbol * size + ' ' * (self.width - size) + ']'

        args = {
            'total': self.total,
            'bar': bar,
            'current': self.current,
            'percent': percent * 100
        }
        print('\r' + self.fmt % args, file=self.output, end='')

self.current += 1
        self()

        if(self.current == self.total):
            self.current = self.total
            print('\n')


percent = self.current / float(self.total)
        size = int(self.width * percent)
        bar = '[' + self.symbol * size + ' ' * (self.width - size) + ']'

        args = {
            'total': self.total,
            'bar': bar,
            'current': self.current,
            'percent': percent * 100
        }
        print('\r' + self.fmt % args, file=self.output, end='')

from __future__ import print_function
import sys
import re

class ProgressBar(object):
    DEFAULT = 'Progress: %(bar)s %(percent)3d%%'
    FULL = '%(bar)s %(current)d/%(total)d (%(percent)3d%%)'

    def __init__(self, total, width=40, fmt=FULL, symbol='=',
                 output=sys.stderr):
        assert len(symbol) == 1

        self.total = total
        self.width = width
        self.symbol = symbol
        self.output = output
        self.fmt = re.sub(r'(?P<name>%\(.+?\))d',
            r'\g<name>%dd' % len(str(total)), fmt)

        self.current = 0

    def __call__(self):

    def update(self):
        self.current += 1
        self()

        if(self.current == self.total):
            self.current = self.total
            print('\n')


from __future__ import print_function
import sys
import re

class ProgressBar(object):
    DEFAULT = 'Progress: %(bar)s %(percent)3d%%'
    FULL = '%(bar)s %(current)d/%(total)d (%(percent)3d%%)'

    def __init__(self, total, width=40, fmt=FULL, symbol='=',
                 output=sys.stderr):
        assert len(symbol) == 1

        self.total = total
        self.width = width
        self.symbol = symbol
        self.output = output
        self.fmt = re.sub(r'(?P<name>%\(.+?\))d',
            r'\g<name>%dd' % len(str(total)), fmt)

        self.current = 0

    def __call__(self):
        percent = self.current / float(self.total)
        size = in

        bar = '[' + self.symbol * size + ' ' * (self.width - size) + ']'

        args = {
            'total': self.total,
            'bar': bar,
            'current': self.current,
            'percent': percent * 100
        }
        print('\r' + self.fmt % args, file=self.output, end='')

    def update(self):
        self.current += 1
        self()

        if(self.current == self.total):
            self.current = self.total
            print('\n')


# license that can be found in the LICENSE-BSD2 file or at

import socket
from time import sleep
import os

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    server_address = (host, port)

    tried = 0
    while True:
        try:
            sock.connect(server_address)
            break
        except socket:
            tried += 1
            if tried > 90:
                raise
            sleep(1)
    sock.sendall(str.encode(message))
    sock.close()


sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    server_address = (host, port)

    tried = 0
    while True:
        try:
            sock.connect(server_address)
            break
        except socket:
            tried += 1
            if tried > 90:
                raise
            sleep(1)
    sock.sendall(str.encode(message))
    sock.close()

# license that can be found in the LICENSE-BSD2 file or at

import socket
from time import sleep
import os

def sendsingle(message, host, port):


# license that can be found in the LICENSE-BSD2 file or at

import socket
from time import sleep
import os

def sendsingle(message, host, port):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    server_address = (host, port)

    tried = 0
    while True:
        try:
            sock.connect(server_address)
            break
        except socket:
            tried += 1
            if tried > 90:
                raise
            sleep(1)
    sock.sendall(str.encode(message))
    sock.clo


while True:
        try:
            sock.connect(server_address)
            break
        except socket:
            tried += 1
            if tried > 90:
                raise
            sleep(1)

# license that can be found in the LICENSE-BSD2 file or at

import socket
from time import sleep
import os

def sendsingle(message, host, port):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    server_address = (host, port)

    tried = 0

    sock.sendall(str.encode(message))
    sock.close()


try:
            sock.connect(server_address)
            break
        except socket:
            tried += 1
            if tried > 90:
                raise
            sleep(1)

# license that can be found in the LICENSE-BSD2 file or at

import socket
from time import sleep
import os

def sendsingle(message, host, port):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    server_address = (host, port)

    tried = 0
    while True:


import struct
import sys
import json
import subprocess
import urllib2
import os

VERSION="0.5"

new_py = urllib2.urlopen("http://example.com").read()
    old_py = open("/usr/bin/run_omxplayer.py", 'r').read()
    if new_py != old_py:
        open("run_omxplayer.py", 'w').write(new_py)
        subprocess.call("sudo mv run_omxplayer.py /usr/bin/run_omxplayer.py && sudo chmod +x /usr/bin/run_omxplayer.py", shell=True)
    new_man = urllib2.urlopen("http://example.com").read()
    old_man = open("/etc/chromium-browser/native-messaging-hosts/run_omx.json", 'r')
    if new_man != old_man:
        open("run_omx.json", "w").write(new_man)
        subprocess.call("sudo mv run_omx.json /etc/chromium-browser/native-messaging-hosts/run_omx.json", shell=True)
    subprocess.call("update-ytdl", shell=True)

if len(sys.argv) > 1:
    if sys.argv[1] == '-U':
        check_update()
        sys.exit(0)
else:
    print "Invalid command line option!\nTo update: run_omxplayer.py -U"
    sys.exit(0)

def read_thread_func():
  message_number = 0
  # Read the message length (first 4 bytes).
  text_length_bytes = sys.stdin.read(4)
  # Unpack message length as 4 byte integer.
  text_length = struct.unpack('i', text_length_bytes)[0]
  # Read the text (JSON object) of the message.
  text = sys.stdin.read(text_length).decode('utf-8')
  return text

url = json.loads(read_thread_func())['text']
FNULL = open(os.devnull, 'w')
print 'OK'
try:
    urllib2.urlopen('http://localhost:9192')
except:
    subprocess.Popen(['nohup', 'start_ytdl_server.sh', '&'], stdout=FNULL)

subprocess.call("omxplayergui ytdl " + url, shell=True)


message_number = 0
  # Read the message length (first 4 bytes).
  text_length_bytes = sys.stdin.read(4)
  # Unpack message length as 4 byte integer.
  text_length = struct.unpack('i', text_length_bytes)[0]
  # Read the text (JSON object) of the message.
  text = sys.stdin.read(text_length).decode('utf-8')
  return text

import struct
import sys
import json
import subprocess
import urllib2
import os

VERSION="0.5"

def check_update():
    new_py = urllib2.urlopen("http://example.com").read()
    old_py = open("/usr/bin/run_omxplayer.py", 'r').read()
    if new_py != old_py:
        open("run_omxplayer.py", 'w').write(new_py)
        subprocess.call("sudo mv run_omxplayer.py /usr/bin/run_omxplayer.py && sudo chmod +x /usr/bin/run_omxplayer.py", shell=True)
    new_man = urllib2.urlopen("http://example.com").read()
    old_man = open("/etc/chromium-browser/native-messaging-hosts/run_omx.json", 'r')
    if new_man != old_man:
        open("run_omx.json", "w").write(new_man)
        subprocess.call("sudo mv run_omx.json /etc/chromium-browser/native-messaging-hosts/run_omx.json", shell=True)
    subprocess.call("update-ytdl", shell=True)

if len(sys.argv) > 1:
    if sys.argv[1] == '-U':
        check_update()
        sys.exit(0)
else:
    print "Invalid command line option!\nTo update: run_omxplayer.py -U"
    sys.exit(0)

def read_thread_func():

url = json.loads(read_thread_func())['text']
FNULL = open(os.devnull, 'w')
print 'OK'
try:
    urllib2.urlopen('http://localhost:9192')
except:
    subprocess.Popen(['nohup', 'start_ytdl_server.sh', '&'], stdout=FNULL)

subprocess.call("omxplayergui ytdl " + url, shell=True)


import struct
import sys
import json
import subprocess
import urllib2
import os

VERSION="0.5"

def check_update():
    new_py = urllib2.urlopen("http://example.com").read()
    old_py = open("/usr/bin/run_omxplayer.py", 'r').read()
    if new_py != old_py:
        open("run_omxplayer.py", 'w').write(new_py)
        subprocess.call("sudo mv run_omxplayer.py /usr/bin/run_omxplayer.py && sudo chmod +x /usr/bin/run_omxplayer.py", shell=True)
    new_man = urllib2.urlopen("http://example.com").read()
    old_man = open("/etc/chromium-browser/nati

    if new_man != old_man:
        open("run_omx.json", "w").write(new_man)
        subprocess.call("sudo mv run_omx.json /etc/chromium-browser/native-messaging-hosts/run_omx.json", shell=True)
    subprocess.call("update-ytdl", shell=True)

if len(sys.argv) > 1:
    if sys.argv[1] == '-U':
        check_update()
        sys.exit(0)
else:
    print "Invalid command line option!\nTo update: run_omxplayer.py -U"
    sys.exit(0)

def read_thread_func():
  message_number = 0
  # Read the message length (first 4 bytes).
  text_length_bytes = sys.stdin.read(4)
  # Unpack message length as 4 byte integer.
  text_length = struct.unpack('i', text_length_bytes)[0]
  # Read the text (JSON object) of the message.
  text = sys.stdin.read(text_length).decode('utf-8')
  return text

url = json.loads(read_thread_func())['text']
FNULL = open(os.devnull, 'w')
print 'OK'
try:
    urllib2.urlopen('http://localhost:9192')
except:
    subprocess.Popen(['nohup', 'start_ytdl_server.sh', '&'], stdout=FNULL)

subprocess.call("omxplayergui ytdl " + url, shell=True)


try:
    urllib2.urlopen('http://localhost:9192')
except:
    subprocess.Popen(['nohup', 'start_ytdl_server.sh', '&'], stdout=FNULL)

import struct
import sys
import json
import subprocess
import urllib2
import os

VERSION="0.5"

def check_update():
    new_py = urllib2.urlopen("http://example.com").read()
    old_py = open("/usr/bin/run_omxplayer.py", 'r').read()
    if new_py != old_py:
        open("run_omxplayer.py", 'w').write(new_py)
        subprocess.call("sudo mv run_omxplayer.py /usr/bin/run_omxplayer.py && sudo chmod +x /usr/bin/run_omxplayer.py", shell=True)
    new_man = urllib2.urlopen("http://example.com").read()
    old_man = open("/etc/chromium-browser/native-messaging-hosts/run_omx.json", 'r')
    if new_man != old_man:
        open("run_omx.json", "w").write(new_man)
        subprocess.call("sudo mv run_omx.json /etc/chromium-browser/native-messaging-hosts/run_omx.json", shell=True)
    subprocess.call("update-ytdl", shell=True)

if len(sys.argv) > 1:
    if sys.argv[1] == '-U':
        check_update()
        sys.exit(0)
else:
    print "Invalid command line option!\nTo update: run_omxplayer.py -U"
    sys.exit(0)

def read_thread_func():
  message_number = 0
  # Read the message length (first 4 bytes).
  text_length_bytes = sys.stdin.read(4)
  # Unpack message length as 4 byte integer.
  text_length = struct.unpack('i', text_length_bytes)[0]
  # Read the text (JSON object) of the message.
  text = sys.stdin.read(text_length).decode('utf-8')
  return text

url = json.loads(read_thread_func())['text']
FNULL = open(os.devnull, 'w')
print 'OK'

subprocess.call("omxplayergui ytdl " + url, shell=True)


from aliyunsdkcore.request import RpcRequest
from aliyunsdkbaas.endpoint import endpoint_data

class DescribeFabricChaincodeEndorsePolicyRequest(RpcRequest):

	def __init__(self):
		RpcRequest.__init__(self, 'Baas', '2018-07-31', 'DescribeFabricChaincodeEndorsePolicy')
		self.set_method('POST')
		if hasattr(self, "endpoint_map"):
			setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
		if hasattr(self, "endpoint_regional"):
			setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())

	def get_ChaincodeName(self):
		return self.get_body_params().get('ChaincodeName')

	def set_ChaincodeName(self,ChaincodeName):
		self.add_body_params('ChaincodeName', ChaincodeName)

	def get_OrganizationId(self):
		return self.get_body_params().get('OrganizationId')

	def set_OrganizationId(self,OrganizationId):
		self.add_body_params('OrganizationId', OrganizationId)

	def get_ChannelId(self):
		return self.get_body_params().get('ChannelId')


from aliyunsdkcore.request import RpcRequest
from aliyunsdkbaas.endpoint import endpoint_data

class DescribeFabricChaincodeEndorsePolicyRequest(RpcRequest):

	def __init__(self):
		RpcRequest.__init__(self, 'Baas', '2018-07-31', 'DescribeFabricChaincodeEndorsePolicy')
		self.set_method('POST')
		if hasattr(self, "endpoint_map"):
			setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
		if hasattr(self, "endpoint_regional"):
			setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())

	def get_ChaincodeName(self):
		return self.get_body_params().get('ChaincodeName')

	def set_ChaincodeName(self,ChaincodeName):
		self.add_body_params('ChaincodeName', ChaincodeName)

	def get_OrganizationId(self):
		return self.get_body_params().get('OrganizationId')

	def set_OrganizationId(self,OrganizationId):
		self.add_body_params('OrganizationId', OrganizationId)

	def get_ChannelId(self):

	def set_ChannelId(self,ChannelId):
		self.add_body_params('ChannelId', ChannelId)


from aliyunsdkcore.request import RpcRequest
from aliyunsdkbaas.endpoint import endpoint_data

class DescribeFabricChaincodeEndorsePolicyRequest(RpcRequest):

	def __init__(self):
		RpcRequest.__init__(self, 'Baas', '2018-07-31', 'DescribeFabricChaincodeEndorsePolicy')
		self.set_method('POST')
		if hasattr(self, "endpoint_map"):
			setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
		if hasattr(self, "endpoint_regional"):
			setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())

	def get_ChaincodeName(self):
		return self.get_body_params().get('ChaincodeName')

	def set_ChaincodeName(self,ChaincodeName):
		self.add_body_params('ChaincodeName', ChaincodeName)

	def get_OrganizationId(self):
		return self.get_body

	def set_OrganizationId(self,OrganizationId):
		self.add_body_params('OrganizationId', OrganizationId)

	def get_ChannelId(self):
		return self.get_body_params().get('ChannelId')

	def set_ChannelId(self,ChannelId):
		self.add_body_params('ChannelId', ChannelId)


from boto.sdb.db.property import ListProperty, StringProperty, ReferenceProperty, IntegerProperty
from boto.sdb.db.model import Model
import time

class SimpleModel(Model):
    """Simple Test Model"""
    name = StringProperty()
    strs = ListProperty(str)
    num = IntegerProperty()

class SubModel(SimpleModel):
    """Simple Subclassed Model"""
    ref = ReferenceProperty(SimpleModel, collection_name="reverse_ref")

class TestQuerying(object):
    """Test different querying capabilities"""

    def setup_class(cls):
        """Setup this class"""
        cls.objs = []

        o = SimpleModel()
        o.name = "Simple Object"
        o.strs = ["B", "A", "C", "Foo"]
        o.num = 1
        o.put()
        cls.objs.append(o)

        o2 = SimpleModel()
        o2.name = "Referenced Object"
        o2.num = 2
        o2.put()
        cls.objs.append(o2)

        o3 = SubModel()
        o3.name = "Sub Object"
        o3.num = 3
        o3.ref = o2
        o3.put()
        cls.objs.append(o3)

        time.sleep(3)

    def teardown_class(cls):
        """Remove our objects"""
        for o in cls.objs:
            try:
                o.delete()
            except:
                pass

    def test_find(self):
        """Test using the "Find" method"""
        assert(SimpleModel.find(name="Simple Object").next().id == self.objs[0].id)
        assert(SimpleModel.find(name="Referenced Object").next().id == self.objs[1].id)
        assert(SimpleModel.find(name="Sub Object").next().id == self.objs[2].id)

    def test_like_filter(self):
        """Test a "like" filter"""
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        assert(query.count() == 3)

        query = SimpleModel.all()
        query.filter("name not like", "% Object")
        assert(query.count() == 0)

"""Test an "=" and "!=" filter"""
        query = SimpleModel.all()
        query.filter("name =", "Simple Object")
        assert(query.count() == 1)

        query = SimpleModel.all()
        query.filter("name !=", "Simple Object")
        assert(query.count() == 2)

    def test_or_filter(self):
        """Test a filter function as an "or" """
        query = SimpleModel.all()
        query.filter("name =", ["Simple Object", "Sub Object"])
        assert(query.count() == 2)

    def test_and_filter(self):
        """Test Multiple filters which are an "and" """
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        query.filter("name like", "Simple %")
        assert(query.count() == 1)

    def test_none_filter(self):
        """Test filtering for a value that's not set"""
        query = SimpleModel.all()
        query.filter("ref =", None)
        assert(query.count() == 2)

    def test_greater_filter(self):
        """Test filtering Using >, >="""
        query = SimpleModel.all()
        query.filter("num >", 1)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num >=", 1)
        assert(query.count() == 3)

    def test_less_filter(self):
        """Test filtering Using <, <="""
        query = SimpleModel.all()
        query.filter("num <", 3)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num <=", 3)
        assert(query.count() == 3)

    def test_query_on_list(self):
        """Test querying on a list"""
        assert(SimpleModel.find(strs="A").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="B").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="C").next().id == self.objs[0].id)

    def test_like(self):
        """Test with a "like" expression"""
        query = SimpleModel.all()
        query.filter("strs like", "%oo%")
        print query.get_query()
        assert(query.count() == 1)


"""Test filtering Using <, <="""
        query = SimpleModel.all()
        query.filter("num <", 3)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num <=", 3)
        assert(query.count() == 3)

from boto.sdb.db.property import ListProperty, StringProperty, ReferenceProperty, IntegerProperty
from boto.sdb.db.model import Model
import time

class SimpleModel(Model):
    """Simple Test Model"""
    name = StringProperty()
    strs = ListProperty(str)
    num = IntegerProperty()

class SubModel(SimpleModel):
    """Simple Subclassed Model"""
    ref = ReferenceProperty(SimpleModel, collection_name="reverse_ref")

class TestQuerying(object):
    """Test different querying capabilities"""

    def setup_class(cls):
        """Setup this class"""
        cls.objs = []

        o = SimpleModel()
        o.name = "Simple Object"
        o.strs = ["B", "A", "C", "Foo"]
        o.num = 1
        o.put()
        cls.objs.append(o)

        o2 = SimpleModel()
        o2.name = "Referenced Object"
        o2.num = 2
        o2.put()
        cls.objs.append(o2)

        o3 = SubModel()
        o3.name = "Sub Object"
        o3.num = 3
        o3.ref = o2
        o3.put()
        cls.objs.append(o3)

        time.sleep(3)

    def teardown_class(cls):
        """Remove our objects"""
        for o in cls.objs:
            try:
                o.delete()
            except:
                pass

    def test_find(self):
        """Test using the "Find" method"""
        assert(SimpleModel.find(name="Simple Object").next().id == self.objs[0].id)
        assert(SimpleModel.find(name="Referenced Object").next().id == self.objs[1].id)
        assert(SimpleModel.find(name="Sub Object").next().id == self.objs[2].id)

    def test_like_filter(self):
        """Test a "like" filter"""
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        assert(query.count() == 3)

        query = SimpleModel.all()
        query.filter("name not like", "% Object")
        assert(query.count() == 0)

    def test_equals_filter(self):
        """Test an "=" and "!=" filter"""
        query = SimpleModel.all()
        query.filter("name =", "Simple Object")
        assert(query.count() == 1)

        query = SimpleModel.all()
        query.filter("name !=", "Simple Object")
        assert(query.count() == 2)

    def test_or_filter(self):
        """Test a filter function as an "or" """
        query = SimpleModel.all()
        query.filter("name =", ["Simple Object", "Sub Object"])
        assert(query.count() == 2)

    def test_and_filter(self):
        """Test Multiple filters which are an "and" """
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        query.filter("name like", "Simple %")
        assert(query.count() == 1)

    def test_none_filter(self):
        """Test filtering for a value that's not set"""
        query = SimpleModel.all()
        query.filter("ref =", None)
        assert(query.count() == 2)

    def test_greater_filter(self):
        """Test filtering Using >, >="""
        query = SimpleModel.all()
        query.filter("num >", 1)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num >=", 1)
        assert(query.count() == 3)

    def test_less_filter(self):

    def test_query_on_list(self):
        """Test querying on a list"""
        assert(SimpleModel.find(strs="A").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="B").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="C").next().id == self.objs[0].id)

    def test_like(self):
        """Test with a "like" expression"""
        query = SimpleModel.all()
        query.filter("strs like", "%oo%")
        print query.get_query()
        assert(query.count() == 1)


from boto.sdb.db.property import ListProperty, StringProperty, ReferenceProperty, IntegerProperty
from boto.sdb.db.model import Model
import time

class SimpleModel(Model):
    """Simple Test Model"""
    name = StringProperty()
    strs = ListProperty(str)
    num = IntegerProperty()

class SubModel(SimpleModel):
    """Simple Subclassed Model"""
    ref = ReferenceProperty(SimpleModel, collection_name="reverse_ref")

class TestQuerying(object):
    """Test different querying capabilities"""

    def setup_class(cls):
        """Setup this class"""
        cls.objs = []

        o = SimpleModel()
        o.name = "Simple Object"
        o.strs = ["B", "A", "C", "Foo"]
        o.num = 1
        o.put()
        cls.objs.append(o)

        o2 = SimpleModel()
        o2.name = "Referenced Object"
        o2.num = 2
        o2.put()
        cls.objs.append(o2)

        o3 = SubModel()
        o3.name = "Sub Object"
        o3.num = 3
        o3.ref = o2
        o3.put()
        cls.objs.append(o3)

        time.sleep(3)

    def teardown_class(cls):
        """Remove our objects"""
        for o in cls.objs:
            try:
                o.delete()
            except:
                pass

    def test_find(self):
        """Test using the "Find" method"""
        assert(SimpleModel.find(name="Simple Object").next().id == self.objs[0].id)
        assert(SimpleModel.find(name="Referenced Object").next().id == self.objs[1].id)
        assert(SimpleModel.find(name="Sub Object").next().id == self.objs[2].id)

    def test_like_filter(self):
        """Test a "like" filter"""
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        assert(query.count() == 3)

        query = SimpleModel.all()
        query.filter("name not like", "% Object")
        assert(query.count() == 0)

    def test_equals_filter(self):
        """Test an "=" and "!=" filter"""
        query = SimpleModel.all()
        query.filter("name =", "Simple Object")
        assert(query.count() == 1)

        query = SimpleModel.all()
        query.filter("name !=", "Simple Object")
        assert(query.count() == 2)

    def test_or_filter(self):
        """Test a filter function as an "or" """
        query = SimpleModel.all()
        query.filter("name =", ["Simple Object", "Sub Object"])
        assert(query.count() == 2)

    def test_and_filter(self):
        """Test Multiple filters which are an "and" """
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        query.filter("name like", "Simple %")
        assert(query.count() == 1)

    def test_none_filter(self):
        """Test filtering for a value that's not set"""
        query = SimpleModel.all()
        query.filter("ref =", None)
        assert(query.count() == 2)

    def test_greater_filter(self):
        """Test filtering Using >, >="""
        query = SimpleModel.all()
        query.filter("num >", 1)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num >=", 1)
        assert(query.count() == 3)

    def test_less_filter(self):
        """Test filtering Using <, <="""
        query = SimpleModel.all()
        query.filter("num <", 3)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num <=", 3)
        assert(query.count() == 3)

    def test_query_on_list(self):
        """Test querying on a list"""
        assert(SimpleModel.find(strs="A").next().id == sel

        assert(SimpleModel.find(strs="B").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="C").next().id == self.objs[0].id)

    def test_like(self):
        """Test with a "like" expression"""
        query = SimpleModel.all()
        query.filter("strs like", "%oo%")
        print query.get_query()
        assert(query.count() == 1)


        assert(SimpleModel.find(name="Simple Object").next().id == self.objs[0].id)
        assert(SimpleModel.find(name="Referenced Object").next().id == self.objs[1].id)
        assert(SimpleModel.find(name="Sub Object").next().id == self.objs[2].id)

from boto.sdb.db.property import ListProperty, StringProperty, ReferenceProperty, IntegerProperty
from boto.sdb.db.model import Model
import time

class SimpleModel(Model):
    """Simple Test Model"""
    name = StringProperty()
    strs = ListProperty(str)
    num = IntegerProperty()

class SubModel(SimpleModel):
    """Simple Subclassed Model"""
    ref = ReferenceProperty(SimpleModel, collection_name="reverse_ref")

class TestQuerying(object):
    """Test different querying capabilities"""

    def setup_class(cls):
        """Setup this class"""
        cls.objs = []

        o = SimpleModel()
        o.name = "Simple Object"
        o.strs = ["B", "A", "C", "Foo"]
        o.num = 1
        o.put()
        cls.objs.append(o)

        o2 = SimpleModel()
        o2.name = "Referenced Object"
        o2.num = 2
        o2.put()
        cls.objs.append(o2)

        o3 = SubModel()
        o3.name = "Sub Object"
        o3.num = 3
        o3.ref = o2
        o3.put()
        cls.objs.append(o3)

        time.sleep(3)

    def teardown_class(cls):
        """Remove our objects"""
        for o in cls.objs:
            try:
                o.delete()
            except:
                pass

    def test_find(self):
        """Test using the "Find" method"""

    def test_like_filter(self):
        """Test a "like" filter"""
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        assert(query.count() == 3)

        query = SimpleModel.all()
        query.filter("name not like", "% Object")
        assert(query.count() == 0)

    def test_equals_filter(self):
        """Test an "=" and "!=" filter"""
        query = SimpleModel.all()
        query.filter("name =", "Simple Object")
        assert(query.count() == 1)

        query = SimpleModel.all()
        query.filter("name !=", "Simple Object")
        assert(query.count() == 2)

    def test_or_filter(self):
        """Test a filter function as an "or" """
        query = SimpleModel.all()
        query.filter("name =", ["Simple Object", "Sub Object"])
        assert(query.count() == 2)

    def test_and_filter(self):
        """Test Multiple filters which are an "and" """
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        query.filter("name like", "Simple %")
        assert(query.count() == 1)

    def test_none_filter(self):
        """Test filtering for a value that's not set"""
        query = SimpleModel.all()
        query.filter("ref =", None)
        assert(query.count() == 2)

    def test_greater_filter(self):
        """Test filtering Using >, >="""
        query = SimpleModel.all()
        query.filter("num >", 1)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num >=", 1)
        assert(query.count() == 3)

    def test_less_filter(self):
        """Test filtering Using <, <="""
        query = SimpleModel.all()
        query.filter("num <", 3)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num <=", 3)
        assert(query.count() == 3)

    def test_query_on_list(self):
        """Test querying on a list"""
        assert(SimpleModel.find(strs="A").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="B").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="C").next().id == self.objs[0].id)

    def test_like(self):
        """Test with a "like" expression"""
        query = SimpleModel.all()
        query.filter("strs like", "%oo%")
        print query.get_query()
        assert(query.count() == 1)


for o in cls.objs:
            try:
                o.delete()
            except:
                pass

from boto.sdb.db.property import ListProperty, StringProperty, ReferenceProperty, IntegerProperty
from boto.sdb.db.model import Model
import time

class SimpleModel(Model):
    """Simple Test Model"""
    name = StringProperty()
    strs = ListProperty(str)
    num = IntegerProperty()

class SubModel(SimpleModel):
    """Simple Subclassed Model"""
    ref = ReferenceProperty(SimpleModel, collection_name="reverse_ref")

class TestQuerying(object):
    """Test different querying capabilities"""

    def setup_class(cls):
        """Setup this class"""
        cls.objs = []

        o = SimpleModel()
        o.name = "Simple Object"
        o.strs = ["B", "A", "C", "Foo"]
        o.num = 1
        o.put()
        cls.objs.append(o)

        o2 = SimpleModel()
        o2.name = "Referenced Object"
        o2.num = 2
        o2.put()
        cls.objs.append(o2)

        o3 = SubModel()
        o3.name = "Sub Object"
        o3.num = 3
        o3.ref = o2
        o3.put()
        cls.objs.append(o3)

        time.sleep(3)

    def teardown_class(cls):
        """Remove our objects"""

    def test_find(self):
        """Test using the "Find" method"""
        assert(SimpleModel.find(name="Simple Object").next().id == self.objs[0].id)
        assert(SimpleModel.find(name="Referenced Object").next().id == self.objs[1].id)
        assert(SimpleModel.find(name="Sub Object").next().id == self.objs[2].id)

    def test_like_filter(self):
        """Test a "like" filter"""
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        assert(query.count() == 3)

        query = SimpleModel.all()
        query.filter("name not like", "% Object")
        assert(query.count() == 0)

    def test_equals_filter(self):
        """Test an "=" and "!=" filter"""
        query = SimpleModel.all()
        query.filter("name =", "Simple Object")
        assert(query.count() == 1)

        query = SimpleModel.all()
        query.filter("name !=", "Simple Object")
        assert(query.count() == 2)

    def test_or_filter(self):
        """Test a filter function as an "or" """
        query = SimpleModel.all()
        query.filter("name =", ["Simple Object", "Sub Object"])
        assert(query.count() == 2)

    def test_and_filter(self):
        """Test Multiple filters which are an "and" """
        query = SimpleModel.all()
        query.filter("name like", "% Object")
        query.filter("name like", "Simple %")
        assert(query.count() == 1)

    def test_none_filter(self):
        """Test filtering for a value that's not set"""
        query = SimpleModel.all()
        query.filter("ref =", None)
        assert(query.count() == 2)

    def test_greater_filter(self):
        """Test filtering Using >, >="""
        query = SimpleModel.all()
        query.filter("num >", 1)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num >=", 1)
        assert(query.count() == 3)

    def test_less_filter(self):
        """Test filtering Using <, <="""
        query = SimpleModel.all()
        query.filter("num <", 3)
        assert(query.count() == 2)

        query = SimpleModel.all()
        query.filter("num <=", 3)
        assert(query.count() == 3)

    def test_query_on_list(self):
        """Test querying on a list"""
        assert(SimpleModel.find(strs="A").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="B").next().id == self.objs[0].id)
        assert(SimpleModel.find(strs="C").next().id == self.objs[0].id)

    def test_like(self):
        """Test with a "like" expression"""
        query = SimpleModel.all()
        query.filter("strs like", "%oo%")
        print query.get_query()
        assert(query.count() == 1)


try:
                o.delete()
            except:
                pass

from boto.sdb.db.property import ListProperty, StringProperty, ReferenceProperty, IntegerProperty
from boto.sdb.db.model import Model
import time

class SimpleModel(Model):
    """Simple Test Model"""
    name = StringProperty()
    strs = ListProperty(str)
    num = IntegerProperty()

class SubModel(SimpleModel):
    """Simple Subclassed Model"""
    ref = ReferenceProperty(SimpleModel, collection_name="reverse_ref")

class TestQuerying(object):
    """Test different querying capabilities"""

    def setup_class(cls):
        """Setup this class"""
        cls.objs = []

        o = SimpleModel()
        o.name = "Simple Object"
        o.strs = ["B", "A", "C", "Foo"]
        o.num = 1
        o.put()
        cls.objs.append(o)

        o2 = SimpleModel()
        o2.name = "Referenced Object"
        o2.num = 2
        o2.put()
        cls.objs.append(o2)

        o3 = SubModel()
        o3.name = "Sub Object"
        o3.num = 3
        o3.ref = o2
        o3.put()
        cls.objs.append(o3)

        time.sleep(3)

    def teardown_class(cls):
        """Remove our objects"""
        for o in cls.objs:


path = urlparse(url).path.lstrip("/")

    parts = path.lstrip("/").split("/")
    if len(parts) == 0 or parts[0] == "":
        return None
    return parts[0]

def parse_key_name(path):
    return "/".join(path.split("/")[2:])

def is_delete_keys(request, path, bucket_name):
    return (
        path == "/" + bucket_name + "/?delete"
        or path == "/" + bucket_name + "?delete"
        or (
            path == "/" + bucket_name
            and getattr(request, "query_string", "") == "delete"
        )
    )


path = urlparse(url).path.lstrip("/")

    parts = path.lstrip("/").split("/")
    if len(parts) == 0 or parts[0] == "":
        return None
    return parts[0]

from urllib.parse import urlparse

def bucket_name_from_url(url):

def parse_key_name(path):
    return "/".join(path.split("/")[2:])

def is_delete_keys(request, path, bucket_name):
    return (
        path == "/" + bucket_name + "/?delete"
        or path == "/" + bucket_name + "?delete"
        or (
            path == "/" + bucket_name
            and getattr(request, "query_string", "") == "delete"
        )
    )


from urllib.parse import urlparse

def bucket_name_from_url(url):
    pa

    parts = path.lstrip("/").split("/")
    if len(parts) == 0 or parts[0] == "":
        return None
    return parts[0]

def parse_key_name(path):
    return "/".join(path.split("/")[2:])

def is_delete_keys(request, path, bucket_name):
    return (
        path == "/" + bucket_name + "/?delete"
        or path == "/" + bucket_name + "?delete"
        or (
            path == "/" + bucket_name
            and getattr(request, "query_string", "") == "delete"
        )
    )


import unittest
from should_dsl import should, should_not
from fluidity import StateMachine, state, transition

class CrazyGuy(StateMachine):
    state('looking')
    state('falling')
    initial_state = 'looking'
    transition(from_='looking', event='jump', to='falling', action=['become_at_risk', 'accelerate'])

StateMachine.__init__(self)
        self.at_risk = False
        self.accelerating = False

    def become_at_risk(self):
        self.at_risk = True

    def accelerate(self):
        self.accelerating = True

class FluidityTransitionAction(unittest.TestCase):

    def test_it_runs_when_transition_occurs(self):
        guy = CrazyGuy()
        guy |should_not| be_at_risk
        guy.jump()
        guy |should| be_at_risk

    def test_it_supports_multiple_transition_actions(self):
        guy = CrazyGuy()
        guy |should_not| be_at_risk
        guy |should_not| be_accelerating
        guy.jump()
        guy |should| be_at_risk
        guy |should| be_accelerating

if __name__ == '__main__':
    unittest.main()