discovery: moved sampling functions inside discovery object
In this patch, we transform the sampling functions into
methods of the partialdiscovery class in the Python case.
This will provide multiple benefit. For example we can keep some cache from one
sampling to another. In addition this will help the Oxidation work as all graph
traversal related logic will be contained in a single object.