<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def dir_param_valid(d):
    '''True if d is a string and it's an existing directory.'''
    r = True
    if not isinstance(d, str) :
        r = False
        raise TypeError
    if not os.path.isdir(d):
        r = False
        raise ValueError
    return r