Consistency and Adaptation of Gaussian Process Regression, Bayesian Stochastic Block Model and Tail Index