def get_preferred_collection(self):
bus = secretstorage.dbus_init()<EOL>try:<EOL><INDENT>if hasattr(self, '<STR_LIT>'):<EOL><INDENT>collection = secretstorage.Collection(<EOL>bus, self.preferred_collection)<EOL><DEDENT>else:<EOL><INDENT>collection = secretstorage.get_default_collection(bus)<EOL><DEDENT><DEDENT>except exceptions.SecretStorageException as e:<EOL><INDENT>raise InitError("<STR_LIT>" % e)<EOL><DEDENT>if collection.is_locked():<EOL><INDENT>collection.unlock()<EOL>if collection.is_locked():  <EOL><INDENT>raise KeyringLocked("<STR_LIT>")<EOL><DEDENT><DEDENT>return collection<EOL>
If self.preferred_collection contains a D-Bus path,
        the collection at that address is returned. Otherwise,
        the default collection is returned.