code: def weighted_mse_loss(pred, target, weight=None):
      weight = 1.0 if weight is None else weight[target].to(pred.dtype)
      return (weight * (pred - target.to(pred.dtype)).pow(2)).mean()
  
imports: import argparse
  import os.path
  import torch
  import torch.nn.functional
  from torch.nn import Linear
  import torch_geometric.transforms
  from torch_geometric.datasets import MovieLens
  from torch_geometric.nn import SAGEConv, to_hetero
label_desc: Use image node_id 1 for calling a global function with example usage: weighted_mse_loss(pred, target, weight) and returns: unknown