# Path: core/constants.py
# SESSION_CLOSE_REASON_API_CALL = "Session closed via API stop_session call"
# GET_ENDPOINT_ATTEMPTS = 10
# ENDPOINT_REBUILD_ATTEMPTS = 3
# CREATE_SESSION_REQUEST_TIMEOUT = 60
# REQUEST_TIMEOUT = 60
# MAKE_REQUEST_ATTEMPTS_AMOUNT = 3
# REQUEST_SLEEP_BASE_TIME = 5
# REQUEST_TIMEOUT_ON_CREATE_ENDPOINT = 60
# ANY = u'ANY'
# GET_SESSION_SLEEP_TIME = 2
# ER_SLEEP_TIME = 2
# EP_SLEEP_TIME = 2


import logging
from core import constants
# -*- coding: utf-8 -*-


log = logging.getLogger(__name__)


class IMatcher(object):
    def get_matched_platforms(self, platform):
        """
        Return all matched platforms available
        :param platform: str
        :return: list of str
        """
        raise NotImplemented

    def match(self, dc):
        """
        Main matcher method, must return True/False
        :param dc: desired capabilities dictionary
        :return: boolean
        """
        raise NotImplemented


class PlatformsBasedMatcher(IMatcher):
    def __init__(self, platforms):
        self.platforms = platforms

    def get_matched_platforms(self, platform):

# Path: core/constants.py
# SESSION_CLOSE_REASON_API_CALL = "Session closed via API stop_session call"
# GET_ENDPOINT_ATTEMPTS = 10
# ENDPOINT_REBUILD_ATTEMPTS = 3
# CREATE_SESSION_REQUEST_TIMEOUT = 60
# REQUEST_TIMEOUT = 60
# MAKE_REQUEST_ATTEMPTS_AMOUNT = 3
# REQUEST_SLEEP_BASE_TIME = 5
# REQUEST_TIMEOUT_ON_CREATE_ENDPOINT = 60
# ANY = u'ANY'
# GET_SESSION_SLEEP_TIME = 2
# ER_SLEEP_TIME = 2
# EP_SLEEP_TIME = 2


# Path: vmmaster/matcher.py
import logging
from core import constants

# -*- coding: utf-8 -*-


log = logging.getLogger(__name__)


class IMatcher(object):
    def get_matched_platforms(self, platform):
        """
        Return all matched platforms available
        :param platform: str
        :return: list of str
        """
        raise NotImplemented

    def match(self, dc):
        """
        Main matcher method, must return True/False
        :param dc: desired capabilities dictionary
        :return: boolean
        """
        raise NotImplemented


class PlatformsBasedMatcher(IMatcher):
    def __init__(self, platforms):
        self.platforms = platforms

    def get_matched_platforms(self, platform):

        if platform == constants.ANY: