import six


def find(inventories, res_class):
    """Return the inventory record from the list of Inventory records that
    matches the supplied resource class, or None.

    :param inventories: A list of Inventory objects.
    :param res_class: An integer or string representing a resource
                      class. If the value is a string, the method first
                      looks up the resource class identifier from the
                      string.
    """
    if not isinstance(res_class, six.string_types):
        raise ValueError

    for inv_rec in inventories:
        if inv_rec.resource_class == res_class:
            return inv_rec