code: def _cpercentile(N, percent, key=lambda x: x):
      """Find the percentile   of a list of values.
  
      @parameter N - is a list of values. Note N MUST BE already sorted.
      @parameter percent - a float value from 0.0 to 1.0.
      @parameter key - optional key function to compute value from each element of N.
  
      @return - the percentile  of the values
      """
      N.sort()
      k = (len(N) - 1) * percent
      f = ivy.math.floor(k)
      c = ivy.math.ceil(k)
      if f == c:
          return key(N[int(k)])
      d0 = key(N[int(f)]) * (c - k)
      d1 = key(N[int(c)]) * (k - f)
      return d0 + d1
  
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, handle_numpy_out
label_desc: Use image node_id 1 for calling a global function with example usage: _cpercentile(N, percent, key) and returns: unknown, key