code: def _get_num_samples(data_qualities: OpenmlQualitiesType) -> int:
      """Get the number of samples from data qualities.
  
      Parameters
      ----------
      data_qualities : list of dict
          Used to retrieve the number of instances (samples) in the dataset.
  
      Returns
      -------
      n_samples : int
          The number of samples in the dataset or -1 if data qualities are
          unavailable.
      """
      # If the data qualities are unavailable, we return -1
      default_n_samples = -1
  
      qualities = {d["name"]: d["value"] for d in data_qualities}
      return int(
          float(qualities.get("NumberOfInstances", default_n_samples))
      )
  
imports: import gzip
  import hashlib
  import json
  import os
  import shutil
  import time
  from contextlib import closing
  from functools import wraps
  from os.path import join
  from tempfile import TemporaryDirectory
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from urllib.error import HTTPError, URLError
  from urllib.request import Request, urlopen
  from warnings import warn
  import numpy
  from ..utils import Bunch, check_pandas_support
  from ..utils._param_validation import Hidden, Integral, Interval, Real, StrOptions, validate_params
  from .None import get_data_home
  from ._arff_parser import load_arff_from_gzip_file
label_desc: Use image node_id 10 for calling a global function with example usage: _get_num_samples(data_qualities) and returns: int