<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def match_filter(self, idx_list, pattern, dict_type=False, dict_key='name'):
 """Return Matched items in indexed files. :param idx_list: :return list """


        if dict_type is False:
            return self._return_deque([
                obj for obj in idx_list
                if re.search(pattern, obj)
            ])
        elif dict_type is True:
            return self._return_deque([
                obj for obj in idx_list
                if re.search(pattern, obj.get(dict_key))
            ])
        else:
            return self._return_deque()