code: def pk(ref, hyp, k=None, boundary="1"):
      """
      Compute the Pk metric for a pair of segmentations A segmentation
      is any sequence over a vocabulary of two items (e.g. "0", "1"),
      where the specified boundary value is used to mark the edge of a
      segmentation.
  
      >>> '%.2f' % pk('0100'*100, '1'*400, 2)
      '0.50'
      >>> '%.2f' % pk('0100'*100, '0'*400, 2)
      '0.50'
      >>> '%.2f' % pk('0100'*100, '0100'*100, 2)
      '0.00'
  
      :param ref: the reference segmentation
      :type ref: str or list
      :param hyp: the segmentation to evaluate
      :type hyp: str or list
      :param k: window size, if None, set to half of the average reference segment length
      :type boundary: str or int or bool
      :param boundary: boundary value
      :type boundary: str or int or bool
      :rtype: float
      """
  
      if k is None:
          k = int(round(len(ref) / (ref.count(boundary) * 2.0)))
  
      err = 0
      for i in range(len(ref) - k + 1):
          r = ref[i : i + k].count(boundary) > 0
          h = hyp[i : i + k].count(boundary) > 0
          if r != h:
              err += 1
      return err / (len(ref) - k + 1.0)
  
label_desc: Use image node_id 5 for calling a global function with example usage: pk(ref, hyp, k, boundary) and returns: unknown