<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __is_valid_value_for_arg(self, arg, value, check_extension=True):
 """Check if value is allowed for arg Some commands only allow a limited set of values. The method always returns True for methods that do not provide such a set. :param arg: the argument's name :param value: the value to check :param check_extension: check if value requires an extension :return: True on succes, False otherwise """

        if "values" not in arg and "extension_values" not in arg:
            return True
        if "values" in arg and value.lower() in arg["values"]:
            return True
        if "extension_values" in arg:
            extension = arg["extension_values"].get(value.lower())
            if extension:
                condition = (
                    check_extension and
                    extension not in RequireCommand.loaded_extensions
                )
                if condition:
                    raise ExtensionNotLoaded(extension)
                return True
        return False