<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def detect_shadowing_definitions(self, contract):
 """ Detects if functions, access modifiers, events, state variables, and local variables are named after reserved keywords. Any such definitions are returned in a list. Returns: list of tuple: (type, contract name, definition)"""

        result = []

        # Loop through all functions + modifiers in this contract.
        for function in contract.functions + contract.modifiers:
            # We should only look for functions declared directly in this contract (not in a base contract).
            if function.contract != contract:
                continue

            # This function was declared in this contract, we check what its local variables might shadow.
            for variable in function.variables:
                overshadowed = []
                for scope_contract in [contract] + contract.inheritance:
                    # Check functions
                    for scope_function in scope_contract.functions:
                        if variable.name == scope_function.name and scope_function.contract == scope_contract:
                            overshadowed.append((self.OVERSHADOWED_FUNCTION, scope_contract.name, scope_function))
                    # Check modifiers
                    for scope_modifier in scope_contract.modifiers:
                        if variable.name == scope_modifier.name and scope_modifier.contract == scope_contract:
                            overshadowed.append((self.OVERSHADOWED_MODIFIER, scope_contract.name, scope_modifier))
                    # Check events
                    for scope_event in scope_contract.events:
                        if variable.name == scope_event.name and scope_event.contract == scope_contract:
                            overshadowed.append((self.OVERSHADOWED_EVENT, scope_contract.name, scope_event))
                    # Check state variables
                    for scope_state_variable in scope_contract.variables:
                        if variable.name == scope_state_variable.name and scope_state_variable.contract == scope_contract:
                            overshadowed.append((self.OVERSHADOWED_STATE_VARIABLE, scope_contract.name, scope_state_variable))

                # If we have found any overshadowed objects, we'll want to add it to our result list.
                if overshadowed:
                    result.append((contract.name, function.name, variable, overshadowed))

        return result