<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _contains_internal_dynamic_call(contract):
 """ Checks if a contract contains a dynamic call either in a direct definition, or through inheritance. Returns: (boolean):
 True if this contract contains a dynamic call (including through inheritance). """

        for func in contract.all_functions_called:
            for node in func.nodes:
                for ir in node.irs:
                    if isinstance(ir, (InternalDynamicCall)):
                        return True
        return False