code: def extract_block(filename, lang):
      """extract_block"""
      source = ""
      with open(filename) as f:
          hit = -1
          for line in f:
              if hit < 0:
                  if line.strip().startswith("```" + lang):
                      hit = line.find("```" + lang)
              else:
                  if (
                      line.strip().startswith("```")
                      and line.find("```") == hit
                  ):
                      break
                  source += line
      return source
  
imports: import os
  import sys
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: extract_block(filename, lang) and returns: source