code: def __init__(self, config: BertConfig, add_pooling_layer=True):
      super().__init__(config)
      self.pad_vocab_size_multiple = getattr(
          config, "pad_vocab_size_multiple", 1
      )
      if config.vocab_size % self.pad_vocab_size_multiple != 0:
          config.vocab_size += self.pad_vocab_size_multiple - (
              config.vocab_size % self.pad_vocab_size_multiple
          )
      self.fused_dropout_add_ln = getattr(
          config, "fused_dropout_add_ln", False
      )
      if self.fused_dropout_add_ln and layer_norm_fn is None:
          raise ImportError("Triton is not installed")
      assert config.hidden_act in [
          "gelu",
          "gelu_new",
          "gelu_fast",
          "gelu_pytorch_tanh",
      ]
  
      self.embeddings = BertEmbeddings(
          config.hidden_size,
          config.vocab_size,
          config.max_position_embeddings,
          config.type_vocab_size,
          padding_idx=config.pad_token_id,
      )
      self.emb_drop = nn.Dropout(config.hidden_dropout_prob)
      self.emb_ln = nn.LayerNorm(
          config.hidden_size, eps=config.layer_norm_eps
      )
      self.encoder = BertEncoder(config)
      self.pooler = BertPooler(config) if add_pooling_layer else None
  
      self.apply(
          partial(
              _init_weights, initializer_range=config.initializer_range
          )
      )
  
imports: import logging
  import re
  from collections import OrderedDict
  from collections.abc import Sequence
  from functools import partial
  from typing import Any, Mapping
  import torch
  import torch.nn
  import torch.nn.functional
  from einops import rearrange
  from transformers import BertConfig, PretrainedConfig
  from transformers.models.bert.modeling_bert import BaseModelOutputWithPoolingAndCrossAttentions, BertForPreTrainingOutput
  from flash_attn.bert_padding import index_first_axis, index_first_axis_residual, pad_input, unpad_input
  from flash_attn.modules.block import Block
  from flash_attn.modules.embedding import BertEmbeddings
  from flash_attn.modules.mha import MHA
  from flash_attn.modules.mlp import FusedMLP, Mlp
  from flash_attn.utils.pretrained import state_dict_from_pretrained
label_desc: Use image node_id 1 to create a new BertModel object from inherited base classes: BertPreTrainedModel with example: obj = BertModel(config, add_pooling_layer)