code: def handle_arguments(args, default_input_stream=sys.stdin):
      document_format = args["--format"]
      if document_format is not None and document_format not in PARSERS:
          raise ValueError(
              "Unsupported format of input document. Possible values are: %s. Given: %s."
              % (
                  ", ".join(PARSERS.keys()),
                  document_format,
              )
          )
  
      if args["--url"] is not None:
          parser = PARSERS[document_format or "html"]
          document_content = fetch_url(args["--url"])
      elif args["--file"] is not None:
          parser = PARSERS[document_format or "plaintext"]
          with open(args["--file"], "rb") as file:
              document_content = file.read()
      elif args["--text"] is not None:
          parser = PARSERS[document_format or "plaintext"]
          document_content = args["--text"]
      else:
          parser = PARSERS[document_format or "plaintext"]
          document_content = default_input_stream.read()
  
      items_count = ItemsCount(args["--length"])
  
      language = args["--language"]
      if args["--stopwords"]:
          stop_words = read_stop_words(args["--stopwords"])
      else:
          stop_words = get_stop_words(language)
  
      parser = parser(document_content, Tokenizer(language))
      stemmer = Stemmer(language)
  
      summarizer_class = next(
          cls for name, cls in AVAILABLE_METHODS.items() if args[name]
      )
      summarizer = build_summarizer(
          summarizer_class, stop_words, stemmer, parser
      )
  
      return summarizer, parser, items_count
  
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  import sys
  from docopt import docopt
  from .None import __version__
  from .utils import ItemsCount, get_stop_words, read_stop_words, fetch_url
  from ._compat import to_string, to_unicode, to_bytes, PY3
  from .nlp.tokenizers import Tokenizer
  from .parsers.html import HtmlParser
  from .parsers.plaintext import PlaintextParser
  from .summarizers.luhn import LuhnSummarizer
  from .summarizers.edmundson import EdmundsonSummarizer
  from .summarizers.lsa import LsaSummarizer
  from .summarizers.text_rank import TextRankSummarizer
  from .summarizers.lex_rank import LexRankSummarizer
  from .summarizers.sum_basic import SumBasicSummarizer
  from .summarizers.kl import KLSummarizer
  from .nlp.stemmers import Stemmer
label_desc: Use image node_id 2 for calling a global function with example usage: handle_arguments(args, default_input_stream) and returns: summarizer,  parser,  items_count