code: def drop_feature_weighted(x, w, p: float, threshold: float = 0.7):
      """Returns the new node features after probabilistically masking some`
      Args:
          x (torch.Tensor): Tensor of shape [n_nodes, n_features] representing node features.
          w (torch.Tensor): Tensor of shape [n_features] representing weights
          p (float): Probability multiplier
          threshold (float): Upper bound probability of masking a feature
      """
      w = w / w.mean() * p
      w = w.where(w < threshold, torch.ones_like(w) * threshold)
      drop_prob = w
  
      drop_mask = torch.bernoulli(drop_prob).to(torch.bool)
  
      x = x.clone()
      x[:, drop_mask] = 0.0
  
      return x
  
file_path: DIG/dig/sslgraph/utils/adaptive.py
imports: import torch
  from torch.utils.data import random_split
  from torch_geometric.utils import degree, remove_self_loops, get_laplacian, to_undirected, to_dense_adj, to_networkx, degree, to_undirected
  from torch_scatter import scatter
  import networkx
label_desc: Use image node_id 3 for calling a global function with example usage: drop_feature_weighted(x, w, p, threshold) and returns: x