code: def read_img_from_url(
      url: str,
      resize_to: Optional[tuple[int, int]] = None,
      **resize_kwargs,
  ) -> torch.Tensor:
      # perform request
      response = requests.get(url, timeout=60).content
      # convert to array of ints
      nparr = np.frombuffer(response, np.uint8)
      # convert to image array and resize
      img: np.ndarray = cv2.imdecode(nparr, cv2.IMREAD_UNCHANGED)[
          ..., :3
      ]
      # convert the image to a tensor
      img_t: torch.Tensor = K.utils.image_to_tensor(
          img, keepdim=False
      )  # 1xCxHXW
      img_t = img_t.float() / 255.0
      if resize_to is None:
          img_t = K.geometry.resize(img_t, 184, **resize_kwargs)
      else:
          img_t = K.geometry.resize(img_t, resize_to, **resize_kwargs)
      return img_t
  
file_path: kornia/docs/generate_examples.py
imports: from __future__ import annotations
  import importlib
  import math
  import os
  from pathlib import Path
  from typing import Optional
  import cv2
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import requests
  import torch
  from kornia_moons.feature import visualize_LAF
  import kornia
  from kornia.core import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: read_img_from_url(url, resize_to) and returns: img_t