(path, *args)
Helper to validate passed path directory and append any subsequent
        filename arguments.

        Arguments:
            path (str): Initial filesystem path.  Should expand to a valid
                        directory.
            *args (list, optional): Any filename or path suffices to append to path
                                    for returning.

            Returns:
                (list, str): path prepended list of files from args, or path alone if
                         no args specified.

        Raises:
            ValueError: if path is not a valid directory on this filesystem.
Helper to validate passed path directory and append any subsequent
        filename arguments.
Helper to validate passed path directory and append any subsequent filename arguments .
def _valid_path_append(path, *args):
        """
        Helper to validate passed path directory and append any subsequent
        filename arguments.

        Arguments:
            path (str): Initial filesystem path.  Should expand to a valid
                        directory.
            *args (list, optional): Any filename or path suffices to append to path
                                    for returning.

            Returns:
                (list, str): path prepended list of files from args, or path alone if
                         no args specified.

        Raises:
            ValueError: if path is not a valid directory on this filesystem.
        """
        full_path = os.path.expanduser(path)
        res = []
        if not os.path.exists(full_path):
            os.makedirs(full_path)
        if not os.path.isdir(full_path):
            raise ValueError("path: {0} is not a valid directory".format(path))
        for suffix_path in args:
            res.append(os.path.join(full_path, suffix_path))
        if len(res) == 0:
            return path
        elif len(res) == 1:
            return res[0]
        else:
            return res
def _valid_path_append ( path , * args ) : full_path = os . path . expanduser ( path ) res = [ ] if not os . path . exists ( full_path ) : os . makedirs ( full_path ) if not os . path . isdir ( full_path ) : raise ValueError ( "path: {0} is not a valid directory" . format ( path ) ) for suffix_path in args : res . append ( os . path . join ( full_path , suffix_path ) ) if len ( res ) == 0 : return path elif len ( res ) == 1 : return res [ 0 ] else : return res