<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run(self, user_kw=None, build_kw=None):
 """Run the builder. :param user_kw: keywords from user :type user_kw: dict :param build_kw: internal settings :type build_kw: dict :return: Number of items processed :rtype: int """

        user_kw = {} if user_kw is None else user_kw
        build_kw = {} if build_kw is None else build_kw
        n = self._build(self.get_items(**user_kw), **build_kw)
        finalized = self.finalize(self._status.has_failures())
        if not finalized:
            _log.error("Finalization failed")
        return n