def _get_folder(filepath):
    """
    Handles adding a / or \\ to the end of a directory path.

    Args:
        filepath: string

    Returns:
        string
    """

    if '/' in filepath:
        folder = filepath if filepath[-1] == '/' else filepath + '/'
    elif '\\' in filepath:
        folder = filepath if filepath[-1] == '\\' else filepath + '\\'
    else:
        folder = filepath + '/'
    return folder