<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(self, arg=None):
 """Check that inputted path is valid - set validator accordingly"""

        if os.path.isdir(self.path):
            self.validator.object = None
        else:
            self.validator.object = ICONS['error']