code: def extract_memory_info(
      memory_pool: PoolInfo, memory_pressure: int
  ) -> MemoryRegion:
      "Create a MemoryRegion based on the info in the memory pool"
      size = int(memory_pool.size_hint_bytes - memory_pressure)
      read_bandwidth = int(memory_pool.read_bandwidth_bytes_per_cycle)
      write_bandwidth = int(memory_pool.write_bandwidth_bytes_per_cycle)
  
      for param in (size, read_bandwidth, write_bandwidth):
          assert (
              param != -1
          ), f"{param} needs to be specified for the cascader."
  
      name_to_burst_length = {
          target.kind.name: burst
          for target, burst in memory_pool.target_burst_bytes.items()
      }
  
      try:
          burst_length = int(name_to_burst_length["ethos-u"])
      except KeyError:
          burst_length = 1
  
      return MemoryRegion(
          name=memory_pool.pool_name,
          size=size,
          read_bandwidth=read_bandwidth,
          write_bandwidth=write_bandwidth,
          read_latency=int(memory_pool.read_latency_cycles),
          write_latency=int(memory_pool.write_latency_cycles),
          burst_length=burst_length,
      )
  
imports: from typing import Tuple, List, Dict, DefaultDict
  from collections import defaultdict
  import time
  import numpy
  import tvm
  from tvm import te
  from tvm import tir
  from tvm import PoolInfo
  from .cascader_options import CascaderOptions
  from .graph import CascaderGraph, Part, Tensor, TESubgraph
  from .parts import EthosuPart
  from .tensor_config import MemoryRegion
  from .proposal import Proposal
  from .proposal_generator import generate_proposals
  from .plan_generator import get_copy_cycles_hint
  from .graph import create_cascader_graph
  from .device_config import EthosuDeviceConfig
  from .logging import Logging
label_desc: Use image node_id 8 for calling a global function with example usage: extract_memory_info(memory_pool, memory_pressure) and returns: MemoryRegion