def get_reference(node, identifiers):
    """Recurses through yaml node to find the target key."""
    if len(identifiers) == 1:
        return {identifiers[0]: node[identifiers[0]]}

    if not identifiers[0]:  # skip over any empties
        return get_reference(node, identifiers[1:])
    return get_reference(node[identifiers[0]], identifiers[1:])