code: def launch_shorthand_support(args: TypeTuple) -> TypeTuple:
      """When launching, we want to be able to default to 'domain' if it's not provided, to launch
      nodes when no name is provided, and to support node names which have multiple words.
  
      hagrid launch -> hagrid launch domain
      hagrid launch United Nations -> hagrid launch "United Nations" domain
      hagrid launch United Nations domain -> hagrid launch "United Nations" domain
      hagrid launch on docker -> hagrid launch domain on docker
  
      """
  
      # Some mild analysis
      found_node_type = False
      preposition_position = 10000
      for i, arg in enumerate(args):
          if arg in ALLOWED_NODE_TYPES:
              found_node_type = True
  
          if arg.strip() in ["to", "from"]:
              if i < preposition_position:
                  preposition_position = i
  
      _args = list(args)
  
      # Default to domain if it's not provided
      if not found_node_type:
          if preposition_position != 10000:
              _args.insert(preposition_position, "domain")
              preposition_position += 1
          else:
              _args = _args + ["domain"]
  
      # if there are no prepositions and the domain/network is the last word
      if (
          preposition_position == 10000
          and _args[-1] in ALLOWED_NODE_TYPES
      ):
          _args = [" ".join(_args[:-1])] + _args[-1:]
  
      # if there are prepositions then combine the words in the name if there are multiple
      elif preposition_position != 10000:
          _args = [" ".join(_args[: preposition_position - 1])] + _args[
              preposition_position - 1 :
          ]
  
      # if there wasn't a name provided - make sure we don't have an empty place in the list
      # so that later logic will generate a name
      if _args[0] == "":
          _args = _args[1:]
  
      args = tuple(_args)
  
      return args
  
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 2 for calling a global function with example usage: launch_shorthand_support(args) and returns: args