code: def validate_arg_count(arg_count: int, verb: GrammarVerb) -> bool:
      valid = True
  
      if arg_count not in verb.abbreviations:
          error_str = f"Command {verb.command} supports the following invocations:\n"
          for count in sorted(verb.abbreviations.keys()):
              abbreviation = verb.abbreviations[count]
              example_terms = []
              for i, term_type in enumerate(abbreviation):
                  if term_type is not None:
                      term_settings = verb.full_sentence[i]
                      example = term_settings["klass"](
                          **term_settings
                      ).get_example()
                      example_terms.append(example)
              error_str += f"{count} args: {verb.command} {' '.join(example_terms)}\n"
  
          raise BadGrammar(error_str)
  
      return valid
  
imports: from __future__ import annotations
  import socket
  from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Tuple
  from typing import Union
  from .deps import allowed_hosts
  from .lib import find_available_port
label_desc: Use image node_id 1 for calling a global function with example usage: validate_arg_count(arg_count, verb) and returns: valid