code: def _validate_filenames(self):
          
          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')
docs: Checks if passed filenames are valid.
  
          Specifically, f_* parameter should not be passed in
          conjunction with dirname.