code: def is_realnews_domain(
      page: PageFeatures,
      realnews_domains: Mapping[str, Collection[str]],
  ):
      """Returns False iff page's (sub)domain is not allowed."""
      counter_inc_fn = get_counter_inc_fn("realnews-domain-filter")
      url = page.normalized_url
      ext = tfds.core.lazy_imports.tldextract.extract(url)
      main_domain = ext.domain + "." + ext.suffix
      if main_domain not in realnews_domains:
          counter_inc_fn("filtered:bad_domain")
          return False
      allowed_subdomains = realnews_domains[main_domain]
      if (
          isinstance(allowed_subdomains, list)
          and ext.subdomain not in allowed_subdomains
      ):
          counter_inc_fn("filtered:bad_subdomain")
          return False
      counter_inc_fn("passed")
      return True
  
imports: import dataclasses
  import functools
  import gzip
  import hashlib
  import heapq
  import io
  import re
  import threading
  from typing import Collection, Iterable, Mapping, Optional, Sequence, Tuple
  from absl import logging
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 16 for calling a global function with example usage: is_realnews_domain(page, realnews_domains) and returns: True, False, False