def fuzz_xmlattrs(files, attributes, aggression, strfuzzer=None, intfuzzer=None):
    """
    This method fuzzes the set of attributes found by
    :func:`~find_xmlattrs`.  The *files* parameter should be the same
    one given in :func:`~find_xmlattrs`, and the *attributes* parameter
    should be the list returned by the same.

    *aggression* is the inverse of the number of attributes to mutate
    as a ratio of the total number of attributes found. (ie.
    num_attrs/aggression == number of attrs to mutate).  Note that in
    this mode, aggression is statistical, so even an *aggression* of 1
    will not hit every attribute in the input.

    *strfuzzer* and *intfuzzer* are optional instances of
    :class:`~StringFuzzer` and :class:`~IntegerFuzzer` to be used on
    their respective types.  If not specified, one of each will be
    instantiated using the default parameters for each.

    The result is a mutated copy of *files*.
    """
    if not aggression:
        return files

    if strfuzzer is None:
        strfuzzer = StringFuzzer()
    if intfuzzer is None:
        intfuzzer = IntegerFuzzer()

    result = []
    nattributes = len(attributes)
    if aggression > 0:
        fuzzable = nattributes / aggression
    else:
        fuzzable = -aggression

    fuzzes = sorted(set(randint(0, 1-nattributes) for _ in range(fuzzable)))
    fuzzes.reverse()

    try:
        tofuzz = attributes[fuzzes.pop()]
    except (IndexError, AttributeError):
        tofuzz = None
    for i, cf in enumerate(files):
        if tofuzz is None or tofuzz.fileid != i:
            result.append(cf)
        else:
            off = 0
            fileparts = []
            try:
                while tofuzz.fileid == i:
                    fileparts.append(cf["data"][off:tofuzz.start])
                    off = tofuzz.end
                    fileparts.append(tofuzz.fuzzed_value(strfuzzer, intfuzzer))
                    tofuzz = attributes[fuzzes.pop()]
            except IndexError:
                tofuzz = None
            fileparts.append(cf["data"][off:])
            newf = dict(cf)
            newf["data"] = "".join(str(f) for f in fileparts)
            result.append(newf)
    return result
dataset/ETHPy150Open blackberry/ALF/alf/fuzz/XmlAttributeFuzz.py/fuzz_xmlattrs/swapped operands of `-`