<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_internal_consistency(self, **kwargs):
 """Check whether the database is internally consistent We check that all variables are equal to the sum of their sectoral components and that all the regions add up to the World total. If the check is passed, None is returned, otherwise a dictionary of inconsistent variables is returned. Note: at the moment, this method's regional checking is limited to checking that all the regions sum to the World region. We cannot make this more automatic unless we start to store how the regions relate, see [this issue](https://github.com/IAMconsortium/pyam/issues/106). Parameters kwargs: passed to `np.isclose()` """

        inconsistent_vars = {}
        for variable in self.variables():
            diff_agg = self.check_aggregate(variable, **kwargs)
            if diff_agg is not None:
                inconsistent_vars[variable + "-aggregate"] = diff_agg

            diff_regional = self.check_aggregate_region(variable, **kwargs)
            if diff_regional is not None:
                inconsistent_vars[variable + "-regional"] = diff_regional

        return inconsistent_vars if inconsistent_vars else None