def _index_datasets(self):

        self.resources = OrderedDict()
        for package in self.packages:
            if package.resource_count == 1:
                name = package.name
                if name in self.resources:
                    raise MetadataError("Two single-resource packages with the"
                                        " same name '%s'" % name)
                self.resources[name] = package.resources[0]
            else:
                for resource in package.resources:
                    name = "%s.%s" % (package.name, resource.name)
                    if name in self.resources:
                        raise MetadataError("Duplicate datapackage resource %s in "
                                            "%s." % (resource.name, package.name) )
                    self.resources[name] = resource
Attempts to get a sane common name from a given certificate.
dataset/ETHPy150Open Stiivi/bubbles/bubbles/datapackage.py/DataPackageCollectionStore._index_datasets--crossover with--dataset/ETHPy150Open Netflix/security_monkey/security_monkey/watchers/iam/iam_ssl.py/cert_get_cn