def are_specs_matched(self, sub, super, allow_conversion=False,
                          out_converters=None):
        """Checks if specs of `sub` subclass `super`.
        """
        # For a connection, this gets called for sub -> super
        basic_pkg = get_vistrails_basic_pkg_id()
        variant_desc = self.get_descriptor_by_name(basic_pkg, 'Variant')
        list_desc = self.get_descriptor_by_name(basic_pkg, 'List')
        # sometimes sub is coming None
        # I don't know if this is expected, so I will put a test here
        sub_descs = []
        if sub:
            sub_descs = sub.descriptors()
        if sub_descs is None:
            return False
        elif sub_descs == [variant_desc]:
            return True
        super_descs = []
        if super:
            super_descs = super.descriptors()
        if super_descs is None:
            return False
        elif super_descs == [variant_desc]:
            return True
        elif [list_desc] in [super_descs, sub_descs]:
            # Allow Lists to connect to anything
            return True
        #elif super_descs == [list_desc] and sub_descs != [list_desc] \
        #     and sub.depth > 0:
        #    # List is handled as Variant with depth 1
        #    return True
        #elif sub_descs == [list_desc] and super_descs != [list_desc] \
        #     and super.depth > 0:
        #    # List is handled as Variant with depth 1
        #    return True

        if (len(sub_descs) == len(super_descs) and
                self.is_descriptor_list_subclass(sub_descs, super_descs)):
            return True

        if allow_conversion:
            converters = self.get_converters(sub_descs, super_descs)
            if converters:
                if out_converters is not None:
                    out_converters.extend(converters)
                return True

        return False
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/core/modules/module_registry.py/ModuleRegistry.are_specs_matched/original