'Return the set of imports under the given prefix.
"prefix" is a tuple of import name parts. E.g. ("xml", "sax")
for "import xml.sax." in Python. Or ("XML", "Parser") for
"use XML::Parser::" in Perl.
See description in database.py docstring for details.'

def get_blob_imports(self, prefix):

    self._acquire_lock()
    try:
        if (prefix not in self._blob_imports_from_prefix_cache):
            if prefix:
                for dir in self.dirs:
                    importables = self._importables_from_dir(dir)
                    if (prefix[0] in importables):
                        sub_importables = self._importables_from_dir(join(dir, *prefix))
                        imports = set(((name, is_dir_import) for (name, (_, _, is_dir_import)) in sub_importables.items()))
                        break
                else:
                    imports = set()
            else:
                imports = set()
                for dir in self.dirs:
                    importables = self._importables_from_dir(dir)
                    imports.update(((name, is_dir_import) for (name, (_, _, is_dir_import)) in importables.items()))
            self._blob_imports_from_prefix_cache[prefix] = imports
        return self._blob_imports_from_prefix_cache[prefix]
    finally:
        self._release_lock()
