code: def master(pretrained: bool = False, **kwargs: Any) -> MASTER:
      """MASTER as described in paper: <https://arxiv.org/pdf/1910.02562.pdf>`_.
  
      >>> import torch
      >>> from doctr.models import master
      >>> model = master(pretrained=False)
      >>> input_tensor = torch.rand((1, 3, 32, 128))
      >>> out = model(input_tensor)
  
      Args:
      ----
          pretrained (bool): If True, returns a model pre-trained on our text recognition dataset
          **kwargs: keywoard arguments passed to the MASTER architecture
  
      Returns:
      -------
          text recognition architecture
      """
      return _master(
          "master",
          pretrained,
          magc_resnet31,
          "10",
          ignore_keys=[
              "decoder.embed.weight",
              "linear.weight",
              "linear.bias",
          ],
          **kwargs,
      )
  
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from torch.nn import functional
  from torchvision.models._utils import IntermediateLayerGetter
  from doctr.datasets import VOCABS
  from doctr.models.classification import magc_resnet31
  from doctr.models.modules.transformer import Decoder, PositionalEncoding
  from ...utils.pytorch import _bf16_to_float32, load_pretrained_params
  from .base import _MASTER, _MASTERPostProcessor
label_desc: Use image node_id 2 for calling a global function with example usage: master(pretrained) and returns: _master