code: def _weighted_loss(self, soft_loss, hard_loss):
      return (
          1.0 - self.hard_weight
      ) * soft_loss + self.hard_weight * hard_loss
  
file_path: pytext/pytext/models/output_layers/squad_output_layer.py
imports: from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from pytext.config.component import create_loss
  from pytext.fields import FieldMeta
  from pytext.loss import BinaryFocalLoss, CrossEntropyLoss, FocalLoss, KLDivergenceCELoss, Loss
  from pytext.models.output_layers import OutputLayerBase
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 8 for calling the SquadOutputLayer obj's underlying member method code with example usage: obj._weighted_loss(soft_loss, hard_loss) and returns: unknown