code: def peak_memory_mb():
      """
      Get peak memory usage for this process, as measured by
      max-resident-set size:
  
      https://unix.stackexchange.com/questions/30940/getrusage-system-call-what-is-maximum-resident-set-size
  
      Only works on OSX and Linux, returns 0.0 otherwise.
      """
      if resource is None or sys.platform not in ("linux", "darwin"):
          return 0.0
  
      # TODO(joelgrus): For whatever, our pinned version 0.521 of mypy does not like
      # next line, but later versions (e.g. 0.530) are fine with it. Once we get that
      # figured out, remove the type: ignore.
      peak = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss  # type: ignore
  
      if sys.platform == "darwin":
          # On OSX the result is in bytes.
          return peak / 1000000
  
      else:
          # On Linux the result is in kilobytes.
          return peak / 1000
  
imports: from __future__ import division
  from __future__ import absolute_import
  import importlib
  import logging
  import pkgutil
  import random
  import subprocess
  import sys
  import os
  import torch
  import numpy
  import spacy
  from spacy.cli.download import download
  from spacy.language import Language
  import allennlp
  from allennlp.common.checks import log_pytorch_version_info
  from allennlp.common.params import Params
  from allennlp.common.tqdm import Tqdm
  from allennlp.common.tee_logger import TeeLogger
label_desc: Use image node_id 11 for calling a global function with example usage: peak_memory_mb() and returns: int, unknown, unknown