<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_condition(self, conkey, val):
 """Set condition conkey to value val. Convert val to str if not None. conkey: str A valid condition key. val: str, int, float, None Can always be None. Can be number or string depending on conkey. """


        if not any([conkey.startswith(c) for c in _COND_PREFIXES]):
            raise KeyError(conkey)

        if val in NONES:
            self.conditions[conkey] = None
        else:
            self.conditions[conkey] = str(val)