code: def resnet31(pretrained: bool = False, **kwargs: Any) -> ResNet:
      """Resnet31 architecture with rectangular pooling windows as described in
      `"Show, Attend and Read:A Simple and Strong Baseline for Irregular Text Recognition",
      <https://arxiv.org/pdf/1811.00751.pdf>`_. Downsizing: (H, W) --> (H/8, W/4)
  
      >>> import torch
      >>> from doctr.models import resnet31
      >>> model = resnet31(pretrained=False)
      >>> input_tensor = torch.rand((1, 3, 512, 512), dtype=torch.float32)
      >>> out = model(input_tensor)
  
      Args:
      ----
          pretrained: boolean, True if model is pretrained
          **kwargs: keyword arguments of the ResNet architecture
  
      Returns:
      -------
          A resnet31 model
      """
      return _resnet(
          "resnet31",
          pretrained,
          [1, 2, 5, 3],
          [256, 256, 512, 512],
          [1, 1, 1, 1],
          [True] * 4,
          [(2, 2), (2, 1), None, None],
          origin_stem=False,
          stem_channels=128,
          ignore_keys=["13.weight", "13.bias"],
          **kwargs,
      )
  
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple
  from torch import nn
  from torchvision.models.resnet import BasicBlock
  from torchvision.models.resnet import ResNet
  from torchvision.models.resnet import resnet18
  from torchvision.models.resnet import resnet34
  from torchvision.models.resnet import resnet50
  from doctr.datasets import VOCABS
  from ...utils import conv_sequence_pt, load_pretrained_params
label_desc: Use image node_id 5 for calling a global function with example usage: resnet31(pretrained) and returns: _resnet