def is_dir(value):
    """
    This function checks whether given path as argument exists.
    :param str value: Assumed directory path
    :rtype: str
    :return: If given value is valid, retuning given value.
    """
    value = os.path.expanduser(value)
    value = os.path.expandvars(value)
    value = os.path.abspath(value)

    if os.path.exists(value):
        if os.path.isdir(value):
            if os.access(value, os.R_OK):
                return value

            else:
                err_message = ('{path}: Permission denied.'
                               ''.format(path=value)
                               )
                raise validate.VdtValueError(err_message)
        else:
            err_message = ('{value} is file.'
                           ''.format(value=value)
                           )
            raise validate.VdtTypeError(err_message)
    else:
        err_message = ('{path}: No such file or directory.'
                       ''.format(path=value)
                       )
        raise validate.VdtValueError(err_message)
def is_dir ( value ) : value = os . path . expanduser ( value ) value = os . path . expandvars ( value ) value = os . path . abspath ( value ) if os . path . exists ( value ) : if os . path . isdir ( value ) : if os . access ( value , os . R_OK ) : return value else : err_message = ( '{path}: Permission denied.' '' . format ( path = value ) ) raise validate . VdtValueError ( err_message ) else : err_message = ( '{value} is file.' '' . format ( value = value ) ) raise validate . VdtTypeError ( err_message ) else : err_message = ( '{path}: No such file or directory.' '' . format ( path = value ) ) raise validate . VdtValueError ( err_message )
This function checks whether given path as argument exists.
    :param str value: Assumed directory path
    :rtype: str
    :return: If given value is valid, retuning given value.