def remove_last_dir(url):
    """
    remove_last_dir() removes the lowest layer of directory in the url
    (e.g. /dir/folder --> /dir)

    url: the url to be processed
    returns: the processed url
    """
    return url[:url.rfind('/')]