def get_cost(self, parent_cost, url):
    '\n        Return the cost for a URL.\n\n        :param float parent_cost: The cost of the resource which yielded this\n            URL.\n        :param str url: The URL to compute cost for.\n        :returns: Cost of ``url``.\n        :rtype: float\n        '
    for (pattern, match, action, amount) in self._rules:
        if (pattern is None):
            break
        else:
            result = (pattern.search(url) is not None)
            if (match == 'DOES_NOT_MATCH'):
                result = (not result)
            if result:
                break
    if (action == 'ADD'):
        return (parent_cost + amount)
    return (parent_cost * amount)
Return the cost for a URL.

:param float parent_cost: The cost of the resource which yielded this
    URL.
:param str url: The URL to compute cost for.
:returns: Cost of ``url``.
:rtype: float
def get_cost(self, parent_cost, url):
    '\n        Return the cost for a URL.\n\n        :param float parent_cost: The cost of the resource which yielded this\n            URL.\n        :param str url: The URL to compute cost for.\n        :returns: Cost of ``url``.\n        :rtype: float\n        '
    for (pattern, match, action, amount) in self._rules:
        if (pattern is None):
            break
        else:
            result = (pattern.search(url) is not None)
            if (match == 'DOES_NOT_MATCH'):
                result = (not result)
            if result:
                break
    if (action == 'ADD'):
        return (parent_cost + amount)
    return (parent_cost * amount)