def check_direct(element, list_to_check):
    """ Returns a boolean indicating whether the direct should be update.

        Inputs:
            - element: direct that needs to be checked;
            - list_to_check: operational mode or pb_type and port of the direct to select.
    """
    interconnect = element.getparent()
    mode_or_pb_type = interconnect.getparent()

    if mode_or_pb_type.tag not in ['mode', 'pb_type']:
        return False

    for mode_or_pb_type_to_check, port_to_check in list_to_check:
        if mode_or_pb_type.attrib[
                'name'] == mode_or_pb_type_to_check and element.attrib[
                    'name'] == port_to_check:
            return True

    return False