def METHOD_NAME(pathname):
    max_len = 42
    if len(pathname) < max_len:
        return pathname
    elems = pathname.split('/')
    #if len(elems[-1]) < max_len:
    #    return elems[-1]
    snip = '...'
    return pathname[0:int((max_len-len(snip))/2)]  + snip + elems[-1][-int((max_len-len(snip))/2):]