code: def fill_defaults(args, n, defaults_tail):
      """
      __torch_dispatch__ doesn't guarantee the number of arguments you are
      passed (e.g., defaulted arguments are not passed); but usually it is
      convenient to pad out the arguments list with defaults.  This function
      helps you do that.
      Args:
          args: the list of positional arguments passed to __torch_dispatch__
          n: the number of arguments you are expecting to get
          defaults_tail: default values for the arguments, starting from the
              end of the list
      Example:
          >>> fill_defaults([1, 2, 3], 5, [3, 4, 5])
          [1, 2, 3, 4, 5]
          >>> fill_defaults([1, 2, 3], 5, [None, None, None])
          [1, 2, 3, None, None]]
      """
      if n - len(defaults_tail) > len(args):
          raise RuntimeError("not enough defaults to fill arguments")
      r = list(args)
      for i in range(len(args), n):
          r.append(defaults_tail[i - n + len(defaults_tail)])
      return r
  
imports: import itertools
  from typing import List, Tuple
  import torch
  import torch._prims_common
label_desc: Use image node_id 3 for calling a global function with example usage: fill_defaults(args, n, defaults_tail) and returns: r