:param browser:
    :param args:
    :rtype: RemoteDriver
    :return:

def get_driver(browser='firefox', args=None):
    """
    :param browser:
    :param args:
    :rtype: RemoteDriver
    :return:
    """
    if browser not in BROWSER_MAPPING.keys():
        raise RuntimeError("unknown browser %s. allowed: %s" % (browser, ", ".join(BROWSER_MAPPING.keys())))
    driver_cls = BROWSER_MAPPING.get(browser)
    safe_args = {}
    if args is not None:
        expected_arguments = inspect.getargspec(driver_cls.__init__).args
        expected_arguments.remove("self")
        for arg in expected_arguments:
            if arg in args:
                safe_args[arg] = args[arg]
    return driver_cls(**safe_args)