def METHOD_NAME(tileCoverage, args):
    r"""
    The mapreduce method calls this function
    for each tile. The parameters (args) are fixed
    in the main method.
    >>> funcArgs= {'scaleFactors': (1,1)}
    >>> average([1, 2], funcArgs)
    1.5
    >>> funcArgs= {'scaleFactors': (1,0.5)}
    >>> average([1, 2], funcArgs)
    1.0
    >>> funcArgs= {'scaleFactors': (1,0.5,0.1,0.2)}
    >>> average([1, 2, 3, 12], funcArgs)
    1.175
    >>> average([1, 2, 3, np.nan], funcArgs)
    nan
    """
    norm_values = [args['scaleFactors'][i] * cov for i, cov in enumerate(tileCoverage)]
    return np.mean(norm_values)