code: def _adapted_beta(
      shape: Union[Tuple[int, ...], torch.Size],
      a: Union[float, Tensor],
      b: Union[float, Tensor],
      same_on_batch: bool = False,
  ) -> Tensor:
      r"""The beta sampling function that accepts 'same_on_batch'.
  
      If same_on_batch is True, all values generated will be exactly same given a batch_size (shape[0]). By default,
      same_on_batch is set to False.
  
      By default, sampling happens on the default device and dtype. If a/b is a tensor, sampling will happen in the same
      device/dtype as a/b tensor.
      """
      device, dtype = _extract_device_dtype(
          [
              a if isinstance(a, Tensor) else None,
              b if isinstance(b, Tensor) else None,
          ]
      )
      a = as_tensor(a, device=device, dtype=dtype)
      b = as_tensor(b, device=device, dtype=dtype)
      dist = Beta(a, b, validate_args=False)
      return _adapted_rsampling(shape, dist, same_on_batch)
  
imports: from functools import wraps
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  from torch.distributions import Beta, Uniform
  from kornia.core import Tensor, as_tensor
  from kornia.geometry.boxes import Boxes
  from kornia.geometry.keypoints import Keypoints
  from kornia.utils import _extract_device_dtype
label_desc: Use image node_id 14 for calling a global function with example usage: _adapted_beta(shape, a, b, same_on_batch) and returns: _adapted_rsampling