code: def _get_reader_and_filenames(reader, filenames):
      if reader is None and isinstance(filenames, dict):
          # filenames is a dictionary of reader_name -> filenames
          reader = list(filenames.keys())
          remaining_filenames = set(
              f for fl in filenames.values() for f in fl
          )
      elif reader and isinstance(filenames, dict):
          # filenames is a dictionary of reader_name -> filenames
          # but they only want one of the readers
          filenames = filenames[reader]
          remaining_filenames = set(filenames or [])
      else:
          remaining_filenames = set(filenames or [])
      return reader, filenames, remaining_filenames
  
imports: from __future__ import annotations
  import logging
  import os
  import pathlib
  import pickle
  import warnings
  from datetime import datetime, timedelta
  from functools import total_ordering
  import yaml
  from yaml import UnsafeLoader
  from satpy._config import config_search_paths, get_entry_points_config_dirs, glob_config
  from .yaml_reader import AbstractYAMLReader
  from .yaml_reader import load_yaml_configs
label_desc: Use image node_id 16 for calling a global function with example usage: _get_reader_and_filenames(reader, filenames) and returns: reader,  filenames,  remaining_filenames