code: def is_affine(fn):
      """
      A sound but incomplete test to determine whether a funsor is affine with
      respect to all of its real inputs.
  
      :param Funsor fn: A funsor.
      :rtype: bool
      """
      return affine_inputs(fn) == _real_inputs(fn)
  
file_path: funsor/funsor/affine.py
imports: from collections import OrderedDict
  from functools import reduce, singledispatch
  import opt_einsum
  from funsor.domains import Bint
  from funsor.interpreter import gensym
  from funsor.tensor import Tensor, get_default_prototype
  from funsor.terms import Binary, Finitary, Funsor, Lambda, Reduce, Unary, Variable
  from .None import ops
label_desc: Use image node_id 1 for calling a global function with example usage: is_affine(fn) and returns: unknown