Based on the GitHub repository as follow:
you need to refer the below file
https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/core/generic_scheduler.go
below code snippet retrieves all the available nodes and a node is identified that is best suitable for running a specific pod
nodes, err := nodeLister.List()
if err != nil {
return result, err
}
if len(nodes) == 0 {
return result, ErrNoNodesAvailable
}
if err := g.snapshot(); err != nil {
return result, err
}
trace.Step("Computing predicates")
startPredicateEvalTime := time.Now()
filteredNodes, failedPredicateMap, err := g.findNodesThatFit(pod, nodes)