def get_positional(args, kw, kw_overrides=False):
  """Interpolates keyword arguments into argument lists.

  If `kw` contains keywords of the form "_0", "_1", etc., these
  are positionally interpolated into the argument list.

  Args:
      args: argument list
      kw: keyword dictionary
      kw_overrides: key/value pairs that override kw

  Returns:
      (new_args, new_kw), new argument lists and keyword dictionaries
      with values interpolated.
  """
  new_kw = {k: v for k, v in kw.items() if k[0] != "_"}
  if len(new_kw) == len(kw):
    return args, kw
  new_args = list(args)
  for key, value in kw.items():
    if key[0] != "_": continue
    index = int(key[1:])
    while len(new_args) <= index:
      new_args += [None]
    if kw_overrides or new_args[index] is None:
      new_args[index] = value
  return new_args, new_kw