code: def streaming_and_function_calling_format_tests(idx, chunk):
      extracted_chunk = ""
      finished = False
      print(f"idx: {idx}")
      print(f"chunk: {chunk}")
      decision = False
      if idx == 0:  # ensure role assistant is set
          decision = validate_first_function_call_chunk_structure(chunk)
          role = chunk["choices"][0]["delta"]["role"]
          assert role == "assistant"
      elif idx != 0:  # second chunk
          try:
              decision = validate_second_function_call_chunk_structure(
                  data=chunk
              )
          except:  # check if it's the last chunk (returns an empty delta {} )
              decision = validate_final_function_call_chunk_structure(
                  data=chunk
              )
              finished = True
      if "content" in chunk["choices"][0]["delta"]:
          extracted_chunk = chunk["choices"][0]["delta"]["content"]
      if decision == False:
          raise Exception("incorrect format")
      return extracted_chunk, finished
  
imports: import sys, os, asyncio
  import traceback
  import time, pytest
  from dotenv import load_dotenv
  import litellm
  from litellm import completion, acompletion, AuthenticationError, BadRequestError, RateLimitError, ModelResponse
label_desc: Use image node_id 32 for calling a global function with example usage: streaming_and_function_calling_format_tests(idx, chunk) and returns: extracted_chunk,  finished