code: def detect_c3_function_shadowing(contract):
      
  
      # Loop through all contracts, and all underlying functions.
      results = {}
      for i in range(0, len(contract.immediate_inheritance) - 1):
          inherited_contract1 = contract.immediate_inheritance[i]
  
          for function1 in inherited_contract1.functions_and_modifiers:
              # If this function has already be handled or is unimplemented, we skip it
              if function1.full_name in results or function1.is_constructor or not function1.is_implemented:
                  continue
  
              # Define our list of function instances which overshadow each other.
              functions_matching = [(inherited_contract1, function1)]
              already_processed = set([function1])
  
              # Loop again through other contracts and functions to compare to.
              for x in range(i + 1, len(contract.immediate_inheritance)):
                  inherited_contract2 = contract.immediate_inheritance[x]
  
                  # Loop for each function in this contract
                  for function2 in inherited_contract2.functions_and_modifiers:
                      # Skip this function if it is the last function that was shadowed.
                      if function2 in already_processed or function2.is_constructor or not function2.is_implemented:
                          continue
  
                      # If this function does have the same full name, it is shadowing through C3 linearization.
                      if function1.full_name == function2.full_name:
                          functions_matching.append((inherited_contract2, function2))
                          already_processed.add(function2)
  
              # If we have more than one definition matching the same signature, we add it to the results.
              if len(functions_matching) > 1:
                  results[function1.full_name] = functions_matching
  
      return list(results.values())
docs: Detects and obtains functions which are indirectly shadowed via multiple inheritance by C3 linearization
      properties, despite not directly inheriting from each other.
  
      :param contract: The contract to check for potential C3 linearization shadowing within.
      :return: A list of list of tuples: (contract, function), where each inner list describes colliding functions.
      The later elements in the inner list overshadow the earlier ones. The contract-function pair's function does not
      need to be defined in its paired contract, it may have been inherited within it.