def _check_valid_condition(self, get_params):
try:<EOL><INDENT>variable = get_params(self.variable)<EOL><DEDENT>except:  <EOL><INDENT>variable = None<EOL><DEDENT>value = self.value<EOL>if variable is None:<EOL><INDENT>return not self.default<EOL><DEDENT>if isinstance(variable, bool):<EOL><INDENT>value = bool(self.value)<EOL><DEDENT>elif isinstance(variable, Number):<EOL><INDENT>try:<EOL><INDENT>value = int(self.value)<EOL><DEDENT>except:  <EOL><INDENT>try:<EOL><INDENT>value = float(self.value)<EOL><DEDENT>except:  <EOL><INDENT>return not self.default<EOL><DEDENT><DEDENT><DEDENT>if self.condition == "<STR_LIT:=>":<EOL><INDENT>return (variable == value) == self.default<EOL><DEDENT>elif self.condition == "<STR_LIT:>>":<EOL><INDENT>return (variable > value) == self.default<EOL><DEDENT>elif self.condition == "<STR_LIT:<>":<EOL><INDENT>return (variable < value) == self.default<EOL><DEDENT>
Check if the condition has been met.
We need to make sure that we are of the correct type.