code: def default_perturb_func(original_inp, **kwargs):
      assert (
          "num_interp_features" in kwargs
      ), "Must provide num_interp_features to use default interpretable sampling function"
      if isinstance(original_inp, Tensor):
          device = original_inp.device
      else:
          device = original_inp[0].device
  
      probs = torch.ones(1, kwargs["num_interp_features"]) * 0.5
      return torch.bernoulli(probs).to(device=device).long()
  
imports: import inspect
  import math
  import typing
  import warnings
  from typing import Any, Callable, cast, List, Optional, Tuple, Union
  import torch
  from captum._utils.common import _expand_additional_forward_args, _expand_target, _flatten_tensor_or_tuple, _format_output, _format_tensor_into_tuples, _get_max_feature_index, _is_tuple, _reduce_list, _run_forward
  from captum._utils.models.linear_model import SkLearnLasso
  from captum._utils.models.model import Model
  from captum._utils.progress import progress
  from captum._utils.typing import BaselineType, Literal, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr._utils.attribution import PerturbationAttribution
  from captum.attr._utils.batching import _batch_example_iterator
  from captum.attr._utils.common import _construct_default_feature_mask, _format_input_baseline
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import CosineSimilarity
  from torch.utils.data import DataLoader, TensorDataset
label_desc: Use image node_id 3 for calling a global function with example usage: default_perturb_func(original_inp) and returns: torch