def METHOD_NAME(refs):
    refs = [{'basename':basename(ref['docname']), 'docname': ref['docname']} for ref in refs]
    sorted_refs = []
    for key in sorted([basename(ref['basename']) for ref in refs]):
        for i, value in enumerate(refs):
            if key == value['basename']:
                sorted_refs.append(refs.pop(i))
    return sorted_refs