def _cmp_by_local_origin(path1, path2):
    # If both paths are from same sources we cannot compare them here.
    if path1.source == path2.source:
        return None

    # Here we consider prefix from NC as locally originating static route.
    # Hence it is preferred.
    if path1.source is None:
        return path1

    if path2.source is None:
        return path2

    return None
Select locally originating path as best path.
dataset/ETHPy150Open osrg/ryu/ryu/services/protocols/bgp/processor.py/_cmp_by_local_origin