code: def gpd_loglikelihood_scale_and_shape_factory(price_data):
      # minimize a function of two variables requires a list of params
      # we are expecting the lambda below to be called as follows:
      # parameters = [scale, shape]
      # the final outer negative is added because scipy only minimizes
      return lambda params: -gpd_loglikelihood_scale_and_shape(
          params[0], params[1], price_data
      )
  
imports: from __future__ import division
  import math
  import pandas
  import numpy
  from math import pow
  from scipy import stats, optimize
  from six import iteritems
  from sys import float_info
  from .utils import nanmean, nanstd, nanmin, up, down, roll, rolling_window
  from .periods import ANNUALIZATION_FACTORS, APPROX_BDAYS_PER_YEAR
  from .periods import DAILY, WEEKLY, MONTHLY, QUARTERLY, YEARLY
label_desc: Use image node_id 41 for calling a global function with example usage: gpd_loglikelihood_scale_and_shape_factory(price_data) and returns: function