def rpm_name(self, name, python_version=None, pkg_name=False):
        """Checks if name converted using superclass rpm_name_method match name
        of package in the query. Searches for correct name if it doesn't.
        Args:
            name: name to convert
            python_version: python version for which to retrieve the name of
                            the package
            pkg_name: flag to perform conversion of rpm package name
                      (foo -> python-foo)
        """
        if pkg_name:
            return super(DandifiedNameConvertor, self).rpm_name(
                name, python_version)
        original_name = name
        converted = super(DandifiedNameConvertor, self).rpm_name(
            name, python_version)
        python_query = self.query.filter(name__substr=[
            'python', 'py', original_name, canonical_form(original_name)])
        if converted in [pkg.name for pkg in python_query]:
            logger.debug("Converted name exists")
            return converted

        logger.debug("Converted name not found, searches for correct form")

        not_versioned_name = NameVariants(self.base_name(original_name), '')
        versioned_name = NameVariants(self.base_name(original_name),
                                      python_version)

        if self.base_name(original_name).startswith("py"):
            nonpy_name = NameVariants(self.base_name(
                original_name)[2:], python_version)

        for pkg in python_query:
            versioned_name.find_match(pkg.name)
            not_versioned_name.find_match(pkg.name)
            if 'nonpy_name' in locals():
                nonpy_name.find_match(pkg.name)

        if 'nonpy_name' in locals():
            versioned_name = versioned_name.merge(nonpy_name)

        correct_form = versioned_name.merge(not_versioned_name).best_matching
        logger.debug("Most likely correct form of the name {0}.".format(
            correct_form))
        return correct_form or converted