def linearize_arg_types(fn, args):

  untyped_fundef, closure_args = unpack_closure(fn)
  if isinstance(args, (list, tuple)):
    args = ActualArgs(args)
    
  if not isinstance(untyped_fundef.args, FormalArgs):
    assert False, "Expected function %s to have FormalArgs" % untyped_fundef.name 
    #formals = FormalArgs()
    #for arg in untyped_fundef.args:
    #  formals.add_positional(arg)
  else:
    formals = untyped_fundef.args

  if len(closure_args) > 0:
    args = args.prepend_positional(closure_args)

  def keyword_fn(_, v):
    return type_conv.typeof(v)

  try: 
    linear_args, extra = formals.linearize_values(args, keyword_fn = keyword_fn)
  except UnexpectedKeyword as e:
    e.fn_name = untyped_fundef.name  
    raise 
      
  return untyped_fundef, tuple(linear_args + extra)
Given a function object which might be one of:
dataset/ETHPy150Open iskandr/parakeet/parakeet/type_inference/linearize_args.py/linearize_arg_types