def _get_parent_id_list(self, qualifier_id, hierarchy_id):
if self._caching_enabled():<EOL><INDENT>key = '<STR_LIT>'.format(str(qualifier_id))<EOL>caching_engine = '<STR_LIT>'<EOL>try:<EOL><INDENT>config = self._runtime.get_configuration()<EOL>parameter_id = Id('<STR_LIT>')<EOL>caching_engine = config.get_value_by_parameter(parameter_id).get_string_value()<EOL><DEDENT>except (AttributeError, KeyError, errors.NotFound):<EOL><INDENT>pass<EOL><DEDENT>if caching_engine == '<STR_LIT>':<EOL><INDENT>import memcache<EOL>caching_host = '<STR_LIT>'<EOL>try:<EOL><INDENT>config = self._runtime.get_configuration()<EOL>parameter_id = Id('<STR_LIT>')<EOL>caching_host = config.get_value_by_parameter(parameter_id).get_string_value()<EOL><DEDENT>except (AttributeError, KeyError, errors.NotFound):<EOL><INDENT>pass<EOL><DEDENT>mc = memcache.Client([caching_host], debug=<NUM_LIT:0>)<EOL>parent_id_list = mc.get(key)<EOL>if parent_id_list is None:<EOL><INDENT>parent_ids = self._get_hierarchy_session(hierarchy_id).get_parents(qualifier_id)<EOL>parent_id_list = [str(parent_id) for parent_id in parent_ids]<EOL>mc.set(key, parent_id_list)<EOL><DEDENT><DEDENT>elif caching_engine == '<STR_LIT>':<EOL><INDENT>import diskcache<EOL>with diskcache.Cache('<STR_LIT>') as cache:<EOL><INDENT>parent_id_list = cache.get(key)<EOL>if parent_id_list is None:<EOL><INDENT>parent_ids = self._get_hierarchy_session(hierarchy_id).get_parents(qualifier_id)<EOL>parent_id_list = [str(parent_id) for parent_id in parent_ids]<EOL>cache.set(key, parent_id_list)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise errors.NotFound('<STR_LIT>'.format(caching_engine))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>parent_ids = self._get_hierarchy_session(hierarchy_id).get_parents(qualifier_id)<EOL>parent_id_list = [str(parent_id) for parent_id in parent_ids]<EOL><DEDENT>return parent_id_list<EOL>
Returns list of parent id strings for qualifier_id in hierarchy.

        Uses memcache if caching is enabled.