class_docstr: # Parameters
  
  bias_direction : `BiasDirectionWrapper`
      Bias direction used by mitigator.
  embedding_layer : `torch.nn.Embedding`
      Embedding layer of base model.
  equalize_word_pairs_file : `Union[PathLike, str]`
      Path of file containing equalize word pairs.
  tokenizer : `Tokenizer`
      Tokenizer used to tokenize equalize words.
  mitigator_vocab : `Vocabulary`, optional (default=`None`)
      Vocabulary of tokenizer. If `None`, assumes tokenizer is of
      type `PreTrainedTokenizer` and uses tokenizer's `vocab` attribute.
  namespace : `str`, optional (default=`"tokens"`)
      Namespace of mitigator_vocab to use when tokenizing.
      Disregarded when mitigator_vocab is `None`.
  requires_grad : `bool`, optional (default=`True`)
      Option to enable gradient calculation for bias mitigator.
code: def train(self, mode: bool = True):
      self.mitigator.requires_grad = mode
      self.bias_direction.train(mode)
  
imports: import torch
  from typing import Union, Optional
  from os import PathLike
  from allennlp.fairness.bias_mitigators import HardBiasMitigator, LinearBiasMitigator, INLPBiasMitigator, OSCaRBiasMitigator
  from allennlp.fairness.bias_direction_wrappers import BiasDirectionWrapper
  from allennlp.fairness.bias_utils import load_word_pairs
  from allennlp.common import Registrable
  from allennlp.data.tokenizers.tokenizer import Tokenizer
  from allennlp.data import Vocabulary
label_desc: Use image node_id 3 for calling the HardBiasMitigatorWrapper obj's underlying member method code with example usage: obj.train(mode) without return types