code: def ablate_url_tokens(
      url: str, token_idxs_to_ablate: tuple[int, ...]
  ) -> str:
      """Ablates the tokens at the provided indices and returns the resulting URL."""
      url_tokens = _tokenize_url(url)
      start = 0
      modified_url_pieces = []
      token_idxs_to_ablate = sorted(token_idxs_to_ablate)
      for token_idx in token_idxs_to_ablate:
          assert token_idx < len(url_tokens), (
              "token_idxs_to_ablate must all fall in the range 0 to number of tokens"
              " returned by tokenize_url"
          )
          _, token_start, token_end = url_tokens[token_idx]
          modified_url_pieces.append(url[start:token_start])
          start = token_end
      modified_url_pieces.append(url[start:])
      return "".join(modified_url_pieces)
  
file_path: lit/lit_nlp/components/cf_utils.py
imports: import re
  from typing import Any, Optional, cast
  from lit_nlp.api import types
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: ablate_url_tokens(url, token_idxs_to_ablate) and returns: str