<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _validate_filenames(self):
 """Checks if passed filenames are valid. Specifically, f_* parameter should not be passed in conjunction with dirname. """

        if not self.dirname:
            return

        def _is_truthy_and_not_str(f):
            return f and not isinstance(f, str)

        if (
                _is_truthy_and_not_str(self.f_optimizer) or
                _is_truthy_and_not_str(self.f_params) or
                _is_truthy_and_not_str(self.f_history) or
                _is_truthy_and_not_str(self.f_pickle)
        ):
            raise SkorchException(
                'dirname can only be used when f_* are strings')