code: def scoreatpercentile(a, per):
      values = np.sort(a, axis=0)
  
      idx = int(per / 1.0 * (values.shape[0] - 1))
  
      if idx == values.shape[0] - 1:
          retval = values[-1]
  
      else:
          qlow = idx / (values.shape[0] - 1)
          qhig = (idx + 1) / (values.shape[0] - 1)
          vlow = values[idx]
          vhig = values[idx + 1]
          retval = vlow + (vhig - vlow) * (per - qlow) / (qhig - qlow)
  
      return retval
  
file_path: pandas/pandas/tests/window/test_rolling_quantile.py
imports: from functools import partial
  import numpy
  import pytest
  from pandas import DataFrame, Series, concat, isna, notna
  import pandas._testing
  from pandas.tseries import offsets
label_desc: Use image node_id 1 for calling a global function with example usage: scoreatpercentile(a, per) and returns: retval