def guess_name_from_uri(uri):
    """
    Given a URI like host.tld/bla/fah/jah or host.tld/bla/fah/jah/, returns jah.
    """
    split_uri = uri.split('/')
    if split_uri[-1]:
        return split_uri[-1]    # no trailing slash
    else:
        return split_uri[-2]    # has trailing slash