code: def _get_region(buffer_type, var=None, scratch_region_map=None):
      """A helper to obtain regions for buffer_types and buffer vars"""
      static_regions = {
          BufferType.constant: 0,
          BufferType.input: 3,
          BufferType.output: 4,
          BufferType.shram: int((1 << 8) | (3 << 0)),
      }
      if buffer_type in static_regions.keys():
          return static_regions[buffer_type]
      assert buffer_type == BufferType.scratch
      assert (
          var in scratch_region_map.keys()
      ), f"{var} is not analyzed for scratch regions"
      return scratch_region_map[var].region
  
imports: from typing import Dict, NamedTuple, Tuple, Union, List
  from enum import auto
  from enum import Enum
  import numpy
  import ethosu.vela.api
  import tvm
  from tvm.tir import stmt_functor
  from tvm.relay.backend.contrib.ethosu import util
  from tvm.relay.backend.contrib.ethosu import vela_api
  from tvm.relay.backend.contrib.ethosu.tir import spec
  from tvm.relay.backend.contrib.ethosu.tir import utils
label_desc: Use image node_id 3 for calling a global function with example usage: _get_region(buffer_type, var, scratch_region_map) and returns: scratch_region_map, static_regions