<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_first(self, attr_name, resources, extra_prefix=''):
 """ Returns the boto object for the first resource in ``resources`` that belongs to this stack. Uses the attribute specified by ``attr_name`` to match the stack name. E.g. An RDS instance for a stack named ``foo`` might be named ``foo-mydb-fis8932ifs``. This call:: find_first('id', conn.get_all_dbinstances()) would return the boto.rds.dbinstance.DBInstance object whose ``id`` is ``foo-mydb-fis8932ifs``. Returns None if a matching resource is not found. If specified, ``extra_prefix`` is appended to the stack name prefix before matching. """

        prefix = self.name + '-' + (extra_prefix + '-' if extra_prefix else '')
        for res in resources:
            attr = getattr(res, attr_name)
            if attr.startswith(prefix):
                return res