code: def get_result(response, ctxlen):
      """Process results from OpenAI API response.
  
      :param response: dict
          OpenAI API Response
      :param ctxlen: int
          Length of context (so we can slice them away and only keep the predictions)
      :return:
          continuation_logprobs: np.array
              Log probabilities of continuation tokens
          is_greedy: bool
              whether argmax matches given continuation exactly
      """
      is_greedy = True
      logprobs = response["logprobs"]["token_logprobs"]
      continuation_logprobs = sum(logprobs[ctxlen:])
  
      for i in range(ctxlen, len(response["logprobs"]["tokens"])):
          token = response["logprobs"]["tokens"][i]
          top_tokens = response["logprobs"]["top_logprobs"][i]
          top_token = max(
              top_tokens.keys(), key=lambda x: top_tokens[x]
          )
          if top_token != token:
              is_greedy = False
              break
  
      return continuation_logprobs, is_greedy
  
imports: import os
  import numpy
  import transformers
  from lm_eval.base import BaseLM
  from lm_eval import utils
  from tqdm import tqdm
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: get_result(response, ctxlen) and returns: continuation_logprobs,  is_greedy