class_docstr: Represents the source of a dataset stored at a web location and referred to
  by an HTTP or HTTPS URL.
class_docstr_tok: ["Represents","the","source","of","a","dataset","stored","at","a","web","location","and","referred","to","by","an","HTTP","or","HTTPS","URL","."]
docstr: Extracts a filename from the Content-Disposition header or the URL's path.
docstr_tok: ["Extracts","a","filename","from","the","Content-Disposition","header","or","the","URL","'s","path","."]
code: def _extract_filename(self, response) -> str:
      """
      Extracts a filename from the Content-Disposition header or the URL's path.
      """
      if content_disposition := response.headers.get(
          "Content-Disposition"
      ):
          for match in re.finditer(
              r"filename=(.+)", content_disposition
          ):
              filename = match[1].strip("'\"")
              if _is_path(filename):
                  raise MlflowException.invalid_parameter_value(
                      f"Invalid filename in Content-Disposition header: {filename}. "
                      "It must be a file name, not a path."
                  )
              return filename
  
      # Extract basename from URL if no valid filename in Content-Disposition
      return os.path.basename(urlparse(self.url).path)
  
imports: import os
  import re
  from typing import Any, Dict
  from urllib.parse import urlparse
  from mlflow.data.dataset_source import DatasetSource
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.utils.file_utils import create_tmp_dir
  from mlflow.utils.rest_utils import augmented_raise_for_status, cloud_storage_http_request
label_desc: Use image node_id 4 for calling the HTTPDatasetSource obj's underlying member method code with example usage: obj._extract_filename(response) and returns: os, filename